body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0%, #36466b, #10131e 70%);
  color: #fff;
  font-family: system-ui, Arial;
  display: grid;
  place-items: center;
  min-height: 100vh;
}
main {
  width: min(100%, 1000px);
}
h1 {
  text-align: center;
  font-size: clamp(20px, 4vw, 34px);
  margin: 12px;
}
#hud {
  display: flex;
  justify-content: space-around;
  padding: 10px;
  background: #252844;
  border: 2px solid #b98a44;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  font-weight: 700;
}
canvas {
  display: block;
  width: 100%;
  background: #443d52;
  box-shadow: 0 12px 45px #0008;
  cursor: crosshair;
  touch-action: none;
}
#foot {
  text-align: center;
  background: #252844;
  padding: 12px;
  border-radius: 0 0 12px 12px;
}
button {
  background: linear-gradient(#ffe9a0, #dba73d);
  border: 0;
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 800;
  cursor: pointer;
}
small {
  color: #c8c9d7;
}
#stage {
  position: relative;
  overflow: hidden;
}
#eventbox {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 50%;
  transform: translate(-50%, -140%) scale(0.9);
  width: min(78%, 620px);
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
  text-align: center;
  padding: 12px 20px;
  border: 3px solid #ffd46b;
  border-radius: 14px;
  background: linear-gradient(145deg, #43244d, #7b2840);
  box-shadow:
    0 8px 25px #000a,
    0 0 0 3px #442b39;
  transition:
    transform 0.18s ease-out,
    opacity 0.18s;
  color: #fff;
}
#eventbox.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
#eventbox.jackpot {
  background: linear-gradient(135deg, #741e2b, #a82f24);
  border-color: #ffe66b;
  animation: jackpotPulse 0.45s ease-in-out infinite alternate;
}
#eventtitle {
  font-size: clamp(15px, 3vw, 26px);
  font-weight: 1000;
  letter-spacing: 0.6px;
  text-shadow: 2px 2px #381d28;
}
#eventdetail {
  font-size: clamp(11px, 1.9vw, 17px);
  font-weight: 700;
  margin-top: 4px;
  color: #ffedb1;
}
@keyframes jackpotPulse {
  to {
    box-shadow:
      0 8px 25px #000a,
      0 0 23px #ffc33b;
  }
}
#version {
  font-size: 12px;
  opacity: 0.75;
  white-space: nowrap;
}
@media (max-width: 600px) {
  #hud {
    padding: 7px;
    font-size: 14px;
  }
  #eventbox {
    top: 5px;
    padding: 7px 9px;
    width: 88%;
  }
  #foot {
    padding: 9px;
  }
  h1 {
    font-size: 20px;
  }
}
#online {
  margin: 16px 0;
  padding: 16px;
  background: #252844;
  border: 1px solid #b98a44;
  border-radius: 12px;
}
#online form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#online input {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #a6a7b5;
  min-width: 120px;
  flex: 1;
}
#online p {
  color: #e1dfd8;
}
#online button {
  margin: 4px;
}

#authProviders {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.oauth-button {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 8px;
  background: #fff;
  color: #111;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid #bbb;
}
.oauth-button:hover {
  background: #e9e9e9;
}
.oauth-button[hidden] {
  display: none;
}

/* Start- und Zwischenscreen: zwei Spalten und eine gemeinsame Buttonleiste. */
.menu-screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  padding: clamp(10px, 2vw, 22px);
  box-sizing: border-box;
  background: rgba(13, 17, 32, 0.94);
  gap: 12px;
}
.menu-screen[hidden] {
  display: none;
}
.menu-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.menu-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid #b98a44;
  border-radius: 13px;
  padding: clamp(12px, 1.8vw, 22px);
  background: linear-gradient(155deg, #292f50, #1b2036);
  box-sizing: border-box;
}
.menu-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(19px, 2.5vw, 28px);
}
.menu-panel h3 {
  margin: 14px 0 5px;
}
.menu-panel p {
  margin: 7px 0;
  line-height: 1.4;
  color: #e1dfd8;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: #ffdf7e !important;
  font-weight: 800;
}
.round-summary {
  font-size: clamp(13px, 1.7vw, 17px);
}
.point-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
}
.point-rules span {
  background: #11182e;
  border-radius: 7px;
  padding: 8px;
  font-size: clamp(11px, 1.3vw, 14px);
}
.point-rules b {
  color: #ffdf7e;
  white-space: nowrap;
}
.menu-status {
  color: #ffdf7e !important;
  font-size: 13px;
}
.leaderboard-note {
  font-size: 12px;
}
#leaderboard {
  margin: 8px 0;
  padding-left: 30px;
  max-height: clamp(65px, 15vh, 140px);
  overflow: auto;
}
#leaderboard li {
  padding: 4px 0;
  border-bottom: 1px solid #ffffff20;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.profile-area {
  border-top: 1px solid #ffffff30;
  margin-top: 10px;
  padding-top: 10px;
}
.profile-area label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.name-row {
  display: flex;
  gap: 7px;
}
.name-row input {
  min-width: 0;
  flex: 1;
  background: #fff;
  color: #111;
  border: 1px solid #aaa;
  border-radius: 7px;
  padding: 8px;
  font: inherit;
}
.name-row button {
  padding: 8px 12px;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#authStatus {
  font-size: 12px;
}
#authProviders {
  margin: 6px 0 0;
  gap: 7px;
}
.oauth-button {
  padding: 8px 12px;
  font-size: 12px;
}
.menu-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 0 0;
  border-top: 1px solid #ffffff35;
}
.menu-actions button {
  min-width: 145px;
}
@media (max-width: 650px) {
  .menu-screen {
    position: relative;
    min-height: 540px;
    padding: 10px;
  }
  .menu-columns {
    grid-template-columns: 1fr;
  }
  .menu-panel {
    overflow: visible;
  }
  #leaderboard {
    max-height: 110px;
  }
  .menu-actions button {
    flex: 1;
    min-width: 120px;
  }
}
@media (max-width: 650px) {
  #stage:has(.menu-screen:not([hidden])) canvas {
    display: none;
  }
  #stage:has(.menu-screen:not([hidden])) {
    overflow: visible;
  }
}
