:root {
  --bg: #0f1419;
  --surface: #1a2230;
  --border: #2d3a4d;
  --text: #e8edf4;
  --muted: #8b9bb0;
  --accent: #3ddc97;
  --accent-dim: #2a9d6c;
  --danger: #f07178;
  --wheel-shadow: rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a4a 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem;
}

.header h1 {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.02em;
}

.sub {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.main {
  display: grid;
  gap: 2.5rem;
  margin-top: 2rem;
}

@media (min-width: 900px) {
  .main {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }

  .wheel-section {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .form-section {
    grid-column: 2;
    grid-row: 1;
  }

  .table-section {
    grid-column: 1 / -1;
  }
}

.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.wheel-wrap {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1;
  filter: drop-shadow(0 12px 32px var(--wheel-shadow));
}

#wheel {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid var(--accent);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  z-index: 2;
}

.wheel-actions {
  text-align: center;
  max-width: 420px;
}

.hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.spin-result {
  min-height: 1.5em;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

.form-section,
.table-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
}

.form-section h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.reserve-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field span {
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

input:focus,
select:focus {
  outline: 2px solid var(--accent-dim);
  outline-offset: 2px;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.btn.primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #0a0f14;
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(240, 113, 120, 0.45);
}

.btn.danger:hover {
  background: rgba(240, 113, 120, 0.12);
}

.table-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.table-section-head h2 {
  margin: 0;
}

.btn.ghost {
  background: transparent;
  color: var(--danger);
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
}

.btn.ghost:hover {
  text-decoration: underline;
}

.message {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

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

.message.ok {
  color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

td.mono {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-row td {
  color: var(--muted);
  font-style: italic;
  border: none;
}
