:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07100d;
  color: #ecfff7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 20%, rgba(63, 255, 174, 0.16), transparent 30%),
    radial-gradient(circle at 80% 75%, rgba(255, 74, 74, 0.18), transparent 32%),
    #07100d;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 0.8rem 1rem;
  color: #082016;
  background: #92ffd0;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

input {
  border: 1px solid rgba(236, 255, 247, 0.2);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  color: #ecfff7;
  background: rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

.panel {
  width: min(620px, calc(100vw - 32px));
  margin: 9vh auto;
  padding: 2rem;
  border: 1px solid rgba(236, 255, 247, 0.16);
  border-radius: 28px;
  background: rgba(6, 18, 14, 0.78);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: #92ffd0;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.92;
}

.summary {
  color: rgba(236, 255, 247, 0.78);
  font-size: 1.05rem;
  line-height: 1.6;
}

.team-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.6rem 0;
}

.team-picker label {
  display: block;
}

.team-picker input {
  position: absolute;
  opacity: 0;
}

.team-picker span {
  display: block;
  padding: 1rem;
  border: 1px solid rgba(236, 255, 247, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
  font-weight: 900;
  cursor: pointer;
}

.team-picker input:checked + span {
  color: #04110c;
  background: #92ffd0;
}

.lobby-actions {
  display: grid;
  gap: 0.75rem;
}

.primary {
  background: linear-gradient(135deg, #92ffd0, #eaff8f);
}

.join-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.error {
  min-height: 1.2rem;
  color: #ff9c9c;
}

.tips {
  color: rgba(236, 255, 247, 0.65);
  font-size: 0.95rem;
}

.game,
#gameCanvas {
  width: 100vw;
  height: 100vh;
}

#gameCanvas {
  display: block;
  background: #102118;
}

.hud {
  position: fixed;
  z-index: 2;
  min-width: 230px;
  padding: 1rem;
  border: 1px solid rgba(236, 255, 247, 0.14);
  border-radius: 18px;
  background: rgba(5, 14, 11, 0.72);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
}

.top-left {
  top: 1rem;
  left: 1rem;
}

.top-right {
  top: 1rem;
  right: 1rem;
  display: grid;
  gap: 0.55rem;
}

.top-center {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
}

.combat-status {
  min-width: 280px;
}

.command-panel {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.35rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(236, 255, 247, 0.14);
}

.bottom-left {
  bottom: 1rem;
  left: 1rem;
  max-width: 440px;
}

.room-line {
  color: rgba(236, 255, 247, 0.72);
}

.meter-label {
  margin-top: 0.8rem;
  color: rgba(236, 255, 247, 0.7);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.meter-value {
  margin-top: 0.25rem;
  color: rgba(236, 255, 247, 0.68);
  font-size: 0.82rem;
  font-weight: 800;
}

.meter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4fffb1, #eaff8f);
}

.meter.danger span {
  background: linear-gradient(90deg, #ff5757, #ffb35c);
}

.meter.wall span {
  background: linear-gradient(90deg, #8fb7ff, #c7f0ff);
}

.meter.wall.danger span {
  background: linear-gradient(90deg, #ff8f8f, #ffd08f);
}

.meter.player span {
  background: linear-gradient(90deg, #69f6ff, #7dffcf);
}

.meter.enemy span {
  background: linear-gradient(90deg, #ff4f59, #ff9c9c);
}

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at center, rgba(234, 255, 143, 0.12), transparent 34%),
    rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.result-card {
  width: min(520px, calc(100vw - 32px));
  padding: 2rem;
  border: 1px solid rgba(236, 255, 247, 0.18);
  border-radius: 28px;
  background: rgba(6, 18, 14, 0.9);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.result-card h2 {
  margin: 0.2rem 0 0.75rem;
  color: #eaff8f;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 0.95;
}

.result-card p:not(.eyebrow) {
  color: rgba(236, 255, 247, 0.78);
  line-height: 1.55;
}

#messageLog {
  margin: 0.75rem 0 0;
  padding-left: 1rem;
  color: rgba(236, 255, 247, 0.72);
  font-size: 0.88rem;
}

/* Class Picker Styles */
.class-picker-container {
  margin: 1.4rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.picker-label {
  margin: 0;
  color: rgba(236, 255, 247, 0.6);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.class-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.class-picker label {
  display: block;
}

.class-picker input {
  position: absolute;
  opacity: 0;
}

.class-picker span {
  display: block;
  padding: 0.75rem 0.5rem;
  border: 1px solid rgba(236, 255, 247, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.class-picker label:hover span {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(236, 255, 247, 0.25);
  transform: translateY(-1px);
}

.class-picker input:checked + span {
  color: #04110c;
  background: #92ffd0;
  border-color: #92ffd0;
  box-shadow: 0 0 16px rgba(146, 255, 208, 0.4);
}

.class-description {
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(236, 255, 247, 0.1);
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(236, 255, 247, 0.75);
  min-height: 4.2rem;
}

.player-class-line {
  color: #eaff8f;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.meter.ability-meter span {
  background: linear-gradient(90deg, #ffd95c, #ff9f43);
}
