:root {
  --paper: #f4f1eb;
  --paper-deep: #e9e5dd;
  --ink: #1e2524;
  --muted: #777d79;
  --line: #d8d5ce;
  --white: #fffdf8;
  --teal: #256b67;
  --teal-light: #dcece7;
  --coral: #e86f55;
  --coral-light: #f9ddd3;
  --yellow: #f2c85b;
  --shadow: 0 16px 38px rgba(30, 37, 36, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { background: #1f2927; color: #e9eeea; padding: 28px 18px 20px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; line-height: 0.9; letter-spacing: 0.04em; text-transform: uppercase; }
.brand b { color: var(--yellow); font-weight: 700; }
.brand-mark { width: 26px; height: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; align-items: end; }
.brand-mark i { display: block; border-radius: 2px 2px 0 0; background: var(--coral); }
.brand-mark i:nth-child(1) { height: 13px; }
.brand-mark i:nth-child(2) { height: 22px; background: var(--yellow); }
.brand-mark i:nth-child(3) { height: 17px; background: #8bd0c2; }
.main-nav { margin-top: 74px; }
.nav-label, .eyebrow { color: #8d9791; font-size: 10px; line-height: 1; text-transform: uppercase; letter-spacing: 0.15em; margin: 0 0 12px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin: 3px 0; border-left: 2px solid transparent; color: #bac4be; font-size: 14px; transition: background 160ms ease, color 160ms ease; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.is-active { color: #fff; background: rgba(255,255,255,0.1); border-left-color: var(--coral); }
.nav-icon { width: 19px; color: #8faaa0; font-size: 18px; line-height: 1; text-align: center; }
.nav-grid-icon { font-size: 21px; }
.sidebar-bottom { margin-top: auto; }
.side-stat { border-top: 1px solid rgba(255,255,255,0.13); border-bottom: 1px solid rgba(255,255,255,0.13); padding: 17px 4px; margin-bottom: 20px; display: flex; gap: 10px; align-items: center; }
.side-stat-icon { width: 30px; height: 30px; border: 1px solid rgba(242,200,91,0.5); color: var(--yellow); display: grid; place-items: center; border-radius: 50%; }
.side-stat .eyebrow { margin-bottom: 6px; }
.side-stat strong { font-size: 15px; font-weight: 600; }
.sidebar-footer { margin-top: 24px; padding: 0 12px; display: flex; justify-content: space-between; gap: 8px; color: #71807a; font-size: 9px; letter-spacing: 0.12em; }

.main-content { min-width: 0; padding: 0 5.1vw 64px; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); letter-spacing: 0.07em; text-transform: uppercase; }
.crumb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.date-chip { color: var(--muted); font-size: 10px; letter-spacing: 0.12em; }
.icon-button, .avatar-button { border: 1px solid var(--line); background: transparent; color: var(--ink); width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 17px; }
.icon-button:hover { background: var(--white); border-color: var(--ink); }
.avatar-button { border: 0; background: var(--teal); color: white; font-size: 10px; letter-spacing: 0.06em; }
.has-tooltip { position: relative; }
.has-tooltip::after { content: attr(data-tooltip); position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; padding: 6px 8px; background: var(--ink); color: white; border-radius: 4px; font-size: 10px; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateY(-3px); transition: opacity 140ms ease, transform 140ms ease; }
.has-tooltip:hover::after, .has-tooltip:focus-visible::after { opacity: 1; transform: translateY(0); }

.search-drawer, .help-drawer { margin-top: 14px; border: 1px solid var(--line); background: var(--white); padding: 16px; display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow); }
.search-drawer { display: block; }
.search-drawer label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; border: 1px solid var(--line); padding: 11px 12px; border-radius: 5px; background: var(--paper); outline: none; }
.search-row input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(37,107,103,0.12); }
.small-button { border: 1px solid var(--ink); background: var(--ink); color: white; padding: 0 14px; border-radius: 5px; font-size: 12px; }
.search-results { padding-top: 9px; font-size: 13px; }
.search-result { display: inline-flex; gap: 8px; margin: 4px 12px 0 0; color: var(--teal); }
.help-drawer { justify-content: space-between; }
.help-drawer p { margin: 0; font-size: 13px; }

.view-container { max-width: 1220px; margin: 0 auto; padding-top: 42px; }
.page-intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.page-kicker { display: flex; align-items: center; gap: 8px; color: var(--teal); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 9px; }
.page-kicker span { width: 22px; height: 2px; background: var(--coral); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 0; font-size: clamp(32px, 4vw, 57px); line-height: 1.02; letter-spacing: 0; font-weight: 650; }
h1 em { color: var(--coral); font-style: normal; }
.intro-note { max-width: 230px; color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 4px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(275px, 0.72fr); gap: 20px; align-items: stretch; }
.feature-panel, .progress-panel, .game-card, .game-surface, .saved-panel { border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); }
.feature-panel { min-height: 460px; padding: 28px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.feature-panel::before { content: ""; position: absolute; top: 0; right: 0; width: 42%; height: 4px; background: var(--coral); }
.feature-meta { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 24px; }
.feature-meta .eyebrow { color: var(--teal); margin-bottom: 8px; }
.feature-title { margin: 0; font-size: 28px; line-height: 1.05; font-weight: 650; }
.feature-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #c3dbd5; padding: 7px 9px; color: var(--teal); border-radius: 4px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.sudoku-board { width: min(100%, 390px); aspect-ratio: 1; margin: auto; display: grid; grid-template-columns: repeat(9, 1fr); border: 2px solid var(--ink); background: var(--ink); gap: 1px; }
.sudoku-cell { min-width: 0; border: 0; background: var(--white); display: grid; place-items: center; color: var(--ink); font-size: clamp(14px, 2vw, 19px); font-weight: 600; }
.sudoku-cell.given { background: #efede7; }
.sudoku-cell.selected { background: var(--teal-light); color: var(--teal); }
.sudoku-cell.correct { color: var(--teal); }
.sudoku-cell.wrong { color: var(--coral); background: var(--coral-light); }
.sudoku-cell:nth-child(3n) { border-right: 2px solid var(--ink); }
.sudoku-cell:nth-child(9n) { border-right: 0; }
.sudoku-cell:nth-child(n+19):nth-child(-n+27), .sudoku-cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--ink); }
.feature-footer { margin-top: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.micro-copy { font-size: 11px; color: var(--muted); }
.primary-button, .outline-button { border-radius: 5px; padding: 12px 16px; font-weight: 650; font-size: 12px; letter-spacing: 0.02em; transition: transform 150ms ease, background 150ms ease; }
.primary-button { border: 1px solid var(--teal); background: var(--teal); color: white; }
.primary-button:hover, .outline-button:hover { transform: translateY(-1px); }
.outline-button { border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.progress-panel { padding: 27px; display: flex; flex-direction: column; }
.progress-panel h2 { margin-bottom: 7px; font-size: 22px; }
.panel-copy { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 25px; }
.progress-number { display: flex; align-items: baseline; gap: 8px; margin-bottom: 13px; }
.progress-number strong { font-size: 47px; line-height: 1; font-weight: 650; }
.progress-number span { color: var(--muted); font-size: 12px; }
.progress-track { height: 7px; background: var(--paper-deep); position: relative; margin-bottom: 25px; }
.progress-track i { position: absolute; inset: 0 auto 0 0; width: 66%; background: var(--coral); }
.check-list { border-top: 1px solid var(--line); margin: 0; padding: 7px 0 0; list-style: none; }
.check-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 14px 0; font-size: 13px; }
.check-list li span:last-child { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.check-list li.done span:last-child { background: var(--teal); border-color: var(--teal); color: white; }
.panel-bottom { margin-top: auto; padding-top: 22px; display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 11px; }
.panel-bottom strong { color: var(--ink); font-size: 17px; }

.section-heading { margin: 42px 0 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading a { color: var(--teal); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.game-card { padding: 19px; min-height: 185px; display: flex; flex-direction: column; position: relative; overflow: hidden; transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.game-card:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: var(--shadow); }
.game-card::after { content: ""; position: absolute; right: -18px; bottom: -23px; width: 90px; height: 90px; border: 14px solid var(--teal-light); transform: rotate(18deg); }
.game-card:nth-child(2)::after { border-color: var(--coral-light); border-radius: 50%; }
.game-card:nth-child(3)::after { border-color: #f7e9b5; transform: rotate(45deg); }
.game-card-top { display: flex; justify-content: space-between; align-items: start; position: relative; z-index: 1; }
.game-symbol { width: 35px; height: 35px; display: grid; place-items: center; background: var(--teal-light); color: var(--teal); font-size: 19px; border-radius: 5px; }
.game-card:nth-child(2) .game-symbol { background: var(--coral-light); color: var(--coral); }
.game-card:nth-child(3) .game-symbol { background: #f7e9b5; color: #8b6918; }
.game-card .tag { padding: 5px 7px; font-size: 9px; }
.game-card h3 { margin: 26px 0 6px; font-size: 17px; }
.game-card p { margin: 0; max-width: 230px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.card-arrow { margin-top: auto; padding-top: 17px; color: var(--teal); font-size: 16px; position: relative; z-index: 1; }
.ad-slot { min-height: 46px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 36px; display: flex; align-items: center; justify-content: center; color: #a5aaa6; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; }

.game-view-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.game-view-head h1 { font-size: clamp(30px, 4vw, 48px); }
.game-view-head .intro-note { max-width: 290px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.game-surface { padding: 28px; min-height: 520px; }
.surface-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 24px; }
.surface-top h2 { margin: 0; font-size: 18px; }
.surface-top p { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; color: var(--teal); font-size: 13px; }
.game-side { display: grid; gap: 14px; }
.info-block { border-top: 2px solid var(--ink); padding-top: 12px; }
.info-block .eyebrow { color: var(--teal); margin-bottom: 8px; }
.info-block h3 { font-size: 17px; margin-bottom: 7px; }
.info-block p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 0; }
.stat-line { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 11px 0; font-size: 12px; }
.stat-line strong { font-weight: 650; }
.sudoku-large { width: min(100%, 480px); margin: 0 auto; }
.number-pad { max-width: 480px; margin: 21px auto 0; display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; }
.number-pad button { height: 36px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 4px; font-weight: 650; }
.number-pad button:hover, .number-pad button.is-active { border-color: var(--teal); background: var(--teal-light); color: var(--teal); }
.game-actions { max-width: 480px; margin: 17px auto 0; display: flex; justify-content: space-between; gap: 8px; }
.game-actions button { flex: 1; }
.minesweeper-board { width: min(100%, 455px); aspect-ratio: 1; display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; padding: 5px; margin: 24px auto; background: var(--ink); }
.mine-cell { border: 0; background: #d8ddd8; color: var(--ink); display: grid; place-items: center; font-size: clamp(13px, 2vw, 19px); font-weight: 750; min-width: 0; }
.mine-cell:hover { background: #eef2ec; }
.mine-cell.revealed { background: var(--paper); }
.mine-cell.flagged { background: var(--yellow); color: var(--ink); }
.mine-cell.mine { background: var(--coral); color: white; }
.mine-cell[data-number="1"] { color: #2366a3; }.mine-cell[data-number="2"] { color: #3a8d53; }.mine-cell[data-number="3"] { color: #c14b3e; }.mine-cell[data-number="4"] { color: #6c4c9b; }
.mine-controls { display: flex; justify-content: center; gap: 8px; }
.word-board { max-width: 530px; margin: 20px auto 0; }
.word-target { display: flex; align-items: center; justify-content: center; gap: 13px; margin-bottom: 24px; }
.word-target strong { font-size: 33px; letter-spacing: 0.12em; }
.word-target span { color: var(--coral); font-size: 22px; }
.word-guesses { display: grid; gap: 7px; margin-bottom: 20px; }
.word-guess { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.letter-tile { height: 52px; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; font-size: 20px; font-weight: 700; letter-spacing: 0.08em; }
.letter-tile.correct { background: var(--teal); border-color: var(--teal); color: white; }.letter-tile.close { background: var(--yellow); border-color: var(--yellow); }.letter-tile.used { background: #dadbd5; color: #69716c; }
.word-form { display: flex; gap: 8px; }
.word-form input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--paper); padding: 12px; text-transform: uppercase; letter-spacing: 0.13em; border-radius: 4px; outline: none; }
.word-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(37,107,103,0.12); }
.word-feedback { min-height: 22px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.word-feedback.is-good { color: var(--teal); }.word-feedback.is-bad { color: var(--coral); }
.saved-panel { padding: 28px; }
.saved-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 23px; }
.saved-item { border-top: 2px solid var(--teal); padding-top: 12px; }
.saved-item strong { display: block; margin-bottom: 4px; font-size: 15px; }.saved-item span { color: var(--muted); font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--ink); color: white; padding: 11px 16px; font-size: 12px; border-radius: 4px; transition: opacity 170ms ease, transform 170ms ease; z-index: 20; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding-top: 18px; display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 11px; }
.footer-brand { color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.site-footer nav { margin-left: auto; display: flex; gap: 14px; color: var(--teal); }
.site-footer nav a:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 24px 10px 16px; align-items: center; }
  .brand { display: block; text-align: center; font-size: 0; }.brand-mark { margin: 0 auto; }
  .main-nav { width: 100%; margin-top: 64px; }.nav-label, .nav-item span:last-child, .sidebar-footer, .side-stat div { display: none; }
  .nav-item { justify-content: center; border-left: 0; border-bottom: 2px solid transparent; padding: 13px 4px; }.nav-item.is-active { border-bottom-color: var(--coral); }
  .side-stat { border: 0; padding: 0; margin-bottom: 24px; }.side-stat-icon { width: 34px; height: 34px; }
  .sidebar-bottom { width: 100%; }.sidebar-bottom .nav-item { margin-top: 5px; }
  .home-grid, .game-layout { grid-template-columns: 1fr; }.game-side { grid-template-columns: repeat(2, minmax(0,1fr)); }.game-side .info-block:last-child { grid-column: span 2; }
}
@media (max-width: 650px) {
  .main-content { padding: 0 16px 42px; }.topbar { height: 64px; }.date-chip { display: none; }.view-container { padding-top: 28px; }
  .page-intro, .game-view-head { display: block; }.intro-note, .game-view-head .intro-note { margin-top: 16px; max-width: 100%; }
  h1 { font-size: 36px; }.feature-panel, .progress-panel, .game-surface, .saved-panel { padding: 18px; }.feature-panel { min-height: 0; }.feature-meta { margin-bottom: 17px; }.feature-title { font-size: 24px; }.feature-footer { align-items: stretch; flex-direction: column; }
  .feature-footer .primary-button { width: 100%; }.sudoku-board { width: 100%; }.game-grid { grid-template-columns: 1fr; }.section-heading { margin-top: 32px; }.ad-slot { margin-top: 26px; }
  .game-side { grid-template-columns: 1fr; }.game-side .info-block:last-child { grid-column: auto; }.surface-top { align-items: start; }.surface-top .tag { display: none; }.number-pad { gap: 3px; }.number-pad button { height: 34px; }.game-actions { flex-direction: column; }.saved-list { grid-template-columns: 1fr; }
  .site-footer { display: block; line-height: 1.8; }.site-footer nav { margin-top: 9px; }
}
