/* Snow Cannons theme, kept separate from the portal. */
@font-face {
  font-family: Cormorant;
  src: url('../../fonts/cormorant-cyrillic.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Cormorant;
  src: url('../../fonts/cormorant-cyrillic-italic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Nunito;
  src: url('../../fonts/nunito-cyrillic.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Nunito;
  src: url('../../fonts/nunito-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: dark;
  --ink: #071623;
  --cream: #fff1d4;
  --gold: #f4ce87;
  --gold-dark: #c99954;
  --muted: #b1c9d1;
  --line: #36505a;
  --title: Cormorant, Georgia, serif;
  --body: Nunito, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-height: 100%; margin: 0; overscroll-behavior: none; }
body {
  background: radial-gradient(ellipse at 48% 0, #142d37, transparent 66%), var(--ink);
  font: 15px/1.5 var(--body);
  color: var(--cream);
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid #f9de9e; outline-offset: 4px; }
button, h1, h2, p { margin: 0; }
.shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  display: flex;
  flex-direction: column;
  padding: 0 max(32px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left));
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 82px; padding: max(8px, env(safe-area-inset-top)) 0 8px; }
.brand { display: flex; align-items: center; gap: 13px; text-align: left; background: none; border: 0; padding: 0; min-height: 44px; text-decoration: none; }
.brand:hover .brand-domain { color: var(--cream); }
.brand-domain { color: var(--gold); transition: color .16s; }
.crest {
  display: grid; place-items: center; width: 45px; height: 45px; flex: none;
  border-radius: 13px; border: 1px solid #a88151; color: var(--gold);
  background: radial-gradient(ellipse at 50% 25%, #25424a, #0c1e2a 75%);
  box-shadow: inset 0 0 0 3px #172b35, 0 4px 12px #01091375;
  font-size: 25px; line-height: 1;
}
.brand-name { display: grid; gap: 3px; line-height: 1.15; }
.brand-name strong { font: bold 21px/1.1 var(--title); letter-spacing: .01em; }
.brand-name small, .eyebrow { color: var(--gold); font-size: 10px; font-weight: bold; letter-spacing: .20em; }
.top-actions, .hud-tools { display: flex; gap: 9px; align-items: center; }
.top-actions > * { flex: 0 0 auto; }
.outline, .primary, .text-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; min-width: 44px; padding: 8px 15px; border: 1px solid var(--line);
  border-radius: 9px; background: #0d2330; color: var(--cream); font-weight: bold;
  transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s;
}
.outline:hover:not(:disabled) { background: #193644; border-color: #948467; }
.icon-button { font-size: 13px; }
.icon-button > span:first-child { color: var(--gold); font-size: 17px; line-height: 1; }
.catalog-link { text-decoration: none; white-space: nowrap; }
.topbar[inert] a { pointer-events: none; }
.script-message { margin: 8px 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.icon-button .question { width: 18px; height: 18px; border: 1px solid #ac915d; border-radius: 50%; display: grid; place-items: center; font: bold 12px/1 var(--body) !important; }
.speaker { position: relative; }
#sound[aria-pressed="true"] .speaker::after { content: ''; position: absolute; top: 50%; left: -3px; width: 18px; height: 1px; background: var(--gold); transform: rotate(-50deg); }
.stage {
  position: relative; isolation: isolate; flex: 1 0 auto;
  height: clamp(520px, calc(100vh - 168px), 820px);
  height: clamp(520px, calc(100dvh - 168px), 820px);
  border: 1px solid #796448; border-radius: 19px; overflow: hidden;
  background: #102b3b; box-shadow: 0 22px 58px #01091070;
}
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.scene-frame { position: absolute; inset: 10px; border: 1px solid #dfbc7940; border-radius: 12px; pointer-events: none; z-index: 3; }
.scene-frame i { position: absolute; width: 31px; height: 31px; border: solid #f8d393b0; border-width: 1px 0 0 1px; border-top-left-radius: 10px; }
.scene-frame i::after { content: ''; position: absolute; width: 5px; height: 5px; top: 5px; left: 5px; background: #f7d18d; transform: rotate(45deg); }
.scene-frame i:nth-child(2) { right: 0; transform: rotate(90deg); }
.scene-frame i:nth-child(3) { bottom: 0; transform: rotate(-90deg); }
.scene-frame i:nth-child(4) { right: 0; bottom: 0; transform: rotate(180deg); }
.menu, .battle, .overlay { position: absolute; inset: 0; }
.menu { z-index: 2; isolation: isolate; display: flex; align-items: center; padding: 3.6% 7.1%; }
.menu::before {
  position: absolute; z-index: -1; content: ''; inset: 0;
  background: linear-gradient(92deg, #061521ed 0%, #081a27d9 26%, #081a27b5 40%, #08192550 53%, transparent 71%), linear-gradient(0deg, #05152282, transparent 25%);
}
.hero { max-width: min(52%, 610px); padding-bottom: 5px; }
.hero .eyebrow { display: flex; align-items: center; gap: 9px; font-size: 11px; }
.eyebrow > span { font-size: 17px; color: var(--gold); }
h1, h2 { font-family: var(--title); }
h1 { margin-top: 14px; font-size: clamp(39px, 5.7vw, 86px); line-height: .98; letter-spacing: -.055em; font-weight: bold; text-shadow: 0 4px 26px #020d18b0; }
h1 em { color: var(--gold); font-weight: 700; letter-spacing: -.045em; white-space: nowrap; }
.flourish { display: flex; align-items: center; gap: 8px; color: var(--gold-dark); font-size: 9px; height: 20px; margin: 11px 0 6px; }
.flourish span { height: 1px; width: 38px; background: linear-gradient(90deg, transparent, #d7ae6e); }
.flourish span:last-child { transform: rotate(180deg); }
.hero > p { max-width: 355px; color: #d2e0e5; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 25px; }
.primary { background: linear-gradient(145deg, #ffe6ac, #e8b86c); color: #25180d; border-color: #ffe5b2; box-shadow: 0 5px 22px #d7a45733, inset 0 1px 0 #fff5d9; }
.primary:hover:not(:disabled) { background: #ffe6ac; box-shadow: 0 5px 22px #dfae5770; }
.primary:disabled, .outline:disabled { color: #b2c2ca; background: #122532; border-color: #344956; box-shadow: none; }
.hero-actions .primary { justify-content: flex-start; gap: 12px; min-width: 207px; min-height: 52px; padding: 11px 16px; }
.hero-actions .primary > span:first-child { font-size: 11px; }
.button-arrow { margin-left: auto; font-size: 19px; line-height: 1; }
.text-button { background: transparent; border-color: transparent; color: var(--gold); }
.text-button:hover { background: #253747; }
.hero > .hero-meta { display: flex; align-items: center; gap: 9px; margin-top: 15px; color: #b6cbd4; font-size: 12px; }
.hero-meta span { color: var(--gold); font-size: 14px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 13px; border: 1px solid #2b444f; border-radius: 13px; background: #0b1d29c9; min-height: 58px; }
.quick-item { display: flex; align-items: center; justify-content: center; gap: 11px; padding: 8px 12px; }
.quick-item + .quick-item { border-left: 1px solid #2b444f; }
.quick-item div { display: grid; gap: 2px; }
.quick-item strong { font-size: 13px; line-height: 1.1; }
.quick-item small { color: var(--muted); font-size: 11px; line-height: 1.2; }
.quick-icon { display: grid; place-items: center; width: 33px; height: 33px; flex: none; background: #162b37; border: 1px solid #4a534e; border-radius: 8px; color: var(--gold); font-size: 17px; line-height: 1; }
kbd { font: inherit; color: #e8d0a4; }
.touch-tip { display: none; }
.developer-credit { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-size: 13px; }
.developer-credit a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; color: var(--gold); text-decoration: none; }
.developer-credit a:hover { text-decoration: underline; }
.developer-credit[inert] a { pointer-events: none; }

.battle { pointer-events: none; z-index: 2; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; margin: 24px 27px; }
.hud-level, .health, .wallet, .notice, .wave { border: 1px solid #a78d5370; background: #0b1d2cef; border-radius: 11px; box-shadow: 0 3px 12px #020e1855; }
.hud-level { justify-self: start; display: grid; padding: 7px 12px; line-height: 1.2; gap: 4px; }
.hud-level strong { font: bold clamp(14px, 2.1vw, 20px)/1.05 var(--title); }
.health, .wallet { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 4px 11px; }
.health span { color: #ff9596; font-size: 21px; line-height: 1; text-shadow: 0 0 11px #ff784996; }
.health .lost { color: #8fa4ae; opacity: .65; text-shadow: none; }
.hud-tools { justify-self: end; }
.hud-tools button, .fire { pointer-events: auto; }
.wallet > span { font-size: 18px; color: #b8f0ff; }
.notice { position: absolute; top: 87px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 38px); padding: 6px 13px; text-align: center; font-size: 13px; color: var(--cream); }
.wave { position: absolute; bottom: 23px; left: 23px; padding: 5px 11px; color: #e0edf0; font-size: 12px; }
.fire { display: none; position: absolute; right: 21px; bottom: 21px; min-width: 80px; min-height: 56px; border: 1px solid #ffe0a0; border-radius: 13px; background: #f3c679; color: #21170d; font-weight: bold; box-shadow: 0 4px 20px #07162699; }
.fire:active { background: #ffe6ac; }
.fire span { font-size: 18px; }

.overlay { z-index: 4; display: grid; place-items: center; padding: 20px; background: #071623ba; }
.stage:is([data-screen="FINAL_SONG"], [data-screen="END"]) { position: fixed; z-index: 4; inset: 0; height: auto; border: 0; border-radius: 0; }
.stage:is([data-screen="FINAL_SONG"], [data-screen="END"]) .overlay {
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: linear-gradient(90deg, #071623ba, #07162348);
}
@media (min-width: 900px) {
  .stage:is([data-screen="FINAL_SONG"], [data-screen="END"]) .overlay { justify-items: start; padding-left: 10%; }
}
.panel {
  max-height: 100%; width: min(100%, 440px); overflow: auto; overscroll-behavior: contain;
  background: radial-gradient(ellipse at 48% 0%, #21404b, #0b202e 68%);
  border: 1px solid #9b7e56; border-radius: 16px; padding: clamp(18px, 3.4vw, 34px);
  box-shadow: 0 18px 60px #030b14aa, inset 0 0 0 5px #d5a97712; text-align: center;
}
.panel h2 { font-size: clamp(26px, 4vw, 43px); color: var(--cream); line-height: 1.05; margin: 8px 0 10px; }
.panel p { color: #c7d9df; margin-bottom: 14px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.panel-actions > * { flex: 1 1 auto; }
.panel-help { text-align: left; color: #d9e8eb; padding-left: 20px; }
.panel-help li + li { margin-top: 6px; }
.shop { width: min(100%, 850px); text-align: left; }
.shop-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.shop-head h2 { margin-bottom: 0; }
.shop-controls { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.upgrade { display: grid; grid-template-rows: auto 1fr auto; gap: 7px; padding: 10px; border: 1px solid #4a616a; border-radius: 11px; background: #0b1d2d; }
.upgrade h3 { font-size: 14px; margin: 0; color: var(--cream); }
.upgrade h3 span { color: var(--gold); margin-right: 4px; }
.upgrade small { display: block; color: #bed2da; font-size: 12px; }
.upgrade .outline { justify-content: space-between; padding: 5px 9px; font-size: 12px; }
.song { width: min(100%, 535px); }
.lyrics { max-height: min(31vh, 260px); overflow: auto; padding: 12px 6px; scrollbar-color: #70644d #102634; border-block: 1px solid #52636b; }
.lyrics p { margin: 0; padding: 6px; color: #c1d0d7; }
.lyrics p.stanza { margin-top: 9px; }
.lyrics p.active { background: #433b2d; border-radius: 7px; color: #ffe6ab; font-weight: bold; }
.share-status { color: var(--gold); margin-top: 9px; overflow-wrap: anywhere; }

@media (pointer: coarse) {
  .desktop-tip { display: none; }
  .touch-tip { display: initial; }
  .fire { display: block; touch-action: none; }
}
@media (max-width: 820px) {
  .shell { padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  .topbar { min-height: 66px; }
  .stage { height: clamp(470px, calc(100vh - 145px), 820px); height: clamp(470px, calc(100dvh - 145px), 820px); }
}
@media (max-width: 600px) and (orientation: portrait) {
  .shell { padding-inline: max(9px, env(safe-area-inset-left)) max(9px, env(safe-area-inset-right)); padding-bottom: max(9px, env(safe-area-inset-bottom)); }
  .topbar { min-height: 62px; }
  .crest { width: 39px; height: 39px; font-size: 22px; }
  .brand { gap: 7px; }
  .brand-name strong { font-size: 17px; }
  .brand-name small { font-size: 8px; letter-spacing: .13em; }
  .top-actions { gap: 5px; }
  .top-actions .icon-button { padding: 6px; }
  #catalog-link { min-width: 44px; min-height: 44px; padding: 6px; }
  .action-label { display: none; }
  .stage { height: max(420px, calc(100vh - 130px)); height: max(420px, calc(100dvh - 130px)); border-radius: 14px; }
  .scene-frame { inset: 6px; }
  .menu { align-items: start; padding: clamp(21px, 5vh, 49px) 7%; }
  .menu::before { background: linear-gradient(180deg, #061521f5 0%, #081a27c9 33%, #08192535 62%, transparent 76%, #051522a3); }
  .hero { max-width: 100%; }
  h1 { font-size: clamp(36px, 9.6vw, 59px); }
  .hero > p { max-width: 295px; font-size: 14px; }
  .hero-actions { margin-top: 15px; }
  .hero-actions .primary { min-height: 46px; min-width: 165px; }
  .hero > .hero-meta { margin-top: 10px; font-size: 11px; }
  .flourish { margin: 6px 0 3px; }
  .quick { margin-top: 8px; min-height: 43px; }
  .quick-item { gap: 5px; padding: 6px 3px; }
  .quick-item small { display: none; }
  .quick-icon { width: 23px; height: 23px; font-size: 13px; }
  .quick-item strong { font-size: 11px; }
  .hud { margin: 15px 13px; gap: 6px; }
  .hud-level, .health, .wallet { padding: 5px 7px; }
  .health, .hud-tools { gap: 4px; }
  .health span { font-size: 15px; }
  .hud-level .eyebrow { font-size: 8px; }
  .notice { top: 67px; }
  .wave { bottom: 17px; left: 13px; }
  .fire { right: 13px; bottom: 14px; }
  .overlay { padding: 11px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-head { align-items: flex-start; gap: 6px; }
  .shop-controls .primary { padding-inline: 10px; }
}
@media (max-width: 360px) and (orientation: portrait) {
  .brand-name strong { font-size: 15px; }
  .brand-name small { display: none; }
  .crest { width: 33px; height: 33px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .topbar { min-height: 49px; padding-block: max(2px, env(safe-area-inset-top)) 2px; }
  .crest { width: 33px; height: 33px; font-size: 19px; }
  .brand-name strong { font-size: 17px; }
  .brand-name small { font-size: 8px; }
  .stage { height: max(213px, calc(100vh - 65px)); height: max(213px, calc(100dvh - 65px)); border-radius: 13px; }
  .scene-frame { inset: 6px; }
  .quick { display: none; }
  .menu { padding: 1.5% 6%; }
  h1 { margin-top: 4px; font-size: clamp(31px, 6vw, 52px); }
  .hero .eyebrow { font-size: 9px; }
  .hero > p { font-size: 13px; line-height: 1.3; }
  .flourish { height: 12px; margin: 3px 0; }
  .hero-actions, .hero > .hero-meta { margin-top: 6px; }
  .hero-actions .primary { min-height: 44px; }
  .hud { margin: 12px 16px; }
  .notice { top: 59px; }
  .wave, .fire { bottom: 12px; }
  .overlay { padding: 9px; }
  .panel { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }