/* ===== Copyright Course — Design System v2 ===== */
:root {
    --law-indigo: #4f46e5;
    --law-purple: #7c3aed;
    --law-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --radius: 14px;
    --transition: 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ---- Keyframes (must be in real CSS for non-Tailwind refs) ---- */
@keyframes slideUp {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes shimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes floatOrb {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-30px) scale(1.05); }
}
@keyframes pulse-ring {
    0%   { transform: scale(0.8); opacity: 0.5; }
    80%, 100% { transform: scale(2.2); opacity: 0; }
}
@keyframes gradient-x {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ---- Navigation ---- */
.nav-glass {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-bottom: 1px solid rgba(226,232,240,0.7);
}
.nav-pill {
    padding: 6px 13px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-pill:hover { background: rgba(241,245,249,0.8); color: #1e293b; }
.nav-pill.active { background: var(--law-gradient); color: #fff; box-shadow: 0 1px 4px rgba(79,70,229,0.3); }

/* ---- Glass Card ---- */
.glass-card {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border: 1px solid rgba(226,232,240,0.8);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}
.glass-card:hover {
    border-color: rgba(79,70,229,0.2);
    box-shadow: 0 8px 24px -8px rgba(79,70,229,0.08);
}

/* ---- Badges ---- */
.badge-indigo { display:inline-block; padding:2px 10px; border-radius:9999px; font-size:11px; font-weight:600; background:#eef2ff; color:#4338ca; }
.badge-purple { display:inline-block; padding:2px 10px; border-radius:9999px; font-size:11px; font-weight:600; background:#f5f3ff; color:#6d28d9; }
.badge-emerald { display:inline-block; padding:2px 10px; border-radius:9999px; font-size:11px; font-weight:600; background:#ecfdf5; color:#047857; }
.badge-amber { display:inline-block; padding:2px 10px; border-radius:9999px; font-size:11px; font-weight:600; background:#fffbeb; color:#b45309; }
.badge-rose { display:inline-block; padding:2px 10px; border-radius:9999px; font-size:11px; font-weight:600; background:#fff1f2; color:#be123c; }
.badge-cyan { display:inline-block; padding:2px 10px; border-radius:9999px; font-size:11px; font-weight:600; background:#ecfeff; color:#0e7490; }

/* ---- Buttons ---- */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 20px; border-radius: 12px;
    background: var(--law-gradient); color: #fff;
    font-size: 14px; font-weight: 600;
    border: none; cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px -2px rgba(79,70,229,0.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px -4px rgba(79,70,229,0.4); transform: translateY(-1px); }
.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 20px; border-radius: 12px;
    background: rgba(255,255,255,0.8);
    color: #334155; font-size: 14px; font-weight: 600;
    border: 1px solid rgba(226,232,240,0.8);
    cursor: pointer; transition: all var(--transition);
}
.btn-secondary:hover { background: #fff; border-color: rgba(79,70,229,0.3); color: #4f46e5; }

/* ---- Input ---- */
.input-field {
    width: 100%; padding: 10px 14px; border-radius: 12px;
    background: rgba(241,245,249,0.8);
    border: 1px solid rgba(226,232,240,0.8);
    font-size: 14px; color: #1e293b;
    transition: all var(--transition);
    outline: none;
}
.input-field:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
    background: #fff;
}

/* ---- Progress ---- */
.progress-track { height: 6px; background: #e2e8f0; border-radius: 9999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--law-gradient); border-radius: 9999px; transition: width 0.5s ease; }

/* ---- Typography ---- */
.stat-num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.gradient-shimmer {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #4f46e5 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s ease-in-out infinite;
}

/* ---- Grid dots ---- */
.grid-dots {
    background-image: radial-gradient(circle, #94a3b8 0.8px, transparent 0.8px);
    background-size: 32px 32px;
}

/* ---- Floating orbs ---- */
.float-orb { animation: floatOrb 8s ease-in-out infinite; }
.float-orb-slow { animation: floatOrb 12s ease-in-out infinite reverse; }

/* ---- Path rows ---- */
.path-row {
    background: rgba(255,255,255,0.6); backdrop-filter: blur(8px);
    border: 1px solid rgba(226,232,240,0.6); border-radius: var(--radius);
    transition: all var(--transition);
}
.path-row:hover { background: rgba(255,255,255,0.85); }
.path-indigo:hover { border-left: 3px solid #4f46e5; }
.path-purple:hover { border-left: 3px solid #7c3aed; }
.path-emerald:hover { border-left: 3px solid #10b981; }
.path-amber:hover { border-left: 3px solid #f59e0b; }
.path-rose:hover { border-left: 3px solid #f43f5e; }
.path-cyan:hover { border-left: 3px solid #06b6d4; }

/* ---- Stagger animation ---- */
.card-stagger { opacity: 0; animation: slideUp 0.5s cubic-bezier(0.25,0.8,0.25,1) forwards; }

/* ---- Keyboard hint ---- */
.kbd-hint {
    display: inline-block; padding: 1px 6px; border-radius: 4px;
    background: rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.1);
    font-size: 10px; font-family: 'SF Mono', Menlo, monospace;
    line-height: 1.6; vertical-align: middle; margin-left: 4px;
}

/* ---- Knowledge card hover ---- */
.knowledge-card { transition: all var(--transition); }
.knowledge-card:hover { border-color: rgba(79,70,229,0.3); transform: translateY(-1px); }

/* ---- Practice option ---- */
.practice-option { transition: all var(--transition); }

/* ===== Homepage Hero Extras ===== */
.hero-feature-card {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226,232,240,0.8);
    border-radius: 16px;
    padding: 28px 22px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}
.hero-feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--card-accent, var(--law-gradient));
    opacity: 0;
    transition: opacity 0.3s;
}
.hero-feature-card:hover::before { opacity: 1; }
.hero-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(79,70,229,0.12);
    border-color: rgba(79,70,229,0.2);
}
.hero-feature-card .card-icon-ring {
    width: 56px; height: 56px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    transition: transform 0.3s;
}
.hero-feature-card:hover .card-icon-ring { transform: scale(1.1); }

/* ---- Module list enhanced ---- */
.module-row {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226,232,240,0.6);
    border-radius: 14px;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
}
.module-row:hover {
    background: rgba(255,255,255,0.9);
    box-shadow: 0 4px 16px -4px rgba(79,70,229,0.1);
    transform: translateX(4px);
}

/* ---- Stats row ---- */
.stat-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226,232,240,0.6);
    border-radius: 12px;
}

/* ===== Game Page v2 Styles ===== */
.game-cover {
    position: fixed; inset: 0; z-index: 999;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #0c0c1e 0%, #1e1b4b 40%, #312e81 70%, #1e1b4b 100%);
    overflow: hidden;
}
.game-cover-orb {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.3;
    animation: floatOrb 10s ease-in-out infinite;
}
.game-cover h1 {
    background: linear-gradient(135deg, #c7d2fe, #e9d5ff, #c7d2fe);
    background-size: 200% 200%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-x 4s ease-in-out infinite;
}
.game-body-bg {
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    min-height: calc(100vh - 4rem);
}
.game-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}
.game-role-card {
    position: relative;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 24px 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    cursor: pointer;
}
.game-role-card::before {
    content: '';
    position: absolute; inset: 0;
    background: var(--role-gradient);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 16px;
}
.game-role-card:hover::before { opacity: 1; }
.game-role-card:hover {
    border-color: var(--role-border, rgba(99,102,241,0.5));
    transform: translateY(-4px);
    box-shadow: 0 16px 40px -8px var(--role-shadow, rgba(99,102,241,0.3));
}
.game-role-card > * { position: relative; z-index: 1; }
.game-choice-btn {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    display: flex; align-items: flex-start; gap: 12px;
}
.game-choice-btn:hover {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.4);
    transform: translateX(4px);
    box-shadow: 0 4px 20px -4px rgba(99,102,241,0.2);
}
.game-choice-btn .choice-letter {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: rgba(99,102,241,0.2);
    color: #a5b4fc;
    font-size: 13px; font-weight: 700;
    font-family: 'SF Mono', Menlo, monospace;
}
.game-choice-btn:hover .choice-letter {
    background: rgba(99,102,241,0.4);
    color: #fff;
}
.game-legal-tip {
    border-left: 3px solid #6366f1;
    background: rgba(99,102,241,0.08);
    border-radius: 0 12px 12px 0;
    padding: 14px 16px;
    animation: slideUp 0.3s ease-out;
}
.game-progress-step {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: all 0.3s;
}
.game-progress-step.done { background: #6366f1; box-shadow: 0 0 8px rgba(99,102,241,0.5); }
.game-progress-step.current {
    background: #818cf8;
    box-shadow: 0 0 12px rgba(99,102,241,0.6);
    transform: scale(1.4);
}
.risk-bar-fill { transition: width 0.5s ease; }
.risk-critical { background: linear-gradient(90deg, #ef4444, #dc2626); }
.risk-warning  { background: linear-gradient(90deg, #f97316, #ea580c); }
.risk-safe     { background: linear-gradient(90deg, #22c55e, #16a34a); }

/* ---- Mobile responsive ---- */
@media (max-width: 1023px) {
    .nav-pill { padding: 5px 10px; font-size: 12px; }
    .hero-feature-card { padding: 20px 16px; }
    .game-role-card { padding: 16px 14px; }
    .game-panel { padding: 16px !important; border-radius: 16px; }
    .game-choice-btn { padding: 12px 14px; font-size: 13px; }
}

/* ---- Safe area for iOS ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body { padding-bottom: env(safe-area-inset-bottom); }
}
