/* Gym Time HQ — gaming lobby theme */
:root {
  --void: #0D0F2E;
  --void-2: #12153A;
  --panel: #171A47;
  --panel-2: #1E2258;
  --line: #2E3378;
  --blue: #1EA8F8;
  --blue-soft: rgba(30, 168, 248, .14);
  --coin: #F7D339;
  --coin-ink: #1A1400;
  --hot: #FF5A86;
  --hot-soft: rgba(255, 90, 134, .16);
  --text: #EEF1FF;
  --muted: #A4ABDD;
  --ok: #4BE3A6;

  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;

  --chamfer: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --r: 6px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }

.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.nw { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--coin); outline-offset: 3px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--coin); color: var(--coin-ink); padding: .6rem 1rem; font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.4rem;
  font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: .02em;
  color: var(--coin-ink); background: var(--coin);
  border: 0; cursor: pointer; text-decoration: none;
  clip-path: var(--chamfer);
  transition: filter .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--blue); filter: none; }
.btn-small { min-height: 40px; padding: .45rem 1rem; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--hot); color: #2A0010; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--text); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { border-color: var(--blue); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 15, 46, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }
.brand img { height: 44px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 1.6rem; }
.main-nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; }
.main-nav a:not(.btn):hover { color: var(--text); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--r); width: 44px; height: 44px; place-items: center; cursor: pointer; }

.mode-banner { background: var(--hot-soft); border-bottom: 1px solid var(--hot); font-size: .95rem; padding: .7rem 0; }
.mode-banner strong { color: var(--hot); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem);
  background:
    radial-gradient(circle at 1px 1px, rgba(164, 171, 221, .14) 1px, transparent 0) 0 0 / 22px 22px,
    var(--void);
}
.hero::after {
  content: ""; position: absolute; right: -180px; top: -120px; width: 620px; height: 620px;
  border: 2px solid var(--line);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: linear-gradient(var(--void-2), var(--void));
  z-index: 0; opacity: .7;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); font-weight: 700; max-width: 13ch; }
.lead { margin-top: 1.4rem; font-size: 1.2rem; color: var(--muted); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }

/* Party / lobby roster */
.party { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; }
.party-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.party-head h2 { font-size: 1.25rem; }
.party-date { color: var(--muted); font-size: .95rem; }
.party-slots { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.slot {
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: .8rem;
  padding: .65rem .8rem; background: var(--void-2); border: 1px solid var(--line); border-radius: 4px;
}
.slot.is-loading { display: block; color: var(--muted); }
.slot-n { font-family: var(--display); font-weight: 700; color: var(--muted); text-align: center; }
.slot-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-reason { font-size: .85rem; color: var(--muted); }
.slot.taken { border-color: var(--line); border-left: 3px solid var(--pc, var(--blue)); }
.slot.taken .slot-n { color: var(--pc, var(--blue)); }
.slot.free .slot-name { color: var(--muted); font-weight: 500; }
.slot.free .waiting::after { content: "_"; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
.party-summary { margin-top: 1rem; color: var(--muted); font-size: .95rem; }
.party-summary b { color: var(--coin); font-family: var(--display); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Steps ---------- */
.steps { border-block: 1px solid var(--line); background: var(--void-2); padding: 2rem 0; }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.steps-list li { display: flex; gap: 1rem; align-items: flex-start; }
.step-n {
  flex: none; width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; color: var(--coin);
  border: 2px solid var(--coin); clip-path: var(--chamfer);
}
.steps h3 { font-size: 1.1rem; margin-bottom: .25rem; }
.steps p { color: var(--muted); font-size: .98rem; }

/* ---------- Sections ---------- */
.lobby, .upcoming, .modes { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.section-head p { color: var(--muted); margin-top: .5rem; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1rem, 2.5vw, 1.6rem); }

.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1.5rem; align-items: start; }

/* ---------- Calendar ---------- */
.cal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-top h3 { font-size: 1.3rem; text-transform: capitalize; }
.weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.weekdays span { text-align: center; color: var(--muted); font-size: .85rem; font-weight: 600; padding-bottom: .4rem; }
.day {
  position: relative; aspect-ratio: 1 / 1; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--void-2); border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; padding: 0;
}
.day:hover:not(:disabled) { border-color: var(--blue); }
.day-num { font-family: var(--display); font-weight: 600; font-size: 1.05rem; line-height: 1; }
.pips { display: flex; gap: 3px; }
.pip { display: inline-block; width: 5px; height: 5px; border-radius: 1px; background: var(--line); }
.pip.on { background: var(--blue); }
.day.is-empty { visibility: hidden; }
.day:disabled { cursor: default; opacity: .35; }
.day.is-today .day-num { color: var(--coin); }
.day.is-today::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; background: var(--coin); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.day.is-full { background: var(--hot-soft); border-color: rgba(255, 90, 134, .5); }
.day.is-full .pip.on { background: var(--hot); }
.day.is-selected { background: var(--blue); border-color: var(--blue); color: #001827; }
.day.is-selected .day-num { color: #001827; }
.day.is-selected .pip { background: rgba(0, 24, 39, .3); }
.day.is-selected .pip.on { background: #001827; }
.legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.1rem; color: var(--muted); font-size: .88rem; }
.legend span { display: inline-flex; align-items: center; gap: .45rem; }
.legend .pip { width: 8px; height: 8px; }
.sw-full { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--hot-soft); border: 1px solid var(--hot); }

/* ---------- Octagon arena ---------- */
.arena-head h3 { font-size: 1.3rem; }
.count-chip { font-family: var(--display); font-weight: 600; font-size: .9rem; padding: .3rem .7rem; border-radius: 999px; background: var(--blue-soft); color: var(--blue); }
.count-chip.full { background: var(--hot-soft); color: var(--hot); }

.arena-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.arena-title { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; }

/* Octogonul: masa (inel cu date) + 5 scaune + centrul cu detalii */
.octagon {
  position: relative; width: min(100%, 500px); aspect-ratio: 1 / 1; margin: 2rem auto 1.4rem;
  container-type: inline-size;
}
.octagon-art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spokes line { stroke: var(--line); stroke-width: .5; stroke-dasharray: 1.2 1.2; transition: stroke-width .15s ease; }
.spokes line.lit { stroke-dasharray: none; stroke-width: .7; opacity: .75; }
.spokes line.focus { stroke-width: 1.4; opacity: 1; }
.spokes line.chosen { stroke: var(--coin); stroke-dasharray: none; stroke-width: 1; }
.oct-ring { fill: var(--void-2); stroke: var(--blue); stroke-width: .6; }
.oct-plate { fill: var(--panel-2); stroke: var(--line); stroke-width: .5; }

.ring-date {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; line-height: 1;
  padding: .3cqi .6cqi; border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--display);
}
.ring-date b { font-size: max(.72rem, 3.4cqi); font-weight: 700; color: var(--text); }
.ring-date small { font-size: max(.55rem, 2.1cqi); margin-top: .4cqi; }
.ring-date.is-empty b { color: var(--muted); }
.ring-date.is-full b { color: var(--hot); }
.ring-date:hover b { color: var(--blue); }
.ring-date.is-current { background: var(--coin); }
.ring-date.is-current b, .ring-date.is-current small { color: var(--coin-ink); }

.oct-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 38%; height: 38%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: .6cqi; pointer-events: none; overflow: hidden;
}
.core-week, .core-month, .core-occ, .core-reason, .core-meta, .core-more, .core-seat { font-size: max(.62rem, 2.6cqi); line-height: 1.2; color: var(--muted); }
.core-big { font-family: var(--display); font-weight: 700; font-size: max(2rem, 12cqi); line-height: .9; color: var(--coin); }
.core-occ { color: var(--text); font-weight: 600; margin-top: .6cqi; }
.core-seat { font-family: var(--display); font-weight: 600; color: var(--pc); }
.core-name { font-family: var(--display); font-size: max(1rem, 5.2cqi); line-height: 1.05; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.core-reason { color: var(--text); }
.core-more { color: var(--pc); }

.seat {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: 19%; aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4cqi;
  padding: 4px; cursor: pointer; border: 0;
  background: var(--blue); color: var(--text); isolation: isolate;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  transition: transform .15s ease;
}
.seat::before { content: ""; position: absolute; inset: 2px; z-index: -1; background: var(--panel); clip-path: inherit; }
.seat-n { font-family: var(--display); font-weight: 700; font-size: max(.95rem, 4.4cqi); line-height: 1; color: var(--blue); }
.seat-name { font-size: max(.62rem, 2.5cqi); font-weight: 600; line-height: 1.1; max-width: 88%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.seat-tag { font-size: max(.55rem, 2cqi); font-weight: 700; padding: 0 .35em; border-radius: 2px; background: var(--coin); color: var(--coin-ink); line-height: 1.4; }
.seat:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.06); }
.seat.is-taken { background: var(--pc, var(--hot)); }
.seat.is-taken::before { background: color-mix(in srgb, var(--pc, var(--hot)) 16%, var(--panel)); }
.seat.is-taken .seat-n { color: var(--pc, var(--hot)); }
.seat.is-taken .seat-name { color: var(--text); }
.seat.is-pinned { transform: translate(-50%, -50%) scale(1.08); }
.seat.is-pinned::before { inset: 3px; }
.seat.is-selected { background: var(--coin); }
.seat.is-selected::before { background: var(--coin); }
.seat.is-selected .seat-n, .seat.is-selected .seat-name { color: var(--coin-ink); }
.seat:disabled { cursor: not-allowed; opacity: .4; }
.seat:focus-visible { outline: none; }
.seat:focus-visible::after { content: ""; position: absolute; inset: 6px; border: 2px dashed var(--coin); clip-path: inherit; }

.seat-detail {
  margin-top: .6rem; padding: .9rem 1rem; border-radius: 4px;
  background: var(--void-2); border: 1px solid var(--line); border-left: 3px solid var(--pc, var(--line));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem;
}
.seat-detail p { color: var(--text); }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--pc); margin-right: .5rem; }
.muted { color: var(--muted); font-size: .92rem; }
code { white-space: nowrap; font-family: var(--display); font-weight: 700; letter-spacing: .06em; color: var(--coin); background: var(--void); padding: .05em .4em; border-radius: 3px; }

/* ---------- Form ---------- */
.booking-form { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); display: grid; gap: 1rem; }
.form-intro { font-weight: 500; }
.form-intro b { color: var(--coin); font-family: var(--display); }
.field { display: grid; gap: .4rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-size: .9rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: .4rem; }
input[type="text"] {
  min-height: 48px; padding: .7rem .9rem; border-radius: 4px;
  background: var(--void-2); border: 1px solid var(--line);
}
input[type="text"]:focus { outline: none; border-color: var(--coin); box-shadow: 0 0 0 3px rgba(247, 211, 57, .2); }
input[aria-invalid="true"] { border-color: var(--hot); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: .4rem .9rem; border-radius: 999px;
  background: var(--void-2); border: 1px solid var(--line); cursor: pointer; font-weight: 500; font-size: .95rem;
}
.chip span:hover { border-color: var(--blue); }
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #001827; font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--coin); outline-offset: 2px; }
.form-status { min-height: 1.4em; font-size: .95rem; }
.form-status.error { color: var(--hot); }
.form-status.ok { color: var(--ok); }

/* ---------- Upcoming ---------- */
.upcoming { background: var(--void-2); border-block: 1px solid var(--line); }
.up-list { display: grid; gap: 1rem; }
.up-day { display: grid; grid-template-columns: 11rem 1fr; gap: 1.2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.up-day:last-child { border-bottom: 0; }
.up-date { font-family: var(--display); font-weight: 600; }
.up-date small { display: block; font-family: var(--body); color: var(--muted); font-weight: 400; margin-top: .2rem; }
.up-date button { all: unset; cursor: pointer; }
.up-date button:hover { color: var(--blue); }
.up-date button:focus-visible { outline: 2px solid var(--coin); outline-offset: 3px; }
.up-people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.up-people li { display: inline-flex; gap: .5rem; align-items: center; padding: .4rem .8rem; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); font-size: .95rem; }
.up-people li { border-left: 3px solid var(--pc, var(--line)); }
.up-people .tag { font-family: var(--display); font-weight: 700; color: var(--pc, var(--blue)); font-size: .85rem; }
.up-people .you { font-size: .75rem; font-weight: 700; padding: 0 .4em; border-radius: 2px; background: var(--coin); color: var(--coin-ink); }
.up-people .why { color: var(--muted); }
.empty { color: var(--muted); }
.empty a { font-weight: 600; }

/* ---------- My bookings ---------- */
.mine { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.mine-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.mine-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.mine-items li {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--pc); border-radius: 4px;
}
.mine-info { display: grid; gap: .2rem; }
.mine-date { all: unset; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.mine-date:hover { color: var(--blue); }
.mine-date:focus-visible { outline: 2px solid var(--coin); outline-offset: 3px; }
.code-form { display: grid; gap: 1rem; }
.code-form h3 { font-size: 1.2rem; }
.code-form > p { color: var(--muted); }
#codeInput { text-transform: uppercase; letter-spacing: .08em; font-family: var(--display); }

/* ---------- Modes ---------- */
.modes-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mode { background: var(--panel); padding: 1.4rem; display: flex; flex-direction: column; gap: .5rem; }
.mode h3 { font-size: 1.2rem; }
.mode p { color: var(--muted); flex: 1; }
.mode-pick { align-self: flex-start; background: none; border: 0; padding: .3rem 0; color: var(--blue); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.mode-pick:hover { color: var(--coin); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.footer-row img { height: 32px; width: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 90;
  background: var(--coin); color: var(--coin-ink); font-weight: 600; padding: .8rem 1.2rem;
  clip-path: var(--chamfer); max-width: calc(100% - 2rem);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .lobby-grid, .mine-grid { grid-template-columns: 1fr; }
  .modes-list { grid-template-columns: repeat(2, 1fr); }
  .hero::after { width: 420px; height: 420px; right: -220px; }
}
@media (max-width: 760px) {
  .menu-toggle { display: grid; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; display: none;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--void); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1.25rem;
  }
  .main-nav.open { display: flex; }
  .main-nav a:not(.btn) { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .main-nav .btn { margin-top: 1rem; }
  .steps-list { grid-template-columns: 1fr; gap: 1.2rem; }
  .up-day { grid-template-columns: 1fr; gap: .6rem; }
  .modes-list { grid-template-columns: 1fr; }
  .brand img { height: 36px; }
}
@media (max-width: 420px) {
  .weekdays, .cal-grid { gap: 4px; }
  .pip { width: 4px; height: 4px; }
  .oct-core { width: 40%; height: 40%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
#codeInput::placeholder { text-transform: none; letter-spacing: normal; font-family: var(--body); }
