* { box-sizing: border-box; margin: 0; padding: 0; }
/* Page cream sampled from the Vela brand sheet. The old #f5f0e8 was warmer and
   yellower, which is what read as muddy; this is the same warmth with the
   yellow pulled out. Chips and controls keep the old value on purpose - they
   sit on white cards, not on the page. */
body { font-family: system-ui, sans-serif; background: #f5f3ee; color: #1a1a1a; min-height: 100vh; }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f5f3ee; position: relative; }

.auth-screen { padding: 2rem 1.5rem; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.auth-logo { font-size: 2rem; font-weight: 500; color: #3d2c1e; margin-bottom: 0.5rem; letter-spacing: -0.5px; display: flex; align-items: center; gap: 0.3em; }
/* Sized in em so the sail tracks whatever type it sits beside. */
.brand-sail { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.auth-tagline { font-size: 14px; color: #7a6555; margin-bottom: 2.5rem; }
.auth-card { background: #fff; border-radius: 16px; padding: 1.5rem; box-shadow: 0 1px 2px rgba(61,44,30,0.05), 0 8px 24px -12px rgba(61,44,30,0.10); }
.auth-card h2 { font-size: 16px; font-weight: 500; margin-bottom: 1rem; color: #3d2c1e; }
.field { margin-bottom: 1rem; }
.field label { font-size: 12px; color: #7a6555; display: block; margin-bottom: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.field input { width: 100%; padding: 10px 12px; border: 0.5px solid #d0c8be; border-radius: 8px; font-size: 15px; background: #faf8f5; color: #3d2c1e; outline: none; }
.field input:focus { border-color: #9b7a5a; background: #fff; }
.btn-primary { width: 100%; padding: 12px; background: #3d2c1e; color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer; }
.btn-primary:hover { background: #2d1e12; }
.auth-switch { text-align: center; margin-top: 1rem; font-size: 13px; color: #7a6555; }
.auth-switch span { color: #9b7a5a; cursor: pointer; font-weight: 500; }
.announce-banner { background: #e8f0d8; border: 0.5px solid #b8d08a; border-radius: 10px; padding: 10px 14px; margin-bottom: 1.5rem; font-size: 13px; color: #3a5a1a; display: flex; align-items: flex-start; gap: 8px; }
.announce-banner .close-btn { background: none; border: none; color: #3a5a1a; cursor: pointer; font-size: 16px; margin-left: auto; line-height: 1; }

/* CARD SURFACES
   Cards used to be outlined. Twenty hairline borders on one screen is what
   made this read as an engineering dashboard. They are now separated by fill
   and a very soft shadow instead, which is the same information with far less
   drawing. Small controls - pills, tabs, inputs - keep their borders, because
   there a border is the affordance rather than decoration. */
.top-nav { background: #f5f3ee; padding: 16px 1.5rem 12px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; gap: 10px; }
.nav-logo { font-size: 1.3rem; font-weight: 500; color: #3d2c1e; display: flex; align-items: center; gap: 0.32em; }
.nav-right { display: flex; align-items: center; gap: 8px; }
/* Was a solid dark-brown pill, which shouted next to everything else in the
   bar. Now the same quiet chip as the streak, so the three items read as a set. */
.nav-lang { font-size: 12px; line-height: 18px; background: #ece4d8; color: #5a4a3a; border: 0.5px solid #dbcfbe; padding: 4px 10px; border-radius: 20px; cursor: pointer; font-weight: 600; }
/* The flag sat flush against the language name: .nav-lang is a plain button
   with no gap, and .lang-flag's fixed 28px width (which aligns the modal list)
   works against it here. The modal gets its spacing from .lang-option's flex
   gap, so give the button the same treatment. */
.nav-lang { display: inline-flex; align-items: center; gap: 6px; }
.nav-lang .lang-flag { width: auto; }
/* 28px, not 32px: it sat visibly taller than the streak and language
   pills beside it, which made the top bar look mis-set. */
/* Same chip treatment as the streak and language pills beside it, so the top
   bar reads as one set rather than three unrelated objects. */
.profile-btn { width: 28px; height: 28px; border-radius: 50%; background: #ece4d8; color: #5a4a3a; border: 0.5px solid #dbcfbe; cursor: pointer; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
/* Streak sits in the top bar so it's visible from every tab, not just Home.
   Quiet by design: a number, not a trophy. Padding, font size and line-height
   deliberately match .nav-lang so the two pills are the same height — the flag
   emoji makes that one taller than its text alone would. */
.nav-streak { font-size: 12px; font-weight: 600; line-height: 18px; color: #5a4a3a; background: #ece4d8; border: 0.5px solid #dbcfbe; border-radius: 20px; padding: 4px 10px; white-space: nowrap; }
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: #fff; box-shadow: 0 -1px 20px -8px rgba(61,44,30,0.16); display: flex; padding: 8px 0 16px; z-index: 10; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; padding: 4px 0; border: none; background: none; }
.nav-item svg { width: 22px; height: 22px; stroke-width: 1.8; stroke: #aaa; }
.nav-item span { font-size: 10px; color: #7a6555; }
.nav-item.active span { color: #3d2c1e; font-weight: 500; }
.nav-item.active svg { stroke: #3d2c1e; }

.screen { padding: 1.5rem; padding-bottom: 90px; }
.welcome-text { font-size: 20px; font-weight: 500; color: #3d2c1e; margin-bottom: 4px; }
.welcome-sub { font-size: 14px; color: #7a6555; margin-bottom: 1.5rem; }

.progress-ring-wrap { background: #fff; border-radius: 16px; padding: 1.4rem 1.25rem; margin-bottom: 1.1rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 1px 2px rgba(61,44,30,0.05), 0 8px 24px -12px rgba(61,44,30,0.10); }
.ring-svg { flex-shrink: 0; }
.ring-info h3 { font-size: 15px; font-weight: 500; color: #3d2c1e; }
.ring-info p { font-size: 13px; color: #7a6555; }

.pile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.25rem; }
.pile-card { background: #fff; border-radius: 14px; padding: 1rem 1rem 1.05rem; box-shadow: 0 1px 2px rgba(61,44,30,0.05), 0 8px 24px -12px rgba(61,44,30,0.10); }
.pile-card .pile-count { font-size: 1.6rem; font-weight: 500; }
.pile-card .pile-label { font-size: 12px; color: #7a6555; margin-top: 2px; }
.pile-card .pile-sub { font-size: 11px; color: #aaa; margin-top: 2px; }
/* The coloured left bars are gone - four striped tiles read as a status board.
   The number keeps the colour, which is enough to tell them apart.
   "Not started" is deliberately NEUTRAL now: it was the largest, reddest thing
   on the home screen, and having 1,036 words left to meet is not bad news. */
.pile-card.need .pile-count { color: #7a6555; }
.pile-card.tried .pile-count { color: #ba7517; }
.pile-card.half .pile-count { color: #185fa5; }
.pile-card.conquered .pile-count { color: #3b6d11; }

.section-label { font-size: 12px; font-weight: 500; color: #7a6555; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.deck-row { background: #fff; border-radius: 14px; padding: 15px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(61,44,30,0.05), 0 8px 24px -12px rgba(61,44,30,0.10); transition: box-shadow 0.15s, transform 0.15s; }
.deck-row:hover { box-shadow: 0 2px 4px rgba(61,44,30,0.07), 0 12px 28px -12px rgba(61,44,30,0.16); transform: translateY(-1px); }
.deck-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink:0; font-weight:600; color:#3d2c1e; }
.deck-info { flex: 1; min-width: 0; }
.deck-info strong { font-size: 14px; font-weight: 500; color: #3d2c1e; display: block; }
.deck-info span { font-size: 12px; color: #7a6555; }
.deck-count { font-size: 12px; color: #9b7a5a; background: #f5f0e8; padding: 3px 8px; border-radius: 20px; flex-shrink:0; }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 8px; }
.card-header h2 { font-size: 15px; font-weight: 500; color: #3d2c1e; }
.card-header .back-btn { background: none; border: none; color: #7a6555; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 4px; flex-shrink:0; }
.progress-bar-wrap { background: #e0d8ce; border-radius: 10px; height: 4px; margin-bottom: 1rem; overflow: hidden; }
.progress-bar-fill { height: 100%; background: #9b7a5a; border-radius: 10px; transition: width 0.3s; }

.deck-switcher { display: flex; gap: 6px; margin-bottom: 1rem; overflow-x: auto; padding-bottom: 2px; }
.deck-pill { flex-shrink: 0; padding: 6px 12px; border-radius: 20px; border: 0.5px solid #d0c8be; background: #fff; font-size: 12px; cursor: pointer; color: #7a6555; white-space: nowrap; }
.deck-pill.active { background: #3d2c1e; color: #f5f0e8; border-color: #3d2c1e; }

.flashcard-area { position: relative; height: 360px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; touch-action: none; }
.flashcard { width: 100%; height: 100%; background: #fff; border-radius: 20px; box-shadow: 0 1px 2px rgba(61,44,30,0.05), 0 12px 32px -14px rgba(61,44,30,0.16); padding: 2rem 1.5rem; text-align: center; cursor: grab; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; user-select: none; overflow: hidden; }
.flashcard.dragging { cursor: grabbing; transition: none; }
.flashcard.snap-back { transition: transform 0.25s ease; }
.flashcard.fly-out { transition: transform 0.3s ease, opacity 0.3s ease; }

.card-face-front, .card-face-back { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; }
.card-face-back { display: none; }
.flashcard.revealed .card-face-front { display: none; }
.flashcard.revealed .card-face-back { display: flex; }

.card-lang-label { font-size: 11px; color: #9b7a5a; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.75rem; }
.card-word { font-size: 2rem; font-weight: 500; color: #3d2c1e; line-height: 1.2; margin-bottom: 0.5rem; }
.card-subtext { font-size: 14px; color: #7a6555; margin-bottom: 1rem; }
.trans-word { font-size: 1.6rem; font-weight: 500; color: #5a3e2b; margin-bottom: 0.5rem; }
.trans-example { font-size: 13px; color: #7a6555; margin-top: 8px; font-style: italic; max-width: 90%; }
.reveal-hint { font-size: 12px; color: #aaa; display: flex; align-items: center; gap: 4px; justify-content: center; position: absolute; bottom: 14px; left: 0; right: 0; }
.swipe-edge-hint { position: absolute; top: 50%; transform: translateY(-50%); font-size: 11px; color: #ccc; pointer-events: none; }
.swipe-edge-hint.left { left: 10px; }
.swipe-edge-hint.right { right: 10px; }

.sound-btn { background: #f5f0e8; border: 0.5px solid #e0d8ce; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; margin: 0 auto 0.5rem; }
.sound-btn:hover { background: #ede8df; }
.sound-btn svg { width: 18px; height: 18px; stroke: #7a6555; stroke-width: 2; fill: none; }

.swipe-actions { display: flex; gap: 12px; justify-content: center; margin-top: 0.5rem; }
.swipe-btn { flex: 1; padding: 14px; border-radius: 12px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 6px; transition: transform 0.1s; }
.swipe-btn:active { transform: scale(0.97); }
/* Drawn from the same tint family as the deck badges. "Not Yet" moves off amber
   onto a soft red so the two choices read differently at a glance, but stays a
   tint rather than a warning colour — nobody should hesitate to admit a miss. */
.btn-dont-know { background: #f7d6cc; color: #9a3d26; }
.btn-know { background: #d8ebbd; color: #3f6614; }

.deck-complete { text-align: center; padding: 2rem 1rem; }
.deck-complete h2 { font-size: 1.5rem; font-weight: 500; color: #3d2c1e; margin-bottom: 0.5rem; }
.deck-complete p { color: #7a6555; margin-bottom: 1.5rem; }
.deck-complete .score-big { font-size: 3rem; font-weight: 500; color: #639922; }

.conquered-list { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(61,44,30,0.05), 0 8px 24px -12px rgba(61,44,30,0.10); }
.conquered-item { padding: 12px 16px; border-bottom: 0.5px solid #f0ebe3; display: flex; align-items: center; justify-content: space-between; gap:8px; }
.conquered-item:last-child { border-bottom: none; }
.conquered-item .ci-word { font-size: 15px; color: #3d2c1e; }
.conquered-item .ci-trans { font-size: 13px; color: #7a6555; }
.conquered-item .ci-badge { font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 500; flex-shrink:0; white-space:nowrap; }
.badge-full { background: #eaf3de; color: #3b6d11; }
.badge-half { background: #e6f1fb; color: #185fa5; }
.badge-tried { background: #faeeda; color: #854f0b; }
.filter-tabs { display: flex; gap: 6px; margin-bottom: 1rem; overflow-x:auto; }
.filter-tab { flex-shrink:0; padding: 6px 12px; border-radius: 20px; border: 0.5px solid #d0c8be; background: #fff; font-size: 12px; cursor: pointer; color: #7a6555; white-space:nowrap; }
.filter-tab.active { background: #3d2c1e; color: #f5f0e8; border-color: #3d2c1e; }

.admin-section { background: #fff; border-radius: 14px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(61,44,30,0.05), 0 8px 24px -12px rgba(61,44,30,0.10); }
.admin-section h3 { font-size: 14px; font-weight: 500; color: #3d2c1e; margin-bottom: 1rem; }
.admin-section textarea { width: 100%; padding: 10px 12px; border: 0.5px solid #d0c8be; border-radius: 8px; font-size: 13px; background: #faf8f5; color: #3d2c1e; resize: vertical; min-height: 80px; font-family: inherit; }
.admin-section input, .admin-section select { width: 100%; padding: 10px 12px; border: 0.5px solid #d0c8be; border-radius: 8px; font-size: 14px; background: #faf8f5; color: #3d2c1e; margin-bottom: 8px; font-family: inherit; }
.btn-secondary { width: 100%; padding: 10px; background: #f5f0e8; color: #3d2c1e; border: 0.5px solid #d0c8be; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 500; }
/* The one button the daily habit runs through. Same happy green as the ring
   stroke, but washed out to a tint in the manner of the deck badges, with the
   colour carried by the text instead of the fill. Size and weight make it the
   primary action; it doesn't need saturation to do that. */
.btn-today { width: 100%; padding: 14px; margin-bottom: 1.25rem; background: #d7e9bd; color: #41611a; border: 0.5px solid #c3dba3; border-radius: 12px; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; cursor: pointer; transition: background 0.15s, transform 0.05s; }
.btn-today:hover { background: #cbe2ac; }
.btn-today:active { transform: translateY(1px); }

/* Second-rank action. Blue rather than a second green so the two can never be
   confused at a glance, and drawn from the same tint family as the W2 deck
   badge so it belongs to the palette rather than sitting next to it. */
.btn-quiet { width: 100%; padding: 10px; background: #dbe9f7; color: #2f5a7d; border: 0.5px solid #c3d8ec; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.btn-quiet:hover { background: #cfe1f3; }
.btn-secondary:hover { background: #ede8df; }
.user-row { padding: 10px 0; border-bottom: 0.5px solid #f0ebe3; display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.user-row:last-child { border-bottom: none; }
.user-name { font-weight: 500; color: #3d2c1e; }
.user-email { color: #7a6555; }
.user-joined { color: #aaa; font-size: 11px; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-sheet { background: #fff; border-radius: 20px 20px 0 0; padding: 1.5rem; width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto; }
.modal-sheet h3 { font-size: 16px; font-weight: 500; color: #3d2c1e; margin-bottom: 1rem; }
.lang-option { padding: 12px 16px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 12px; font-size: 15px; color: #3d2c1e; }
.lang-option:hover { background: #f5f0e8; }
.lang-option.active { background: #3d2c1e; color: #f5f0e8; border-radius: 10px; }
.lang-flag { font-size: 13px; font-weight:600; width:28px; }

.profile-avatar { width: 56px; height: 56px; border-radius: 50%; background: #ece4d8; color: #5a4a3a; border: 0.5px solid #dbcfbe; display:flex; align-items:center; justify-content:center; font-size: 20px; font-weight:600; margin-bottom: 1rem; }

.onboard-overlay { position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.5); z-index: 100; display:flex; align-items:center; justify-content:center; }
.onboard-bubble { background:#fff; border-radius:16px; padding:1.5rem; max-width: 320px; width: 90%; text-align:left; position: relative; }
/* The arrow's horizontal position is set by renderOnboard() as --arrow-x, and
   its DIRECTION comes from the arrow-up / arrow-down classes the same function
   adds. Both were previously ignored: the triangle was hardcoded to the bottom
   edge at a fixed 40px, so it always pointed down and rarely at anything. */
.onboard-bubble:after { content:''; position:absolute; left: var(--arrow-x, 40px); margin-left:-10px; width:0; height:0; border-left:10px solid transparent; border-right:10px solid transparent; }
/* Bubble sits BELOW its target, so the arrow points up out of the top edge. */
.onboard-bubble.arrow-up:after { top:-10px; border-bottom:10px solid #fff; }
/* Bubble sits ABOVE its target, so the arrow points down out of the bottom. */
.onboard-bubble.arrow-down:after { bottom:-10px; border-top:10px solid #fff; }
.onboard-bubble h3 { font-size:16px; font-weight:500; color:#3d2c1e; margin-bottom:0.5rem; }
.onboard-bubble p { font-size:13px; color:#7a6555; line-height:1.5; margin-bottom:1rem; }
.onboard-footer { display:flex; align-items:center; justify-content:space-between; }
.onboard-dots { display:flex; gap:5px; }
.onboard-dot { width:6px; height:6px; border-radius:50%; background:#e0d8ce; }
.onboard-dot.active { background:#9b7a5a; }
.onboard-next { background:#3d2c1e; color:#fff; border:none; padding:8px 16px; border-radius:8px; font-size:13px; font-weight:500; cursor:pointer; }
.onboard-skip { background:none; border:none; color:#aaa; font-size:12px; cursor:pointer; }

.hidden { display: none; }
.tab-bar { display: flex; gap: 6px; margin-bottom: 1rem; }
.tab { padding: 6px 14px; border-radius: 20px; border: 0.5px solid #d0c8be; background: #fff; font-size: 13px; cursor: pointer; color: #7a6555; }
.tab.active { background: #3d2c1e; color: #f5f0e8; border-color: #3d2c1e; }

.lang-option.disabled { opacity: 0.45; cursor: default; }
.lang-option.disabled:hover { background: transparent; }
.lang-soon { margin-left: auto; font-size: 11px; color: #7a6555; border: 0.5px solid #e0d8ce; border-radius: 999px; padding: 2px 8px; }
.lang-flag { font-size: 18px; line-height: 1; }
.section-note { font-size: 12px; color: #7a6555; line-height: 1.45; margin: -2px 1.5rem 10px; }
.section-note strong { color: #3d2c1e; font-weight: 600; }

/* Closes the home screen with the brand instead of another list. Georgia italic
   rather than a script webfont: this app loads no external assets, and the CSS
   `cursive` keyword resolves to Comic Sans on most machines. */
.brand-moment { text-align: center; padding: 5rem 1rem 1rem; }
/* Real handwriting, not italic serif. These faces ship with macOS and iOS
   (Snell Roundhand) and Windows (Segoe Script), which is where this will be
   looked at; `cursive` is the last-resort fallback, not the intent. No webfont,
   because the app loads no external assets and must work offline. */
.bm-name, .bm-line { font-family: "Snell Roundhand", "Segoe Script", "Bradley Hand", "Brush Script MT", cursive; }
.bm-name { font-size: 40px; line-height: 1.05; color: #3d2c1e; }
/* A degree and a half of lift - enough to feel written rather than set. */
.bm-line { display: inline-block; font-size: 21px; color: #8a7562; margin-top: 2px; transform: rotate(-1.5deg); }
