@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #ffffff;
  --surface: #f6f8fc;
  --surface-2: #eef1f7;
  --card: #ffffff;
  --line: #e1e6ef;
  --text: #12161f;
  --text-dim: #667085;
  --blue: #2f5ff0;
  --blue-strong: #1c3fc7;
  --blue-dim: #2f5ff014;
  --blue-glow: #2f5ff03d;
  --red: #e5384f;
  --red-strong: #c31f3c;
  --red-dim: #e5384f14;
  --red-glow: #e5384f3d;
  --radius: 14px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow-sm: 0 1px 2px #12161f0d, 0 1px 1px #12161f08;
  --shadow-md: 0 12px 28px -16px #12161f26;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--blue); }
button { font-family: var(--font-body); cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Sync status banner ---------- */
.sync-banner {
  display: none;
  background: var(--red-dim);
  color: var(--red-strong);
  border-bottom: 1px solid var(--red);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: center;
  padding: 9px 16px;
}
.sync-banner a { color: var(--red-strong); font-weight: 700; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #ffffffe6;
  backdrop-filter: blur(10px);
  z-index: 40;
}

.admin-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s;
}
.admin-btn:hover { border-color: var(--red); color: var(--red-strong); }

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--text);
}
.brand span {
  display: block;
  font-size: 10px;
  color: var(--blue);
  letter-spacing: 0.35em;
  font-weight: 600;
}

.hours-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.hours-pill b { color: var(--blue); }

/* ---------- Booking zone (game selection + booking flow — sits at the top) ---------- */
.booking-zone {
  max-width: 1120px;
  margin: 32px auto 0;
  padding: 0 16px;
}
.booking-zone-inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 28px 40px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--red-strong);
  margin: 0 0 14px;
}
.zone-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--text);
}
.zone-title span {
  background: linear-gradient(90deg, var(--blue), var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.zone-sub {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 520px;
  margin: 0 0 28px;
}

/* ---------- Stepper ---------- */
.steps {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0 0 28px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.steps li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  letter-spacing: 0.04em;
  background: var(--card);
}
.steps li.active { color: #fff; background: var(--blue); border-color: var(--blue); font-weight: 700; box-shadow: 0 0 0 4px var(--blue-dim); }
.steps li.done { color: var(--blue); border-color: var(--blue); }

/* ---------- Main flow ---------- */
main { padding: 0; }
.step { display: none; }
.step.active { display: block; animation: rise 0.25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 2.6vw, 27px);
  margin: 0 0 8px;
  color: var(--text);
}
h1 span { color: var(--blue); }

.back-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 0;
  margin-bottom: 14px;
}
.back-btn:hover { color: var(--red-strong); }

.hint { color: var(--text-dim); font-size: 14px; margin: 0 0 18px; }

/* game grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.game-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.game-card::after {
  content: "›";
  position: absolute;
  top: 10px; right: 14px;
  color: var(--red);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
}
.game-card:hover { border-color: var(--blue); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.game-badge {
  width: 54px; height: 54px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  margin-bottom: 12px;
  background: var(--blue-dim);
  border: 1px solid #cdd8fb;
}
.game-badge .badge-icon { width: 26px; height: 26px; color: var(--blue); }
.game-badge .badge-icon svg { width: 100%; height: 100%; }
.game-badge .badge-mono {
  position: absolute;
  bottom: -6px; right: -6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--red-strong);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 4px;
  letter-spacing: 0.03em;
}
.game-card .title { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text); }
.game-card .genre { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.game-card .plats { margin-top: 10px; display: flex; gap: 6px; }
.game-card .plat-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--text-dim);
}

/* platform chips */
.chip-row { display: flex; gap: 12px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  background: var(--card);
  color: var(--text);
  padding: 18px 26px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.chip::after {
  content: "TAP TO SELECT";
  position: absolute;
  top: 10px; right: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--red-strong);
  opacity: 0.85;
}
.chip:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.chip small { font-family: var(--font-mono); color: var(--text-dim); font-size: 11px; font-weight: 400; }
.chip[data-platform="ps4"] { border-left-color: var(--red); }
.chip[data-platform="pc"] { border-left-color: #8a94a6; }

/* station grid */
.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.station-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.station-card::after {
  content: "TAP TO SELECT";
  position: absolute;
  top: 12px; right: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--red-strong);
  opacity: 0.85;
}
.station-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.station-card.selected { border-color: var(--blue); background: var(--blue-dim); box-shadow: 0 0 0 1px var(--blue) inset; }
.station-card.selected::after { content: "✓ SELECTED"; color: var(--blue); opacity: 1; }
.station-card .label { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); }
.station-card .rate { font-family: var(--font-mono); color: var(--red-strong); font-size: 13px; margin-top: 6px; }

.date-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  max-width: 220px;
}
.date-label input {
  display: block;
  margin-top: 6px;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
}

/* slot grid */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.slot-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.slot-btn.free:hover { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.slot-btn.selected { background: var(--blue-dim); border-color: var(--blue); color: var(--blue-strong); font-weight: 700; }
.slot-btn.booked { background: var(--red-dim); border-color: var(--red-dim); color: var(--red-strong); cursor: not-allowed; opacity: 0.85; box-shadow: none; }
.slot-btn.past { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.summary-bar {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: var(--card);
}
.summary-bar b { color: var(--blue-strong); }
.summary-bar .price { color: var(--red-strong); font-weight: 700; }

.cta {
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
  color: #fff;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  padding: 13px 26px;
  border-radius: 10px;
  box-shadow: 0 8px 20px -8px var(--blue-glow);
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -6px var(--blue-glow); }
.cta:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.cta.ghost { background: transparent; border: 1px solid var(--red); color: var(--red-strong); box-shadow: none; }

.confirm-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}
.confirm-card b { color: var(--text); font-family: var(--font-body); }
.confirm-card .price-line { color: var(--red-strong); font-weight: 700; font-size: 16px; }

#bookingForm { display: grid; gap: 14px; max-width: 380px; }
#bookingForm label { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
#bookingForm input {
  display: block;
  margin-top: 6px;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 12px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
}

.field-hint {
  display: block;
  margin-top: 5px;
  font-family: var(--font-body);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 400;
}

.done-card {
  background: var(--card);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.done-card .ok { color: var(--blue-strong); font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.done-card .row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); padding: 6px 0; border-bottom: 1px solid var(--line); }
.done-card .row b { color: var(--text); font-family: var(--font-body); }
.done-card .row:last-child { border-bottom: none; }
.done-card .row.status-row b { color: var(--red-strong); }

.invoice-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Live status board ---------- */
.board {
  max-width: 1120px;
  margin: 40px auto 0;
  padding: 0 24px;
}
.board-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  margin: 0 0 14px;
}
.board-title::before { content: "● "; color: var(--blue); }

.board-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .board-grid { grid-template-columns: repeat(2, 1fr); }
}

.board-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.board-tile .unit {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.board-tile .status {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.board-tile .status.free { color: var(--blue-strong); }
.board-tile .status.busy { color: var(--red-strong); }
.board-tile .status.closed { color: var(--red-strong); }
.board-tile .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}
.board-tile .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}
.board-tile .status.free .dot { background: var(--blue); box-shadow: 0 0 6px var(--blue-glow); }
.board-tile .status.busy .dot { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.board-tile .status.closed .dot { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }

/* ---------- Contact ---------- */
.contact {
  max-width: 1120px;
  margin: 40px auto 0;
  padding: 0 24px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
  box-shadow: var(--shadow-sm);
}
.contact-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.contact-card.static { cursor: default; }
.contact-icon { font-size: 22px; margin-bottom: 8px; }
.contact-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); letter-spacing: 0.06em; }
.contact-value { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin-top: 3px; color: var(--blue-strong); }

footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 40px;
}
footer b { color: var(--red-strong); }

/* ---------- Modal (admin) ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: #12161fb3;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 30px 60px -20px #12161f4d;
}
.modal.wide { max-width: 920px; }
.modal h2 { font-family: var(--font-display); margin: 0 0 16px; color: var(--text); }
.modal-close {
  float: right;
  background: none; border: none; color: var(--text-dim);
  font-size: 18px;
}
.modal-close:hover { color: var(--red-strong); }
#loginForm { display: grid; gap: 12px; max-width: 300px; }
#loginForm input {
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 10px 12px; border-radius: 8px; font-family: var(--font-body);
}
.login-error { color: var(--red-strong); font-size: 13px; font-family: var(--font-mono); display: none; }

.admin-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.admin-toolbar label { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.admin-toolbar input, .admin-toolbar select {
  display: block; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 8px 10px; border-radius: 8px; font-family: var(--font-body); font-size: 13px;
}
.admin-stats { font-family: var(--font-mono); font-size: 13px; color: var(--blue-strong); margin-left: auto; }

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
@media (max-width: 720px) { .admin-summary { grid-template-columns: repeat(2, 1fr); } }
.admin-summary .stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.admin-summary .stat .n { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--blue-strong); }
.admin-summary .stat .l { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.admin-section { margin-bottom: 26px; }
.admin-section-title { font-family: var(--font-display); font-size: 16px; margin: 0 0 6px; color: var(--text); }
.hint.small { font-size: 12px; margin-top: -2px; }

.close-date-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.close-date-form input {
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 9px 11px; border-radius: 8px; font-family: var(--font-body); font-size: 13px;
}
.close-date-form input[type="text"] { flex: 1; min-width: 160px; }

.closed-list { display: flex; flex-wrap: wrap; gap: 8px; }
.closed-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--red-dim); border: 1px solid var(--red); color: var(--red-strong);
  border-radius: 999px; padding: 6px 6px 6px 12px; font-family: var(--font-mono); font-size: 12px;
}
.closed-chip button {
  background: none; border: none; color: var(--red-strong); font-size: 13px;
  border-radius: 50%; width: 20px; height: 20px; line-height: 1;
}
.closed-chip button:hover { color: var(--red); }
.closed-empty { color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; }

.closed-msg {
  border: 1px dashed var(--red);
  color: var(--red-strong);
  background: var(--red-dim);
  border-radius: 10px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  grid-column: 1 / -1;
}

.admin-table-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-table th, table.admin-table td {
  padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.admin-table th { font-family: var(--font-mono); color: var(--text-dim); font-size: 11px; letter-spacing: 0.04em; position: sticky; top: 0; background: var(--surface-2); }
.cancel-btn {
  background: var(--red-dim); border: 1px solid var(--red); color: var(--red-strong);
  border-radius: 6px; padding: 4px 9px; font-size: 12px; font-family: var(--font-mono);
}
.cancel-btn:hover { background: var(--red); color: #fff; }
.empty-row td { color: var(--text-dim); text-align: center; padding: 20px; }
.logout-btn { background: none; border: 1px solid var(--line); color: var(--text-dim); border-radius: 8px; padding: 6px 12px; font-size: 12px; margin-left: 10px; }
.logout-btn:hover { color: var(--red-strong); border-color: var(--red); }
