/* Hockey server: control room (/hockey/server) and live view (/hockey/watch). */
.hs-page { max-width: 1480px; margin: 0 auto; padding: 28px 20px 64px; }
.hs-page-watch { max-width: 1240px; }
.hs-head { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.hs-head h1 { margin: 0 0 2px; font-size: 1.75rem; }
.hs-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hs-power { display: flex; gap: 6px; flex-wrap: wrap; }
.hs-muted { color: var(--text-muted); font-size: .88rem; margin: 0; }
.hs-link { color: var(--accent); }
.hs-link:hover { text-decoration: underline; }
.hs-warn { border-left: 4px solid var(--yellow); margin-bottom: 20px; }

/* Status pills */
.hs-status { display: flex; gap: 8px; flex-wrap: wrap; }
.hs-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary); }
.hs-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.hs-pill.ok { color: var(--text); }
.hs-pill.ok::before { background: var(--accent); box-shadow: 0 0 0 3px rgba(56, 217, 122, .2); animation: hs-pulse 2s infinite; }
.hs-pill.bad::before { background: var(--red); }
@keyframes hs-pulse { 50% { box-shadow: 0 0 0 6px rgba(56, 217, 122, 0); } }

/* Layout */
.hs-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.hs-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hs-side { position: sticky; top: calc(var(--nav-h, 58px) + 16px); display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 1100px) { .hs-layout { grid-template-columns: 1fr; } .hs-side { position: static; } }

/* Scoreboard: broadcast style */
.hs-scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-card); border: 1px solid var(--border); min-height: 64px; }
.hs-scoreboard.is-off { display: none; }
.hs-sb-team { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 30%, transparent), transparent 85%); border-left: 6px solid var(--c); min-width: 0; }
.hs-sb-team.is-away { background: linear-gradient(270deg, color-mix(in srgb, var(--c) 30%, transparent), transparent 85%); border-left: 0; border-right: 6px solid var(--c); }
.hs-sb-name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-sb-goals { font-size: 2.1rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.hs-sb-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 22px; background: var(--bg-elevated); min-width: 120px; }
.hs-sb-clock { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hs-sb-tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); }
.hs-sb-tag.is-live { color: var(--red); }
.hs-sb-tag.is-live::before { content: '● '; }
.hs-meta { display: flex; gap: 8px; flex-wrap: wrap; min-height: 26px; }
.hs-chip { padding: 3px 10px; border-radius: 999px; font-size: .78rem; background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }
.hs-chip.is-game { background: rgba(168, 108, 230, .18); border-color: rgba(168, 108, 230, .4); color: #dcc2ff; font-weight: 600; }

/* The rink */
.hs-stage { position: relative; aspect-ratio: 16 / 9; max-height: 74vh; width: 100%; border-radius: var(--radius-lg); overflow: hidden; background: #0a0f17; border: 1px solid var(--border); }
.hs-stage.is-flat { aspect-ratio: 37 / 16; background: #e9f2f7; }
.hs-stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.hs-stage canvas.hs-flat { object-fit: contain; }
.hs-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hs-tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 3px; background: rgba(0, 0, 0, .55); color: #fff; font: 600 12px/1.4 'Inter', system-ui, sans-serif; white-space: nowrap; border-bottom: 2px solid var(--c, #888); will-change: transform; }
.hs-tag i { font-style: normal; font-size: 9px; padding: 0 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.hs-tag small { font-size: 10px; color: rgba(255, 255, 255, .65); }
.hs-tag.has-puck { background: rgba(0, 0, 0, .78); box-shadow: 0 0 0 2px var(--c, #888); }
.hs-cams { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(10, 15, 23, .7); backdrop-filter: blur(6px); }
.hs-cams button { border: 0; background: transparent; color: #c9d2de; font: 600 12px 'Inter', system-ui, sans-serif; padding: 6px 10px; border-radius: 7px; cursor: pointer; }
.hs-cams button:hover { background: rgba(255, 255, 255, .08); }
.hs-cams button.is-on { background: var(--accent); color: #06210f; }
.hs-offline { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 11, 16, .72); color: #fff; font-weight: 600; font-size: 1.15rem; backdrop-filter: blur(2px); }
.hs-offline[hidden] { display: none; }
.hs-goal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; opacity: 0; }
.hs-goal b { font-size: clamp(2.6rem, 8vw, 6rem); font-weight: 900; letter-spacing: .04em; color: #fff; text-shadow: 0 0 30px var(--c), 0 4px 0 color-mix(in srgb, var(--c) 70%, #000); }
.hs-goal span { margin-top: 4px; padding: 4px 14px; border-radius: 6px; background: var(--c); color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.hs-goal.is-on { animation: hs-goal 3s ease-out; }
@keyframes hs-goal { 0% { opacity: 0; transform: scale(.6); } 10% { opacity: 1; transform: scale(1.06); } 18% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* Panels and tabs */
.hs-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px 18px; }
.hs-panel[hidden] { display: none; }
.hs-panel h3 { margin: 18px 0 8px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.hs-panel h3:first-child { margin-top: 2px; }
.hs-panel .hs-muted { margin: -2px 0 10px; }
.hs-tabs { display: flex; gap: 2px; padding: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; }
.hs-tabs button { flex: 1; border: 0; background: transparent; color: var(--text-secondary); font: 600 .84rem 'Inter', system-ui, sans-serif; padding: 8px 4px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.hs-tabs button:hover { color: var(--text); background: var(--bg-hover); }
.hs-tabs button.is-on { background: var(--bg-elevated); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.hs-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-subtle); color: var(--accent); font-size: .72rem; }
.hs-count:empty { display: none; }
.hs-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hs-row input[type=text] { flex: 1; min-width: 0; }
.hs-row > .btn { flex: 1 1 auto; }

/* Segmented buttons */
.hs-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 9px; }
.hs-seg button { border: 0; background: transparent; color: var(--text-secondary); font: 600 .8rem 'Inter', system-ui, sans-serif; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.hs-seg button.is-on { background: var(--bg-elevated); color: var(--text); box-shadow: 0 0 0 1px var(--border-light); }
.hs-seg-wide { display: flex; }
.hs-seg-wide button { flex: 1; padding: 8px; }

/* Face-off mini rink */
.hs-minirink { position: relative; aspect-ratio: 37 / 16; border-radius: 40px / 34px; background: #e9f2f7; border: 3px solid #c8d4de; margin-bottom: 4px; }
.hs-mr-line { position: absolute; top: 0; bottom: 0; width: 3px; transform: translateX(-50%); }
.hs-mr-line.is-red { left: 50%; background: #d64545; }
.hs-mr-line.is-blue { background: #3e7fd6; }
.hs-mr-line.l { left: 33.8%; } .hs-mr-line.r { left: 66.2%; }
.hs-dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #d64545; background: #fff; cursor: pointer; transition: transform .12s, background .12s; }
.hs-dot.is-centre { border-color: #3e7fd6; }
.hs-dot:hover { transform: scale(1.2); background: #ffd6d6; }
.hs-dot:disabled { opacity: .5; }

/* Team forms */
.hs-team-form { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.hs-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.hs-field > span { font-size: .8rem; font-weight: 500; color: var(--text-secondary); text-transform: none; letter-spacing: 0; }
.hs-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-swatches label { cursor: pointer; }
.hs-swatches input { position: absolute; opacity: 0; pointer-events: none; }
.hs-swatches i { display: block; width: 24px; height: 24px; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); transition: transform .1s; }
.hs-swatches label:hover i { transform: scale(1.12); }
.hs-swatches input:checked + i { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text); }
.hs-swatches input:focus-visible + i { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--accent); }
.hs-score-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.hs-stepper { display: grid; grid-template-columns: 34px 1fr 34px; gap: 4px; align-items: center; }
.hs-stepper-name { grid-column: 1 / -1; font-size: .8rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-stepper button { height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.hs-stepper button:hover { background: var(--bg-hover); }
.hs-stepper input { text-align: center; font-size: 1.2rem; font-weight: 700; padding: 6px 0; -moz-appearance: textfield; }
.hs-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Players and positions */
.hs-spots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hs-spot-col { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; background: var(--bg-elevated); border-top: 3px solid var(--c); min-width: 0; }
.hs-spot-col > b { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-spot { display: flex; align-items: center; gap: 6px; font-size: .84rem; min-width: 0; }
.hs-spot > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-pos { flex: none; width: 30px; font-size: .7rem; font-weight: 700; color: var(--text-muted); }
.hs-bot { flex: none; font-style: normal; font-size: .62rem; font-weight: 700; padding: 1px 4px; border-radius: 3px; background: var(--bg-hover); color: var(--text-secondary); }
.hs-players { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.hs-player { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 10px; background: var(--bg-elevated); border-left: 3px solid var(--c); }
.hs-player img { border-radius: 4px; image-rendering: pixelated; }
.hs-player-name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; }
.hs-player select { padding: 6px 8px; font-size: .82rem; }

/* Minigames */
.hs-games { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.hs-game { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); cursor: pointer; font: inherit; transition: border-color .12s, transform .12s; }
.hs-game:hover { border-color: var(--accent); transform: translateY(-1px); }
.hs-game b { font-size: .9rem; }
.hs-game span { font-size: .76rem; color: var(--text-muted); line-height: 1.35; }
.hs-game:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Console */
.hs-console { padding: 0; overflow: hidden; }
.hs-console-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.hs-console-bar h2 { margin: 0 6px 0 0; font-size: 1rem; }
.hs-console-bar input[type=text] { flex: 1; min-width: 140px; padding: 6px 10px; font-size: .84rem; }
.hs-check { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-secondary); cursor: pointer; user-select: none; }
.hs-log { height: 380px; overflow-y: auto; padding: 8px 0; background: #080a0d; font: 12.5px/1.55 ui-monospace, 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace; }
.hs-log-empty { padding: 12px 16px; color: var(--text-muted); font-family: 'Inter', system-ui, sans-serif; font-size: .88rem; }
.hs-line { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 10px; padding: 0 14px; color: #c9d1db; }
.hs-line:hover { background: rgba(255, 255, 255, .03); }
.hs-line[hidden] { display: none; }
.hs-line time { color: #5d6674; }
.hs-line span { white-space: pre-wrap; word-break: break-word; }
.hs-line.is-warn span { color: #f0c55a; }
.hs-line.is-error span { color: #ff7b72; }
.hs-line.is-web span { color: #7fd4a8; }
.hs-cmd { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--border); background: #0d1014; }
.hs-cmd > span { color: var(--accent); font: 700 14px ui-monospace, Consolas, monospace; }
.hs-cmd input[type=text] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 6px 0; font: 13px ui-monospace, 'JetBrains Mono', Consolas, monospace; }
.hs-cmd input[type=text]:focus { border: 0; }
.hs-cmd.is-off { opacity: .5; }

/* Toast */
.hs-toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); margin: 0; padding: 10px 16px; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--border-light); box-shadow: var(--shadow); color: var(--text); font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.hs-toast.show { opacity: 1; transform: translate(-50%, 0); }
.hs-toast.bad { border-color: rgba(240, 96, 92, .5); color: #ffb4b0; }

@media (max-width: 640px) {
    .hs-page { padding: 18px 16px 48px; }
    .hs-stage { aspect-ratio: 4 / 3; }
    .hs-stage.is-flat { aspect-ratio: 37 / 16; }
    .hs-sb-team { padding: 8px 10px; }
    .hs-sb-name { font-size: .85rem; }
    .hs-sb-goals { font-size: 1.6rem; }
    .hs-sb-mid { min-width: 76px; padding: 6px 10px; }
    .hs-cams { left: 6px; bottom: 6px; padding: 3px; gap: 2px; max-width: calc(100% - 12px); overflow-x: auto; scrollbar-width: none; }
    .hs-cams button { padding: 4px 7px; font-size: 11px; white-space: nowrap; }
    .hs-tag { font-size: 10px; padding: 1px 5px; gap: 3px; }
    .hs-tag small, .hs-tag i { display: none; }
    .hs-log { height: 300px; }
    .hs-line { grid-template-columns: 1fr; gap: 0; }
    .hs-games { grid-template-columns: 1fr; }
}
