:root {
  --green: #0d6b39;
  --green-2: #168348;
  --mint: #e8f7ee;
  --lime: #9ad642;
  --yellow: #f2c94c;
  --sky: #dff5ff;
  --ink: #173225;
  --muted: #60766a;
  --paper: #f8fbf4;
  --line: #dbe8dd;
  --danger: #d92d20;
  --shadow: 0 18px 50px rgba(23, 50, 37, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; color: var(--ink); background: #f2fbf5; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(circle at 15% 5%, rgba(154,214,66,.28), transparent 32%), linear-gradient(180deg, #e6f8ee 0%, #f8fbf4 55%, #eef7ef 100%); }
a { color: var(--green); text-decoration: none; font-weight: 800; }
button, input { font: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px clamp(16px, 4vw, 56px); background: rgba(248,251,244,.9); border-bottom: 1px solid rgba(13,107,57,.12); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(13,107,57,.16)); }
.brand span { font-size: 18px; font-weight: 900; letter-spacing: 0; }
.topbar nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a { color: var(--muted); font-size: 14px; padding: 9px 11px; border-radius: 8px; }
.topbar nav a:hover { background: #e8f7ee; color: var(--green); }

main { flex: 1; }
.intro { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: clamp(30px, 5vw, 70px) 0; display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 28px; align-items: start; }
.intro-copy { position: relative; min-height: 430px; padding: clamp(26px, 4vw, 46px); border-radius: 8px; overflow: hidden; background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(232,247,238,.78)); border: 1px solid rgba(13,107,57,.12); box-shadow: var(--shadow); }
.intro-copy::before { content: ""; position: absolute; inset: auto -40px -18px 0; height: 230px; background: url('/assets/images/bg/landmarks.svg') left bottom / 1220px auto repeat-x; opacity: .9; pointer-events: none; }
.intro-copy::after { content: ""; position: absolute; right: 34px; bottom: 46px; width: min(310px, 38vw); aspect-ratio: 220 / 116; background: url('/assets/images/ui/truck.svg') center / contain no-repeat; filter: drop-shadow(0 20px 24px rgba(23,50,37,.18)); pointer-events: none; }
.kicker, .modal-kicker { margin: 0 0 10px; color: var(--green); text-transform: uppercase; font-weight: 950; font-size: 13px; letter-spacing: .08em; }
h1 { margin: 0 0 16px; max-width: 720px; font-size: clamp(40px, 6vw, 76px); line-height: .94; letter-spacing: 0; }
.lead { position: relative; z-index: 1; max-width: 555px; color: var(--muted); font-size: 19px; line-height: 1.55; }
.hero-actions { position: relative; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; min-height: 48px; padding: 0 22px; border-radius: 8px; font-weight: 950; cursor: pointer; transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--green), var(--green-2)); box-shadow: 0 12px 24px rgba(13,107,57,.22); }
.btn-secondary { color: var(--green); background: #e2f3e6; box-shadow: inset 0 0 0 1px rgba(13,107,57,.12); }

.tutorial-grid { display: grid; gap: 12px; }
.tutorial-grid article, .hof-panel, .modal, .score-card { border: 1px solid rgba(13,107,57,.13); background: rgba(255,255,255,.9); border-radius: 8px; box-shadow: var(--shadow); }
.tutorial-grid article { position: relative; min-height: 128px; padding: 18px 18px 18px 78px; display: grid; gap: 7px; overflow: hidden; }
.tutorial-grid article i { position: absolute; left: 18px; top: 19px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: linear-gradient(135deg, #0d6b39, #41b86c); color: #fff; font-style: normal; font-size: 25px; font-weight: 950; box-shadow: 0 10px 18px rgba(13,107,57,.18); }
.tutorial-grid strong { font-size: 21px; }
.tutorial-grid span { color: var(--muted); line-height: 1.45; }
.hof-panel { grid-column: 1 / -1; padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .page h1 { margin: 0; font-size: 30px; }

.ranking-list { display: grid; gap: 9px; }
.ranking-row { display: grid; grid-template-columns: 52px 1fr 96px 80px; gap: 10px; align-items: center; min-height: 50px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 18px rgba(23,50,37,.05); }
.ranking-row.top-1 { border-color: rgba(242,201,76,.75); background: linear-gradient(90deg, #fff9df, #fff); }
.ranking-row.top-3:not(.top-1) { background: linear-gradient(90deg, #edf9ef, #fff); }
.ranking-row .rank { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #e8f7ee; font-weight: 950; color: var(--green); }
.ranking-row.top-1 .rank { background: var(--yellow); color: #5a3d00; }
.ranking-row .nick { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-row .score { text-align: right; font-weight: 950; color: var(--green); font-size: 18px; }
.ranking-row .meta { text-align: right; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 16px; text-align: center; border: 1px dashed var(--line); border-radius: 8px; background: rgba(255,255,255,.55); }

.game-section { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 14px; background: radial-gradient(circle at 50% 0, #234a31, #0e2117 70%); }
#game { width: min(100%, 1280px); aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; box-shadow: 0 26px 70px rgba(0,0,0,.36); background: #b8e4f8; outline: 1px solid rgba(255,255,255,.14); }

.modal-backdrop { position: fixed; inset: 0; display: none; place-items: center; padding: 18px; background: rgba(11, 34, 22, .7); z-index: 50; backdrop-filter: blur(6px); }
.modal-backdrop.show { display: grid; }
.modal { width: min(540px, 100%); padding: 26px; animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: .4; } to { transform: none; opacity: 1; } }
.modal h2 { margin: 0 0 6px; font-size: 38px; line-height: 1; }
.subtitle, .rank-note { color: var(--muted); margin: 0 0 16px; line-height: 1.45; }
.score-card { padding: 18px; margin: 16px 0; background: linear-gradient(135deg, #ffffff, #eff9f1); }
.score-card span { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; font-weight: 900; }
.score-card strong { display: block; font-size: 58px; color: var(--green); line-height: 1; }
.score-card div { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); }
label { display: block; margin-bottom: 6px; font-weight: 900; }
input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 8px; padding: 0 13px; background: #fff; outline: none; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(13,107,57,.12); }
.field-error { color: var(--danger); min-height: 22px; font-size: 13px; padding-top: 5px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.saved { color: var(--green); font-weight: 950; padding: 14px; background: #e8f7ee; border-radius: 8px; }

.page, .legal { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 46px 0; }
.page h1 { font-size: clamp(42px, 6vw, 70px); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.filter { border: 1px solid var(--line); background: #fff; color: var(--green); border-radius: 8px; min-height: 42px; padding: 0 15px; font-weight: 900; cursor: pointer; box-shadow: 0 8px 16px rgba(23,50,37,.05); }
.filter.active { background: var(--green); color: #fff; border-color: var(--green); }
.legal { line-height: 1.65; font-size: 18px; }
.legal h1 { font-size: 42px; }
.footer { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; padding: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; background: rgba(248,251,244,.8); }

@media (max-width: 880px) {
  .topbar { align-items: flex-start; }
  .brand span { font-size: 15px; }
  .topbar nav { gap: 4px; }
  .topbar nav a { padding: 7px 8px; }
  .intro { grid-template-columns: 1fr; padding-top: 24px; }
  .intro-copy { min-height: 520px; }
  .intro-copy::after { width: min(340px, 76vw); right: 20px; bottom: 42px; }
  .ranking-row { grid-template-columns: 42px 1fr 76px; }
  .ranking-row .meta { display: none; }
  #game { width: min(100%, 520px); aspect-ratio: 9 / 16; }
}

@media (max-width: 520px) {
  .intro, .page, .legal { width: min(100% - 20px, 960px); }
  .intro-copy { padding: 22px; }
  h1 { font-size: 42px; }
  .lead { font-size: 17px; }
  .tutorial-grid article { padding-left: 68px; }
  .modal { padding: 20px; }
  .score-card strong { font-size: 48px; }
}
