:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f6f7f2;
  background: #10120f;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(201, 255, 64, 0.12), transparent 28rem),
    linear-gradient(145deg, #151813, #0c0e0c 65%);
}

main {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.page-header, .section-heading, .room-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-header { margin-bottom: 1.5rem; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 7vw, 4rem); letter-spacing: -0.06em; }
h2 { margin-bottom: 0; font-size: 1.4rem; }

.eyebrow {
  margin-bottom: 0.35rem;
  color: #c9ff40;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.card {
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border: 1px solid #343a30;
  border-radius: 1.25rem;
  background: rgba(27, 30, 25, 0.92);
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.2);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid #3d4339;
  border-radius: 999px;
  color: #bec4b8;
  font-size: 0.82rem;
}

.status span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #ff695f;
  box-shadow: 0 0 0.8rem rgba(255, 105, 95, 0.6);
}

.status.connected span { background: #c9ff40; box-shadow: 0 0 0.8rem rgba(201, 255, 64, 0.65); }
.status.connected { color: #e7ffc0; }

.setup label, .room-code-input {
  display: grid;
  gap: 0.45rem;
  color: #bdc3b7;
  font-size: 0.8rem;
  font-weight: 700;
}

.identity { margin: 0; color: #858c80; font-size: 0.72rem; }
.identity code { color: #aeb5a7; }
.setup > label { margin: 1.4rem 0 1rem; }

input, button {
  min-height: 2.75rem;
  border: 1px solid #454c40;
  border-radius: 0.7rem;
  font: inherit;
}

input {
  width: 100%;
  padding: 0 0.85rem;
  color: #fff;
  outline: none;
  background: #121510;
}

input:focus { border-color: #c9ff40; box-shadow: 0 0 0 3px rgba(201, 255, 64, 0.12); }

button {
  padding: 0 1rem;
  color: #edf0e9;
  cursor: pointer;
  background: #30352d;
}

button:hover:not(:disabled) { border-color: #77816e; transform: translateY(-1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { color: #10130c; border-color: #c9ff40; background: #c9ff40; font-weight: 800; }
button.small { min-height: 2rem; padding: 0 0.7rem; font-size: 0.75rem; }

.room-actions { justify-content: flex-start; align-items: end; }
.room-actions > span { align-self: center; color: #777e72; }
.room-code-input { width: 10rem; }
.room-code-input input { text-transform: uppercase; letter-spacing: 0.12em; }

.error { margin: 1rem 0 0; color: #ff8c84; }

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.75fr);
  gap: 1rem;
  margin: 1rem 0;
}

.room-identity { display: grid; justify-items: end; gap: 0.25rem; color: #92998d; font-size: 0.7rem; }
button.room-code { min-height: auto; padding: 0; color: #c9ff40; border: 0; font-size: 1.55rem; font-weight: 900; letter-spacing: 0.12em; background: transparent; }

.players { display: grid; gap: 0.65rem; margin: 1.5rem 0; }
.player {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  background: #131611;
}

.player .online { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #666d61; }
.player.connected .online { background: #c9ff40; }
.player .name { font-weight: 750; }
.player .you { margin-left: 0.35rem; color: #899181; font-size: 0.68rem; text-transform: uppercase; }
.player .score { color: #c9ff40; font-size: 1.5rem; font-weight: 900; }
.revision, .hint { margin-bottom: 0; color: #858c80; font-size: 0.75rem; }

.controls { display: flex; flex-direction: column; gap: 0.65rem; }
.controls h2 { margin-bottom: 0.75rem; }
.basket-button { min-height: 6.5rem; color: #10130d; border-color: #c9ff40; background: #c9ff40; font-weight: 900; }
.basket-button span { display: block; font-size: 2.2rem; }

.event-log { min-height: 14rem; }
#log { display: grid; gap: 0.4rem; max-height: 22rem; margin: 1rem 0 0; padding: 0; overflow: auto; list-style: none; }
#log li { display: grid; grid-template-columns: 5.2rem 1fr; gap: 0.75rem; padding: 0.5rem 0; border-top: 1px solid #2b3028; color: #c2c7bd; font: 0.76rem ui-monospace, SFMono-Regular, Menlo, monospace; }
#log time { color: #727a6d; }
#log li.error-entry { color: #ff9992; }

@media (max-width: 720px) {
  main { width: min(100% - 1rem, 1080px); padding-top: 1rem; }
  .page-header { align-items: flex-end; }
  .section-heading { align-items: flex-start; }
  .identity { display: none; }
  .room-actions { flex-wrap: wrap; }
  .room-actions > span { display: none; }
  .room-actions > button, .room-code-input { flex: 1 1 9rem; }
  .game-grid { grid-template-columns: 1fr; }
}
