:root {
  --bg: #1a1b26;
  --surface: #24283b;
  --text: #c0caf5;
  --muted: #565f89;
  --accent: #7aa2f7;
  --success: #9ece6a;
  --sold: #f7768e;
  --reserved: #e0af68;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 1rem;
  line-height: 1.5;
}

#app {
  max-width: 640px;
  margin: 0 auto;
}

header {
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
}

#stats-section {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#stats-section .stat {
  flex: 0 0 auto;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--surface);
}

#stats-section .stat.secondary {
  opacity: 0.8;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 600;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

.calendar .day-label {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0.25rem;
}

.calendar .date-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: default;
  background: var(--surface);
  color: var(--muted);
}

.calendar .date-cell.available {
  color: var(--accent);
  cursor: pointer;
}

.calendar .date-cell.available:hover {
  background: #2d3250;
}

.calendar .date-cell.reserved {
  color: var(--reserved);
}

.calendar .date-cell.sold {
  color: var(--sold);
}

.calendar .date-cell.selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.calendar .date-name {
  margin-top: 0.1rem;
  font-size: 0.55rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

#reserve-form label,
#check-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

#reserve-form input[type="text"],
#check-form input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--muted);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  margin-bottom: 1rem;
}

#reserve-form button,
#check-form button {
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

#reserve-form button:hover,
#check-form button:hover {
  filter: brightness(1.1);
}

#reserve-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ref-label {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.ref-code {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin: 0 0 1rem;
  color: var(--accent);
}

.timer {
  margin: 0 0 1.5rem;
}

.bank-details {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.bank-details h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.bank-details dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1.5rem;
}

.bank-details dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.bank-details dd {
  margin: 0;
  font-family: ui-monospace, monospace;
}

.ref-reminder {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

#back-link {
  color: var(--accent);
}

#check-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--surface);
}

#check-result {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 6px;
  font-size: 0.95rem;
}

#check-result.error {
  color: var(--sold);
}

#check-result.sold {
  color: var(--success);
}

#check-result.reserved {
  color: var(--reserved);
}

.error-msg {
  color: var(--sold);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
