@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/dmsans-latin.woff2) format('woff2');
  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 {
    --font-ui: 'DM Sans', Arial, sans-serif;
    --control-radius: 10px;
    --control-font-size: 12px;
    --meta-font-size: 10px;
    font-family: var(--font-ui);
    color: #f7f7fa;
    background: #070d19;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    color-scheme: dark;
}
* { box-sizing: border-box; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; touch-action: none; }
html { -webkit-touch-callout: none; }
body { position: fixed; inset: 0; height: 100vh; height: 100dvh; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; font-size: var(--control-font-size); font-weight: 600; line-height: 1.2; letter-spacing: .035em; text-transform: uppercase; border-radius: var(--control-radius); cursor: pointer; touch-action: manipulation; }
button strong { font-size: inherit; font-weight: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid #f2d65d; outline-offset: 2px; }
button { transition: filter .15s, background .15s, border-color .15s; }
button:hover { filter: brightness(1.1); }
button:active { filter: brightness(1.2); }
.ui-icon { display: inline-block; width: 24px; height: 24px; flex-shrink: 0; vertical-align: middle; }
.mascot-avatar { display: block; width: 100%; height: 100%; overflow: visible; }
.arcade-shell {
    width: min(100%, 1024px);
    height: 100%;
    min-width: 0;
    overflow: hidden;
    margin: 0 auto;
    padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    display: grid;
    grid-template-rows: 52px 30px 24px minmax(0, 1fr) 178px;
    gap: 6px;
}
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.wordmark { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo { display: block; width: 108px; height: auto; }
.broadcast-summary { display: grid; justify-items: center; gap: 5px; }
.broadcast-live { display: flex; align-items: center; gap: 18px; }
.live-label { display: inline-flex; gap: 7px; align-items: center; font-size: 12px; font-weight: 600; }
.live-label i { width: 9px; height: 9px; background: #ff2638; border-radius: 50%; box-shadow: 0 0 10px #ff243845; }
.viewer-count { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: var(--control-radius); background: #1b1b1e; font-size: 12px; }
.viewer-count .ui-icon { width: 15px; height: 15px; }
.round-progress { font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.round-progress span { margin: 0 5px; color: #82858d; }
.broadcast-tools { display: flex; gap: 8px; }
.round-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 7px; border: 1px solid #8f9097; background: #ffffff04; }
.round-button .ui-icon { width: 21px; height: 21px; }
.round-button:hover { background: #ffffff16; }
.score-ribbon { display: flex; align-items: center; justify-content: space-between; border: 1px solid #6f7aa0; border-radius: var(--control-radius); padding: 0 16px; background: linear-gradient(100deg, #056690, #003a68 45%, #682448 73%, #dd2633); box-shadow: inset 0 0 5px #ffffff30; }
.score-ribbon strong { font-size: 20px; line-height: 1; font-weight: 500; }
.contenders { display: grid; grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr); align-items: center; gap: 8px; }
.contender { display: flex; align-items: center; gap: 4px; min-width: 0; }
.contender:last-child { justify-content: flex-end; }
.player-avatar { width: 25px; height: 25px; flex-shrink: 0; }
.player-name { font-size: 12px; white-space: nowrap; }
.hearts { display: flex; color: #ff233a; flex-shrink: 0; }
.hearts .ui-icon { width: 11px; height: 11px; }
.hearts .heart-empty { color: #c1c3ca; }
.player-timer { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; white-space: nowrap; margin-left: auto; font-variant-numeric: tabular-nums; }
.player-timer .ui-icon { width: 12px; height: 12px; }
.versus { width: 23px; height: 23px; justify-self: center; }
.arena-frame { position: relative; min-height: 0; border: 1px solid #d3b7a0; border-radius: var(--control-radius); overflow: hidden; background: #142033; }
.game-viewport { position: relative; width: 100%; height: 100%; overflow: hidden; background: #142033; }
.godot-host { position: absolute; inset: 0; outline: none; touch-action: none; }
.godot-host:focus, .godot-host:focus-visible, .godot-host canvas:focus, .godot-host canvas:focus-visible { outline: none; }
.godot-host canvas { display: block; touch-action: none; }
.spectator-panel { display: grid; grid-template-rows: 26px 36px 52px minmax(0,1fr); gap: 6px; min-height: 0; }
.identity-row { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 15px; }
.mini-avatar { width: 26px; height: 26px; }
.identity-team { font-weight: 700; }
.identity-team-blue { color: #279bff; }
.identity-team-red { color: #ff4a61; }
.identity-status { font-size: 12px; opacity: .8; }
.identity-retry { border: 1px solid #526079; padding: 3px 8px; background: #1a2839; color: #b8dfff; }
.bet-row { display: grid; grid-template-columns: minmax(0,1fr) 68px minmax(0,1fr); gap: 8px; align-items: stretch; }
.bet-button { display: flex; align-items: center; justify-content: space-between; min-width: 0; overflow: hidden; border: 1px solid; padding: 0 9px; white-space: nowrap; }
.bet-blue { background: linear-gradient(110deg,#079af8,#086ab9); border-color: #55bdff; }
.bet-red { background: linear-gradient(110deg,#ff4a61,#ca243c); border-color: #ff9b9d; }
.bet-percent { opacity: .8; }
.bet-people { display: inline-flex; align-items: center; align-self: stretch; justify-content: center; gap: 4px; padding-left: 8px; margin-left: 4px; border-left: 1px solid #ffffff25; }
.bet-people .ui-icon { width: 14px; height: 14px; }
.wallet { display: flex; align-items: center; justify-content: center; gap: 6px; }
.wallet strong { font-size: 20px; font-weight: 500; }
.coin { display: inline-grid; place-items: center; flex-shrink: 0; width: 11px; height: 11px; border-radius: 50%; background: #e4c732; border: 1px solid #fff197; color: #fff498; font-size: 9px; line-height: 1; box-shadow: inset -2px -2px 0 #ac7c20; }
.coin-large { width: 26px; height: 26px; font-size: 21px; border-width: 2px; }
.power-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; }
.power-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; border: 1px solid #85858b; background: linear-gradient(#242427,#0c0d0f); padding: 2px 1px; }
.power-available { background: linear-gradient(#302a09,#171504); border-color: #dbc746; }
.power-icon { width: 18px; height: 18px; }
.power-card strong { line-height: 1.15; white-space: nowrap; }
.power-price { display: inline-flex; align-items: center; gap: 3px; color: #d2d2d8; font-size: var(--meta-font-size); line-height: 1; }
.power-card:not(.power-available) .coin { background: #bcbcc1; border-color: #e9e9ec; color: #eeeef0; box-shadow: inset -1px -1px 0 #85858e; }
.play-row { display: flex; align-items: center; justify-content: center; }
.play-button { display: flex; align-items: center; justify-content: center; gap: 17px; width: 206px; height: 40px; border: 1px solid #83dc8d; background: linear-gradient(110deg,#0b2618,#104d2a,#0b281a); box-shadow: inset 0 0 0 1px #7bc98228; color: #d9f3de; }
.play-button > .ui-icon { width: 24px; height: 24px; }
.queue-count { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid #b3dbbd88; }
.queue-count .ui-icon { width: 16px; height: 16px; }
@media (min-width: 700px) {
    .arcade-shell { padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); grid-template-rows: 52px 30px 28px minmax(0,1fr) 170px; }
    .brand-logo { width: 125px; }
    .player-name { font-size: 14px; }
    .contender { gap: 7px; }
    .hearts .ui-icon { width: 14px; height: 14px; }
    .player-timer { margin-left: 10px; font-size: 13px; }
    .contender:last-child .player-timer { margin-left: 10px; }
    .spectator-panel { width: min(100%,760px); justify-self: center; grid-template-rows: 26px 36px 50px minmax(0,1fr); }
}
@media (max-width: 430px) {
    :root { --control-font-size: 10px; --meta-font-size: 9px; }
    .arcade-shell { grid-template-rows: 46px 28px 22px minmax(0,1fr) 170px; gap: 5px; }
    .brand-logo { width: 80px; }
    .broadcast-live { gap: 12px; }
    .broadcast-tools { gap: 6px; }
    .round-button { width: 34px; height: 34px; }
    .round-button .ui-icon { width: 19px; height: 19px; }
    .contenders { grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr); gap: 3px; }
    .contender { gap: 2px; }
    .player-avatar { width: 19px; height: 19px; }
    .player-name { font-size: 10px; }
    .hearts .ui-icon { width: 9px; height: 9px; }
    .player-timer { font-size: 10px; gap: 2px; }
    .player-timer .ui-icon { width: 10px; height: 10px; }
    .versus { width: 20px; height: 20px; }
    .spectator-panel { grid-template-rows: 26px 34px 50px minmax(0,1fr); gap: 5px; }
    .bet-row { grid-template-columns: minmax(0,1fr) 56px minmax(0,1fr); gap: 5px; }
    .bet-button { padding: 0 7px; }
    .bet-people { padding-left: 5px; gap: 3px; }
    .bet-people .ui-icon { width: 11px; height: 11px; }
    .power-grid { gap: 5px; }
}
@media (max-width: 359px) {
    :root { --control-font-size: 8px; }
    .brand-logo { width: 67px; }
    .broadcast-tools { gap: 4px; }
    .round-button { width: 29px; height: 29px; }
    .round-button .ui-icon { width: 16px; height: 16px; }
    .round-progress { font-size: 10px; }
    .player-name { font-size: 9px; }
    .player-avatar { width: 17px; height: 17px; }
    .hearts .ui-icon { width: 8px; height: 8px; }
    .player-timer { font-size: 9px; }
    .bet-percent { font-size: 9px; }
}
@media (max-height: 540px) and (orientation: landscape) {
    :root { --control-font-size: 9px; --meta-font-size: 9px; }
    .arcade-shell { width: 100%; grid-template-columns: minmax(0,1fr) clamp(170px, 29vw, 240px); grid-template-rows: 38px 22px 22px minmax(0,1fr); gap: 4px 10px; padding: max(5px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
    .site-header, .score-ribbon, .contenders, .live-arena { grid-column: 1; }
    .spectator-panel { grid-column: 2; grid-row: 1 / -1; width: 100%; align-self: center; grid-template-rows: 30px 44px 70px 54px; }
    .brand-logo { width: 80px; }
    .contenders { grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr); gap: 3px; }
    .contender { gap: 2px; }
    .player-avatar { width: 19px; height: 19px; }
    .player-name { font-size: 10px; }
    .hearts .ui-icon { width: 9px; height: 9px; }
    .player-timer { margin-left: auto; font-size: 10px; }
    .contender:last-child .player-timer { margin-left: auto; }
    .player-timer .ui-icon { width: 10px; height: 10px; }
    .identity-row { font-size: 13px; gap: 6px; }
    .bet-row { grid-template-columns: minmax(0,1fr) 36px minmax(0,1fr); gap: 3px; }
    .bet-button { justify-content: center; padding: 2px; }
    .bet-percent, .bet-people { display: none; }
    .wallet { gap: 3px; }
    .coin-large { width: 18px; height: 18px; font-size: 13px; }
    .wallet strong { font-size: 16px; }
    .power-grid { gap: 3px; }
    .power-card strong { white-space: normal; text-align: center; }
    .power-icon { width: 20px; height: 20px; }
    .play-button { width: min(100%, 190px); gap: 10px; }
}
@media (max-height: 540px) and (orientation: landscape) and (max-width: 600px) {
    :root { --control-font-size: 8px; }
    .site-header { gap: 6px; }
    .brand-logo { width: 60px; }
    .broadcast-tools .round-button:last-child { display: none; }
    .round-button { width: 28px; height: 28px; }
    .round-button .ui-icon { width: 16px; height: 16px; }
    .round-progress { font-size: 10px; }
    .live-label, .viewer-count { font-size: 10px; }
    .broadcast-live { gap: 8px; }
    .player-timer { display: none; }
}
.game-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; gap: 14px; text-align: center; background: #101b2be8; backdrop-filter: blur(5px); }
.game-overlay > strong { font-size: clamp(17px, 2.4vw, 28px); font-weight: 600; letter-spacing: normal; }
.game-overlay > p { color: #9cacc0; font-size: 16px; margin: 0; line-height: 1.5; }
.game-overlay-button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; background: #9b54ed; border: 1px solid #d1a9fc; padding: 11px 15px; color: #fff; }
.game-overlay-button:hover { background: #ab66f7; }
.game-overlay-button .ui-icon { width: 16px; height: 16px; }
.game-win-kicker { color: #c3ed7a; font-size: 10px; letter-spacing: 2px; }
.game-win-actions { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.game-complete { background: #101b2bd4; }
.game-replay { padding: 11px 15px; border: 1px solid #526079; background: #1a2839; color: #e0dce9; }
@media (max-width: 600px) {
    .game-overlay { gap: 9px; padding: 12px; }
    .game-overlay > p { max-width: 300px; font-size: 14px; }
    .game-overlay-button, .game-replay { padding: 8px 10px; }
    .game-overlay-button .ui-icon { width: 12px; height: 12px; }
    .game-win-kicker { font-size: 7px; }
}
