/* styles.css */
/* ========================================
   Premium Glass Design System
   Apple-inspired Minimalist & Unified
   ======================================== */

:root {
  /* Refined Color Palette */
  --cream-50: #FDF8F3;
  --cream-100: #F8F0E8;
  --cream-200: #EFE4D8;
  --cream-300: #E5D4C0;

  --caramel-50: #F4E8D8;
  --caramel-100: #E8D4B8;
  --caramel-200: #D4B896;
  --caramel-300: #C09060;

  --coffee-100: #A67C52;
  --coffee-200: #8B6239;
  --coffee-300: #6D4C2E;

  --dark-50: #3D2A1F;
  --dark-100: #2D1F15;
  --dark-200: #1F150E;
  --dark-300: #120C08;

  /* Glass system */
  --glass-light: rgba(255, 248, 240, 0.06);
  --glass-lighter: rgba(255, 248, 240, 0.10);
  --glass-border: rgba(255, 248, 240, 0.14);
  --glass-border-strong: rgba(255, 248, 240, 0.22);

  /* Effects */
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.3);

  --glow-soft: 0 0 20px rgba(212, 184, 150, 0.15);
  --glow-medium: 0 0 32px rgba(212, 184, 150, 0.25);

  /* Unified Spacing Scale (8px base) */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Typography Scale */
  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 15px;
  --text-xl: 16px;
  --text-2xl: 19px;
  --text-3xl: 24px;
  --text-4xl: 32px;
  --text-5xl: 40px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;

  /* Unified control heights */
  --control-sm: 36px;
  --control-md: 44px;
  --control-lg: 48px;
  /* Refined Color Palette */
  --cream-50: #FDF8F3;
  --cream-100: #F8F0E8;
  --cream-200: #EFE4D8;
  --cream-300: #E5D4C0;

  --caramel-50: #F4E8D8;
  --caramel-100: #E8D4B8;
  --caramel-200: #D4B896;
  --caramel-300: #C09060;

  --coffee-100: #A67C52;
  --coffee-200: #8B6239;
  --coffee-300: #6D4C2E;

  --dark-50: #3D2A1F;
  --dark-100: #2D1F15;
  --dark-200: #1F150E;
  --dark-300: #120C08;

  /* Glass system */
  --glass-light: rgba(255, 248, 240, 0.06);
  --glass-lighter: rgba(255, 248, 240, 0.10);
  --glass-border: rgba(255, 248, 240, 0.14);
  --glass-border-strong: rgba(255, 248, 240, 0.22);

  /* Effects */
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.3);

  --glow-soft: 0 0 20px rgba(212, 184, 150, 0.15);
  --glow-medium: 0 0 32px rgba(212, 184, 150, 0.25);

  /* Unified Spacing Scale (8px base) */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Typography Scale */
  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 15px;
  --text-xl: 16px;
  --text-2xl: 19px;
  --text-3xl: 24px;
  --text-4xl: 32px;
  --text-5xl: 40px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;

  /* Unified control heights */
  --control-sm: 36px;
  --control-md: 44px;
  --control-lg: 48px;

  /* Layout sizing (shared by topbar + map+panel) */
  --hallTableW: clamp(210px, 18vw, 260px);
  --hallGap: clamp(6px, 1vw, 10px);
  --hallCoreW: calc((var(--hallTableW) * 2) + var(--hallGap));

  /* Panel + gap (desktop) */
  --panelW: 360px;
  --layoutGap: clamp(12px, 3vw, 24px);
  --layoutW: calc(var(--hallCoreW) + (var(--hallGap) * 2) + var(--layoutGap) + var(--panelW));

}

/* ========================================
   Base & Reset
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.5;
  color: var(--cream-100);
  background:
    radial-gradient(1200px 600px at 30% 18%, rgba(212, 184, 150, 0.08) 0%, rgba(166, 124, 82, 0.04) 40%, transparent 70%),
    radial-gradient(1200px 700px at 70% 80%, rgba(166, 124, 82, 0.06) 0%, rgba(109, 76, 46, 0.04) 50%, transparent 75%),
    linear-gradient(180deg, var(--dark-200) 0%, var(--dark-300) 100%);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  isolation: isolate;
  min-height: 100vh;
  position: relative;
}

/* ========================================
   Background Layers
   ======================================== */

.bg-noise {
  position: fixed;
  inset: -1px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: normal;
  opacity: 0.18;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: opacity, transform, filter;
}

.bg-glow {
  position: fixed;
  inset: -1px;
  background:
    radial-gradient(circle 1400px at 20% 30%, rgba(212, 184, 150, 0.08), transparent 70%),
    radial-gradient(circle 1200px at 80% 70%, rgba(166, 124, 82, 0.06), transparent 65%);
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(120px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, filter, opacity;
}

/* ========================================
   Glass Components
   ======================================== */

.glass {
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-md);
}

/* ========================================
   Topbar
   ======================================== */

.topbar {
  position: relative;
  z-index: 10;
  margin: clamp(12px, 3vw, 24px) auto 0;
  max-width: min(1280px, var(--layoutW));
  width: 100%;
  padding: clamp(12px, 2vw, 16px) clamp(16px, 3vw, 24px);
  border-radius: var(--radius-xl);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-lg);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: box-shadow, transform;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.06);
  background-clip: padding-box;
}

.topbar__left,
.topbar__center,
.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar__center {
  justify-content: center;
}

.topbar__right {
  justify-content: flex-end;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--caramel-100), var(--caramel-200));
  box-shadow: 0 0 16px rgba(212, 184, 150, 0.4);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(0.95); }
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__title {
  font-size: clamp(14px, 2.5vw, 15px);
  font-weight: 590;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--cream-50);
}

.brand__subtitle {
  font-size: clamp(11px, 2vw, 12px);
  font-weight: 450;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--cream-200);
  opacity: 0.65;
}

.legend {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0 clamp(10px, 2vw, 12px);
  height: var(--control-sm);
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 248, 240, 0.08);
  font-size: clamp(11px, 2vw, 13px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cream-200);
  transition: all var(--duration-base) var(--ease-smooth);
  white-space: nowrap;
}

.chip:hover {
  background: rgba(0, 0, 0, 0.35);
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.swatch.free {
  background: linear-gradient(135deg, rgba(248, 240, 232, 0.3), rgba(239, 228, 216, 0.2));
}

.swatch.taken {
  background: linear-gradient(135deg, rgba(20, 15, 12, 0.6), rgba(30, 20, 15, 0.5));
  border-color: rgba(255, 255, 255, 0.1);
}

.swatch.mine {
  background: linear-gradient(135deg, var(--caramel-200), var(--caramel-300));
  box-shadow: 0 0 10px rgba(212, 184, 150, 0.4);
  border-color: rgba(212, 184, 150, 0.5);
}

.swatch.selected {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(248, 240, 232, 0.6));
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
}

.actions {
  display: flex;
  gap: var(--space-xs);
}

body:not(.has-user) #btnLogout {
  display: none !important;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-md);
  height: auto;
  padding: clamp(8px, 2vw, 12px) clamp(16px, 3vw, 24px);
  border-radius: var(--radius-full);
  font-size: clamp(12px, 2.2vw, 13px);
  font-weight: 510;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid;
  transition: all var(--duration-base) var(--ease-smooth);
  user-select: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-smooth);
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: opacity, transform, box-shadow;
}

.btn:active {
  transform: scale(0.97);
}

.btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--caramel-100) 0%, var(--caramel-200) 100%);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--dark-100);
  box-shadow: var(--shadow-sm), var(--glow-soft);
}

.btn-primary::before {
  background: linear-gradient(135deg, var(--caramel-50) 0%, var(--caramel-100) 100%);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--glow-medium);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border);
  color: var(--cream-100);
}

.btn-ghost::before {
  background: rgba(255, 255, 255, 0.08);
}

.btn-ghost:hover {
  border-color: var(--glass-border-strong);
}

.icon-btn {
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: var(--cream-100);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-smooth);
  font-size: var(--text-lg);
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--glass-border-strong);
}

.btn, .icon-btn {
  -webkit-tap-highlight-color: transparent;
}

/* ========================================
   Layout
   ======================================== */

.shell {
  position: relative;
  z-index: 2;
  max-width: min(1280px, var(--layoutW));
  /* Keep overall page padding but constrain the first column (hall) to the dancefloor core + small gaps.
     Second column (panel) is reduced to keep personal details compact. */
  width: min(100%, var(--layoutW));
  margin: clamp(12px, 3vw, 24px) auto clamp(24px, 5vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, calc(var(--hallCoreW) + (var(--hallGap) * 2))) minmax(0, var(--panelW));
  /* tighten to a fixed minimal gap to eliminate large whitespace */
  gap: var(--layoutGap);
  align-items: start;
  grid-template-areas: "hall panel";
  justify-content: center;
  min-height: 0;
}

.hall { 
  grid-area: hall; 
  min-height: 400px;
  width: 100%;
  overflow-y: visible;
    /* Constrain the hall box to the dancefloor core width + a tiny gap on each side.
      Remove automatic centering so the panel column sits directly to the right. */
    max-width: calc(var(--hallCoreW) + (var(--hallGap) * 2));
    margin-inline: 0;
    /* reduce right-side padding so the panel visually hugs the map */
    padding-right: 0;
}

.panel { 
  grid-area: panel;
  /* make panel compact and remove large internal horizontal padding */
  width: min(var(--panelW), 30vw);
  max-width: var(--panelW);
  padding: clamp(12px, 3vw, 16px);
  max-height: calc(100vh - clamp(24px, 6vw, 48px));
  overflow-y: auto;
  margin-left: 0;
}

/* ========================================
   Hall
   ======================================== */

.hall {
  --hallTableW: clamp(210px, 18vw, 260px);
  --hallGap: clamp(6px, 1vw, 10px);
  --hallCoreW: calc((var(--hallTableW) * 2) + var(--hallGap));
  border-radius: var(--radius-xl);
  padding: clamp(16px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3vw, 24px);
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.015), inset -1px 0 0 rgba(0,0,0,0.045);
  background-clip: padding-box;
}

.hall.glass {
  background:
    radial-gradient(circle 900px at 18% 20%, rgba(212, 184, 150, 0.11), transparent 62%),
    radial-gradient(circle 700px at 82% 72%, rgba(166, 124, 82, 0.10), transparent 65%),
    linear-gradient(180deg, rgba(61, 42, 31, 0.72), rgba(31, 21, 14, 0.84));
  border-color: rgba(255, 248, 240, 0.18);
  backdrop-filter: blur(34px) saturate(175%);
  -webkit-backdrop-filter: blur(34px) saturate(175%);
}

.hall::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 1000px at 28% 18%, rgba(212, 184, 150, 0.08), transparent 62%),
    radial-gradient(circle 900px at 70% 80%, rgba(166, 124, 82, 0.06), transparent 65%),
    linear-gradient(180deg, rgba(45, 31, 21, 0.28), rgba(31, 21, 14, 0.48));
}

.hall > * {
  position: relative;
  z-index: 1;
}

.hall__stage,
.hall__floor,
.hall__entry {
  /* Always keep these visible (stage / dancefloor / entry).
     Some layout overrides can accidentally collapse them; force a stable block. */
  display: flex !important;
  justify-content: center;
  flex: 0 0 auto;
  width: 100%;
}

/* Ensure banners inside the hall are never collapsed */
.hall__stage .banner,
.hall__floor .banner,
.hall__entry .banner {
  display: inline-flex;
}

.hall__stage .banner,
.hall__floor .banner,
.hall__floor .banner--big,
.hall__entry .banner {
  max-width: var(--hallCoreW);
}

.banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vw, 12px) clamp(16px, 4vw, 32px);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 248, 240, 0.08), rgba(255, 248, 240, 0.04));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  font-size: clamp(10px, 1.8vw, 11px);
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-200);
  position: relative;
  width: 100%;
  max-width: 600px;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.banner::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.banner--big {
  padding: clamp(16px, 4vw, 24px) clamp(20px, 5vw, 32px);
  font-size: clamp(20px, 6vw, 32px);
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--cream-50);
  text-shadow: none;
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 248, 240, 0.14);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  min-height: clamp(70px, 15vw, 100px);
}

/* Ensure stage + dancefloor + entry always match the core hall width
   (A + mini gap + G). Must override the base .banner max-width: 600px. */
.hall__stage,
.hall__floor,
.hall__entry {
  align-items: center;
}

.hall__stage .banner,
.hall__floor .banner,
.hall__floor .banner--big,
.hall__entry .banner {
  width: min(100%, var(--hallCoreW));
  max-width: none;
  margin-inline: auto;
}

.hall__grid {
  display: grid;
  /*
    Tight layout: remove the big empty middle space.
    The center column is only a mini gap.
    The dance-floor banner width is set via --hallCoreW.
  */
  grid-template-columns: var(--hallTableW) var(--hallGap) var(--hallTableW);
  column-gap: 0;
  row-gap: clamp(10px, 2.2vw, 14px);
  justify-content: center;
  align-items: start;
}

.hall__grid,
.hall__grid * {
  -webkit-user-select: none;
  user-select: none;
}

/* Align banners with the hall core width (A + mini gap + G) */
.hall .banner,
.hall .banner--big {
  max-width: var(--hallCoreW);
}

body:not(.has-user) .hall__grid {
  pointer-events: none;
}

.hallLock[aria-hidden="false"] ~ .hall__grid {
  pointer-events: none;
}

.col {
  width: var(--hallTableW);
  display: flex;
  flex-direction: column;
  /* tighten vertical spacing between table blocks (A-B-C-...) */
  gap: clamp(6px, 1.2vw, 10px);
  align-items: stretch;
}

/* make the left / right column hug the dance floor edges */
.hall__grid > .col:first-child {
  align-items: flex-end;
}
.hall__grid > .col:last-child {
  align-items: flex-start;
}

.col--middle {
  width: var(--hallGap);
  min-height: 100px;
  pointer-events: none;
}

/* ========================================
   Table Block
   ======================================== */

.tableBlock {
  /* Table blocks fill the fixed table column width */
  width: 100%;
  max-width: 100%;
  padding: clamp(6px, 1.6vw, 10px);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 248, 240, 0.04), rgba(255, 248, 240, 0.02));
  border: 1px solid var(--glass-border);
  transition: all var(--duration-slow) var(--ease-smooth);
  position: relative;
  transform: none;
  -webkit-transform: none;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  transform-style: flat;
  -webkit-transform-style: flat;
  will-change: auto;
}

.tableBlock::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(212, 184, 150, 0.03), transparent 70%);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-smooth);
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: opacity, transform, box-shadow;
}

.seatsRow {
  display: flex;
  justify-content: space-between;
  gap: clamp(4px, 1vw, 8px);
  padding: clamp(4px, 1vw, 8px) clamp(2px, 0.5vw, 4px);
}

.tableCenter {
  display: flex;
  justify-content: center;
  padding: clamp(8px, 2vw, 12px) clamp(4px, 1vw, 8px);
}

.tableCard {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: clamp(48px, 10vw, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(212, 184, 150, 0.12), rgba(212, 184, 150, 0.06)),
    linear-gradient(180deg, rgba(255, 248, 240, 0.03), transparent);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transform: none;
  -webkit-transform: none;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  transform-style: flat;
  -webkit-transform-style: flat;
  will-change: auto;
}

.tableCard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: opacity, transform, box-shadow;
  pointer-events: none;
}

.tableCard span {
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--cream-50);
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

/* ========================================
   Seats
   ======================================== */

.seat {
  min-width: clamp(36px, 8vw, 40px);
  min-height: 44px;
  height: auto;
  padding: clamp(6px, 1.5vw, 8px) clamp(6px, 1.5vw, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid;
  font-size: clamp(11px, 2.2vw, 12px);
  font-weight: 620;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  user-select: none;
  position: relative;
  overflow: hidden;
  transform: none;
  -webkit-transform: none;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  transform-style: flat;
  -webkit-transform-style: flat;
  will-change: auto;
}

.seat::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-smooth);
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: opacity, transform, box-shadow;
}

.seat:hover {
  transform: translateY(-2px);
}

.seat:active {
  transform: translateY(0) scale(0.95);
}

.seat[data-state="free"] {
  background: linear-gradient(135deg, rgba(248, 240, 232, 0.10), rgba(239, 228, 216, 0.08));
  border-color: rgba(255, 248, 240, 0.18);
  color: var(--cream-200);
}

.seat[data-state="free"]::before {
  background: linear-gradient(135deg, rgba(248, 240, 232, 0.15), rgba(239, 228, 216, 0.12));
}

.seat[data-state="taken"] {
  background: linear-gradient(135deg, rgba(18, 12, 8, 0.5), rgba(29, 20, 15, 0.4));
  border-color: rgba(255, 248, 240, 0.08);
  color: rgba(239, 228, 216, 0.35);
  cursor: not-allowed;
  opacity: 0.6;
}

.seat[data-state="taken"]:hover {
  transform: none;
}

.seat[data-state="taken"]::before {
  display: none;
}

.seat[data-state="mine"] {
  background: linear-gradient(135deg, rgba(212, 184, 150, 0.25), rgba(192, 144, 96, 0.2));
  border-color: rgba(212, 184, 150, 0.5);
  color: var(--cream-50);
  box-shadow: var(--glow-soft);
}

.seat[data-state="mine"]::before {
  background: linear-gradient(135deg, rgba(212, 184, 150, 0.35), rgba(192, 144, 96, 0.3));
}

.seat[data-state="mine"]:hover {
  box-shadow: var(--glow-medium);
}

.seat[data-state="selected"] {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(248, 240, 232, 0.4));
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--dark-100);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.2), var(--shadow-xs);
}

.seat[data-state="selected"]::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(248, 240, 232, 0.55));
}

/* ========================================
   Panel
   ======================================== */

.panel {
  border-radius: var(--radius-xl);
  padding: clamp(16px, 4vw, 32px);
  position: sticky;
  top: clamp(12px, 3vw, 24px);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.02);
  background-clip: padding-box;
  align-self: start;
}

.panel__title {
  margin: 0 0 var(--space-md);
  font-size: clamp(10px, 1.8vw, 11px);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-200);
  opacity: 0.75;
}

.panel__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 2vw, 12px);
  margin-bottom: clamp(12px, 2.5vw, 16px);
}

.kv {
  padding: clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.15));
  border: 1px solid rgba(255, 248, 240, 0.06);
  transition: all var(--duration-base) var(--ease-smooth);
}

.kv:hover {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.18));
  border-color: rgba(255, 248, 240, 0.1);
}

.k {
  font-size: clamp(9px, 1.6vw, 10px);
  font-weight: 540;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-200);
  opacity: 0.6;
  margin-bottom: var(--space-xs);
}

.v {
  font-size: clamp(13px, 2.4vw, 14px);
  font-weight: 590;
  letter-spacing: -0.01em;
  color: var(--cream-50);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 240, 0.1), transparent);
  margin: clamp(16px, 3vw, 24px) 0;
}

.panel__hint {
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.15));
  border: 1px solid rgba(255, 248, 240, 0.06);
  font-size: clamp(11px, 2vw, 12px);
  line-height: 1.6;
  color: var(--cream-200);
  opacity: 0.85;
}

/* Add spacing between hint text and buttons inside admin panel */
.admin .panel__hint {
  margin-bottom: var(--space-md);
}

.panel__mini {
  margin-top: var(--space-sm);
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 248, 240, 0.06);
  background: rgba(0, 0, 0, 0.18);
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: clamp(11px, 2vw, 12px);
  color: rgba(248, 240, 232, 0.9);
  flex-wrap: wrap;
}

.panel__buttons {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 12px);
  margin-top: clamp(12px, 2.5vw, 16px);
}

.panel__buttons .btn {
  width: 100%;
}

.panel__buttons--triple {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 2vw, 12px);
}

.panel__buttons--triple .btn:first-child {
  grid-column: 1 / -1;
}

/* ========================================
   Modal
   ======================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
  overflow-y: auto;
}

.modal[aria-hidden="false"] {
  display: flex;
  animation: none !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  will-change: backdrop-filter, filter;
}

.modal__card {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  max-height: calc(100vh - clamp(24px, 6vw, 48px));
  padding: clamp(16px, 4vw, 32px);
  border-radius: var(--radius-xl);
  animation: none !important;
  overflow-y: auto;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(16px, 3vw, 24px);
}

.modal__head h3 {
  font-size: clamp(16px, 3.5vw, 19px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--cream-50);
}

/* ========================================
   Form
   ======================================== */

.form {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.5vw, 16px);
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: clamp(8px, 2vw, 12px);
}

.field {
  display: grid;
  grid-template-rows: 20px var(--control-md);
  gap: var(--space-xs);
  align-self: stretch;
}

.field__label {
  margin: 0;
  min-height: 20px;
  display: flex;
  align-items: flex-end;
  font-size: clamp(10px, 1.8vw, 11px);
  font-weight: 540;
  letter-spacing: 0.01em;
  color: var(--cream-200);
  opacity: 0.75;
  line-height: 1.1;
}

.field__input {
  width: 100%;
  display: block;
  height: var(--control-md);
  min-height: var(--control-md);
  line-height: var(--control-md);
  padding: 0 clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  color: var(--cream-100);
  font-size: clamp(12px, 2.4vw, 14px);
  font-family: inherit;
  transition: all var(--duration-base) var(--ease-smooth);
  outline: none;
}

select.field__input {
  line-height: normal;
  padding: 0 38px 0 clamp(12px, 2.5vw, 16px);
  margin: 0;
}

.field__input::placeholder {
  color: var(--cream-200);
  opacity: 0.35;
}

.field__input:hover {
  border-color: var(--glass-border-strong);
  background: rgba(0, 0, 0, 0.3);
}

.field__input:focus {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(212, 184, 150, 0.4);
  box-shadow: 0 0 0 3px rgba(212, 184, 150, 0.08);
}

.form__note {
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.15));
  border: 1px solid rgba(255, 248, 240, 0.06);
  font-size: clamp(10px, 1.8vw, 11px);
  line-height: 1.6;
  color: var(--cream-200);
  opacity: 0.8;
}

.form__actions {
  display: flex;
  justify-content: flex-end;
  gap: clamp(8px, 2vw, 12px);
  margin-top: clamp(12px, 2.5vw, 16px);
  flex-wrap: wrap;
}

.form__error {
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(109, 76, 46, 0.2), rgba(109, 76, 46, 0.15));
  border: 1px solid rgba(212, 184, 150, 0.3);
  font-size: clamp(11px, 2vw, 12px);
  line-height: 1.5;
  color: var(--cream-100);
}

/* ========================================
   Admin Mode Adjustments
   ======================================== */

#loginModal.is-admin .modal__card .form__row:nth-of-type(2) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 2vw, 12px);
  align-items: start;
}

#loginModal.is-admin .modal__card .form__row:nth-of-type(2) .field:first-child {
  grid-column: 1 / 3;
  justify-self: center;
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  transform: none;
}

#loginModal.is-admin .modal__card .form__row:nth-of-type(2) .field:first-child .field__input {
  width: 100%;
}

#loginModal.is-admin #ticketField {
  display: none !important;
}

/* ========================================
   Responsive Breakpoints
   ======================================== */

/* ≤1100px: Tablet layout - panel vedľa mapy začína byť príliš úzky */
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "panel"
      "hall";
    gap: clamp(16px, 4vw, 24px);
    max-width: 100%;
    padding: 0 clamp(12px, 3vw, 20px);
  }

  .hall {
    max-width: 100%;
    margin-inline: auto;
  }

  .panel {
    position: static;
    max-width: 100%;
    width: 100%;
    max-height: none;
    overflow-y: visible;
  }

  /* Hide desktop panel buttons - mobile bar will show */
  .panel__buttons {
    display: none;
  }
}

/* ============================================
   TABLET: 980px and below
   - Optimize topbar
   - Adjust spacing
   ============================================ */
@media (max-width: 980px) {
  .topbar {
    padding: 14px 18px;
    gap: 12px;
  }

  /* Keep topbar horizontal but tighter */
  .topbar__center {
    flex: 1;
  }

  .legend {
    gap: 8px;
  }

  .chip {
    font-size: 11px;
    padding: 0 10px;
    height: 32px;
  }
}

/* ============================================
   MOBILE: 700px and below
   - Complete mobile layout
   - Stack everything vertically
   - Optimize for touch
   ============================================ */
@media (max-width: 700px) {
  
  /* ===== TOPBAR ===== */
  .topbar {
    padding: 12px 16px;
    gap: 12px;
    /* Stack vertically */
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "center"
      "right";
    border-radius: 16px;
    margin: 12px auto 0;
    max-width: calc(100% - 24px);
  }

  .topbar__left {
    grid-area: left;
    justify-content: flex-start;
  }

  .topbar__center {
    grid-area: center;
    justify-content: flex-start;
    width: 100%;
  }

  .topbar__right {
    grid-area: right;
    justify-content: center;
    width: 100%;
  }

  /* Brand */
  .brand__title {
    font-size: 14px;
  }

  .brand__subtitle {
    font-size: 11px;
  }

  /* Legend - 2 column grid */
  .legend {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .chip {
    justify-content: flex-start;
    width: 100%;
    padding: 0 12px;
    height: 36px;
    font-size: 12px;
  }

  .swatch {
    width: 12px;
    height: 12px;
  }

  /* Logout button full width */
  #btnLogout {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
  }

  /* ===== SHELL ===== */
  .shell {
    width: calc(100% - 16px);
    margin: 12px auto 24px;
    gap: 16px;
  }

  /* ===== PANEL ===== */
  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  .panel__title {
    font-size: 11px;
    margin-bottom: 12px;
    letter-spacing: 0.08em;
  }

  .panel__row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }

  .kv {
    padding: 12px;
    border-radius: 12px;
  }

  .k {
    font-size: 9px;
    margin-bottom: 6px;
  }

  .v {
    font-size: 13px;
  }

  .panel__hint {
    padding: 12px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 12px;
  }

  .panel__mini {
    padding: 10px 12px;
    font-size: 11px;
    margin-top: 10px;
  }

  .divider {
    margin: 16px 0;
  }

  /* ===== HALL ===== */
  .hall {
    padding: 20px 16px;
    border-radius: 16px;
    gap: 16px;
  }

  /* Hall grid - SINGLE COLUMN for mobile */
  .hall__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Hide middle column completely */
  .col--middle {
    display: none !important;
  }

  /* Make columns full width */
  #colLeft,
  #colRight {
    display: flex !important;
    width: 100%;
    align-items: stretch;
    gap: 10px;
  }

  /* Add section labels */
  #colLeft::before,
  #colRight::before {
    display: block;
    content: '';
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--cream-200);
    opacity: 0.9;
    letter-spacing: 0.06em;
    margin: 12px 0 8px;
    pointer-events: none;
  }

  #colLeft::before { 
    content: "ĽAVÁ STRANA SÁLY"; 
  }
  
  #colRight::before { 
    content: "PRAVÁ STRANA SÁLY"; 
  }

  /* Banners */
  .banner {
    padding: 10px 16px;
    font-size: 10px;
    border-radius: 12px;
  }

  .banner--big {
    font-size: 20px;
    padding: 16px 20px;
    min-height: 70px;
    border-radius: 14px;
  }

  /* ===== TABLE BLOCKS ===== */
  .tableBlock {
    padding: 8px;
    border-radius: 12px;
  }

  .seatsRow {
    gap: 6px;
    padding: 6px 4px;
  }

  .tableCenter {
    padding: 10px 6px;
  }

  .tableCard {
    height: 48px;
    border-radius: 12px;
  }

  .tableCard span {
    font-size: 28px;
  }

  /* ===== SEATS - BIGGER FOR TOUCH ===== */
  .seat {
    min-width: 40px;
    min-height: 44px;
    padding: 8px;
    font-size: 12px;
    border-radius: 50%;
  }

  /* Remove hover transform on mobile (prevents ghost hovers) */
  .seat:hover {
    transform: none;
  }

  .seat:active {
    transform: scale(0.95);
  }

  /* ===== FORMS ===== */
  .form__row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .field {
    grid-template-rows: auto auto;
    gap: 8px;
  }

  .field__label {
    font-size: 11px;
    min-height: auto;
  }

  .field__input,
  select.field__input {
    height: 48px;
    min-height: 48px;
    font-size: 16px; /* Prevent iOS zoom */
    padding: 0 14px;
    border-radius: 12px;
  }

  /* ===== MODAL ===== */
  .modal {
    padding: 16px;
  }

  .modal__card {
    padding: 20px;
    border-radius: 16px;
    max-height: calc(100vh - 32px);
  }

  .modal__head {
    margin-bottom: 16px;
  }

  .modal__head h3 {
    font-size: 17px;
  }

  .form__actions {
    margin-top: 16px;
    gap: 10px;
  }

  .form__actions .btn {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    padding: 12px 16px;
    min-height: 48px;
  }

  /* Seat popover styles removed (replaced by Admin panel info) */

  /* ===== BUTTONS ===== */
  .btn {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 12px;
  }

  .icon-btn {
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
    font-size: 16px;
  }

  /* ===== MOBILE BAR ===== */
  body.is-logged {
    padding-bottom: 90px; /* Space for mobile bar */
  }

  .mobileBar {
    display: none;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 12px;
    border-radius: 16px;
    gap: 10px;
  }

  body.is-logged .mobileBar {
    display: flex;
  }

  .mobileBar .btn {
    flex: 1;
    min-height: 48px;
    font-size: 14px;
  }

  /* ===== ADMIN ===== */
  .admin__grid {
    gap: 12px;
  }

  .admin__grid .field {
    padding: 12px;
    min-height: auto;
  }

  .admin__grid .field__input {
    height: 44px;
    font-size: 15px;
  }

  .admin__buttons {
    gap: 10px;
    margin-top: 12px;
  }

  .admin__buttons .btn {
    min-height: 48px;
  }

  /* Make admin buttons span full width of the panel (responsive) */
  .admin .btn {
    display: flex;
    width: 100%;
    max-width: none;
    justify-content: center;
    box-sizing: border-box;
    padding-left: clamp(14px, 3vw, 20px);
    padding-right: clamp(14px, 3vw, 20px);
  }

  /* ===== SAVED LOGIN ===== */
  .savedLogin {
    margin-bottom: 16px;
  }

  .savedLogin__title {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .savedLogin__who {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .savedLogin__actions {
    gap: 10px;
  }

  .savedLogin__actions .btn {
    flex: 1;
    min-height: 44px;
  }

  /* ===== HALL LOCK ===== */
  .hallLock {
    padding: 16px;
  }

  .hallLock__card {
    padding: 20px;
    border-radius: 16px;
  }

  .hallLock__badge {
    font-size: 10px;
    padding: 6px 10px;
    margin-bottom: 10px;
  }

  .hallLock__title {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .hallLock__text {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .hallLock__hint {
    font-size: 12px;
  }

  /* ===== LOADING ===== */
  .loading {
    padding: 16px;
  }

  .loading__card {
    padding: 14px;
    gap: 10px;
  }

  .loading__text {
    font-size: 13px;
  }

  /* ===== TOASTS ===== */
  .toastHost {
    right: 12px;
    bottom: 12px;
    gap: 10px;
  }

  .toast {
    max-width: calc(100vw - 24px);
    padding: 12px 14px;
    font-size: 12px;
  }
}

/* ============================================
   SMALL MOBILE: 480px and below
   - Extra touch optimization
   - Slightly bigger text
   ============================================ */
@media (max-width: 480px) {
  
  .topbar {
    margin: 10px auto 0;
    max-width: calc(100% - 20px);
  }

  .shell {
    width: calc(100% - 12px);
    margin: 10px auto 20px;
  }

  .banner--big {
    font-size: 18px;
    padding: 14px 16px;
    min-height: 60px;
  }

  .tableCard span {
    font-size: 24px;
  }

  .modal__card {
    padding: 16px;
  }

  .seat {
    min-width: 38px;
    min-height: 42px;
  }
}

/* ============================================
   ULTRA SMALL: 360px and below
   - iPhone SE, small Androids
   - Minimal spacing
   ============================================ */
@media (max-width: 360px) {
  
  .topbar {
    padding: 10px 12px;
  }

  .brand__title {
    font-size: 13px;
  }

  .brand__subtitle {
    font-size: 10px;
  }

  .chip {
    font-size: 10px;
    padding: 0 8px;
    height: 32px;
  }

  .swatch {
    width: 10px;
    height: 10px;
  }

  .panel {
    padding: 14px;
  }

  .hall {
    padding: 16px 12px;
  }

  .seat {
    min-width: 36px;
    min-height: 40px;
    font-size: 11px;
    padding: 6px;
  }

  .btn {
    font-size: 13px;
    padding: 9px 14px;
    min-height: 42px;
  }

  .mobileBar .btn {
    min-height: 44px;
  }

  .banner--big {
    font-size: 16px;
  }
}

/* ============================================
   LANDSCAPE MOBILE: Special handling
   - When phone is rotated
   ============================================ */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  
  body {
    overflow-y: auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0;
    max-width: 100%;
    border-radius: 0;
  }

  .shell {
    margin-top: 0;
  }

  .panel {
    position: static;
    max-height: none;
  }

  .modal__card {
    max-height: 90vh;
  }

  .mobileBar {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
  }
}

/* ============================================
   TOUCH DEVICE FIXES
   - Prevent ghost hovers
   - Better tap feedback
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  
  /* Remove all hover effects on touch devices */
  .btn-primary:hover,
  .btn-ghost:hover,
  .icon-btn:hover,
  .chip:hover,
  .seat:hover,
  .tableBlock:hover,
  .kv:hover,
  .field__input:hover {
    transform: none !important;
    box-shadow: inherit !important;
    background: inherit !important;
    border-color: inherit !important;
  }

  /* Active states only */
  .btn:active {
    transform: scale(0.97);
  }

  .seat:active {
    transform: scale(0.95);
  }

  /* Prevent text selection during touches */
  .hall,
  .seat,
  .tableBlock,
  .btn {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* ============================================
   SAFE AREA INSETS
   - iOS notch/island support
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  
  @media (max-width: 700px) {
    
    .mobileBar {
      bottom: env(safe-area-inset-bottom, 12px);
      padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .modal__card {
      bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    body.is-logged {
      padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    }
  }
}

/* ========================================
   Hall Lock Overlay
   ======================================== */

.hallLock {
  position: fixed;
  inset: 0;
  min-height: calc(var(--safe-vh, 1vh) * 100);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  z-index: 20;
  pointer-events: none;
  cursor: default;
}

.hallLock[aria-hidden="false"] {
  display: flex;
}

.hallLock,
.hallLock * {
  -webkit-user-select: none;
  user-select: none;
}

.hallLock__card {
  width: min(520px, 100%);
  padding: clamp(16px, 4vw, 24px);
  border-radius: var(--radius-xl);
  text-align: center;
  background:
    radial-gradient(circle at 26% 18%, rgba(253, 248, 243, 0.20), transparent 55%),
    radial-gradient(circle at 70% 80%, rgba(212, 184, 150, 0.18), transparent 60%),
    linear-gradient(135deg, rgba(232, 212, 184, 0.28), rgba(212, 184, 150, 0.18));
  border: 1px solid rgba(255, 248, 240, 0.28);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  cursor: pointer;
}

.hallLock__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: clamp(6px, 1.5vw, 8px) clamp(10px, 2vw, 12px);
  border-radius: var(--radius-full);
  font-size: clamp(10px, 1.8vw, 11px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 240, 232, 0.86);
  border: 1px solid rgba(255, 248, 240, 0.14);
  background: rgba(0, 0, 0, 0.22);
  margin-bottom: clamp(8px, 2vw, 12px);
}

.hallLock__title {
  font-size: clamp(15px, 3.5vw, 16px);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--cream-50);
  margin-bottom: clamp(8px, 2vw, 12px);
}

.hallLock__text {
  font-size: clamp(11px, 2.2vw, 12px);
  line-height: 1.6;
  color: var(--cream-200);
  opacity: 0.82;
  margin-bottom: clamp(8px, 2vw, 12px);
}

.hallLock__hint {
  font-size: clamp(11px, 2.2vw, 12px);
  color: rgba(248, 240, 232, 0.85);
  opacity: 0.85;
}

/* ========================================
   Mobile Fixed Action Bar
   ======================================== */

.mobileBar {
  position: fixed;
  left: clamp(8px, 2vw, 12px);
  right: clamp(8px, 2vw, 12px);
  bottom: clamp(8px, 2vw, 12px);
  z-index: 190;
  display: none;
  gap: clamp(8px, 2vw, 12px);
  padding: clamp(8px, 2vw, 12px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 248, 240, 0.14);
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.mobileBar .btn {
  width: 100%;
  min-height: var(--control-md);
}

@media (max-width: 700px) {
  body.is-logged .mobileBar {
    display: flex;
  }
}

/* ========================================
   Loading Overlay
   ======================================== */

.loading {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.loading[aria-hidden="false"] {
  display: flex;
}

.loading__card {
  width: min(420px, 100%);
  padding: clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-xl);
  display: flex;
  gap: clamp(8px, 2vw, 12px);
  align-items: center;
}

.loading__spinner {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 248, 240, 0.22);
  border-top-color: rgba(212, 184, 150, 0.85);
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading__text {
  font-size: clamp(12px, 2.2vw, 13px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cream-100);
  opacity: 0.92;
}

/* ========================================
   Toast Notifications
   ======================================== */

.toastHost {
  position: fixed;
  right: clamp(8px, 2vw, 12px);
  bottom: clamp(8px, 2vw, 12px);
  z-index: 220;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 12px);
  pointer-events: none;
}

.toast {
  pointer-events: none;
  max-width: min(360px, calc(100vw - clamp(16px, 4vw, 24px)));
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 248, 240, 0.12);
  background: rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(8px);
  opacity: 0;
  transition: transform var(--duration-base) var(--ease-smooth),
              opacity var(--duration-base) var(--ease-smooth);
  color: rgba(248, 240, 232, 0.92);
  font-size: clamp(11px, 2vw, 12px);
  box-shadow: var(--shadow-md);
}

.toast.is-in {
  transform: translateY(0);
  opacity: 1;
}

.toast.is-out {
  transform: translateY(8px);
  opacity: 0;
}

.toast--ok {
  border-color: rgba(212, 184, 150, 0.28);
}

.toast--warn {
  border-color: rgba(255, 248, 240, 0.18);
}

.toast--err {
  border-color: rgba(255, 248, 240, 0.14);
  background: rgba(0, 0, 0, 0.40);
}

/* Seat popover styles removed (UI refactor: admin info block used instead) */

/* ========================================
   Admin Tools
   ======================================== */

/* Admin: selected seat info (replaces seat popover for admin) */
.adminSeat{
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: clamp(10px, 2vw, 14px);
}

.adminSeat__title{
  font-size: clamp(12px, 2.2vw, 13px);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--cream-50);
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 248, 240, 0.10);
  background: rgba(0, 0, 0, 0.18);
}

.adminSeat__meta{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xs);
}

.adminSeat__line{
  display: flex;
  justify-content: space-between;
  gap: clamp(8px, 2vw, 12px);
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 248, 240, 0.08);
  background: rgba(0, 0, 0, 0.22);
  font-size: clamp(11px, 2vw, 12px);
}

.admin__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(8px, 2vw, 12px);
}

.admin__buttons {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 12px);
  margin-top: clamp(8px, 2vw, 12px);
  align-items: stretch;
}

.admin__buttons .btn {
  width: 100%;
  max-width: none;
}

.admin__buttons .btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.admin__grid .field {
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-height: 58px;
}

.admin__grid .field__label {
  font-size: clamp(11px, 2vw, 12px);
  color: var(--cream-50);
  opacity: 0.9;
}

.admin__grid .field__input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--cream-50);
  padding: 0 clamp(8px, 2vw, 12px);
  height: 40px;
  border-radius: var(--radius-sm);
}

.admin .admin__small {
  margin-top: clamp(8px, 2vw, 12px);
  font-size: clamp(11px, 2vw, 12px);
  opacity: 0.78;
}

.admin .panel__title {
  margin-top: var(--space-xs);
}

body.is-admin .seat[data-state="free"] {
  cursor: default;
  opacity: 0.98;
}

/* Admin: mapa je len prehľad (read-only) */
body.is-admin .seat{
  cursor: default;
}

body.is-admin #selectionArea {
  display: none;
}

body.is-admin .admin {
  margin-top: var(--space-xs);
}

body.is-admin .panel {
  padding-bottom: clamp(16px, 3vw, 24px);
}

/* ========================================
   Saved Login Block
   ======================================== */

.savedLogin {
  margin-bottom: clamp(12px, 2.5vw, 16px);
}

.savedLogin__title {
  font-size: clamp(10px, 1.8vw, 11px);
  font-weight: 540;
  color: var(--cream-200);
  opacity: 0.75;
  margin-bottom: var(--space-xs);
}

.savedLogin__who {
  font-size: clamp(13px, 2.4vw, 14px);
  font-weight: 620;
  color: var(--cream-50);
  letter-spacing: -0.01em;
  margin-bottom: clamp(8px, 2vw, 12px);
}

.savedLogin__actions {
  display: flex;
  gap: clamp(8px, 2vw, 12px);
  flex-wrap: wrap;
}

/* ========================================
   Focus States
   ======================================== */

:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.seat:focus-visible,
.field__input:focus-visible,
select.field__input:focus-visible {
  outline: 2px solid rgba(243, 234, 223, 0.75);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(212, 184, 150, 0.10);
}

/* ========================================
   Hover Effects (pointer-capable devices)
   ======================================== */

@media (hover: hover) and (pointer: fine) {
  .btn:hover::before {
    opacity: 1;
  }
  .seat:hover::before {
    opacity: 1;
  }
  .tableBlock:hover::before {
    opacity: 1;
  }
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
   Touch device fixes (iOS / Android)
   ======================================== */

:root{
  /* JS updates this value for stable viewport sizing on mobile */
  --safe-vh: 1vh;
}

/* Prevent iOS zoom on form controls */
input,
textarea,
select,
button {
  font-size: max(16px, var(--text-xl));
}

/* Better tap behaviour on touch devices */
button,
a,
.btn,
.icon-btn,
.seat,
.tableBlock,
.hallLock__card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Don't allow accidental text selection on the seating map */
.hall,
.hall__grid,
.seat,
.tableBlock,
.hallLock {
  -webkit-user-select: none;
  user-select: none;
}

/* When overlays are open, we also apply a CSS lock (JS uses position:fixed for iOS reliability) */
body.modal-open {
  overflow: hidden;
}

/* Prevent scroll chaining (scroll leaking to background) */
.modal,
.panel {
  overscroll-behavior: contain;
}

/* Smoother scrolling inside overlay cards on iOS */
.modal__card,
.panel {
  -webkit-overflow-scrolling: touch;
}

/* Use stable viewport sizing on mobile browsers */
.modal__card {
  max-height: calc((var(--safe-vh) * 100) - clamp(24px, 6vw, 48px));
  max-height: calc(100dvh - clamp(24px, 6vw, 48px));
}

.mobileBar {
  bottom: calc(clamp(8px, 2vw, 12px) + env(safe-area-inset-bottom));
  padding-bottom: calc(clamp(8px, 2vw, 12px) + env(safe-area-inset-bottom));
}

/* Avoid sticky/ghost hover states on touch devices */
@media (hover: none) and (pointer: coarse) {
  .btn-primary:hover,
  .btn-ghost:hover,
  .icon-btn:hover,
  .chip:hover,
  .seat:hover,
  .tableBlock:hover,
  .kv:hover {
    transform: none !important;
    box-shadow: inherit !important;
    background: inherit !important;
    border-color: inherit !important;
  }
}

/* iOS: fixed background can cause jitter; keep the look but avoid the scroll glitch */
@supports (-webkit-touch-callout: none) {
  body {
    background-attachment: scroll;
  }
}

/* Mobile: show parket banner between left and right columns and hide the desktop floor banner */
.parket-mobile { display: none; }

@media (max-width: 700px) {
  .hall__floor .banner--big { display: none; }
  .parket-mobile { display: block; padding: 12px 0; }
  .parket-mobile .banner--big { width: 100%; min-height: 96px; display:flex; align-items:center; justify-content:center; }
}

/* ========================================
   Admin List Modal
   ======================================== */

.adminList{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adminItem{
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 248, 240, 0.12);
  background: rgba(0, 0, 0, 0.20);
  overflow: hidden;
}

.adminItem__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.adminItem__who{
  display:flex;
  flex-direction:column;
  gap: 2px;
  min-width: 0;
}

.adminItem__name{
  font-weight: 650;
  color: var(--cream-50);
  letter-spacing: -0.01em;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adminItem__meta{
  font-size: 12px;
  color: rgba(248, 240, 232, 0.82);
  opacity: 0.9;
}

.adminItem__badge{
  padding: 6px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 248, 240, 0.12);
  background: rgba(0,0,0,0.22);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.adminItem__badge.taken{ opacity: 0.95; }
.adminItem__badge.free{ opacity: 0.65; }

.adminItem__body{
  padding: 0 14px 14px;
  display: grid;
  gap: 10px;
}

.adminItem__kv{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 248, 240, 0.08);
  background: rgba(0, 0, 0, 0.16);
  font-size: 12px;
}

.adminItem__actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.adminItem__actions .btn{
  flex: 1;
  min-width: 180px;
}

@media (max-width: 480px){
  .adminItem__actions .btn{
    min-width: 0;
  }
}


/* ================================
   Admin – hover tooltip nad miestom
   ================================ */

.seat{ position: relative; }

.seat .admin-tooltip{
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,25,20,.95);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 50;
}

.seat .admin-tooltip::after{
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(30,25,20,.95) transparent transparent transparent;
}

body.is-admin .seat:hover .admin-tooltip{ opacity: 1; }


/* Danger button (napr. Odstrániť účet) */
.btn-danger{
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  border: 1px solid rgba(220, 38, 38, 0.65);
}
.btn-danger:hover{
  background: rgba(239, 68, 68, 0.95);
}
.btn-danger:active{
  transform: translateY(1px);
}
