* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0a0c12;
  --bg-deep: #05070b;
  --ink: #eef1f5;
  --muted: #aab3c7;
  --glass: rgba(16, 20, 28, 0.55);
  --glass-strong: rgba(16, 20, 28, 0.78);
  --stroke: rgba(121, 137, 179, 0.25);
  --accent: #6ad1ff;
}

body {
  margin: 0;
  font-family: "Onest", system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(68, 120, 255, 0.2), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(125, 255, 213, 0.18), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255, 176, 94, 0.16), transparent 45%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(120, 200, 255, 0.18), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(120, 255, 204, 0.12), transparent 45%),
    radial-gradient(circle at 60% 80%, rgba(255, 168, 120, 0.12), transparent 50%);
  animation: floatGlow 18s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes floatGlow {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(2%, -2%, 0) scale(1.04);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.5;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 32px 8px;
  gap: 12px;
  text-align: center;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.title p {
  margin: 4px 0;
  color: var(--muted);
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-family: "Gloock", "Onest", serif;
  letter-spacing: 0.5px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 360px;
  gap: 24px;
  padding: 16px 32px 32px;
  position: relative;
  z-index: 1;
}

.layout.single {
  grid-template-columns: minmax(320px, 900px);
  justify-content: center;
}

.admin-card {
  width: 100%;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--stroke);
  text-align: left;
}

.admin-table thead th {
  color: var(--muted);
  font-weight: 600;
}

.admin-row h2 {
  margin: 0;
}

.admin-table tbody tr.row-free {
  background: rgba(18, 53, 31, 0.3);
}

.admin-table tbody tr.row-hold {
  background: rgba(58, 50, 19, 0.3);
}

.admin-table tbody tr.row-booked {
  background: rgba(59, 20, 20, 0.3);
}

.admin-table tbody tr {
  cursor: pointer;
}

.admin-table tbody tr:hover {
  outline: 1px solid var(--accent);
}

.admin-row {
  justify-content: space-between;
  margin-top: 8px;
}

.map {
  display: flex;
  justify-content: center;
}

.room {
  position: relative;
  width: min(100%, 900px);
  aspect-ratio: 8 / 9;
  background:
    linear-gradient(180deg, rgba(23, 28, 40, 0.9), rgba(10, 12, 18, 0.9)),
    radial-gradient(circle at 60% 20%, rgba(106, 209, 255, 0.08), transparent 55%);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease 0.1s, transform 0.7s ease 0.1s;
}

.bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10%;
  background: rgba(23, 29, 44, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 4px;
  z-index: 2;
}

#tables-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.table {
  position: absolute;
  width: 64px;
  height: 48px;
  background: rgba(18, 24, 36, 0.65);
  border: 1px solid rgba(120, 140, 200, 0.35);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.table.round {
  width: 58px;
  height: 58px;
  border-radius: 50%;
}

.table:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.table.rotate-90 {
  transform: translate(-50%, -50%) rotate(90deg);
}

.table.rotate-90:hover {
  transform: translate(-50%, -50%) rotate(90deg) scale(1.04);
}

.table-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.table.rotate-90 .table-content {
  transform: rotate(-90deg);
}

.table .id {
  font-size: 12px;
  opacity: 0.8;
}

.table .label {
  font-size: 12px;
  font-weight: 600;
}

.table .cap {
  font-size: 11px;
  opacity: 0.8;
}

.table.free {
  background: rgba(19, 61, 38, 0.7);
  border-color: rgba(70, 219, 131, 0.7);
}

.table.hold {
  background: rgba(63, 52, 18, 0.7);
  border-color: rgba(255, 201, 72, 0.8);
}

.table.booked {
  background: rgba(72, 18, 22, 0.75);
  border-color: rgba(255, 91, 107, 0.8);
}

.table.yours {
  background: rgba(20, 42, 59, 0.8);
  border-color: rgba(106, 209, 255, 0.9);
  box-shadow:
    0 0 0 1px rgba(106, 209, 255, 0.25),
    0 0 24px rgba(106, 209, 255, 0.3);
}

.map-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffb84d;
  font-size: 14px;
  text-align: center;
  padding: 24px;
}

.tooltip {
  position: absolute;
  z-index: 5;
  background: rgba(8, 12, 20, 0.9);
  color: var(--ink);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  white-space: pre-line;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s;
}

.card {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(14px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

input,
select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(8, 10, 16, 0.8);
  color: var(--ink);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.primary {
  background: linear-gradient(135deg, #63b9ff, #9bf6ff);
  border: none;
  color: #0a0e12;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.hidden {
  display: none;
}

.legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
  background: rgba(10, 12, 18, 0.6);
  backdrop-filter: blur(10px);
}

.pill.free {
  border-color: rgba(70, 219, 131, 0.7);
}
.pill.hold {
  border-color: rgba(255, 201, 72, 0.8);
}
.pill.booked {
  border-color: rgba(255, 91, 107, 0.8);
}
.pill.yours {
  border-color: rgba(106, 209, 255, 0.9);
}

.checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

body.loaded .header,
body.loaded .room,
body.loaded .panel {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
