/* SYNONYMR — simple dark theme. One accent (mint), yellow for stars, red for low time. */
:root {
  color-scheme: dark;
  --bg: #0e1014;
  --card: #161921;
  --card-2: #1c2029;
  --line: #2a2f3b;
  --text: #eef0f5;
  --muted: #8d95a7;
  --accent: #7ee0c3;
  --accent-ink: #08201a;
  --star: #ffd166;
  --danger: #ff7b86;
  --radius: 16px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Outfit', var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: var(--font); line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app-shell { max-width: 1040px; margin: 0 auto; padding: 20px 20px 32px; }

/* ---------- Header ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { display: grid; grid-template-columns: 34px auto auto; align-items: center; column-gap: 12px; text-decoration: none; }
.brand-mark { position: relative; width: 34px; height: 30px; flex: none; }
.brand-mark i { position: absolute; width: 17px; height: 17px; border-radius: 50%; }
.brand-mark i:nth-child(1) { left: 0; top: 0; background: #a79bff; }
.brand-mark i:nth-child(2) { left: 15px; top: 0; background: var(--accent); }
.brand-mark i:nth-child(3) { left: 7px; top: 11px; background: var(--star); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.5px; line-height: 1; }
.brand-name small { display: block; margin-top: 4px; font-family: var(--font); font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.brand-credit { border-left: 1px solid var(--line); padding-left: 12px; color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
@media (max-width: 760px) { .brand { grid-template-columns: 34px auto; column-gap: 8px; row-gap: 3px; } .brand-mark { grid-column: 1; grid-row: 1 / span 2; } .brand-name { grid-column: 2; grid-row: 1; } .brand-credit { grid-column: 2; grid-row: 2; border: 0; padding: 0; font-size: 10px; } }
.header-actions { display: flex; align-items: center; gap: 10px; }
.mini-stat { display: flex; align-items: baseline; gap: 6px; margin-right: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.mini-stat > span:first-child { color: var(--star); }
.mini-stat strong { color: var(--text); font-family: var(--display); font-size: 18px; }
.icon-button {
  width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
  font-weight: 700; transition: border-color .15s, color .15s;
}
.icon-button:hover { color: var(--text); border-color: #3b4252; }
.icon-button svg { width: 20px; height: 20px; }
.icon-button[aria-pressed="true"] #sound-cross { display: none; }
.icon-button[aria-pressed="false"] #sound-wave { display: none; }

/* ---------- Mode tabs ---------- */
.mode-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.mode-tab { display: flex; align-items: center; gap: 8px; padding: 9px 16px; background: none; border: 0; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 15px; transition: background .15s, color .15s; }
.mode-tab:hover { color: var(--text); }
.mode-tab.active { background: var(--accent); color: var(--accent-ink); }
.tab-detail { font-size: 12px; font-weight: 500; opacity: .7; }

/* ---------- Layout ---------- */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.game-card, .side-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.game-card { padding: 28px; min-height: 520px; }
.loading-fallback { padding: 60px 0; text-align: center; color: var(--muted); }
.sidebar { display: grid; gap: 16px; }
.side-card { padding: 20px; }
.side-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.side-card h3 span { color: var(--accent); }
.side-lead { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.note-card p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Round header ---------- */
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.round-counter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tiny-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.progress-trail { display: flex; gap: 5px; }
.progress-trail span { width: 22px; height: 5px; border-radius: 9px; background: var(--line); }
.progress-trail span.done { background: var(--accent); }
.progress-trail span.current { background: var(--text); }

/* ---------- Timer ---------- */
.timer-row { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.timer-num { display: flex; align-items: baseline; gap: 4px; min-width: 78px; color: var(--accent); }
.timer-num b { font-family: var(--display); font-size: 38px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.timer-num span { color: var(--muted); font-size: 13px; }
.timer { flex: 1; height: 10px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.timer-bar { height: 100%; width: 100%; background: var(--accent); border-radius: inherit; transition: width .2s linear; }
.timer-row.low .timer-num { color: var(--danger); }
.timer-row.low .timer-bar { background: var(--danger); }
.timer-row.low .timer-num b { animation: blink .6s ease-in-out infinite alternate; }

/* ---------- Word ---------- */
.word-area { text-align: center; margin-bottom: 26px; }
.word-kicker { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.target-word { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(44px, 9vw, 76px); letter-spacing: -1.5px; line-height: 1.05; overflow-wrap: anywhere; animation: word-in .3s ease-out; }
.word-meta { display: flex; justify-content: center; gap: 8px; margin: 12px 0 8px; }
.tag { padding: 3px 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: capitalize; }
.tag.easy { color: var(--accent); }
.tag.medium { color: var(--star); }
.tag.hard { color: var(--danger); }
.clue { margin: 0; color: var(--muted); font-size: 15px; }
.clue strong { color: var(--text); }

/* ---------- Answers ---------- */
.stars-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .1em; }
.stars-display { color: var(--star); font-size: 18px; letter-spacing: 2px; }
.stars-display .dim { color: var(--line); }
.answer-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.answer-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; padding: 8px 10px; border-radius: 12px; text-align: center; overflow: hidden; }
.answer-slot.empty { border: 1.5px dashed var(--line); color: #596073; }
.answer-slot.empty .slot-number { font-family: var(--display); font-size: 18px; font-weight: 700; }
.answer-slot.empty small { font-size: 10px; letter-spacing: .1em; }
.answer-slot.filled { background: rgba(126, 224, 195, .12); border: 1.5px solid rgba(126, 224, 195, .55); font-weight: 700; animation: pop .25s ease-out; }
.answer-slot.filled span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-check { color: var(--accent); font-size: 13px; line-height: 1; }

.guess-form { display: flex; gap: 10px; }
.guess-form input { flex: 1; min-width: 0; padding: 14px 16px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; font-size: 18px; transition: border-color .15s; }
.guess-form input::placeholder { color: #596073; }
.guess-form input:focus { outline: none; border-color: var(--accent); }
.primary-button { padding: 0 22px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 14px; font-weight: 800; font-size: 14px; letter-spacing: .06em; transition: filter .15s, transform .1s; }
.primary-button:hover:not(:disabled) { filter: brightness(1.08); }
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button.wide { width: 100%; padding: 15px; }
.secondary-button { padding: 13px 20px; background: none; border: 1.5px solid var(--line); border-radius: 14px; font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.secondary-button:hover { border-color: #3b4252; }

.feedback { min-height: 24px; margin: 10px 2px 0; font-size: 14px; font-weight: 600; text-align: center; }
.feedback.positive { color: var(--accent); }
.feedback.negative { color: var(--danger); }
.feedback.notice { color: var(--muted); }
.round-toolbar { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.miss-count { color: var(--muted); font-size: 13px; }
.lower-actions { display: flex; gap: 14px; }
.text-button { padding: 4px 2px; background: none; border: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.text-button:hover:not(:disabled) { color: var(--text); }

/* ---------- Round end ---------- */
.reveal-top { text-align: center; margin: 6px 0 4px; }
.reveal-kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.reveal-top h2, .daily-result h2 { margin: 6px 0 4px; font-family: var(--display); font-size: 36px; font-weight: 800; letter-spacing: -.5px; }
.reveal-top p, .daily-result p { margin: 0; color: var(--muted); }
.big-stars { display: flex; justify-content: center; gap: 10px; margin: 18px 0; color: var(--star); font-size: 56px; line-height: 1; }
.big-stars span { animation: pop .35s ease-out both; }
.big-stars span:nth-child(2) { animation-delay: .1s; }
.big-stars span:nth-child(3) { animation-delay: .2s; }
.big-stars .off { color: var(--line); }
.review-title { margin: 0 0 8px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.review-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.review-chips span { padding: 6px 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 99px; font-size: 14px; font-weight: 600; }
.review-chips span.yours { background: rgba(126, 224, 195, .12); border-color: rgba(126, 224, 195, .5); color: var(--accent); }
.review-section { padding-top: 16px; margin-bottom: 6px; border-top: 1px solid var(--line); }

/* ---------- Daily result ---------- */
.daily-result { text-align: center; padding: 14px 0 6px; }
.trophy { font-size: 46px; line-height: 1; margin-bottom: 8px; }
.score-big { margin-top: 10px; font-family: var(--display); font-size: 84px; font-weight: 800; line-height: 1; color: var(--star); }
.score-big span { font-size: 28px; color: var(--muted); }
.score-sub { margin: 6px 0 18px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.daily-results-rows { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.daily-results-rows div { display: grid; gap: 2px; width: 46px; padding: 8px 0; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; color: var(--star); font-size: 18px; }
.daily-results-rows small { color: var(--muted); font-size: 10px; }
.result-actions { display: flex; justify-content: center; gap: 10px; margin: 20px 0 14px; }
.result-actions .primary-button { padding: 13px 22px; }
.new-day-note { color: var(--muted); font-size: 13px; }

/* ---------- Sidebar contents ---------- */
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.step { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; }
.step.current { background: var(--card-2); }
.step-circle { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border: 1.5px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 12px; font-weight: 700; }
.step.current .step-circle { border-color: var(--text); color: var(--text); }
.step.done .step-circle { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step-words { flex: 1; min-width: 0; }
.step-words strong { display: block; font-size: 14px; }
.step-words small { display: block; color: var(--muted); font-size: 12px; }
.step:not(.done):not(.current) strong { color: var(--muted); font-weight: 500; }
.step-stars { color: var(--star); font-size: 12px; letter-spacing: 1px; }
.side-footer { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-footer span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.side-footer strong { font-family: var(--display); font-size: 24px; color: var(--star); }
.side-footer b { color: var(--muted); font-size: 14px; font-weight: 500; }
.side-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.stat-tile { padding: 12px; background: var(--card-2); border-radius: 12px; }
.stat-tile strong { display: block; font-family: var(--display); font-size: 24px; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.mini-graph { display: flex; align-items: flex-end; gap: 6px; height: 48px; }
.mini-graph span { flex: 1; border-radius: 4px; }

/* ---------- Footer, dialog, toast ---------- */
.site-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: 12px; }
dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 24px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 20px; }
dialog::backdrop { background: rgba(5, 6, 10, .75); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.dialog-head h2 { margin: 4px 0 0; font-family: var(--display); font-size: 26px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.close-button { width: 34px; height: 34px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 20px; line-height: 1; }
.rule-item { display: flex; gap: 14px; margin-bottom: 16px; }
.rule-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; background: var(--card-2); border-radius: 50%; color: var(--accent); font-weight: 700; }
.rule-item p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.dialog-note { margin: 0 0 18px; padding: 12px 14px; background: var(--card-2); border-radius: 12px; color: var(--muted); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); padding: 11px 18px; background: var(--text); color: var(--bg); border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.particle { position: fixed; z-index: 99; pointer-events: none; font-size: 19px; animation: particle-flight 760ms ease-out forwards; }

/* ---------- Motion ---------- */
@keyframes word-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { 0% { transform: scale(.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes blink { to { opacity: .55; } }
@keyframes particle-flight {
  0% { opacity: 1; transform: translate3d(0, 0, 0) scale(.7); }
  100% { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--spin)) scale(1.2); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .note-card { display: none; }
}
@media (max-width: 520px) {
  .app-shell { padding: 14px 12px 24px; }
  .game-card { padding: 18px 16px; min-height: 0; }
  .brand-name { font-size: 21px; }
  .brand-name small, .mini-stat-caption { display: none; }
  .tab-detail { display: none; }
  .mode-tab { white-space: nowrap; }
  .result-actions { flex-direction: column; }
  .result-actions button { width: 100%; white-space: nowrap; }
  .mode-tabs { display: flex; }
  .mode-tab { flex: 1; justify-content: center; padding: 9px 8px; }
  .timer-num b { font-size: 32px; }
  .answer-slots { gap: 6px; }
  .big-stars { font-size: 46px; }
  .guess-form input { font-size: 17px; }
  .primary-button { padding: 0 16px; }
  .score-big { font-size: 68px; }
}

/* Welcome screen: never begin a round until the visitor actively presses Play. */
.welcome-screen{min-height:525px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding-block:48px}
.welcome-symbol{font-size:42px;letter-spacing:10px;color:var(--accent);margin-bottom:20px;line-height:1}
.welcome-symbol span{color:var(--yellow)}
.welcome-eyebrow{color:#a79bff;font-size:11px;font-weight:900;letter-spacing:2px;margin:0 0 10px}
.welcome-title{font-family:var(--display);font-size:clamp(36px,5vw,58px);font-weight:900;letter-spacing:-1.8px;line-height:1.05;margin:0 0 18px}
.welcome-description{color:var(--muted);font-size:15px;line-height:1.6;max-width:390px;margin:0 auto 25px}
.welcome-progress{border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.04);padding:8px 14px;color:var(--white);font-weight:700;font-size:12px;margin-bottom:26px}
.welcome-play{max-width:330px;min-height:58px}
.welcome-note{color:var(--muted);font-size:12px;margin:19px 0 0}
@media(max-width:690px){.welcome-screen{min-height:435px;padding-block:40px}.welcome-description{font-size:13px;max-width:310px}.welcome-symbol{font-size:35px}}

/* Laptop layout: show the full game, daily steps and footer without vertical scrolling.
   Mobile retains the original single-column layout. */
@media (min-width: 821px) and (max-height: 860px) {
  .app-shell { padding-top: 10px; padding-bottom: 10px; }
  .site-header { margin-bottom: 10px; }
  .mode-tabs { margin-bottom: 8px; }
  .content-grid { gap: 12px; }
  .game-card { min-height: 0; padding: 16px 22px; }
  .side-card { padding: 12px 14px; }
  .sidebar { gap: 8px; }
  .side-lead { margin-bottom: 8px; }
  .steps-list { gap: 1px; }
  .step { padding: 5px 8px; gap: 8px; }
  .step-words strong { font-size: 13px; }
  .step-words small { font-size: 11px; }
  .side-footer { margin-top: 9px; padding-top: 9px; }
  .site-footer { margin-top: 10px; }
  .card-top { margin-bottom: 10px; }
  .timer-row { margin-bottom: 12px; }
  .timer-num b { font-size: 34px; }
  .word-area { margin-bottom: 12px; }
  .target-word { font-size: clamp(40px, 5vw, 60px); }
  .word-meta { margin: 7px 0 5px; }
  .clue { font-size: 14px; }
  .stars-label { margin-bottom: 7px; }
  .answer-slots { margin-bottom: 8px; }
  .answer-slot { min-height: 52px; }
  .guess-form input { padding: 10px 14px; }
  .feedback { min-height: 21px; margin-top: 5px; }
  .round-toolbar { margin-top: 7px; padding-top: 8px; }
  .welcome-screen { min-height: 0; padding-block: 20px; }
  .welcome-symbol { font-size: 32px; margin-bottom: 10px; }
  .welcome-title { font-size: 42px; margin-bottom: 11px; }
  .welcome-description { margin-bottom: 12px; }
  .welcome-progress { margin-bottom: 14px; }
  .welcome-note { margin-top: 10px; }
  .reveal-top h2, .daily-result h2 { font-size: 30px; }
  .big-stars { margin: 12px 0; font-size: 48px; }
  .review-chips { margin-bottom: 11px; }
  .review-section { padding-top: 10px; }
  .daily-result { padding: 8px 0; }
  .trophy { margin-bottom: 4px; }
  .score-big { font-size: 68px; }
  .result-actions { margin: 12px 0 8px; }
}

/* Player-selected Normal Mode difficulty; fits beside the game tabs on laptops. */
[hidden] { display: none !important; }
.difficulty-picker { display: inline-flex; align-items: center; gap: 3px; padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--line); }
.difficulty-caption { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin-right: 3px; }
.difficulty-option { border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 9px 10px; font-size: 12px; font-weight: 700; transition: background .15s, color .15s; }
.difficulty-option:hover { color: var(--text); background: var(--card-2); }
.difficulty-option.active { color: var(--accent-ink); background: var(--accent); }
.difficulty-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 680px) {
  .mode-tabs { display: flex; flex-wrap: wrap; width: 100%; }
  .difficulty-picker { width: 100%; justify-content: center; border-left: 0; border-top: 1px solid var(--line); margin: 0; padding: 5px 0 0; }
  .difficulty-option { flex: 1; }
}
