body.game { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--ink); overscroll-behavior: none; }

.g-top { border-bottom: 1px solid var(--line-dark); background: var(--ink); position: relative; z-index: 5; }
.g-top .wrap { width: min(100% - 24px, 1440px); display: flex; align-items: center; gap: 18px; min-height: 64px; }
.g-back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-dark); white-space: nowrap; }
.g-back:hover { color: var(--gold-light); }
.g-back svg { width: 16px; height: 16px; }
.g-title { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.g-title img { height: 22px; width: auto; }
.g-title h1 { font-size: 1.15rem; font-weight: 500; color: var(--sand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-title .sep { width: 1px; height: 22px; background: var(--line-dark); }

.hud { display: flex; align-items: stretch; gap: 8px; }
.stat { display: flex; flex-direction: column; justify-content: center; min-width: 74px; padding: 6px 12px; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--ink-3); }
.stat span { font-size: .58rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-dark); line-height: 1.3; }
.stat b { font-family: "Oswald", sans-serif; font-weight: 500; font-size: 1.25rem; line-height: 1.15; color: var(--sand); font-variant-numeric: tabular-nums; }
.stat.is-low b { color: var(--red); }
.stat.found b { color: var(--gold-light); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; padding: 0 12px; border: 1px solid var(--line-dark); border-radius: var(--radius); background: transparent; color: var(--sand); font: 700 .66rem/1 "Montserrat", sans-serif; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; transition: border-color .2s, color .2s; }
.icon-btn:hover:not(:disabled) { border-color: var(--gold-light); color: var(--gold-light); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn svg { width: 16px; height: 16px; }

.g-main { flex: 1; display: flex; flex-direction: column; width: min(100% - 24px, 1440px); margin: 0 auto; padding: 14px 0 18px; gap: 12px; }

.scene-shell { position: relative; border: 1px solid var(--line-dark); border-radius: var(--radius); overflow: hidden; background: #1a1c20; }
.scene-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
.scene-scroll svg { display: block; width: 100%; height: auto; cursor: crosshair; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: pan-x pan-y; }
.pan-hint { display: none; position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 7px 12px; border-radius: 99px; background: rgba(5,6,8,.78); color: var(--sand); font-size: .7rem; font-weight: 600; pointer-events: none; transition: opacity .4s; white-space: nowrap; }
.pan-hint.is-hidden { opacity: 0; }

.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border: 1px solid var(--line-dark); border-radius: 99px; font-size: .74rem; font-weight: 600; color: #d6d1c8; background: var(--ink-2); }
.chip i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chip b { font-weight: 700; color: var(--sand); font-variant-numeric: tabular-nums; }
.chip.is-done { border-color: rgba(225,193,125,.5); }
.legend .note { margin-left: auto; align-self: center; font-size: .72rem; color: #77746e; }

/* Category colors */
.c-falls { background: #e1c17d; }
.c-struck { background: #ef424d; }
.c-caught { background: #d9824b; }
.c-elec { background: #6fb6e8; }

/* Side panel + feedback */
.g-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side-label { margin-bottom: 8px; font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #77746e; }
.feedback { position: relative; padding: 18px 20px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line-dark); color: var(--sand); transition: border-color .3s var(--ease); }
.feedback.is-hit { border-color: rgba(225,193,125,.45); animation: fb-in .45s var(--ease); }
.feedback.is-miss { border-color: rgba(239,66,77,.45); animation: fb-in .3s var(--ease); }
@keyframes fb-in { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.feedback .fb-tag { display: inline-flex; align-items: center; gap: 8px; font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-dark); }
.feedback .fb-tag i { width: 9px; height: 9px; border-radius: 50%; }
.feedback h2 { font-size: 1.3rem; font-weight: 500; margin: 6px 30px 8px 0; }
.feedback p { font-size: .84rem; line-height: 1.6; color: #cfcac1; }
.feedback .fb-fix { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-dark); }
.feedback .fb-fix strong { color: var(--gold-light); font-weight: 700; }
.feedback .fb-ref { margin-top: 8px; font-size: .68rem; color: #8b877f; }
.feedback .fb-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted-dark); cursor: pointer; border-radius: 50%; display: grid; place-items: center; }
.feedback .fb-close:hover { color: var(--sand); background: rgba(242,236,226,.08); }
.feedback.is-idle h2 { margin-right: 0; }

@media (min-width: 1100px) {
  .g-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .g-side { position: sticky; top: 14px; }
  .g-side .legend { flex-direction: column; align-items: flex-start; }
}

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(5,6,8,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); }
.overlay.is-on { opacity: 1; pointer-events: auto; }
.panel { position: relative; width: min(100%, 620px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line-dark); box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); transform: translateY(16px) scale(.98); transition: transform .5s var(--ease); }
.overlay.is-on .panel { transform: none; }
.panel h2 { font-size: clamp(1.9rem, 4.6vw, 2.6rem); margin: 14px 0 12px; }
.panel .lead { color: #cfcac1; font-size: .95rem; }
.panel .legend { margin: 22px 0 6px; }
.panel ul.how { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.panel ul.how li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: .88rem; color: #cfcac1; }
.panel ul.how li span { font-family: "Oswald", sans-serif; color: var(--gold); font-size: 1.05rem; line-height: 1.4; }
.panel .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.panel .fine { margin-top: 18px; font-size: .72rem; color: #77746e; }

.result-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 24px; }
.result-head div { padding: 14px 12px; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--ink-3); text-align: center; }
.result-head b { display: block; font-family: "Oswald", sans-serif; font-weight: 500; font-size: 1.9rem; line-height: 1.1; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.result-head span { font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-dark); }
.result-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-dark); }
.result-list li { padding: 14px 0; border-bottom: 1px solid var(--line-dark); }
.result-list .row { display: flex; align-items: center; gap: 10px; }
.result-list .row i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.result-list .row strong { font-weight: 600; font-size: .92rem; color: var(--sand); }
.result-list .row em { margin-left: auto; font-style: normal; font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 2px; }
.result-list .row em.ok { background: rgba(225,193,125,.16); color: var(--gold-light); }
.result-list .row em.no { background: rgba(239,66,77,.16); color: #ff8088; }
.result-list p { margin: 6px 0 0 19px; font-size: .8rem; line-height: 1.55; color: #a9a59d; }
.verdict { font-family: "Oswald", sans-serif; font-weight: 500; color: var(--gold-light); font-size: 1.05rem; }

/* SVG fx */
.mark-ring { animation: ring-in .5s var(--ease) both; transform-box: fill-box; transform-origin: center; }
@keyframes ring-in { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: scale(1); } }
.miss-x { animation: miss 1s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes miss { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.1); } 30% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.hint-ring { animation: hint 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hint { 0%, 100% { opacity: .35; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
.falling-brick { animation: fall 2.4s cubic-bezier(.55,0,1,.45) infinite; }
@keyframes fall { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(6px,150px) rotate(140deg); opacity: 0; } }
.spark { animation: spark .9s steps(2) infinite; }
@keyframes spark { 50% { opacity: .15; } }
.load-sway { animation: sway 4s ease-in-out infinite; transform-origin: 960px 108px; }
@keyframes sway { 0%,100% { transform: rotate(-.6deg); } 50% { transform: rotate(.6deg); } }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .falling-brick, .spark, .load-sway, .hint-ring { animation: none; } }

/* Scene-only mode (used for card art) */
body.scene-only .g-top, body.scene-only .g-side, body.scene-only .overlay { display: none !important; }
body.scene-only .g-main { display: block; }
body.scene-only .g-main { width: 100%; padding: 0; }
body.scene-only .scene-shell { border: 0; border-radius: 0; }

@media (max-width: 900px) {
  .g-title .sep, .g-title img { display: none; }
  .legend .note { display: none; }
}
@media (max-width: 720px) {
  .g-top .wrap { flex-wrap: wrap; gap: 10px; padding: 10px 0; }
  .g-title { order: 1; flex: 1 1 auto; }
  .g-title h1 { font-size: 1.05rem; }
  .g-back { order: 0; }
  .g-back span { display: none; }
  .hud { order: 2; width: 100%; }
  .stat { flex: 1; min-width: 0; padding: 5px 10px; }
  .stat b { font-size: 1.1rem; }
  .scene-scroll svg { width: 820px; max-width: none; }
  .pan-hint { display: block; }
  .feedback { padding: 14px 16px; }
  .feedback h2 { font-size: 1.15rem; }
  .feedback p { font-size: .8rem; }
  .chip { font-size: .7rem; padding: 6px 10px 6px 8px; }
  .result-head b { font-size: 1.5rem; }
}
