:root {
  --bg-a: #10203a;
  --bg-b: #1a4d78;
  --line: #e9f2ff;
  --field: #2f9e44;
  --field-dark: #2b8a3e;
  --blue: #3b82f6;
  --orange: #f08c00;
  --text: #f8fbff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 10%, var(--bg-b), var(--bg-a) 70%);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.app {
  position: relative;
  width: min(100%, 1040px);
  padding: 16px;
}

.start-menu,
.pause-menu {
  position: absolute;
  inset: 16px;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(8, 20, 39, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(4px);
}

.pause-menu {
  z-index: 11;
}

.menu-card {
  width: min(100%, 440px);
  padding: 28px;
  border-radius: 12px;
  background: rgba(20, 55, 92, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.26);
  text-align: center;
}

.menu-card h1,
.menu-card h2 {
  margin: 0;
}

.menu-card h1 {
  font-size: 34px;
}

.menu-card p {
  margin: 8px 0 20px;
  opacity: 0.9;
}

.menu-card input {
  width: 100%;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
}

.menu-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.menu-wrap {
  flex-wrap: wrap;
}

.menu-actions button,
.room-controls input,
.room-controls button {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
}

.menu-actions button,
.room-controls button {
  cursor: pointer;
  font-weight: 700;
}

.menu-actions button:hover,
.room-controls button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.room-controls {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-controls input {
  background: rgba(0, 0, 0, 0.2);
}

.menu-status {
  margin-top: 14px;
  font-weight: 700;
}

.debug-panel {
  margin-top: 14px;
  text-align: left;
}

.debug-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.debug-log {
  max-height: 180px;
  overflow: auto;
  margin: 10px 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 10px;
}

.title {
  letter-spacing: 0.8px;
}

.team-a {
  color: #a5c8ff;
}

.team-b {
  color: #ffd8a8;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 12px;
}

.controls p {
  margin: 0;
}

kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 2px solid rgba(233, 242, 255, 0.35);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
  display: block;
}

.message {
  margin-top: 10px;
  min-height: 24px;
  font-weight: 700;
}

@media (max-width: 800px) {
  .controls {
    flex-direction: column;
    gap: 6px;
  }

  .hud {
    font-size: 15px;
  }

  .menu-actions {
    flex-direction: column;
  }
}
