/* Brand: https://www.tbank.ru/about/brand/
   Craft references: unslop, Damir Sokolovsky, CC BY 4.0. */
@font-face { font-family: TBank; src: url('assets/fonts/TBank-Site-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: TBank; src: url('assets/fonts/TBank-Site-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: TBank; src: url('assets/fonts/TBank-Site-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root { --yellow: #ffdd2d; --ink: #333; --secondary: #0000008a; --base: #fff; --neutral: #f6f7f8; --border: #0010241f; font-family: TBank, Arial, sans-serif; color: var(--ink); background: #e8e8e5; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { display: grid; place-items: center; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.station { position: relative; width: min(100vw, 56.25dvh); aspect-ratio: 9 / 16; background: var(--base); overflow: hidden; display: flex; flex-direction: column; container-type: inline-size; touch-action: none; user-select: none; }
.header { flex: none; padding: 4cqw 6cqw 0; background: var(--base); z-index: 2; }
.brand-row { display: flex; justify-content: space-between; align-items: center; }
.brand { width: 22cqw; height: auto; display: block; }
.dano-logo { width: 18.5cqw; height: auto; display: block; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 2cqw; padding: 3cqw 0 3cqw; }
h1 { margin: 0; font-size: 8cqw; line-height: 1.05; letter-spacing: -.02em; font-weight: 500; }
.timer { display: flex; align-items: baseline; gap: .8cqw; font-size: 9cqw; line-height: .95; font-weight: 500; font-variant-numeric: tabular-nums; }
.timer small { font-size: 2.5cqw; font-weight: 400; color: var(--secondary); }
.round-progress { height: .5cqw; min-height: 2px; background: #f6f7f8; overflow: hidden; }
.round-progress span { display: block; width: 100%; height: 100%; background: var(--yellow); transform-origin: left; }
.fields { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.player-field { position: relative; min-height: 0; flex: 1; overflow: hidden; }
.player-heading { position: absolute; z-index: 2; left: 6cqw; right: 6cqw; top: 3cqw; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.player-name { display: flex; align-items: center; gap: 2cqw; font-size: 3.2cqw; font-weight: 500; }
.player-number { width: 5cqw; height: 5cqw; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font-size: 2.8cqw; font-weight: 500; }
.player-number.dark { background: var(--ink); color: white; }
.score-block { display: flex; align-items: baseline; gap: 1.1cqw; }
.score-block strong { font-size: 6.8cqw; line-height: 1; font-variant-numeric: tabular-nums; font-weight: 500; }
.score-block > span { font-size: 2.2cqw; color: var(--secondary); }
.player-field canvas { display: block; width: 100%; height: 100%; }
.field-prompt { display: flex; justify-content: center; align-items: center; gap: 1.5cqw; position: absolute; left: 4cqw; right: 4cqw; bottom: 1.6cqw; font-size: 2.6cqw; color: var(--secondary); white-space: nowrap; }
.field-prompt svg { width: 3.8cqw; height: 3.8cqw; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.field-prompt.is-ready { color: var(--ink); font-weight: 500; }
.field-prompt.is-ready svg { color: var(--ink); background: var(--yellow); border-radius: 50%; padding: .5cqw; }
.field-divider { flex: none; display: flex; align-items: center; gap: 2.8cqw; padding: 0 6cqw; height: 4cqw; }
.field-divider > span:not(.divider-label) { height: 1px; flex: 1; background: var(--border); }
.divider-label { font-size: 2.1cqw; color: var(--secondary); white-space: nowrap; }
.footer { display: flex; justify-content: center; align-items: center; gap: 3cqw; padding: 2cqw 4cqw 2cqw; font-size: 2.5cqw; color: var(--ink); }
.arrow-pair { font-family: Arial, sans-serif; font-size: 3.6cqw; word-spacing: 1cqw; }
.round-overlay { position: absolute; z-index: 5; left: 5cqw; right: 5cqw; top: 42%; min-height: 16%; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 3cqw 6cqw; background: #fff; color: var(--ink); text-align: center; border-top: .8cqw solid var(--yellow); border-bottom: 1px solid var(--border); }
.overlay-label { font-size: 2.4cqw; margin-bottom: 1.1cqw; }
#overlay-title { font-size: 10cqw; line-height: 1.05; font-weight: 500; letter-spacing: -.04em; }
.overlay-detail { font-size: 2.8cqw; margin-top: 1.5cqw; }
.station[data-mode="countdown"] .round-overlay { left: 34%; right: 34%; top: 42%; min-height: auto; aspect-ratio: 1; border-radius: 50%; padding: 2cqw; }
.station[data-mode="countdown"] #overlay-title { font-size: 15cqw; }
.station[data-mode="countdown"] .overlay-label { font-size: 2.3cqw; }
.station[data-mode="countdown"] .overlay-detail { display: none; }
.station[data-mode="result"] #overlay-title { font-size: 6.8cqw; }
.station[data-mode="result"] .round-overlay { border-left: 1cqw solid var(--yellow); }
.station[data-mode="result"] .overlay-detail { font-size: 3.1cqw; font-weight: 500; }
.result-stamp { position: absolute; right: 6cqw; top: 11cqw; font-size: 2.6cqw; font-weight: 500; padding: .75cqw 1.5cqw; background: var(--yellow); border-radius: .8cqw; }
.connection-overlay { position: absolute; z-index: 8; inset: 0; background: #ffffffed; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6cqw; }
.connection-overlay h2 { font-size: 6cqw; }
.connection-overlay p { font-size: 3cqw; }
.connection-overlay button { background: var(--yellow); border: 0; border-radius: 1.5cqw; padding: 2cqw 4cqw; font-size: 3cqw; }
dialog { position: fixed; width: min(460px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 20px; color: var(--ink); padding: 28px; user-select: auto; }
dialog::backdrop { background: #0009; }
dialog h2 { margin: 0 0 16px; font-size: 28px; font-weight: 500; }
dialog .close { position: absolute; right: 16px; top: 12px; background: none; border: 0; font-size: 28px; color: var(--secondary); }
dialog label { display: flex; align-items: center; justify-content: space-between; margin: 16px 0; gap: 16px; font-size: 15px; }
dialog input[type="number"] { width: 80px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
dialog input[type="checkbox"] { width: 22px; height: 22px; accent-color: #333; }
.operator-status { font-size: 14px; color: var(--secondary); }
.controller-tests { padding: 12px; background: var(--neutral); border-radius: 12px; font-size: 14px; }
.controller-tests > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.controller-tests span { width: 100%; font-size: 12px; color: var(--secondary); overflow-wrap: anywhere; }
.operator-actions { display: flex; gap: 8px; margin-top: 20px; }
.operator-actions button { padding: 12px; background: var(--yellow); color: var(--ink); border: 0; border-radius: 10px; flex: 1; }
.operator-actions button + button { background: var(--neutral); }
.keyboard-help { color: var(--secondary); font-size: 13px; line-height: 1.5; margin-bottom: 0; }
