:root { color-scheme: dark; font-family: system-ui, sans-serif; background: #111; color: #f7f7f7; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
.home { display: grid; min-height: 100dvh; place-items: center; padding: 1.25rem; }
.entry-wrap { width: min(100%, 34rem); }
h1 { margin: 0; font-size: clamp(2.5rem, 12vw, 5rem); }
.subtitle { color: #aaa; margin: .25rem 0 2.5rem; }
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem .75rem; }
label { font-size: .85rem; color: #bbb; }
input[type=text] { width: 100%; min-width: 0; border: 1px solid #555; border-radius: .6rem; padding: .8rem; background: #1c1c1c; color: white; outline: none; }
input:focus { border-color: #ffd21c; box-shadow: 0 0 0 2px #ffd21c33; }
.reveal { visibility: hidden; opacity: 0; transform: translateY(-.3rem); transition: opacity .2s, transform .2s; }
#entry.started .reveal { visibility: visible; opacity: 1; transform: none; }
#room-actions { margin-top: .75rem; }
.room-actions { display: grid; grid-template-columns: 1fr 1fr; }
.room-actions button { border: 0; min-height: 3.2rem; padding: .8rem; border-radius: .65rem; font-weight: 750; transition: opacity .25s, transform .25s; }
.room-actions .create { background: #ffd21c; color: #191500; }
.room-actions .join { background: #438cff; }
.room-actions.creating .join, .room-actions.joining .create { opacity: 0; pointer-events: none; transform: scaleX(0); }
.room-actions.reserved .create, .room-actions.reserved .join { opacity: 0; pointer-events: none; }
.room-actions.creating .create { grid-column: 1 / 3; }
.room-actions.joining .join { grid-column: 1 / 3; grid-row: 1; }
.availability { color: #999; display: block; margin-top: .45rem; }
.room { height: 100dvh; overflow: hidden; }
.room-layout { height: 100%; display: grid; grid-template-rows: 50% 10% 40%; }
.scoreboard { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: env(safe-area-inset-top) .35rem 0; }
.score-row { display: grid; grid-template-columns: 2.2rem minmax(2.8rem, 1fr) 3.2rem 4.2rem 2.3rem; align-items: center; min-width: 0; border-bottom: 1px solid #2b2b2b; min-height: 2.65rem; gap: .15rem; text-align: center; font-variant-numeric: tabular-nums; }
.host .score-row { grid-template-columns: 2.2rem minmax(2.8rem, 1fr) 3.2rem 4.2rem 2.3rem 2rem 2rem; }
.score-head { position: sticky; top: 0; background: #111; z-index: 1; color: #aaa; font-size: .72rem; min-height: 2rem; }
.score-row > * { min-width: 0; white-space: nowrap; }
.player-name { text-align: left; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.score-row button { border: 1px solid transparent; border-radius: .35rem; background: #333; height: 1.8rem; transition: background-color .15s, border-color .15s, transform .15s; }
.score-row button:hover { background: #4a4a4a; border-color: #777; }
.score-row button:focus-visible { outline: 2px solid #ffd21c; outline-offset: 2px; }
.score-row button:active { transform: scale(.9); }
.player-row { will-change: transform; }
.offline { opacity: .48; }
.host-only { display: none; }
.host-only.visible { display: block; }
.room-bar { position: relative; display: grid; grid-template-columns: 3.2rem 1fr 3.2rem; align-items: center; text-align: center; border-block: 1px solid #333; }
.room-bar > #reset { grid-column: 1; }
.room-bar > strong { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-bar > #settings-toggle { grid-column: 3; }
.icon-button { border: 0; background: transparent; font-size: 1.5rem; height: 100%; }
.settings { position: fixed; inset: 60dvh .35rem auto auto; width: min(19rem, calc(100vw - .7rem)); margin: .35rem 0 0; padding: 1rem; border: 1px solid #444; border-radius: .7rem; background: #252525; color: #f7f7f7; box-shadow: 0 .5rem 2rem #0009; text-align: left; }
.settings::backdrop { background: transparent; }
.settings > * { display: block; margin: .6rem 0; }
.settings > .host-only { display: none; }
.host .settings > .host-only { display: block; }
.settings select { width: 100%; margin-top: .25rem; padding: .45rem; border: 1px solid #555; border-radius: .4rem; background: #181818; color: white; }
.settings button { border: 1px solid #555; background: #333; border-radius: .4rem; padding: .5rem; }
.settings a { color: #ff8d8d; }
.buzzer { border: 0; border-radius: 0; background: #d42626; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: clamp(2.6rem, 15vw, 6rem); font-weight: 850; text-transform: none; touch-action: manipulation; user-select: none; padding-bottom: env(safe-area-inset-bottom); }
.buzzer.first { background: #159447; }
.buzzer.later { background: #d97913; }
.buzzer:disabled { cursor: default; filter: brightness(.72); }
.buzzer small { display: flex; flex-direction: column; margin-top: .4rem; font-size: .9rem; font-weight: 500; }
.not-found { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; text-align: center; overflow: hidden; }
.not-found main { width: min(100%, 32rem); }
.not-found h1 { font-size: clamp(2rem, 10vw, 4rem); }
.not-found p { color: #bbb; }
.not-found a { display: inline-block; margin-top: .75rem; color: #ffd21c; }
.returning { font-size: .85rem; }
.bee-crash { position: relative; height: 7rem; display: flex; justify-content: center; align-items: center; font-size: 4rem; }
.lost-bee { position: absolute; margin-left: -7rem; animation: bee-hit 1.15s ease-in-out infinite; transform-origin: center; }
.brick-wall { position: absolute; margin-left: 5rem; filter: saturate(.8); }
@keyframes bee-hit {
  0% { transform: translateX(-8rem) rotate(-8deg); }
  58% { transform: translateX(3.7rem) rotate(4deg); }
  68% { transform: translateX(3rem) rotate(-25deg) scale(.9); }
  100% { transform: translateX(-8rem) rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) { .lost-bee { animation: none; transform: translateX(3rem) rotate(-20deg); } }
@media (max-width: 370px) { .score-row { grid-template-columns: 1.8rem minmax(1.5rem, 1fr) 2.7rem 3.7rem 2rem; font-size: .84rem; } .host .score-row { grid-template-columns: 1.8rem minmax(1.5rem, 1fr) 2.7rem 3.7rem 2rem 1.8rem 1.8rem; } }
