/* EGG RUN — ornate dark-fantasy UI */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../assets/fonts/cinzel-latin.woff2') format('woff2');
}

:root {
  --gold-1: #fff0b8;
  --gold-2: #f2c25a;
  --gold-3: #c88f34;
  --gold-4: #7c4a12;
  --ink: #0b0604;
  --panel: rgba(16, 10, 6, 0.9);
  --text: #f1dfb8;
  --muted: #b9a17a;
  --line: rgba(216, 164, 67, 0.75);
  --glow: 0 0 24px rgba(255, 170, 60, 0.25);
  --font: 'Cinzel', 'Trajan Pro', 'Cormorant SC', Georgia, 'Times New Roman', serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; background: var(--ink); color: var(--text);
  font-family: var(--font); overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}
#app { position: fixed; inset: 0; touch-action: none; }
#game { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
button { font-family: var(--font); cursor: pointer; }
body:not(.ready) #app > section, body:not(.ready) #hud { opacity: 0; }

/* ---------------- generic panel / buttons ---------------- */
.panel {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(110, 60, 20, 0.28), transparent 60%),
    linear-gradient(180deg, rgba(30, 18, 10, 0.95), rgba(10, 6, 4, 0.96));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 0 4px rgba(0, 0, 0, 0.35),
    inset 0 0 0 5px rgba(216, 164, 67, 0.22), 0 20px 60px rgba(0, 0, 0, 0.6), var(--glow);
  padding: clamp(18px, 4vmin, 34px);
}
.corner {
  position: absolute; width: 30px; height: 30px; pointer-events: none;
  background: url('../assets/ui/corner.svg') no-repeat center / contain;
}
.corner.tl { top: -7px; left: -7px; }
.corner.tr { top: -7px; right: -7px; transform: scaleX(-1); }
.corner.bl { bottom: -7px; left: -7px; transform: scaleY(-1); }
.corner.br { bottom: -7px; right: -7px; transform: scale(-1, -1); }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.panel h2 {
  text-align: center; font-size: clamp(24px, 4.4vmin, 38px); margin-bottom: 0.6em;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 50%, var(--gold-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.8)) drop-shadow(0 0 12px rgba(255, 170, 60, 0.35));
}
.panel h2::after {
  content: ''; display: block; height: 1px; width: 60%; margin: 0.45em auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-3), transparent);
}
.panel h3 { font-size: 14px; color: var(--gold-2); margin: 18px 0 10px; letter-spacing: 0.16em; }

.btn {
  position: relative; display: block; width: 100%;
  min-height: 48px; padding: 0.7em 1.4em;
  color: #f3dca8; font-size: clamp(14px, 2.2vmin, 18px); font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: linear-gradient(180deg, rgba(44, 28, 15, 0.94), rgba(16, 10, 6, 0.96));
  border: 1px solid #a87a35; border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 220, 150, 0.16), 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn:hover, .btn:focus-visible {
  outline: none; border-color: var(--gold-2); color: #fff4d2;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65), inset 0 0 18px rgba(255, 170, 60, 0.18), 0 0 18px rgba(255, 170, 60, 0.3);
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn-primary {
  font-size: clamp(18px, 3vmin, 26px); min-height: 58px;
  background: linear-gradient(180deg, #6a4419, #3a230d 55%, #24150a);
  border: 2px solid #e2b25a; color: #ffe8ad;
  text-shadow: 0 0 10px rgba(255, 190, 90, 0.6), 0 2px 0 rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 3px rgba(255, 210, 120, 0.18), inset 0 10px 18px rgba(255, 200, 110, 0.15),
    0 0 24px rgba(255, 160, 50, 0.3), 0 6px 18px rgba(0, 0, 0, 0.5);
}
.flame {
  position: absolute; left: 50%; top: -26px; width: 18px; height: 30px; transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 72%, #fff8d0 0 18%, #ffc24a 34%, #ff6a12 62%, rgba(255, 60, 0, 0) 72%);
  border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%;
  filter: drop-shadow(0 0 8px #ff8a20);
  animation: flick 0.16s infinite alternate ease-in-out;
  pointer-events: none;
}
@keyframes flick { from { transform: translateX(-50%) scale(1, 1) skewX(2deg); } to { transform: translateX(-50%) scale(0.92, 1.08) skewX(-3deg); } }

.link-btn {
  background: none; border: 0; color: var(--muted); font-size: 13px; letter-spacing: 0.16em;
  text-transform: uppercase; padding: 12px; margin: 4px auto 0; display: block;
}
.link-btn:hover { color: var(--gold-1); }
.link-btn.danger { color: #c47a62; margin-top: 18px; }
.close {
  position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; z-index: 2;
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(216, 164, 67, 0.5); border-radius: 50%;
  color: var(--gold-2); font-size: 24px; line-height: 1;
}
.close:hover { border-color: var(--gold-2); color: var(--gold-1); }

.stack { display: grid; gap: 12px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; }

/* ---------------- screens ---------------- */
.screen {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s; z-index: 10;
}
.screen.active { opacity: 1; visibility: visible; }
.screen.overlay { background: radial-gradient(ellipse at center, rgba(10, 5, 2, 0.55), rgba(5, 2, 1, 0.85)); }
.screen.modal { z-index: 20; }
.screen .panel { transform: translateY(14px) scale(0.98); transition: transform 0.35s cubic-bezier(.2, .9, .3, 1.2); max-height: 100%; overflow: auto; }
.screen.active .panel { transform: none; }
.narrow { width: min(380px, 100%); }

/* main menu */
.menu { background: linear-gradient(90deg, rgba(5, 2, 1, 0.82), rgba(5, 2, 1, 0.25) 50%, rgba(5, 2, 1, 0.82)), linear-gradient(0deg, rgba(5, 2, 1, 0.85), transparent 45%); }
.menu-col { display: flex; flex-direction: column; align-items: center; width: min(400px, 100%); }
.dragon-portrait { width: min(300px, 62vw, 34vh); aspect-ratio: 230 / 250; display: block; margin-bottom: -2vh; }
.title {
  font-size: clamp(54px, 11vmin, 110px); font-weight: 900; letter-spacing: 0.02em; line-height: 1;
  background: linear-gradient(180deg, #fff8d6 0%, #ffd56a 38%, #d5902c 62%, #8a4f12 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #2a1404) drop-shadow(0 0 22px rgba(255, 170, 50, 0.45));
  white-space: nowrap;
}
.subtitle {
  margin: 0.5em 0 1.6em; color: #e8cf98; letter-spacing: 0.3em; font-size: clamp(11px, 1.9vmin, 16px);
  text-transform: uppercase; text-shadow: 0 0 10px rgba(255, 170, 60, 0.4);
}
.menu-buttons { display: grid; gap: 12px; width: min(300px, 82vw); }
.menu-buttons .btn-primary { margin-bottom: 6px; }
.menu-best { margin-top: 18px; color: var(--muted); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; }
.menu-best b { color: var(--gold-1); margin-left: 6px; }
.menu-keys {
  position: absolute; bottom: calc(14px + var(--safe-b)); left: 0; right: 0; text-align: center;
  color: rgba(233, 211, 166, 0.55); font-size: 12px; letter-spacing: 0.12em;
}
@media (hover: none) { .menu-keys { display: none; } }

/* game over */
.over-panel { width: min(560px, 100%); }
.new-best {
  display: none; text-align: center; color: #ffe08a; font-weight: 700; letter-spacing: 0.2em; font-size: 14px;
  margin: -6px 0 10px; text-shadow: 0 0 12px rgba(255, 190, 80, 0.8); animation: pulse 1.1s infinite;
}
.new-best.show { display: block; }
@keyframes pulse { 50% { opacity: 0.55; } }
.over-body { display: grid; grid-template-columns: minmax(120px, 0.8fr) 1.2fr; gap: 10px 18px; align-items: center; }
.over-body .dragon-portrait { width: 100%; margin: 0; }
.results { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin: 0; align-items: baseline; }
.results dt { color: var(--muted); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.results dd { margin: 0; text-align: right; font-weight: 700; font-size: clamp(16px, 2.6vmin, 22px); color: #fff0cf; }
.results dd#over-score { color: var(--gold-1); font-size: clamp(20px, 3.4vmin, 28px); text-shadow: 0 0 12px rgba(255, 190, 80, 0.5); }
.results .zone-dd { font-size: 13px; color: var(--gold-2); }
.name-field { display: flex; align-items: center; gap: 12px; margin: 16px 0 14px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.name-field input, .set-row input {
  flex: 1; min-width: 0; padding: 10px 12px; font-family: var(--font); font-size: 15px; font-weight: 700; color: var(--gold-1);
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(216, 164, 67, 0.45); border-radius: 6px; outline: none;
  -webkit-user-select: text; user-select: text;
}
.name-field input:focus, .set-row input:focus { border-color: var(--gold-2); box-shadow: 0 0 10px rgba(255, 170, 60, 0.3); }

/* leaderboard */
.lb-panel { width: min(620px, 100%); display: flex; flex-direction: column; max-height: min(760px, 100%); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.tab {
  min-height: 42px; padding: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(216, 164, 67, 0.35); border-radius: 22px;
}
.tab.active { color: #2a1604; background: linear-gradient(180deg, #ffe39a, #d79a34); border-color: #ffe39a; box-shadow: 0 0 14px rgba(255, 180, 70, 0.4); }
.lb-head, .lb-row { display: grid; grid-template-columns: 44px 1fr 100px 92px; gap: 8px; align-items: center; }
.lb-head { padding: 0 12px 8px; font-size: 11px; color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase; border-bottom: 1px solid rgba(216, 164, 67, 0.25); }
.lb-head span:nth-child(n+3), .lb-row .pscore, .lb-row .pdist { text-align: right; }
.lb-list { list-style: none; margin: 0; padding: 6px 0 0; overflow: auto; flex: 1; min-height: 120px; }
.lb-row { padding: 8px 12px; border-radius: 8px; margin: 3px 0; background: rgba(255, 255, 255, 0.02); border: 1px solid transparent; font-size: 15px; }
.lb-row:nth-child(odd) { background: rgba(255, 200, 120, 0.04); }
.lb-row .rank {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  font-weight: 700; font-size: 13px; color: var(--muted); border: 1px solid rgba(216, 164, 67, 0.25);
}
.lb-row.top1 .rank { background: radial-gradient(circle at 35% 30%, #fff1b0, #d99a2a 60%, #7a4a0e); color: #2a1604; border-color: #ffe39a; }
.lb-row.top2 .rank { background: radial-gradient(circle at 35% 30%, #ffffff, #b9bcc4 60%, #5d616b); color: #1e2026; border-color: #e8e8ee; }
.lb-row.top3 .rank { background: radial-gradient(circle at 35% 30%, #ffd2a6, #b36a2c 60%, #5a2c0c); color: #24110a; border-color: #ffc28a; }
.lb-row .player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  font-weight: 900; font-size: 13px; color: #fff4dc;
  background: radial-gradient(circle at 35% 30%, hsl(var(--h) 60% 60%), hsl(var(--h) 55% 28%));
  border: 1px solid rgba(255, 220, 150, 0.6);
}
.pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: #f6e4bd; }
.pname small { display: block; font-size: 10px; letter-spacing: 0.14em; color: var(--gold-2); text-transform: uppercase; }
.pscore { font-weight: 700; color: var(--gold-1); }
.pdist { color: var(--muted); font-size: 13px; }
.lb-row.you { border-color: rgba(255, 200, 100, 0.5); background: linear-gradient(90deg, rgba(255, 180, 60, 0.18), rgba(255, 180, 60, 0.04)); }
.lb-row.latest { box-shadow: 0 0 16px rgba(255, 180, 60, 0.35); }
.lb-empty { padding: 30px; text-align: center; color: var(--muted); }

/* how to play */
.howto-panel { width: min(720px, 100%); max-height: min(860px, 100%); }
.controls-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid rgba(216, 164, 67, 0.3); border-radius: 8px; background: rgba(0, 0, 0, 0.3); text-align: center; }
.ctl span { font-weight: 700; font-size: 13px; color: var(--gold-1); letter-spacing: 0.08em; }
.ctl small { color: var(--muted); font-size: 11px; }
kbd {
  display: inline-block; min-width: 30px; padding: 4px 8px; margin: 0 2px; font-family: var(--font); font-weight: 700; font-size: 12px;
  color: #2a1604; background: linear-gradient(180deg, #ffe7a8, #c99036); border-radius: 5px; box-shadow: 0 2px 0 #6b3d0c;
}
.ht-note { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 14px 0 0; }
.ht-note b { color: var(--gold-1); }
.ht-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ht-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 6px; border: 1px solid rgba(216, 164, 67, 0.28); border-radius: 10px; background: linear-gradient(180deg, rgba(60, 36, 16, 0.4), rgba(0, 0, 0, 0.35)); }
.ht-item img { height: 46px; width: 46px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255, 180, 70, 0.45)); }
.ht-item.obs img { width: 64px; }
.ht-item b { font-size: 11px; letter-spacing: 0.08em; color: #f6e4bd; text-transform: uppercase; }
.ht-item small { font-size: 10px; color: var(--muted); }
.ht-glyph { height: 46px; display: grid; place-items: center; font-size: 34px; color: #ff9a3a; text-shadow: 0 0 12px #ff6a12; }

/* settings */
.settings { display: grid; gap: 10px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid rgba(216, 164, 67, 0.25); border-radius: 8px; background: rgba(0, 0, 0, 0.3); font-size: 14px; letter-spacing: 0.08em; }
.set-row.name { flex-wrap: wrap; }
.toggle {
  min-width: 78px; min-height: 38px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(216, 164, 67, 0.4); border-radius: 20px;
}
.toggle.on { color: #2a1604; background: linear-gradient(180deg, #ffe39a, #d79a34); border-color: #ffe39a; }

/* share */
.share-panel { width: min(640px, 100%); text-align: center; }
.share-img { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 0 30px rgba(255, 170, 60, 0.25); margin-bottom: 14px; }
.share-panel .btn { font-size: 14px; min-height: 48px; padding: 0.5em 0.4em; letter-spacing: 0.08em; }
.share-status { min-height: 1.2em; color: var(--gold-2); font-size: 13px; margin: 12px 0 0; }

/* ---------------- HUD ---------------- */
.hud { position: absolute; inset: 0; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.4s; z-index: 5; --hud: 1; }
@media (max-width: 760px), (max-height: 620px) { .hud { --hud: 0.82; } }
@media (max-width: 420px), (max-height: 460px) { .hud { --hud: 0.7; } }
@media (min-width: 1600px) and (min-height: 900px) { .hud { --hud: 1.15; } }
.hud.active { opacity: 1; visibility: visible; }
.hud-left {
  position: absolute; top: calc(14px + var(--safe-t)); left: calc(14px + var(--safe-l));
  display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 10px 14px; align-items: start;
}
.icon-btn {
  pointer-events: auto; width: 52px; height: 52px; border-radius: 10px; display: flex; gap: 7px; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(40, 24, 12, 0.85), rgba(12, 7, 4, 0.9));
  border: 1.5px solid var(--gold-3); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 14px rgba(255, 170, 60, 0.2);
}
.icon-btn span { width: 6px; height: 20px; border-radius: 2px; background: linear-gradient(180deg, var(--gold-1), var(--gold-3)); }
.icon-btn:active { transform: scale(0.95); }
.hud-stats { display: grid; gap: 6px; padding: 10px 16px 10px 14px; border-radius: 10px; background: linear-gradient(90deg, rgba(8, 4, 2, 0.6), rgba(8, 4, 2, 0)); }
.stat { display: flex; flex-direction: column; line-height: 1.05; }
.stat .lbl { font-size: calc(11px * var(--hud)); color: #d8b674; letter-spacing: 0.18em; text-transform: uppercase; text-shadow: 0 1px 2px #000; }
.stat .val { font-size: calc(26px * var(--hud)); font-weight: 700; color: #fff6e2; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.8), 0 0 14px rgba(255, 190, 90, 0.35); display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.stat:first-child .val { font-size: calc(32px * var(--hud)); }
.egg-ico { width: calc(18px * var(--hud)); height: calc(22px * var(--hud)); object-fit: contain; filter: drop-shadow(0 0 6px rgba(255, 190, 80, 0.7)); }

.combo { grid-column: 1 / span 1; position: relative; width: calc(78px * var(--hud)); height: calc(78px * var(--hud)); display: grid; place-items: center; transition: transform 0.2s; }
.combo svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.combo circle { fill: none; stroke-width: 6; }
.combo .ring-bg { stroke: rgba(216, 164, 67, 0.35); fill: rgba(10, 5, 2, 0.7); }
.combo .ring { stroke: #ffcf5a; stroke-dasharray: 283; stroke-dashoffset: 283; stroke-linecap: round; filter: drop-shadow(0 0 4px #ffb030); transition: stroke-dashoffset 0.1s linear; }
.combo-x { position: relative; font-size: calc(28px * var(--hud)); font-weight: 900; color: #ffe7a6; text-shadow: 0 2px 0 #000, 0 0 12px rgba(255, 180, 60, 0.6); margin-top: -8px; }
.combo-lbl { position: absolute; bottom: calc(-16px * var(--hud)); font-size: calc(11px * var(--hud)); letter-spacing: 0.2em; color: #d8b674; text-transform: uppercase; text-shadow: 0 1px 2px #000; }
.combo:not(.hot) .combo-x { color: #b99c6c; }
.combo.bump { animation: bump 0.4s ease; }
@keyframes bump { 30% { transform: scale(1.25); } }

.hud-right { position: absolute; top: calc(14px + var(--safe-t)); right: calc(14px + var(--safe-r)); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.best { padding: 6px 14px; border-radius: 8px; background: rgba(8, 4, 2, 0.6); border: 1px solid rgba(216, 164, 67, 0.4); display: flex; gap: 10px; align-items: baseline; }
.best .lbl { font-size: calc(11px * var(--hud)); letter-spacing: 0.18em; color: #d8b674; text-transform: uppercase; }
.best .val { font-size: calc(17px * var(--hud)); font-weight: 700; color: var(--gold-1); font-variant-numeric: tabular-nums; }
.powers { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.power-chip {
  display: none; position: relative; grid-template-columns: auto auto; align-items: center; gap: 8px; padding: 6px 12px 10px 8px;
  border-radius: 10px; background: linear-gradient(180deg, rgba(40, 24, 12, 0.85), rgba(12, 7, 4, 0.9)); border: 1.5px solid var(--gold-3);
  box-shadow: 0 0 16px rgba(255, 170, 60, 0.25);
}
.power-chip.on { display: grid; animation: chipIn 0.35s cubic-bezier(.2, .9, .3, 1.3); }
.power-chip.ending { animation: blink 0.4s infinite alternate; }
@keyframes chipIn { from { transform: translateX(30px) scale(0.8); opacity: 0; } }
@keyframes blink { to { opacity: 0.5; } }
.power-chip img { width: calc(36px * var(--hud)); height: calc(36px * var(--hud)); filter: drop-shadow(0 0 6px rgba(255, 190, 80, 0.6)); }
.pc-text { display: flex; flex-direction: column; line-height: 1.1; }
.pc-name { font-size: calc(10px * var(--hud)); letter-spacing: 0.14em; color: #d8b674; }
.pc-time { font-size: calc(20px * var(--hud)); font-weight: 700; color: #fff4dc; font-variant-numeric: tabular-nums; }
.pc-bar { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.pc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffe39a, #ff9a2a); transform-origin: left; }

.zone-banner {
  position: absolute; left: 50%; top: 24%; transform: translate(-50%, -50%); text-align: center; opacity: 0; white-space: nowrap;
  padding: 12px 48px; background: linear-gradient(90deg, transparent, rgba(8, 4, 2, 0.75) 20%, rgba(8, 4, 2, 0.75) 80%, transparent);
}
.zone-banner::before, .zone-banner::after { content: ''; position: absolute; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-2), transparent); }
.zone-banner::before { top: 0; }
.zone-banner::after { bottom: 0; }
.zone-banner small { display: block; font-size: 12px; letter-spacing: 0.4em; color: #d8b674; }
.zone-banner strong { display: block; font-size: clamp(22px, 4.6vmin, 42px); letter-spacing: 0.1em; text-transform: uppercase; color: #ffe7a6; text-shadow: 0 0 18px rgba(255, 170, 60, 0.6), 0 2px 0 #000; }
.zone-banner.show { animation: zoneIn 3.4s ease forwards; }
@keyframes zoneIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.92); letter-spacing: 0.3em; }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -60%); }
}
.toast {
  position: absolute; left: 50%; top: 36%; transform: translateX(-50%); opacity: 0; white-space: nowrap;
  font-size: clamp(18px, 3.4vmin, 30px); font-weight: 900; letter-spacing: 0.12em; color: #fff1b8;
  text-shadow: 0 2px 0 #000, 0 0 16px rgba(255, 170, 60, 0.8);
}
.toast.show { animation: toast 1.3s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -20px); } }
.combo-pop {
  position: absolute; left: 50%; top: 44%; transform: translateX(-50%); opacity: 0; white-space: nowrap;
  font-size: calc(20px * var(--hud)); font-weight: 900; color: #ffd76a; letter-spacing: 0.1em; text-shadow: 0 2px 0 #000, 0 0 14px rgba(255, 170, 60, 0.9);
}
.combo-pop.show { animation: comboPop 1s ease forwards; }
@keyframes comboPop { 0% { opacity: 0; transform: translateX(-50%) scale(0.6); } 20% { opacity: 1; transform: translateX(-50%) scale(1.15); } 70% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.touch-hint {
  position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); opacity: 0; white-space: nowrap;
  padding: 10px 18px; border-radius: 20px; background: rgba(8, 4, 2, 0.7); border: 1px solid rgba(216, 164, 67, 0.5); font-size: 13px; color: var(--gold-1);
  transition: opacity 0.6s;
}
.touch-hint.show { opacity: 1; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; color: var(--gold-1); }

/* ---------------- responsive ---------------- */
@media (max-width: 600px) {
  .over-body { grid-template-columns: 110px 1fr; }
  .lb-head, .lb-row { grid-template-columns: 36px 1fr 86px; }
  .lb-head span:nth-child(4), .lb-row .pdist { display: none; }
  .controls-grid { grid-template-columns: repeat(2, 1fr); }
  .row { gap: 8px; }
  .btn { padding: 0.6em 0.8em; letter-spacing: 0.1em; }
  .hud-stats { padding: 8px 10px; }
  .icon-btn { width: 46px; height: 46px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .dragon-portrait { width: 22vh; }
  .menu-col { flex-direction: column; }
  .title { font-size: 13vh; }
  .subtitle { margin: 0.3em 0 0.8em; }
  .menu-buttons { gap: 6px; }
  .btn { min-height: 40px; padding: 0.4em 1em; }
  .btn-primary { min-height: 46px; }
  .menu-keys { display: none; }
  .over-body .dragon-portrait { max-height: 34vh; }
}

/* ---------- skins ---------- */
.skins-panel { width: min(860px, 100%); }
.skins-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.skin-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; cursor: pointer; font: inherit; color: inherit;
  border: 1px solid rgba(216, 164, 67, 0.28); border-radius: 12px; background: linear-gradient(180deg, rgba(60, 36, 16, 0.45), rgba(0, 0, 0, 0.4)); transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.skin-card:hover { transform: translateY(-2px); border-color: rgba(246, 200, 110, 0.7); }
.skin-card.selected { border-color: #f6c86e; box-shadow: 0 0 0 1px #f6c86e inset, 0 0 18px rgba(255, 190, 80, 0.4); }
.skin-card img { width: 100%; aspect-ratio: 225 / 341; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55)); }
.skin-card b { font-size: 12px; letter-spacing: 0.14em; color: #f6e4bd; }
@media (max-width: 600px) { .skins-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } .skin-card img { width: 72%; } }

.btn-x { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; }
.btn-x svg { width: 1.1em; height: 1.1em; }
.share-canvas-wrap canvas { width: 100%; height: 100%; display: block; border-radius: inherit; }
.share-img[hidden] { display: none; }
