/* Player app styles: mirrors core's player app (player_host/player_frontend, Tailwind classes copied as plain CSS: navy page, blue gradient column, white 14px cards, green italic buttons, dashboard pills and cards); club skins (skins v2 theme files) swap in their colours the way core's Leverkusen variant does; plus the SIM layout rules (tablet-portrait column, upright desktop column, "turn upright" overlay on touch devices held sideways). */
:root {
  /* core Default palette */
  --p-page: #001934;
  --p-col-top: #005fc5;
  --p-col-bottom: #00142a;
  --p-card: #ffffff;
  --p-card-shadow: 0 0 21px #001934;
  --p-title: #004590;
  --p-title-style: italic;
  --p-btn: #31cb8b;
  --p-btn-text: #ffffff;
  --p-btn-glow: 0 0 21px #2dffa7;
  --p-btn-style: italic;
  --p-btn-size: 20px;
  --p-btn-off: #9ca3af;
  --p-outline: #6ec1e4;
  --p-option: #eaeaea;
  --p-option-text: #004590;
  --p-select: #31cb8b;
  --p-soft: #abcff5;
  --p-icon: #6ec1e4;
  --p-pill: rgba(255, 255, 255, 0.15);
  --p-prize-bg: rgba(255, 255, 255, 0.15);
  --p-foot-bg: rgba(255, 255, 255, 0.2);
  --p-foot-text: rgba(175, 199, 209, 0.6);
  --p-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --p-font-head: var(--p-font);
  --p-col: 378px;
  --p-dash: 424px;
}
/* Club skins (core's Leverkusen variant: red-to-black page, black titles, solid accent buttons, no glow), colours from the theme file. */
html[data-skin-club] {
  --p-page: var(--ds-bg, #000);
  --p-col-top: var(--ds-accent-press, #bd0000);
  --p-col-bottom: var(--ds-bg, #000);
  --p-title: #000000;
  --p-title-style: normal;
  --p-btn: var(--ds-accent-strong, #ff0000);
  --p-btn-text: var(--ds-on-accent, #fff);
  --p-btn-glow: none;
  --p-btn-style: normal;
  --p-btn-size: 16px;
  --p-btn-off: #c2c2c2;
  --p-outline: var(--ds-accent-strong, #ff0000);
  --p-option-text: var(--ds-accent-press, #d00217);
  --p-select: var(--ds-accent-strong, #ff0000);
  --p-soft: rgba(255, 255, 255, 0.5);
  --p-icon: rgba(255, 255, 255, 0.5);
  --p-prize-bg: rgba(0, 0, 0, 0.5);
  --p-font: var(--ds-font, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  --p-font-head: var(--ds-font-head, var(--p-font));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--p-page); color: #fff; font-family: var(--p-font); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
html[data-skin-club] body { background: linear-gradient(to bottom, var(--p-col-top), var(--p-col-bottom)) fixed; }
button { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- card pages (core: flex h-dvh centred; column sm:max-w-[378px] p-6 with blue gradient) ---------- */
.page { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
@supports (height: 100dvh) { .page { min-height: 100dvh; } }
.col {
  width: 100%;
  max-width: var(--p-col);
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
@media (min-width: 640px) { .col { background: linear-gradient(to bottom, var(--p-col-top), var(--p-col-bottom)); } }
.screen.center { display: flex; justify-content: center; align-items: center; min-height: 60vh; }
.card {
  background: var(--p-card);
  border-radius: 14px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--p-card-shadow);
  color: var(--p-title);
}
.logo { width: 180px; height: auto; }
.logo.mb { margin-bottom: 16px; }
.crest { display: none; width: 50px; height: 50px; background: var(--ds-crest, none) center / contain no-repeat; }
.crest.small { width: 50px; height: 50px; }
html[data-skin-club] .crest { display: block; }
html[data-skin-club] .logo { display: none; }
.hero { width: 200px; max-width: 70%; height: auto; }
.card-txt { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.card-title { margin: 0; padding: 0 8px; font: 700 22px/26px var(--p-font-head); font-style: var(--p-title-style); text-transform: uppercase; color: var(--p-title); overflow-wrap: anywhere; }
.card-p { margin: 0; padding: 0 8px; font-size: 14px; line-height: 16px; color: var(--p-title); }
.card-p.small { font-size: 12px; line-height: 15px; opacity: 0.85; }
.btns { display: flex; flex-direction: column; gap: 16px; width: 100%; margin-top: 12px; }
.powered { margin: 14px 0 0; text-align: center; color: rgba(255, 255, 255, 0.7); font-size: 12px; font-weight: 600; }
.error { margin: 4px 0 0; width: 100%; padding: 8px 10px; border-radius: 9px; background: #fde2e2; color: #b91c1c; font-size: 14px; text-align: center; }

/* buttons (core: py-2 rounded-[9px] uppercase bold italic 20px, green with glow / 4px outline) */
.btn { display: block; width: 100%; padding: 8px 12px; border-radius: 9px; border: 0; font: 700 var(--p-btn-size)/1.5 var(--p-font); font-style: var(--p-btn-style); text-transform: uppercase; cursor: pointer; }
.btn.primary { background: var(--p-btn); color: var(--p-btn-text); box-shadow: var(--p-btn-glow); }
.btn.primary:disabled { background: var(--p-btn-off); box-shadow: none; cursor: not-allowed; }
.btn.outline { background: transparent; border: 4px solid var(--p-outline); color: var(--p-outline); }
html[data-skin-club] .btn.outline { color: #000; }
.btn.big { padding: 16px 12px; font-size: calc(var(--p-btn-size) + 4px); margin-top: 16px; }
html[data-skin-club] .btn.big { font-size: 20px; }
.link { background: none; border: 0; margin-top: 10px; padding: 6px; color: var(--p-title); font: 600 14px var(--p-font); text-decoration: underline; cursor: pointer; opacity: 0.8; }
.btn:focus-visible, .link:focus-visible, .option:focus-visible, .icon-btn:focus-visible, .foot-item:focus-visible { outline: 3px solid #fde047; outline-offset: 2px; }

/* ---------- dashboard (core Dashboard.tsx: column max-w-[424px] min-h-dvh, py-3 px-3 gap-[8.6px]) ---------- */
.dash-page { align-items: stretch; }
@media (min-width: 640px) { .dash-page { padding: 0 16px; align-items: center; } }
.dash {
  width: 100%;
  max-width: var(--p-dash);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, var(--p-col-top), var(--p-col-bottom));
  position: relative;
}
@supports (height: 100dvh) { .dash { min-height: 100dvh; } }
.dash-body { display: flex; flex-direction: column; gap: 8.6px; padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.team-pill { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; background: var(--p-pill); border-radius: 999px; padding: 8px 14px; }
.team-pill-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team-cap { text-transform: uppercase; color: var(--p-soft); font-weight: 500; font-size: 12px; }
html[data-skin-club] .team-cap, html[data-skin-club] .team-name { font-weight: 700; color: rgba(255, 255, 255, 0.5); text-transform: uppercase; }
html[data-skin-club] .shield { display: none; }
.shield { width: 14px; height: 14px; fill: var(--p-icon); flex: none; }
.team-name { color: #fff; font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { flex: none; display: grid; place-items: center; min-width: 32px; min-height: 32px; padding: 4px; background: none; border: 0; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: rgba(255, 255, 255, 0.5); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.share svg { width: 24px; height: 24px; stroke: #fff; }
.icon-btn.dark svg { width: 26px; height: 26px; stroke: var(--p-outline); }
.arena { position: relative; width: 100%; }
.arena img { display: block; width: 100%; height: auto; }
.arena-name { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; padding: 0 16px; text-align: center; font: 700 16px/1.25 var(--p-font-head); text-transform: uppercase; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.banners { display: grid; gap: 8.6px; }
.banner { display: block; width: 100%; border-radius: 6px; overflow: hidden; background: rgba(0, 0, 0, 0.25); color: #fff; text-decoration: none; }
.banner img { display: block; width: 100%; height: auto; }
.banner .btxt { display: block; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.prize-card { margin-top: 4px; background: var(--p-prize-bg); border-radius: 10px; padding: 12px 16px; }
.prize-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.prize-cap { margin: 0; font-size: 16px; font-weight: 700; text-transform: uppercase; color: #fff; }
.prize-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.prize-l { display: flex; align-items: center; gap: 20px; min-width: 0; }
.prize-pic { flex: none; width: 70px; height: 70px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--p-title); font: 800 24px var(--p-font-head); }
.prize-pic img { max-width: 46px; max-height: 46px; object-fit: contain; }
.prize-name { margin: 0 0 2px; color: #fff; font-weight: 700; font-size: 14px; text-transform: uppercase; overflow-wrap: anywhere; }
.prize-name:empty { display: none; }
.prize-points { margin: 0; color: var(--p-soft); font-size: 18px; font-weight: 400; font-variant-numeric: tabular-nums; }
html[data-skin-club] .prize-points { color: #fff; }
.prize-points b { font-weight: 700; }
.btn.claim { width: auto; flex: none; font: 700 18px var(--p-font); font-style: normal; border-radius: 12px; padding: 12px 20px; margin-top: 12px; background: var(--p-btn); color: #fff; border: 0; }
.btn.claim:disabled { background: transparent; color: var(--p-outline); border: 4px solid var(--p-outline); padding: 8px 16px; cursor: default; }
html[data-skin-club] .btn.claim:disabled { color: #4a4a4a; border-color: #282828; background: #282828; }
.bar { margin-top: 10px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--p-btn); border-radius: inherit; transition: width 0.6s ease; }
.prize-card.none .bar, .prize-card.none .btn.claim { display: none; }
.toast { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 14px; text-align: center; }
/* core: marquee in VT323, text-2xl, white uppercase */
.marquee { width: 100%; overflow: hidden; white-space: nowrap; padding: 4px 0; }
.marquee-txt { display: inline-block; padding-left: 100%; font: 400 24px/1.2 'VT323', ui-monospace, 'SFMono-Regular', Menlo, monospace; color: #fff; text-transform: uppercase; animation: marquee 14s linear -4s infinite; }
.marquee.ended .marquee-txt { animation: none; padding-left: 0; width: 100%; text-align: center; white-space: normal; font-size: 20px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.dash-foot { background: var(--p-foot-bg); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
.foot-item { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: var(--p-foot-text); font-size: 12px; line-height: 16px; cursor: pointer; min-width: 44px; }
.foot-item svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; }
.foot-powered { margin: 0; color: var(--p-foot-text); font-size: 12px; font-weight: 600; text-align: right; }

/* ---------- dialogs (core: fixed inset-0, panel w-full max-w-sm rounded-xl bg-white p-6) ---------- */
.modal { position: fixed; inset: 0; z-index: 20; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.4); }
.panel { width: 100%; max-width: 384px; background: #fff; border-radius: 12px; padding: 24px; color: var(--p-title); display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.panel .crest { align-self: center; margin-bottom: 16px; }
.panel-title { margin: 4px 0 24px; font: 700 20px/28px var(--p-font-head); font-style: var(--p-title-style); text-transform: uppercase; color: var(--p-title); }
.panel-p { margin: 0 0 12px; font-size: 18px; font-weight: 500; color: var(--p-title); }
.panel-p.small { font-size: 16px; margin: 12px 0 4px; }
.panel-note { margin: 12px 0 0; font-size: 13px; opacity: 0.75; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option { width: 100%; background: var(--p-option); border: 4px solid transparent; border-radius: 24px; padding: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 24px; text-align: center; color: var(--p-option-text); }
.option[aria-checked="true"] { border: 6px solid var(--p-select); background: #fff; padding: 14px; }
.option .oname { font: 700 24px/1.2 var(--p-font-head); color: var(--p-option-text); overflow-wrap: anywhere; }
html[data-skin-club] .option .oname { font-size: 20px; text-transform: uppercase; }
.option.prize .oname { font-size: 18px; text-transform: uppercase; }
.option .osub { display: block; font-size: 13px; font-weight: 600; opacity: 0.75; margin-top: 2px; text-transform: none; }
.option img { max-width: 56px; max-height: 56px; }
.qr { width: 152px; height: 152px; margin: 4px auto 0; image-rendering: pixelated; }
.copy-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.copy-link { font-size: 15px; font-weight: 700; text-decoration: underline; overflow-wrap: anywhere; }
.copied { margin: 4px 0 0; color: #16a34a; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.field-cap { font-size: 18px; font-weight: 600; font-style: var(--p-title-style); }
.field select { font: 16px var(--p-font); padding: 8px; border: 1px solid #d1d5db; border-radius: 8px; color: #111; background: #fff; }
/* core ReadyCountDown: timer circle, label 16px uppercase #6EC1E4, title 20px bold italic */
.panel.ready { border-radius: 14px; padding: 20px 16px; box-shadow: var(--p-card-shadow); align-items: center; gap: 12px; }
.timer { position: relative; width: 120px; height: 120px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: #e5e7eb; stroke-width: 8; }
.timer-fg { fill: none; stroke: var(--p-btn); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 276.46; stroke-dashoffset: 0; transition: stroke-dashoffset 0.25s linear; }
.timer-num { position: absolute; inset: 0; display: grid; place-items: center; font: 800 44px var(--p-font-head); color: var(--p-title); font-variant-numeric: tabular-nums; }
.ready-label { margin: 7px 0 0; color: var(--p-icon); font-weight: 600; font-size: 16px; text-transform: uppercase; }
html[data-skin-club] .ready-label { color: var(--ds-accent-strong, #ff0000); font-weight: 700; }
.ready-title { margin: 0; font: 700 20px var(--p-font-head); font-style: var(--p-title-style); text-transform: uppercase; color: var(--p-title); }

.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid #d1d5db; border-top-color: #4b5563; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-bar { position: fixed; left: 50%; top: max(8px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 30; padding: 8px 14px; border-radius: 999px; background: #f59e0b; color: #111; font-weight: 700; font-size: 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); white-space: nowrap; }

/* ---------- Layout (SIM rules, docs/LAYOUT.md on feat/layouts, re-implemented) ---------- */
/* Tablet portrait: a wider single column, larger type. */
@media (orientation: portrait) and (min-width: 700px) {
  :root { --p-col: 560px; --p-dash: 680px; }
  .card { padding: 32px 28px; gap: 14px; }
  .logo { width: 240px; } .hero { width: 280px; }
  .card-title { font-size: 30px; line-height: 36px; } .card-p { font-size: 18px; line-height: 22px; } .card-p.small { font-size: 15px; line-height: 19px; }
  .btn { font-size: calc(var(--p-btn-size) + 6px); padding: 12px; }
  .dash-body { gap: 14px; padding: 20px 20px 16px; }
  .team-pill { padding: 12px 20px; } .team-cap, .team-name { font-size: 16px; }
  .arena-name { font-size: 24px; } .prize-cap { font-size: 20px; } .prize-points { font-size: 24px; } .prize-pic { width: 92px; height: 92px; }
  .marquee-txt { font-size: 32px; } .foot-item, .foot-powered { font-size: 15px; }
  .panel { max-width: 520px; padding: 32px; } .panel-title { font-size: 26px; line-height: 34px; }
}
/* Desktop (mouse) landscape: an upright centred column that grows with the window height. */
@media (orientation: landscape) and (min-width: 900px) and (min-height: 860px) and (hover: hover) { .col, .dash, .panel { zoom: 1.15; } }
@media (orientation: landscape) and (min-width: 900px) and (min-height: 1040px) and (hover: hover) { .col, .dash, .panel { zoom: 1.3; } }

/* Phones and tablets held sideways: "Turn your device upright". */
.rotate { display: none; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px 24px; background: var(--p-page); color: #fff; text-align: center; }
.rotate-icon { font-size: 72px; animation: turn 2.4s ease-in-out infinite; }
.rotate-title { margin: 0; font-size: 22px; font-weight: 800; text-transform: uppercase; max-width: 28rem; }
.rotate-note { margin: 0; color: var(--p-soft); max-width: 28rem; }
@keyframes turn { 0%, 20% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0deg); } }
@media (hover: none) and (pointer: coarse) and (orientation: landscape) { .rotate { display: flex; } html, body { overflow: hidden; } }
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (min-width: 900px) and (min-height: 600px) { .rotate-icon { font-size: 112px; } .rotate-title { font-size: 32px; } .rotate-note { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) { .marquee-txt { animation: none; padding-left: 0; } .rotate-icon, .spinner { animation: none; } }
/* Light club skins (theme "tone": "light", e.g. f95): the dark-skin page gradient ends in the light --ds-bg, so the white page text (marquee, footer, Powered by) became unreadable; use the club's own red gradient end to end instead. */
html[data-skin-tone='light'] {
  --p-page: var(--ds-accent-press, #931818);
  --p-col-top: var(--ds-accent-strong, #e30613);
  --p-col-bottom: var(--ds-accent-press, #931818);
}
/* Club look from the theme file (skins v2 keys, no club names in the CSS): cards and dialogs in the theme's surface / text colour and card radius, buttons and options in its button radius, the selected option as a solid accent block, dialog titles as a solid accent title bar; dark skins on the plain page colour with surface-coloured prize card. */
html[data-skin-club] {
  --p-card: var(--ds-surface, #ffffff);
  --p-card-shadow: none;
  --p-title: var(--ds-text, #000000);
  --p-option: var(--ds-surface-2, #eaeaea);
  --p-option-text: var(--ds-text, #000000);
  --p-r-card: var(--ds-radius-card, 14px);
  --p-r-btn: var(--ds-radius, 9px);
}
html[data-skin-tone='dark'] { --p-col-top: var(--ds-bg, #000000); --p-prize-bg: var(--ds-surface, #181818); }
html[data-skin-club] :is(.card, .panel, .panel.ready) { background: var(--p-card); color: var(--p-title); border-radius: var(--p-r-card); box-shadow: none; }
html[data-skin-club] :is(.btn, .btn.claim, .team-pill, .toast, .error) { border-radius: var(--p-r-btn); }
html[data-skin-club] :is(.prize-card, .banner) { border-radius: var(--p-r-card); }
html[data-skin-club] .prize-pic { background: var(--ds-surface-2, #ffffff); color: var(--ds-text, #000000); }
html[data-skin-club] .btn.outline { background: transparent; border: 2px solid var(--p-outline); color: var(--p-outline); }
html[data-skin-club] .option { border: 0; border-radius: var(--p-r-btn); padding: 16px; }
html[data-skin-club] .option[aria-checked="true"] { border: 0; padding: 16px; background: var(--ds-accent-strong, #ff0000); }
html[data-skin-club] .option[aria-checked="true"] .oname { color: var(--ds-on-accent, #ffffff); }
html[data-skin-club] .panel-title { order: -1; margin: -24px -24px 20px; padding: 12px 16px; background: var(--ds-accent-strong, #ff0000); color: var(--ds-on-accent, #ffffff); border-radius: var(--p-r-card) var(--p-r-card) 0 0; font-style: normal; }
@media (orientation: portrait) and (min-width: 700px) { html[data-skin-club] .panel-title { margin: -32px -32px 24px; } }
