:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #171310;
  --panel-2: #211a15;
  --line: #403027;
  --text: #f5f7fb;
  --muted: #9ca9bb;
  --cyan: #ff6a00;
  --lime: #ffb000;
  --pink: #ff3d00;
  --red: #ff5c6c;
  --amber: #ffd166;
  --ok: #31d07f;
  --shadow: 0 20px 70px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: radial-gradient(circle at 20% 0%, rgba(255, 106, 0, .14), transparent 28%), var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p, a, button, label, td, th, .card, .panel { overflow-wrap: break-word; word-break: normal; }
button, input, select {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
  color: #071018;
  background: var(--cyan);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  max-width: 100%;
}
button.secondary { background: #263244; color: var(--text); border: 1px solid var(--line); }
button.warning { background: var(--amber); }
button.danger { background: var(--red); color: white; }
button.ghost { background: transparent; color: var(--cyan); border: 1px solid rgba(56, 242, 255, .35); }
button:disabled { opacity: .55; cursor: not-allowed; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0c111a;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}
.password-field { display: grid; grid-template-columns: 1fr 42px; gap: 8px; align-items: center; }
.password-field input { min-width: 0; }
.password-toggle { width: 42px; height: 42px; padding: 0; font-size: 18px; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56, 242, 255, .12); }
label { color: var(--muted); display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0; }
.site-shell { min-height: 100vh; }
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(16px, 5vw, 64px);
  background: rgba(9, 11, 16, .86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(56, 242, 255, .12);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 950; letter-spacing: 0; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  color: #071018; background: linear-gradient(135deg, var(--cyan), var(--lime));
  clip-path: polygon(0 0, 84% 0, 100% 22%, 100% 100%, 15% 100%, 0 78%);
}
.brand-logo { width: 42px; height: 42px; object-fit: contain; }
.site-links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-links a, .mini-link { color: var(--muted); font-weight: 800; font-size: 14px; }
.site-links a.active { color: var(--cyan); }
.hero {
  min-height: min(78vh, 780px);
  display: grid;
  align-items: center;
  padding: 42px clamp(16px, 5vw, 64px);
  background:
    linear-gradient(90deg, rgba(9, 11, 16, .94), rgba(9, 11, 16, .58)),
    url("/assets/hero.jpg") center/cover;
}
.hero-inner { max-width: 760px; }
.hero-logo { width: clamp(132px, 18vw, 220px); max-height: 180px; object-fit: contain; display: block; margin-bottom: 16px; }
.hero-tagline { display: block; margin-bottom: 14px; font-size: 15px; }
.hero-inner p { max-width: 720px; }
.hero-inner p strong { color: var(--text); }
.eyebrow { color: var(--lime); text-transform: uppercase; font-weight: 950; letter-spacing: 0; font-size: 12px; }
h1, h2, h3 { margin: 0; line-height: 1.05; }
h1 { font-size: clamp(44px, 8vw, 92px); letter-spacing: 0; margin: 10px 0 18px; }
h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 14px; }
h3 { font-size: 18px; }
p { color: var(--muted); line-height: 1.7; }
.hero-actions, .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.add-item-form [name="item_search"] { flex: 1 1 240px; min-width: 160px; }
.section { padding: 54px clamp(16px, 5vw, 64px); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.card, .panel {
  background: linear-gradient(180deg, rgba(22, 31, 45, .98), rgba(13, 18, 27, .98));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card { padding: 18px; min-height: 0; }
.card.accent { border-color: rgba(56, 242, 255, .38); }
.action-card { display: grid; gap: 10px; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.action-card span { color: var(--cyan); font-weight: 950; }
.action-card:hover { transform: translateY(-3px); border-color: var(--cyan); background: linear-gradient(180deg, rgba(255,106,0,.18), rgba(13,18,27,.98)); }
.price { color: var(--lime); font-weight: 950; font-size: 24px; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at top, rgba(255, 79, 216, .13), transparent 28%), var(--bg);
}
.login-card { width: min(440px, 100%); padding: 24px; }
.form-grid { display: grid; gap: 12px; }
.error, .notice {
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 92, 108, .35);
  background: rgba(255, 92, 108, .09);
  color: #ffdbe0;
}
.notice { border-color: rgba(56, 242, 255, .35); background: rgba(56, 242, 255, .08); color: #d7fbff; }
.app-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; background: #0d0a08; }
.app-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #17110e;
}
.app-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.app-tabs button { padding: 9px 12px; background: transparent; color: var(--muted); border: 1px solid var(--line); }
.app-tabs button.active { color: #071018; background: var(--cyan); border-color: var(--cyan); }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-main { padding: 18px; display: grid; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { padding: 16px; }
.stat strong { display: block; font-size: 26px; margin-top: 6px; }
.station-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(305px, 1fr)); gap: 14px; align-items: start; }
.arena-billing { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); gap: 16px; align-items: start; }
.station { padding: 16px; display: grid; gap: 12px; }
.station-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.badge { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 950; background: #273244; color: var(--text); }
.badge.Available { background: rgba(49, 208, 127, .14); color: #baffe0; }
.badge.Running { background: rgba(56, 242, 255, .15); color: #c7fbff; }
.badge.Completed { background: rgba(255, 209, 102, .16); color: #fff1bd; }
.timer { font-size: 34px; font-weight: 950; color: var(--cyan); }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kv div { background: #0d131d; border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.kv span { color: var(--muted); font-size: 12px; display: block; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: start; }
.table-panel { overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar.compact { padding: 0 0 14px; border-bottom: 0; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(0, 0, 0, .72); padding: 18px;
}
.modal { width: min(720px, 100%); max-height: 92vh; overflow: auto; padding: 18px; }
.invoice { background: white; color: #111; padding: 20px; border-radius: 4px; }
.invoice * { color: #111; }
.invoice table th, .invoice table td { border-color: #ddd; }
.small { color: var(--muted); font-size: 12px; }
.empty { padding: 20px; color: var(--muted); }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--line); background: #0d131d; padding: 7px 9px; border-radius: 999px; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.mini-danger { background: rgba(255,77,109,.16); color: #ff9aac; border: 1px solid rgba(255,77,109,.35); padding: 4px 7px; border-radius: 999px; font-size: 11px; }
.resource-price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding: 16px; min-width: 0; }
.resource-price-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #0d131d; min-width: 0; }
.resource-price-card label, .resource-price-card input { min-width: 0; }
.resource-price-card h3 { overflow-wrap: anywhere; }
.booking-section .split { grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); }
.booking-board { display: grid; gap: 12px; max-height: 720px; overflow: auto; padding-right: 4px; }
.booking-resource { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #0d131d; display: grid; gap: 10px; }
.station-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.icon-button {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #071018;
  background: var(--lime);
  font-weight: 950;
  line-height: 1;
}
.booking-info-notice { margin: 8px 0 12px; }
.slot-list { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; font-size: 12px; color: var(--muted); background: #111821; }
.slot-chip.free { color: #baffe0; border-color: rgba(49, 208, 127, .35); background: rgba(49, 208, 127, .09); }
.slot-chip.booked { color: #ffdbe0; border-color: rgba(255, 92, 108, .35); background: rgba(255, 92, 108, .12); text-decoration: line-through; }
.bar-chart { min-height: 190px; display: flex; align-items: end; gap: 8px; overflow-x: auto; padding-top: 18px; }
.bar-col { min-width: 34px; display: grid; gap: 6px; justify-items: center; }
.bar-col span { color: var(--muted); font-size: 10px; }
.bar { width: 24px; background: linear-gradient(180deg, var(--lime), var(--cyan)); border-radius: 4px 4px 0 0; }
.page-hero { min-height: min(54vh, 560px); display:grid; align-items:center; padding:54px clamp(16px,5vw,64px); background-position:center; background-size:cover; }
.page-hero > div { max-width:720px; }
.page-hero h1 { font-size:clamp(42px,7vw,78px); margin:10px 0 16px; }
.image-hero { width: 100%; background: #080808; }
.image-hero img { display: block; width: 100%; height: auto; max-height: 680px; object-fit: contain; object-position: center; }
.product-card { padding:0; overflow:hidden; display:grid; align-content:start; }
.product-card img { width:100%; aspect-ratio: 4 / 3; height:auto; object-fit:contain; display:block; background:#080c12; border-bottom:1px solid var(--line); }
.product-card h3,.product-card p { margin-left:18px; margin-right:18px; }
.product-card p { margin-bottom:20px; }
.image-only-card img { min-height:0; object-fit:contain; border-bottom:0; }
.terms-list { color: var(--muted); line-height: 1.7; padding-left: 20px; }
.game-list { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap:8px; margin-top:14px; }
.game-list span { border:1px solid var(--line); background:#0d131d; border-radius:8px; padding:9px 10px; color:var(--text); font-weight:700; }
.station-games-modal { width:min(860px, 100%); }
textarea { min-height:120px; resize:vertical; border:1px solid var(--line); background:#0c0a08; color:var(--text); border-radius:8px; padding:10px 12px; font:inherit; }
.review-form { max-width:680px; margin-top:24px; }
.auth-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.session-alert { border: 2px solid var(--amber); box-shadow: 0 0 0 6px rgba(255, 209, 102, .13), var(--shadow); animation: alert-pulse 1s ease-in-out infinite alternate; }
@keyframes alert-pulse { from { transform: scale(1); } to { transform: scale(1.018); } }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .arena-billing, .booking-section .split { grid-template-columns: 1fr; }
  .app-top { align-items: flex-start; flex-direction: column; }
  .app-tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
  .app-tabs button { flex: 0 0 auto; white-space: nowrap; }
  .app-actions { width: 100%; }
  .app-actions button { white-space: nowrap; }
  .site-nav { align-items: flex-start; gap: 12px; flex-direction: column; }
  .kv { grid-template-columns: 1fr; }
  .hero, .page-hero { min-height: auto; padding-top: 42px; padding-bottom: 42px; }
  .section { padding-top: 38px; padding-bottom: 38px; }
  .grid { grid-template-columns: 1fr; }
  .station-grid { grid-template-columns: 1fr; }
  .station-head { align-items: flex-start; }
  .site-links { width: 100%; gap: 6px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-links a { min-height: 34px; padding: 7px 8px; display: grid; place-items: center; text-align: center; color: var(--lime); background: rgba(255, 106, 0, .08); border: 1px solid rgba(255, 176, 0, .62); border-radius: 8px; font-size: 12px; line-height: 1.15; }
  .site-links a.active { color: #071018; background: var(--cyan); border-color: var(--cyan); }
  .modal-backdrop { align-items: end; padding: 10px; }
  .modal { max-height: 88vh; border-radius: 8px 8px 0 0; }
}
@media (max-width: 520px) {
  .site-nav, .section, .hero, .page-hero { padding-left: 14px; padding-right: 14px; }
  .hero-actions, .row { align-items: stretch; }
  .hero-actions a, .hero-actions button, .row button, .row a { width: 100%; }
  .hero-logo { width: 128px; max-height: 112px; }
  .site-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 42px; }
  h2 { font-size: 28px; }
  .card, .panel, .station { padding: 14px; }
  .product-card { padding: 0; }
  .product-card h3, .product-card p { margin-left: 14px; margin-right: 14px; }
  .slot-chip { flex: 1 1 72px; text-align: center; }
  .game-list { grid-template-columns: 1fr; }
  th, td { padding: 9px 8px; }
}
@media print {
  body * { visibility: hidden; }
  .invoice, .invoice * { visibility: visible; }
  body { background: white !important; color: #111 !important; }
  .modal-backdrop, .panel, .modal { background: transparent !important; box-shadow: none !important; border: 0 !important; padding: 0 !important; }
  .invoice {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 80mm;
    margin: 0 auto;
    padding: 10px;
    background: white !important;
    color: #111 !important;
    border: 0 !important;
    box-shadow: none !important;
    font-family: Arial, sans-serif;
    font-size: 12px;
  }
  .invoice h2, .invoice h3, .invoice p { margin: 4px 0; color: #111 !important; }
  .invoice .kv { display: block; }
  .invoice .kv div { border: 0; border-bottom: 1px dashed #999; background: white !important; padding: 5px 0; border-radius: 0; }
  .invoice table { font-size: 11px; }
  .invoice table th, .invoice table td { padding: 5px 2px; border-color: #bbb; }
  .no-print { display: none !important; }
}
