.game-page{padding-top:26px}
.game-intro{display:grid;grid-template-columns:1.02fr .98fr;min-height:560px;overflow:hidden}
.game-intro__copy{padding:clamp(42px,6vw,68px);display:flex;flex-direction:column;align-items:flex-start;justify-content:center}
.game-intro h1{font-size:clamp(3rem,6.5vw,5.45rem);margin-bottom:20px}
.game-intro h1 span{color:var(--rh-dark)}
.game-intro__copy>p{max-width:570px;margin:0;color:#3d4842;font-size:1.12rem;line-height:1.7}
.game-intro__copy>.button{margin-top:28px;min-width:160px}
.game-intro__art{position:relative;display:grid;place-items:end center;overflow:hidden;background:linear-gradient(145deg,#efff9e 0%,var(--lime) 38%,var(--rh) 100%)}
.game-intro__art:before,.game-intro__art:after{content:"";position:absolute;border:2px solid rgba(16,19,18,.14);border-radius:50%}
.game-intro__art:before{width:470px;height:470px;right:-150px;top:-140px}
.game-intro__art:after{width:280px;height:280px;left:-100px;bottom:-90px}
.game-intro__art img{position:relative;z-index:2;width:min(94%,620px);margin:0 -20px 18px 0;filter:drop-shadow(0 28px 23px rgba(18,61,20,.23));animation:hero-dog-run 1.15s ease-in-out infinite alternate}
.game-intro__tag{position:absolute;z-index:3;right:7%;top:7%;padding:10px 14px;border-radius:999px;background:var(--ink);color:var(--lime);font-size:.72rem;font-weight:950;letter-spacing:.08em;transform:rotate(4deg);box-shadow:5px 5px 0 rgba(255,255,255,.72)}
.game-intro__bone{position:absolute;z-index:1;color:#fff7b0;font-size:2rem;filter:drop-shadow(0 4px 0 rgba(16,19,18,.16));animation:bone-float 1.6s ease-in-out infinite alternate}
.game-intro__bone--one{left:13%;top:19%;transform:rotate(-12deg)}
.game-intro__bone--two{right:19%;bottom:16%;animation-delay:.4s}
@keyframes hero-dog-run{to{transform:translateY(-9px) rotate(-1deg)}}
@keyframes bone-float{to{transform:translateY(-12px) rotate(13deg)}}

.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 370px;gap:22px;margin-top:0;align-items:start}
.game-shell{padding:32px;min-width:0}
.game-shell__top{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:24px}
.game-shell__top h2,.leaderboard-head h2{font-size:clamp(2rem,4vw,3.4rem);line-height:.98;letter-spacing:-.05em;margin:15px 0 0}
.game-shell__top h2 .game-title-accent{color:var(--rh-dark)!important}
.sound-button,.leaderboard-refresh{appearance:none;border:1px solid var(--line);border-radius:999px;background:#fff;padding:10px 13px;color:var(--ink);font:inherit;font-size:.78rem;font-weight:900;cursor:pointer}
.sound-button:hover,.leaderboard-refresh:hover{border-color:#b9c8b5;background:#fbfff6}

.game-stage{position:relative;width:min(100%,520px);aspect-ratio:3/5;margin:0 auto;border:5px solid var(--ink);border-radius:30px;overflow:hidden;background:#e8ffd2;box-shadow:0 22px 50px rgba(20,35,24,.16);touch-action:none;user-select:none}
#game-canvas{display:block;width:100%;height:100%;background:#e8ffd2;touch-action:none}
.game-hud{position:absolute;z-index:4;left:12px;right:12px;top:12px;display:grid;grid-template-columns:repeat(3,1fr);gap:7px;pointer-events:none}
.game-hud>div{min-width:0;padding:8px 10px;border-radius:12px;background:rgba(16,19,18,.88);color:#fff;text-align:center;backdrop-filter:blur(7px);box-shadow:0 6px 16px rgba(16,19,18,.14)}
.game-hud span{display:block;color:var(--lime);font-size:.58rem;font-weight:950;letter-spacing:.08em;text-transform:uppercase}
.game-hud strong{display:block;margin-top:1px;font-size:1.16rem;line-height:1.1}
.game-overlay{position:absolute;z-index:8;inset:0;display:grid;place-items:center;padding:22px;background:rgba(16,19,18,.3);backdrop-filter:blur(5px)}
.game-overlay[hidden]{display:none}
.game-overlay__card{width:min(100%,350px);padding:28px 25px;border:1px solid rgba(255,255,255,.9);border-radius:26px;background:rgba(255,255,255,.96);text-align:center;box-shadow:0 22px 60px rgba(16,19,18,.25)}
.game-overlay__card>img{width:92px;height:92px;object-fit:contain;margin:0 auto 10px}
.game-overlay__eyebrow{display:block;color:var(--rh-dark);font-size:.72rem;font-weight:950;letter-spacing:.08em;text-transform:uppercase}
.game-overlay__card h3{margin:8px 0 5px;font-size:2rem;line-height:1;letter-spacing:-.045em}
.game-overlay__card p{margin:0;color:var(--muted);line-height:1.5}
.game-overlay__card small{display:block;margin-top:13px;color:#737d77;font-weight:700}
.game-start{width:100%;margin-top:20px;border:0;font:inherit;cursor:pointer}
.final-score{display:flex;align-items:center;justify-content:center;gap:10px;margin:18px 0 8px}
.final-score span{font-size:.75rem;font-weight:950;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.final-score strong{font-size:3rem;line-height:1;color:var(--ink)}
.game-over-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:20px}
.game-over-actions .button{min-height:48px;border:0;padding:0 12px;font:inherit;font-weight:900;cursor:pointer}
.submit-score-link{appearance:none;border:0;background:none;margin-top:16px;padding:4px;color:var(--rh-dark);font:inherit;font-size:.82rem;font-weight:900;text-decoration:underline;cursor:pointer}
.game-control-note{max-width:600px;margin:22px auto 0;text-align:center;color:var(--muted);line-height:1.55}
.game-control-note strong{color:var(--ink)}

.game-leaderboard{position:sticky;top:112px;padding:28px;min-height:600px}
.leaderboard-head p{margin:13px 0 0;color:var(--muted);line-height:1.55}
.leaderboard-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:23px 0 17px}
.leaderboard-tabs button{appearance:none;border:1px solid var(--line);border-radius:999px;background:#fff;padding:9px 5px;color:var(--ink);font:inherit;font-size:.72rem;font-weight:900;cursor:pointer}
.leaderboard-tabs button[aria-selected="true"]{background:var(--ink);border-color:var(--ink);color:var(--lime)}
.leaderboard-status{min-height:50px;display:grid;place-items:center;padding:12px;border-radius:14px;background:#f5f8f1;color:var(--muted);font-size:.82rem;font-weight:800;text-align:center}
.leaderboard-status[hidden]{display:none}
.score-list{list-style:none;margin:0;padding:0}
.score-row{display:grid;grid-template-columns:32px minmax(0,1fr) auto;gap:10px;align-items:center;padding:14px 4px;border-bottom:1px solid #e6ece3}
.score-row:last-child{border-bottom:0}
.score-row__rank{width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:#f0f4ed;color:#6f7974;font-size:.76rem;font-weight:950}
.score-row:nth-child(1) .score-row__rank{background:var(--lime);color:var(--ink)}
.score-row:nth-child(2) .score-row__rank{background:#e4e9e1;color:var(--ink)}
.score-row:nth-child(3) .score-row__rank{background:#f4d7ae;color:#684315}
.score-row__player{min-width:0}
.score-row__player strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.9rem}
.score-row__player small{display:block;margin-top:2px;color:#808984;font-size:.66rem;font-weight:750}
.score-row__score{font-size:1rem;font-weight:950}
.leaderboard-refresh{display:block;margin:18px auto 0}

.score-dialog{position:fixed;z-index:100;inset:0;display:grid;place-items:center;padding:18px}
.score-dialog[hidden]{display:none}
.score-dialog__backdrop{position:absolute;inset:0;background:rgba(16,19,18,.62);backdrop-filter:blur(5px)}
.score-dialog__card{position:relative;width:min(100%,460px);padding:34px;border:1px solid var(--line);border-radius:28px;background:#fff;box-shadow:0 30px 80px rgba(0,0,0,.28)}
.score-dialog__card h2{font-size:2.25rem;line-height:1;letter-spacing:-.05em;margin:15px 0 10px}
.score-dialog__card>p{color:var(--muted);line-height:1.55}
.score-dialog__close{position:absolute;right:18px;top:16px;width:38px;height:38px;border:0;border-radius:50%;background:#eff3ec;color:var(--ink);font-size:1.5rem;line-height:1;cursor:pointer}
#score-form{display:grid;gap:10px;margin-top:22px}
#score-form label{font-size:.76rem;font-weight:950;letter-spacing:.06em;text-transform:uppercase}
#score-form input{width:100%;min-height:52px;border:2px solid var(--ink);border-radius:13px;padding:0 14px;color:var(--ink);background:#fff;font:inherit;font-size:1rem;font-weight:800;outline:none}
#score-form input:focus{border-color:var(--rh);box-shadow:0 0 0 4px rgba(0,200,5,.12)}
#score-form .button{margin-top:5px;border:0;font:inherit;cursor:pointer}
.score-form-status{min-height:22px;margin:13px 0 0!important;color:var(--rh-dark)!important;font-size:.83rem;font-weight:850}

@media(max-width:960px){
  .game-intro{grid-template-columns:1fr}
  .game-intro__art{min-height:460px}
  .game-layout{grid-template-columns:1fr}
  .game-leaderboard{position:static;min-height:0}
}
@media(max-width:640px){
  .game-page{padding-top:13px}
  .game-intro__copy{padding:34px 21px}
  .game-intro__copy>.button{width:100%}
  .game-intro__art{min-height:360px}
  .game-intro__art img{width:min(106%,520px);margin-right:-35px}
  .game-shell{padding:18px 10px 22px}
  .game-shell__top{padding:0 8px;align-items:flex-end}
  .sound-button{padding:8px 10px;font-size:.68rem;white-space:nowrap}
  .game-shell__top h2{font-size:2.2rem}
  .game-stage{width:100%;border-width:4px;border-radius:23px}
  .game-hud{left:8px;right:8px;top:8px;gap:5px}
  .game-hud>div{padding:7px 5px;border-radius:10px}
  .game-hud strong{font-size:1rem}
  .game-overlay{padding:15px}
  .game-overlay__card{padding:23px 18px;border-radius:22px}
  .game-overlay__card>img{width:76px;height:76px}
  .game-overlay__card h3{font-size:1.75rem}
  .game-over-actions{grid-template-columns:1fr}
  .game-leaderboard{padding:26px 20px}
  .score-dialog__card{padding:30px 22px}
}
@media(prefers-reduced-motion:reduce){.game-intro__art img,.game-intro__bone{animation:none}}
