/* ============================================================
   LINGO — Main Stylesheet
   Inspired by Kujon's elegant minimal style
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
    --bg:           #f5f4ef;
    --text:         #1a1a1a;
    --text-muted:   #6b6b6b;
    --accent:       #1a1a1a;
    --font-serif:   'Playfair Display', serif;
    --font-sans:    'Inter', sans-serif;
    --green:        #22c55e;
    --red:          #ef4444;
    --radius:       16px;
    --shadow:       0 8px 40px rgba(0,0,0,0.12);
    --transition:   0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    color: var(--text);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ============================================================
   AUTH PAGES — Login & Register
   ============================================================ */
body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: #0f0e0a;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

.auth-card {
    background: #1a1917;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 48px 44px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}

.auth-logo {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 700;
    color: #f5f4ef;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.auth-tagline {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    margin-bottom: 36px;
    font-style: italic;
}

.auth-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
}

.auth-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 18px;
    color: #f5f4ef;
    font-size: 1rem;
    transition: border-color var(--transition);
    outline: none;
    display: block;
}

.auth-input:focus {
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.09);
}

.auth-input::placeholder { color: rgba(255,255,255,0.2); }

.auth-field { margin-bottom: 20px; }

.auth-btn {
    width: 100%;
    padding: 15px;
    background: #f5f4ef;
    color: #0f0e0a;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity var(--transition), transform var(--transition);
    margin-top: 8px;
    display: block;
}

.auth-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: rgba(255,255,255,0.2);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.google-btn {
    width: 100%;
    padding: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: #f5f4ef;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background var(--transition), border-color var(--transition);
}

.google-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.35);
}

.auth-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fca5a5;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.auth-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    color: #86efac;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #f5f4ef;
    cursor: pointer;
}

.remember-row label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
}

/* ============================================================
   LEARN PAGE — Fullscreen Tinder Swipe
   ============================================================ */
body.learn-page {
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

/* Nav bar */
.learn-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    pointer-events: none;
}

.learn-nav > * { pointer-events: auto; }

.nav-settings-back {
    font-size: 1.3rem;
    opacity: 0.6;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-settings-back:hover {
    opacity: 1;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    opacity: 0.6;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.nav-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    opacity: 0.5;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: opacity var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link:hover { opacity: 0.9; }

/* Card stack */
#lingo-cards {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lingo-card {
    position: absolute;
    width: min(92vw, 540px);
    padding: 0 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    will-change: transform, opacity;
    transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity   0.55s ease;
    cursor: grab;
}

.lingo-card:active { cursor: grabbing; }

.lingo-card.next {
    transform: translateX(110%);
    opacity: 0;
    z-index: 10;
}

.lingo-card.current {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
    z-index: 20;
}

.lingo-card.leaving-left {
    transform: translateX(-130%) rotate(-8deg) !important;
    opacity: 0 !important;
    transition: transform 0.45s cubic-bezier(0.4, 0, 1, 1),
                opacity   0.25s ease !important;
}

.lingo-card.leaving-right {
    transform: translateX(130%) rotate(8deg) !important;
    opacity: 0 !important;
    transition: transform 0.45s cubic-bezier(0.4, 0, 1, 1),
                opacity   0.25s ease !important;
}

/* Card content */
.card-word {
    font-family: var(--font-serif);
    font-size: clamp(3.5rem, 17vw, 7rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.0;
    letter-spacing: -0.03em;
    margin-bottom: 0;
    text-align: center;
    width: 100%;
}

.card-type-badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 12px;
}

.card-line {
    width: 100%;
    height: 2px;
    background: var(--text);
    opacity: 0.15;
    margin: 24px 0;
}

.card-translations {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: fit-content;
    align-self: center;
    align-items: flex-start;
}

.card-translation-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.card-lang-flag {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}

.card-lang-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.45;
    flex-shrink: 0;
    min-width: 28px;
}

.card-translation-text {
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 5vw, 2rem);
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
    font-style: italic;
}

.card-example {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.55;
    font-style: italic;
    line-height: 1.5;
    border-left: 2px solid rgba(0,0,0,0.1);
    padding-left: 12px;
}

/* Swipe overlays */
.swipe-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#overlay-left  { background: rgba(239, 68, 68, 0.18); }
#overlay-right { background: rgba(34, 197, 94, 0.18); }

.overlay-icon {
    width: clamp(80px, 16vw, 120px);
    height: clamp(80px, 16vw, 120px);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.05));
}

#overlay-left  .overlay-icon { color: #ff6b6b; }
#overlay-right .overlay-icon { color: #51cf66; }

/* Swipe action buttons */
.swipe-buttons {
    position: fixed;
    bottom: clamp(28px, 6vh, 60px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 48px;
    z-index: 100;
    align-items: center;
}

.swipe-btn {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), inset 0 2px 4px rgba(255, 255, 255, 0.8);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                background-color 0.2s ease,
                border-color 0.2s ease,
                color 0.2s ease,
                box-shadow 0.25s ease;
    border: 2px solid transparent;
}

.swipe-icon {
    width: 28px;
    height: 28px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.swipe-btn:active {
    transform: scale(0.95);
}

.btn-left {
    background: #fff5f5; /* Soft friendly light red */
    color: #ff6b6b;      /* Friendly red icon */
    border: 2px solid rgba(255, 107, 107, 0.15);
}

.btn-left:hover {
    background: #ffe3e3;
    border-color: rgba(255, 107, 107, 0.45);
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.2);
    transform: scale(1.1);
}

.btn-left:hover .swipe-icon {
    transform: rotate(-15deg) scale(1.15);
}

.btn-right {
    background: #ebfbee; /* Soft friendly light green */
    color: #51cf66;      /* Friendly green icon */
    border: 2px solid rgba(81, 207, 102, 0.15);
}

.btn-right:hover {
    background: #d3f9d8;
    border-color: rgba(81, 207, 102, 0.45);
    box-shadow: 0 12px 30px rgba(81, 207, 102, 0.2);
    transform: scale(1.1);
}

.btn-right:hover .swipe-icon {
    transform: rotate(15deg) scale(1.15);
}

.swipe-badge {
    position: absolute;
    top: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    border: 2px solid var(--bg); /* Cutout border matching page background */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    transition: transform 0.2s ease;
}

/* Wrong (nope) badge: solid friendly pastel red */
.btn-left .swipe-badge {
    right: -4px;
    background: #ff6b6b;
}

/* OK (got it) badge: solid friendly pastel green */
.btn-right .swipe-badge {
    left: -4px;
    background: #51cf66;
}

/* Progress bar */
.learn-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0,0,0,0.08);
    z-index: 200;
}

.learn-progress-bar {
    height: 100%;
    background: var(--text);
    opacity: 0.3;
    transition: width 0.4s ease;
    border-radius: 0 2px 2px 0;
}

/* Session count */
.session-stats {
    position: fixed;
    bottom: clamp(28px, 6vh, 60px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 32px;
    z-index: 90;
    margin-bottom: 90px;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    opacity: 0.4;
    letter-spacing: 0.04em;
}

.stat-count {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.stat-count.green { color: var(--green); opacity: 1; }
.stat-count.red   { color: var(--red);   opacity: 1; }

/* Empty state */
.learn-empty {
    text-align: center;
    padding: 48px 24px;
}

.learn-empty h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.learn-empty p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 28px;
}

.btn-primary {
    display: inline-block;
    padding: 14px 32px;
    background: var(--text);
    color: var(--bg);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: opacity var(--transition), transform var(--transition);
}

.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

/* ============================================================
   DASHBOARD PAGE
   ============================================================ */
body.dashboard-page {
    min-height: 100vh;
    padding: 0;
}

.dashboard-header {
    padding: 32px clamp(20px, 5vw, 60px) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.dash-logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dash-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dash-nav-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    opacity: 0.5;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: opacity var(--transition);
}

.dash-nav-link:hover { opacity: 0.9; }
.dash-nav-link.active { opacity: 1; border-bottom: 2px solid var(--text); }

.dashboard-body {
    padding: 40px clamp(20px, 5vw, 60px) 80px;
    max-width: 1100px;
    margin: 0 auto;
}

.dash-greeting {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.dash-sub {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 40px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.stat-card-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stat-card-value {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.stat-card-value.green { color: #16a34a; }
.stat-card-value.red   { color: #dc2626; }
.stat-card-value.blue  { color: #2563eb; }

.stat-card-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.7;
}

/* Section title */
.section-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.section-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Words table */
.words-table-wrap {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 48px;
}

.words-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.words-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: rgba(0,0,0,0.02);
}

.words-table td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
}

.words-table tr:last-child td { border-bottom: none; }
.words-table tbody tr:hover { background: rgba(0,0,0,0.018); }

.word-en { font-family: var(--font-serif); font-weight: 700; font-size: 1rem; }
.word-es { color: #b45309; font-style: italic; }
.word-pl { color: #1d4ed8; }

.difficulty-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.difficulty-track {
    flex: 1;
    max-width: 80px;
    height: 4px;
    background: rgba(0,0,0,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.difficulty-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444);
    transition: width 0.5s ease;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge-slang    { background: rgba(139,92,246,0.12); color: #7c3aed; }
.badge-idiom    { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-word     { background: rgba(0,0,0,0.06);      color: #555;    }
.badge-phrase   { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.badge-verb     { background: rgba(236,72,153,0.12); color: #be185d; }
.badge-adjective{ background: rgba(20,184,166,0.12); color: #0f766e; }

/* CTA button */
.dash-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.btn-learn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 36px;
    background: var(--text);
    color: var(--bg);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity var(--transition), transform var(--transition);
}

.btn-learn:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 32px;
    background: transparent;
    color: var(--text);
    border: 2px solid rgba(0,0,0,0.15);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: border-color var(--transition), background var(--transition);
}

.btn-review:hover {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.3);
}

/* Progress ring */
.progress-ring-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 32px;
    max-width: 380px;
}

.progress-ring-text {
    flex: 1;
}

.progress-ring-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.progress-ring-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ============================================================
   ADMIN PAGE
   ============================================================ */
body.admin-page {
    padding: 0;
}

.admin-header {
    padding: 28px clamp(20px, 5vw, 60px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-logo {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
}

.admin-logo span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-left: 8px;
}

.admin-body {
    padding: 40px clamp(20px, 5vw, 60px);
    max-width: 1200px;
    margin: 0 auto;
}

/* Add word form */
.add-form {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 40px;
}

.form-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-field { display: flex; flex-direction: column; gap: 8px; }

.form-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.form-input,
.form-select,
.form-textarea {
    padding: 12px 16px;
    border: 1.5px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition);
    outline: none;
    width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--text);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-full { grid-column: 1 / -1; }

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-submit {
    padding: 13px 32px;
    background: var(--text);
    color: var(--bg);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity var(--transition);
}

.btn-submit:hover { opacity: 0.8; }

.btn-danger {
    padding: 8px 16px;
    background: rgba(239,68,68,0.1);
    color: #dc2626;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background var(--transition);
}

.btn-danger:hover { background: rgba(239,68,68,0.2); }

/* Flash messages */
.flash {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 0.88rem;
    font-weight: 500;
}

.flash-success {
    background: rgba(34,197,94,0.1);
    color: #15803d;
    border: 1px solid rgba(34,197,94,0.2);
}

.flash-error {
    background: rgba(239,68,68,0.1);
    color: #dc2626;
    border: 1px solid rgba(239,68,68,0.2);
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.lingo-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lingo-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-text {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text);
    opacity: 0.45;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
    .auth-card { padding: 36px 28px; }
    .swipe-buttons { gap: 32px; bottom: clamp(24px, 5vh, 45px); }
    .swipe-btn { width: 66px; height: 66px; }
    .swipe-icon { width: 24px; height: 24px; }
    .swipe-badge {
        width: 22px;
        height: 22px;
        font-size: 10px;
        top: -1px;
    }
    .btn-left .swipe-badge { right: -3px; }
    .btn-right .swipe-badge { left: -3px; }
    
    /* Navigation bar responsive fixes */
    .learn-nav {
        padding: 12px 16px;
    }
    .nav-settings-back, .nav-logo {
        font-size: 1.1rem;
    }
    .nav-links {
        gap: 8px;
    }
    .nav-link {
        font-size: 0.7rem;
    }
}

@media (min-width: 768px) {
    .lingo-card { padding: 0 48px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}

.swipe-btn.pulse { animation: pulse 0.3s ease; }

/* ============================================================
   FLASHCARD — 3D flip
   ============================================================ */

/* Note: 3D Flashcard styles have been consolidated and moved to the end of the file */

/* Badge pinned to top-right of card face */
.card-face {
    position: relative;
}

.card-type-badge--corner {
    position: absolute;
    top: -8px;
    right: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================================
   ONBOARDING WIZARD
   ============================================================ */
body.onboarding-page {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ob-logo {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    letter-spacing: -0.02em;
    opacity: 0.6;
}

/* Step dots */
.ob-dots {
    position: fixed;
    top: 28px;
    right: 32px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.ob-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text);
    opacity: 0.15;
    transition: opacity 0.3s, transform 0.3s;
}

.ob-dot.active {
    opacity: 1;
    transform: scale(1.25);
}

.ob-dot.done {
    opacity: 0.4;
}

/* Step container */
.ob-step {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 700px;
    animation: fadeUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.ob-step.active { display: flex; }

.ob-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 48px;
}

/* Flag grid */
.ob-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    width: 100%;
}

.ob-flag-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 24px 22px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    min-width: 120px;
    flex: 1;
    max-width: 160px;
}

.ob-flag-card:hover {
    border-color: var(--text);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}

.ob-flag-card.selected {
    border-color: var(--text);
    background: var(--text);
    color: var(--bg);
}

.ob-flag-emoji { font-size: 2.8rem; line-height: 1; }

.ob-flag-name {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ob-flag-card.selected .ob-flag-name { color: rgba(245,244,239,0.7); }

.ob-flag-question {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
}

.ob-flag-card.selected .ob-flag-question { color: rgba(245,244,239,0.5); }

/* Privacy box */
.ob-privacy-box {
    background: #fff;
    border-radius: 20px;
    padding: 36px 40px;
    text-align: left;
    max-width: 560px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 32px;
}

.ob-privacy-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.ob-privacy-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Continue button */
.ob-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 40px;
    background: var(--text);
    color: var(--bg);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 8px;
}

.ob-btn:hover { opacity: 0.85; transform: translateY(-2px); }
.ob-btn:active { transform: translateY(0); }
.ob-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

/* Format cards (step 4) */
.ob-format-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-bottom: 40px;
}

.ob-format-card {
    flex: 1;
    min-width: 200px;
    max-width: 260px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 32px 24px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.ob-format-card:hover {
    border-color: rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.ob-format-card.selected {
    border-color: var(--text);
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}

.ob-format-preview {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 2rem;
}

.ob-format-name {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.ob-format-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Reveal options (radio-style) */
.ob-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 480px;
    margin-bottom: 24px;
}

.ob-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
    text-align: left;
}

.ob-option:hover { border-color: rgba(0,0,0,0.15); }
.ob-option.selected { border-color: var(--text); }

.ob-option-icon { font-size: 1.4rem; flex-shrink: 0; }

.ob-option-label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.ob-option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Account buttons (step 5) */
.ob-account-btns {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 380px;
}

.ob-account-btn {
    display: block;
    width: 100%;
    padding: 18px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.ob-account-btn:hover { transform: translateY(-2px); }

.ob-account-btn-primary {
    background: var(--text);
    color: var(--bg);
}

.ob-account-btn-secondary {
    background: #fff;
    color: var(--text);
    border: 2px solid rgba(0,0,0,0.12);
}

.ob-account-btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px dashed rgba(0,0,0,0.2);
    font-size: 0.9rem;
}

.ob-guest-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

/* Sub-section title */
.ob-sub-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 16px;
}

/* ============================================================
   INTRO OVERLAY (swipe hint on first visit)
   ============================================================ */
.intro-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 48px;
    pointer-events: all;
    transition: opacity 0.6s ease;
}

.intro-overlay.fade-out { opacity: 0; pointer-events: none; }

.intro-hint {
    display: flex;
    align-items: center;
    gap: 20px;
}

.intro-arrow {
    font-size: 2rem;
    opacity: 0.5;
}

.intro-hint-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.intro-hint-action {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
}

.intro-hint-action.left { color: var(--red); }
.intro-hint-action.right { color: var(--green); }

.intro-hint-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.intro-tap-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.5;
    font-style: italic;
    position: absolute;
    bottom: 48px;
}

/* ============================================================
   CARD REVEAL DOTS
   ============================================================ */
.card-reveal-dots {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

.card-reveal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text);
    opacity: 0.15;
    transition: opacity 0.3s;
}

.card-reveal-dot.revealed { opacity: 0.8; }

/* Hidden translation (revealed on tap) */
.card-translation-row.hidden-lang {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.card-translation-row.hidden-lang.revealed {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ============================================================
   VIRTUAL KEYBOARD
   ============================================================ */
.vkeyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: #1a1a1a;
    padding: 14px 16px 24px;
    z-index: 1000;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.35);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.vkeyboard.visible { display: flex; }

.vkey {
    min-width: 44px;
    height: 44px;
    background: #2d2d2d;
    color: #f5f4ef;
    border-radius: 8px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s;
    padding: 0 10px;
    border: none;
    font-family: inherit;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.vkey:hover, .vkey:active { background: #404040; }

.vkey-close {
    margin-left: 12px;
    min-width: 44px;
    height: 44px;
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border-radius: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.12s;
    padding: 0 14px;
}

.vkey-close:hover { background: rgba(239,68,68,0.25); }

.vkeyboard-label {
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(245,244,239,0.3);
    margin-bottom: 2px;
}

/* ============================================================
   ADMIN PANEL — NEW STYLES
   ============================================================ */

/* Section tabs */
.admin-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    background: #fff;
    color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.admin-tab:hover {
    border-color: rgba(0,0,0,0.12);
    color: var(--text);
}

.admin-tab.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Word row (add/edit form row) */
.word-row {
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.word-row.saved {
    border-color: rgba(34,197,94,0.4);
}

.word-row.error-state {
    border-color: rgba(239,68,68,0.4);
}

/* Desktop: horizontal grid */
.word-row-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr) auto auto;
    gap: 12px;
    align-items: end;
}

/* Mobile: 2 cols */
@media (max-width: 768px) {
    .word-row-grid {
        grid-template-columns: 1fr 1fr;
    }
    .word-row-cats { grid-column: 1 / -1; }
    .word-row-save { grid-column: 1 / -1; }
}

.word-row-field { display: flex; flex-direction: column; gap: 6px; }

.word-row-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.word-row-input {
    padding: 10px 14px;
    border: 1.5px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s;
    outline: none;
    width: 100%;
    font-family: inherit;
}

.word-row-input:focus { border-color: var(--text); }

/* Category checkboxes */
.word-row-cats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1.5px solid rgba(0,0,0,0.12);
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: var(--text-muted);
    user-select: none;
}

.cat-chip input[type="checkbox"] { display: none; }

.cat-chip:hover {
    border-color: var(--text);
    color: var(--text);
}

.cat-chip.checked {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* New category input */
.new-cat-input {
    padding: 5px 12px;
    border: 1.5px dashed rgba(0,0,0,0.2);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text);
    background: transparent;
    outline: none;
    width: 120px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.new-cat-input:focus {
    border-color: var(--text);
    border-style: solid;
}

.new-cat-input::placeholder { color: var(--text-muted); opacity: 0.5; }

/* Save button in row */
.word-row-save-btn {
    padding: 10px 22px;
    background: var(--text);
    color: var(--bg);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    white-space: nowrap;
    transition: opacity 0.2s;
    align-self: flex-end;
}

.word-row-save-btn:hover { opacity: 0.8; }
.word-row-save-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Save status */
.word-row-status {
    font-size: 0.8rem;
    margin-top: 8px;
    min-height: 20px;
    transition: opacity 0.3s;
}

.word-row-status.ok { color: #16a34a; }
.word-row-status.err { color: #dc2626; }

/* Add word button */
.add-word-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: 2px dashed rgba(0,0,0,0.2);
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    font-family: inherit;
    margin-top: 8px;
}

.add-word-btn:hover {
    border-color: var(--text);
    color: var(--text);
    background: rgba(0,0,0,0.02);
}

/* ============================================================
   BROWSE BY CATEGORY
   ============================================================ */

/* Category filter chips */
.cat-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.cat-filter-chip {
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1.5px solid rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
    color: var(--text-muted);
}

.cat-filter-chip:hover { border-color: var(--text); color: var(--text); }
.cat-filter-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Browse word list */
.browse-word-row {
    background: #fff;
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 36px 24px 1fr auto;
    gap: 14px;
    align-items: center;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.browse-word-row:hover { border-color: rgba(0,0,0,0.08); }
.browse-word-row.dragging { opacity: 0.4; border-color: var(--text); }
.browse-word-row.drag-over { border-color: var(--text); box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

/* Rank badge */
.rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.rank-badge.rank-1 {
    background: #1a1a1a;
    color: #f5f4ef;
}

/* Drag handle */
.drag-handle {
    color: rgba(0,0,0,0.2);
    cursor: grab;
    font-size: 1.1rem;
    padding: 4px;
    transition: color 0.15s;
    flex-shrink: 0;
}

.drag-handle:hover { color: var(--text); }
.drag-handle:active { cursor: grabbing; }

/* Browse fields grid */
.browse-fields {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    align-items: center;
}

@media (max-width: 768px) {
    .browse-fields { grid-template-columns: repeat(2, 1fr); }
    .browse-word-row { grid-template-columns: 30px 20px 1fr; grid-template-rows: auto auto; }
    .browse-word-actions { grid-column: 1 / -1; }
}

.browse-field-input {
    padding: 8px 10px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text);
    background: var(--bg);
    width: 100%;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.browse-field-input:focus { border-color: var(--text); }

/* Browse actions */
.browse-word-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.btn-top {
    padding: 7px 12px;
    background: rgba(0,0,0,0.05);
    color: var(--text);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-top:hover { background: rgba(0,0,0,0.1); }

.btn-save-row {
    padding: 7px 14px;
    background: var(--text);
    color: var(--bg);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: opacity 0.15s;
}

.btn-save-row:hover { opacity: 0.8; }

.btn-remove-row {
    padding: 7px 10px;
    background: rgba(239,68,68,0.08);
    color: #dc2626;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-remove-row:hover { background: rgba(239,68,68,0.16); }

/* Empty browse state */
.browse-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    font-style: italic;
}

/* Guest banner */
.guest-banner {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26,26,26,0.92);
    color: #f5f4ef;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
    white-space: nowrap;
}

.guest-banner a {
    color: #fbbf24;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   3D FLASHCARD STYLES (Consolidated & Mobile Optimized)
   ============================================================ */
.lingo-card.flashcard-mode {
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    aspect-ratio: 4 / 3;
    min-height: 340px;
    -webkit-perspective: 1200px;
    perspective: 1200px;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    cursor: pointer;
}

.lingo-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lingo-card.flipped .lingo-card-inner,
.lingo-card.flashcard-mode.flipped .lingo-card-inner {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.lingo-card.flashcard-mode .card-face {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: #fdfcf7; /* cream background */
    border: 2px solid rgba(26,26,26,0.08);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    
    /* Hardware acceleration & transitions for mobile opacity cross-fade */
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: opacity 0.4s ease, z-index 0.4s;
}

.lingo-card.flashcard-mode .card-face.front {
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
    -webkit-transform: rotateY(0deg) translateZ(1px);
    transform: rotateY(0deg) translateZ(1px);
}

.lingo-card.flashcard-mode .card-face.back {
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    -webkit-transform: rotateY(180deg) translateZ(1px);
    transform: rotateY(180deg) translateZ(1px);
}

.lingo-card.flipped .card-face.front,
.lingo-card.flashcard-mode.flipped .card-face.front {
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

.lingo-card.flipped .card-face.back,
.lingo-card.flashcard-mode.flipped .card-face.back {
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
}

.lingo-card.flashcard-mode .card-face.back .card-translations {
    width: fit-content;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    align-self: center;
}

.lingo-card.flashcard-mode .card-face.back .card-translation-row {
    justify-content: flex-start;
}

.flashcard-tap-hint {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================================
   SHARED FOOTER — lingo-footer
   ============================================================ */
.lingo-footer {
    background: var(--text);
    color: rgba(245, 244, 239, 0.6);
    padding: 28px 32px;
    margin-top: auto;
}

.lingo-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lingo-footer-brand {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(245, 244, 239, 0.9);
    letter-spacing: -0.02em;
}

.lingo-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.lingo-footer-nav a {
    font-size: 0.82rem;
    color: rgba(245, 244, 239, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: 0.01em;
}

.lingo-footer-nav a:hover {
    color: rgba(245, 244, 239, 0.9);
}

.lingo-footer-copy {
    font-size: 0.78rem;
    color: rgba(245, 244, 239, 0.3);
    width: 100%;
    text-align: center;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .lingo-footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .lingo-footer-nav {
        justify-content: center;
    }
}

/* Auth page footer override — sits below the dark card */
body.auth-page .lingo-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 14, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 24px;
    z-index: 10;
}

body.auth-page .lingo-footer-inner {
    justify-content: center;
    gap: 8px 20px;
}

body.auth-page .lingo-footer-copy {
    display: none;
}

/* Learn page: footer is not shown (fullscreen swipe) */
body.learn-page .lingo-footer {
    display: none;
}


