:root { --u: 1vh; color-scheme: dark; }
@supports (width: min(1px, 2px)) { :root { --u: min(1vh, 0.5625vw); } }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #101713; background-image: radial-gradient(ellipse at top, #1d3124 0%, #101713 65%); color: #f4f4f4; font-family: "DejaVu Sans", "Segoe UI", Arial, Helvetica, sans-serif; }
.app { position: relative; display: grid; align-content: center; min-height: 100vh; padding: calc(var(--u) * 2); }
.theme-christmas .app { box-shadow: inset 0 calc(var(--u) * .6) #853d43; }
.theme-christmas .app::before { content: ""; position: absolute; top: calc(var(--u) * .5); left: 0; right: 0; height: calc(var(--u) * 3); pointer-events: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 30'><path d='M0 2 Q40 17 80 2 Q120 17 160 2 M20 8v5 M60 8v5 M100 8v5 M140 8v5' fill='none' stroke='%23748e68' stroke-width='2'/><ellipse cx='20' cy='18' rx='4' ry='6' fill='%23e4b85d'/><ellipse cx='60' cy='18' rx='4' ry='6' fill='%23cf6666'/><ellipse cx='100' cy='18' rx='4' ry='6' fill='%23aecba3'/><ellipse cx='140' cy='18' rx='4' ry='6' fill='%23f2d394'/></svg>"); background-repeat: repeat-x; background-size: calc(var(--u) * 19) 100%; }
button, input, select { font: inherit; }
button { cursor: pointer; color: #fff; background: #263b30; border: calc(var(--u) * .3) solid #587365; border-radius: calc(var(--u) * 1); padding: calc(var(--u) * 1.3) calc(var(--u) * 1.5); font-weight: bold; }
button.primary { background: #1f7a2e; border-color: #3bd05a; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #ffd84a; outline-offset: 3px; }
header { position: relative; display: flex; align-items: center; justify-content: center; padding: calc(3 * var(--u)) calc(2 * var(--u)) calc(2 * var(--u)); }
.brand { display: flex; align-items: center; justify-content: center; text-align: center; }
.brand-logo { height: calc(var(--u) * 15); width: auto; margin-right: calc(var(--u) * 2); }
h1, p { margin: 0; }
.brand-club { font-size: calc(var(--u) * 4.5); font-weight: bold; color: #f4f4f4; }
.snowflake { display: none; color: #a9c5b1; font-size: .5em; vertical-align: middle; margin: 0 .7em; }
.theme-christmas .snowflake { display: inline; }
.brand-event { font-size: calc(var(--u) * 6.3); font-weight: bold; letter-spacing: -.02em; color: #ffd84a; }
.settings-button { position: absolute; right: calc(2 * var(--u)); font-size: calc(2.8 * var(--u)); }
.display { text-align: center; width: 100%; max-width: calc(115 * var(--u)); margin: 0 auto; padding: calc(var(--u) * 2); background: #192821; border: calc(var(--u) * .4) solid #486450; border-radius: calc(var(--u) * 1); }
.phase { font-size: calc(4 * var(--u)); font-weight: bold; }
.label { display: block; font-size: calc(2.7 * var(--u)); color: #d3ddd5; }
.phase-time { font-size: calc(19 * var(--u)); font-weight: bold; line-height: 1.05; font-family: "DejaVu Sans Mono", Consolas, "Courier New", monospace; font-variant-numeric: tabular-nums; }
.details { display: flex; justify-content: center; gap: calc(9 * var(--u)); margin: calc(2 * var(--u)) 0; }
.details strong { display: block; font-size: calc(5.5 * var(--u)); font-variant-numeric: tabular-nums; }
.status { min-height: 1.4em; font-size: calc(2.7 * var(--u)); color: #ffd84a; }
.controls { display: flex; justify-content: center; gap: calc(2 * var(--u)); margin-top: calc(1.5 * var(--u)); }
.controls button { min-width: calc(19 * var(--u)); font-size: calc(3.5 * var(--u)); }
#flash { position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; background: rgba(255, 216, 74, .94); color: #101713; font-size: calc(18 * var(--u)); font-weight: bold; pointer-events: none; opacity: 0; transition: opacity .12s; }
#flash.active { opacity: 1; }
[hidden] { display: none !important; }
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .94); display: grid; place-items: center; padding: 2vh 2vw; }
.modal { width: min(900px, 96vw); max-height: 94vh; overflow-y: auto; background: #1b2821; border: calc(var(--u) * .4) solid #49634e; border-radius: calc(var(--u) * 1); padding: clamp(18px, 3vh, 36px); font-size: clamp(16px, 2.4vh, 26px); }
.modal h2 { margin: 0 0 .4em; color: #ffd84a; }
.modal p { margin: .5em 0; }
.phase-row { display: flex; gap: .6em; align-items: end; margin: .7em 0; }
.phase-row label { flex: 1; min-width: 0; }
.phase-row input { display: block; width: 100%; }
.modal input[type=number], .modal select { background: #000; color: #fff; border: 1px solid #5b6375; border-radius: .3em; padding: .35em; }
.sound-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 1em; margin-top: 1em; }
.error { color: #ffb1a6; min-height: 1.2em; }
.note { color: #d3ddd5; font-size: .85em; }
.modal-actions { display: flex; gap: .6em; }
@media (max-width: 600px) {
  .phase-row { flex-wrap: wrap; }
  .phase-row label { min-width: 35%; }
}
