:root {
  --bg: #081826;
  --panel: #11283a;
  --panel-soft: #15334a;
  --line: #264d69;
  --text: #eef7ff;
  --muted: #b8c9d8;
  --accent: #56b8ff;
  --danger: #ff6d6d;
  --success: #6ce6a0;
  --gold: #ffd56a;
  --reef: #8ed4ff;
  --offshore: #ff9d7a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #07111a 0%, #0b2031 100%);
  color: var(--text);
}

h1,h2,h3,p { margin-top: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

.shell,
.game-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1.5rem;
  align-items: start;
  min-height: calc(100vh - 2.5rem);
}

.panel,
.hero-card,
.modal-card {
  background: rgba(17, 40, 58, 0.95);
  border: 1px solid rgba(86, 184, 255, 0.18);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
}

.hero-card,
.panel,
.modal-card { padding: 1.25rem; }
.panel-stack { display: grid; gap: 1rem; }
.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.lead, .muted { color: var(--muted); }
.feature-list { padding-left: 1.2rem; line-height: 1.8; }

label {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  color: var(--muted);
}
input, button {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.8rem 0.95rem;
  font-size: 1rem;
}
input { background: #092033; color: var(--text); }
button {
  background: linear-gradient(180deg, var(--accent), #2899ea);
  color: #03121d;
  font-weight: 700;
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
.secondary-button {
  background: transparent;
  color: var(--text);
  border-color: var(--accent);
}
.danger-button {
  background: linear-gradient(180deg, #ff9b9b, #ff6d6d);
}
.form-message { min-height: 1.3rem; color: var(--gold); }

.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.top-stats { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.stat-pill {
  background: rgba(9, 32, 51, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1rem;
}
.grid-layout {
 /* display: grid;*/
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 1rem;
}
.left-panel,.right-panel,.main-panel,.bottom-panel { min-width: 0; }
.key-value,.board-row,.tracker-row,.log-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.session-banner,
.status-strip {
  background: rgba(9,32,51,0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}
.dice-zone {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.dice {
  width: 160px;
  height: 160px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #dbefff);
  color: #03253b;
  display: grid;
  place-items: center;
  font-size: 5rem;
  margin: 0 auto;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.inline-summary {
  display: flex;
  gap: 1rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.compact-row { margin-bottom: 0.85rem; }
.validation-note {
  min-height: 1.3rem;
  margin-bottom: 1rem;
  color: var(--muted);
}
.validation-note.valid { color: var(--success); }
.validation-note.invalid { color: var(--danger); }
.validation-note.warning { color: var(--gold); }
.input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px rgba(255,109,109,0.4);
}
.results-table table {
  width: 100%;
  border-collapse: collapse;
}
.results-table th,
.results-table td {
  padding: 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.lost-value {
  color: var(--danger);
  text-decoration: line-through;
  font-weight: 700;
}
.ready-count { color: var(--gold); margin-bottom: 0.8rem; }
.is-ready strong { color: var(--success); }
.is-waiting strong { color: var(--gold); }
.current-player { background: rgba(86,184,255,0.08); border-radius: 10px; padding-inline: 0.5rem; }
.log-list { display: grid; gap: 0.25rem; }
.log-item time { color: var(--muted); font-size: 0.85rem; }

.mini-chart-card { text-align: center; }
.allocation-chart {
  min-height: 160px;
  display: grid;
  place-items: center;
}
.chart-placeholder { color: var(--muted); }
.chart-svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.chart-segment { stroke-linecap: butt; }
.inshore-stroke { stroke: var(--success); }
.reef-stroke { stroke: var(--reef); }
.offshore-stroke { stroke: var(--offshore); }
.chart-label,
.chart-sub {
  fill: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  transform: rotate(90deg);
  transform-origin: center;
}
.chart-label { font-size: 1rem; font-weight: 700; }
.chart-sub { font-size: 0.5rem; }
.chart-legend {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  text-align: left;
}
.legend-dot {
  width: 0.8rem;
  height: 0.8rem;
  display: inline-block;
  border-radius: 999px;
  margin-right: 0.45rem;
}
.inshore-dot { background: var(--success); }
.reef-dot { background: var(--reef); }
.offshore-dot { background: var(--offshore); }
.host-panel.hidden { display: none; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal.hidden { display: none; }
.modal-card { max-width: 520px; text-align: center; }
.bad-word-list { columns: 3; }
.inline-admin-form { display: flex; gap: 0.75rem; margin-bottom: 1rem; }

@media (max-width: 1100px) {
  .grid-layout,
  .hero-card,
  .dice-zone,
  .form-grid { grid-template-columns: 1fr; }
}
select {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.8rem 0.95rem;
  font-size: 1rem;
  background: #092033;
  color: var(--text);
}
.hidden { display: none !important; }
.winner-summary {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9,32,51,0.75);
  margin-bottom: 1rem;
}
.admin-header-row {
  display:flex; justify-content:space-between; align-items:center; gap:1rem;
}
.narrow-panel { max-width: 520px; margin: 8vh auto 0; }
.panel-stack-form { display:grid; gap:0.75rem; }
.allocation-chart {
  min-height: 40px;
  display:flex;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}
.chart-bar { min-height: 40px; }
.chart-bar.inshore { background: var(--success); }
.chart-bar.reef { background: var(--reef); }
.chart-bar.offshore { background: var(--offshore); }


.hidden { display: none !important; }
a { color: var(--accent); }
.panel-plain { background: rgba(9,32,51,0.35); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.top-gap { margin-top: 1rem; }
.table-scroll { overflow-x: auto; }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th, .mini-table td { padding: 0.65rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; }
.compact-table th, .compact-table td { padding: 0.5rem; font-size: 0.92rem; }
.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.primary-button { background: linear-gradient(180deg, var(--accent), #2899ea); }
.lobby-panel { margin-bottom: 1rem; }
.winner-summary { background: rgba(9,32,51,0.55); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; }
.final-standings-list { display: grid; gap: 0.45rem; }
.final-standing-row { display:flex; justify-content:space-between; gap:1rem; padding:0.55rem 0.7rem; border-bottom:1px solid var(--line); }
.narrow-panel { max-width: 460px; margin: 8vh auto; }
.admin-panel { max-width: 920px; margin: 4vh auto; }
.admin-header-row { display:flex; justify-content:space-between; gap:1rem; align-items:center; }
.inline-admin-form { display:flex; gap:0.75rem; margin-bottom:1rem; }
.bad-word-list { list-style:none; padding:0; margin:0; display:grid; gap:0.35rem; }
.bad-word-list li { background: rgba(9,32,51,0.55); border:1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.85rem; }
.panel-stack-form { display:grid; gap:0.8rem; }
.hero-panel { min-height: 100%; }
.lobby-body .shell { max-width: 1200px; }
@media (max-width: 1100px) {
  .grid-layout { grid-template-columns: 1fr; }
  .left-panel, .right-panel { order: 2; }
  .main-panel { order: 1; }
  .hero-card { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .form-grid, .three-up { grid-template-columns: 1fr; }
  .top-bar { align-items: flex-start; flex-direction: column; }
  .dice-zone { grid-template-columns: 1fr; text-align: center; }
}
