:root {
  --bg-top: #03203f;
  --bg-bottom: #1f8ea9;
  --panel: rgba(2, 21, 43, 0.82);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-main: #f3f8ff;
  --text-muted: rgba(243, 248, 255, 0.7);
  --accent: #ffd166;
  --accent-strong: #ff9f1c;
  --danger: #ff6b6b;
  --success: #06d6a0;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 32%),
    linear-gradient(180deg, var(--bg-top) 0%, #09355c 30%, var(--bg-bottom) 100%);
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chrome-header,
.chrome-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
}

.chrome-header h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: 54px;
  letter-spacing: 0.08em;
  line-height: 1;
}

.chrome-header p,
.chrome-footer span,
.helper-text,
.panel-card p,
.panel-card span,
.field-label {
  color: var(--text-muted);
}

.chrome-header p {
  margin: 2px 0 0;
}

.pill {
  min-width: 140px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(2, 21, 43, 0.55);
  backdrop-filter: blur(12px);
}

.pill strong {
  font-size: 28px;
  color: var(--accent);
}

.main-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 16px;
  min-height: 0;
}

.side-panel,
.game-stage {
  min-height: 0;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-card,
.canvas-frame,
.overlay-card {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.panel-card {
  border-radius: 26px;
  padding: 18px;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.danger {
  color: var(--danger);
}

.stat-card strong,
.hint-card strong,
.panel-title-row strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.stat-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-grid div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.stat-grid strong {
  margin-top: 8px;
  font-size: 32px;
  color: var(--accent);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.game-stage {
  display: flex;
}

.canvas-frame {
  position: relative;
  width: 100%;
  border-radius: 32px;
  overflow: hidden;
  min-height: 520px;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 14, 28, 0.34);
}

.overlay-card {
  width: min(100%, 440px);
  padding: 28px;
  border-radius: 28px;
}

.overlay-card.compact {
  width: min(100%, 320px);
  text-align: center;
}

.overlay-card h2 {
  margin: 8px 0 18px;
  font-size: 34px;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: rgba(255, 209, 102, 0.75);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.14);
}

.color-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.color-option {
  height: 42px;
  border-radius: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}

.color-option.selected {
  border-color: rgba(255, 255, 255, 0.92);
  transform: translateY(-2px);
}

.primary-button {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 800;
  color: #06243f;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  cursor: pointer;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.roster-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.roster-item .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.roster-item strong {
  font-size: 14px;
}

.roster-item span {
  font-size: 12px;
}

.hidden {
  display: none;
}

@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .side-panel .panel-card {
    flex: 1 1 260px;
  }

  .canvas-frame {
    min-height: 60vh;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px;
  }

  .chrome-header,
  .chrome-footer {
    padding: 6px 4px;
    flex-direction: column;
    align-items: flex-start;
  }

  .chrome-header h1 {
    font-size: 44px;
  }

  .panel-card,
  .overlay-card {
    border-radius: 22px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}