:root {
  --neon-blue: #00f0ff;
  --neon-blue-glow: 0 0 20px #00f0ff, 0 0 40px #00f0ff99;
  --yellow: #dfb708;
  --blue: #00345f;
}

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

html,
body {
  height: 100%;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

body {
  background: radial-gradient(ellipse at top, #222 0%, #000 100%);
  color: #fff;
  font-family: "Jockey One", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: auto;
}

#plan_layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.debug {
  position: absolute;
  z-index: 10000;
  margin: 10px;
  font-family: "Courier New";
  font-size: 14px;
  border: 2px solid #000000;
  padding: 6px;
  background-color: #cccccc;
}

#outer {
  position: relative;
  width: 1024px;
  height: 638px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #ffe81f33;
  box-sizing: content-box;
  box-shadow:
    0 0 24px #ffe81f33,
    0 0 32px #00f0ff55;
  background: rgba(0, 0, 0, 0.6);
}

#plan_details {
  width: 320px;
  max-width: 360px;
  background: rgba(8, 12, 18, 0.85);
  border: 1px solid #1f2b3a;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

#plan_details h2 {
  margin: 0 0 12px 0;
  font-size: 1.2rem;
}

#plan_details .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#plan_details .detail-row:last-of-type {
  border-bottom: none;
}

#plan_details strong {
  color: #ffe81f;
  font-weight: 700;
}

#plan_details .detail-hint {
  margin: 12px 0 0 0;
  font-size: 0.95rem;
  color: #cbd5e1;
}

#plan_details .danger {
  margin-top: 12px;
  width: 100%;
  appearance: none;
  border: 1px solid #ff6b6b66;
  background: transparent;
  color: #ff6b6b;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

#plan_details .danger:hover {
  color: #fff;
  border-color: #ff6b6b;
  box-shadow: 0 0 12px rgba(255, 107, 107, 0.4);
}

#plan_details .secondary {
  margin-top: 10px;
  width: 100%;
  appearance: none;
  border: 1px solid #00f0ff55;
  background: transparent;
  color: var(--neon-blue);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 12px #00f0ff44;
}

#plan_details .secondary:hover {
  color: #fff;
  box-shadow: var(--neon-blue-glow);
}

#instructions,
#plan_outer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#instructions {
  font-size: 0.9em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  z-index: 90;
  background-color: rgba(0, 0, 0, 0.78);
  color: #fff;
}

#instructions div {
  float: none;
  padding: 0;
  margin: 0;
  max-width: 720px;
}

#tokenForm {
  display: none;
}

#loginError {
  color: #ff6b6b;
  font-weight: bold;
  font-size: 1.2em;
}

#plan_outer {
  z-index: 80;
  overflow: hidden;
}

#plan_outer img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.tableRect {
  position: absolute;
  z-index: 70;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  width: 55px;
  height: 84px;
  box-sizing: content-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(10px, 1.6vw, 18px);
  color: #cdbb55;
  text-shadow: 0 0 6px #000;
  pointer-events: none;
}

.tableRectOwn {
  border: none;
  color: #00f0ff;
  background: rgba(0, 30, 40, 0.1);
  box-shadow: 0 0 10px #00f0ff66;
}

.tableRectLabel {
  padding: 1px 2px;
  line-height: 1.05;
  max-width: 84px;
  max-height: 55px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: clamp(8px, 1.2vw, 14px);
  display: inline-block;
  transform: rotate(90deg);
  transform-origin: center;
}

.plan-locked #plan_outer {
  filter: blur(6px);
  transition: filter 0.2s ease;
}

.plan-unlocked #plan_outer {
  filter: none;
  transition: filter 0.2s ease;
}

#bookTableButton {
  appearance: none;
  border: 1px solid #00f0ff55;
  background: transparent;
  color: var(--neon-blue);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 12px #00f0ff44;
}

#bookTableButton:hover {
  color: #fff;
  box-shadow: var(--neon-blue-glow);
}

.tGeneral {
  position: absolute;
  text-align: center;
  vertical-align: middle;
  line-height: 28px;
  width: 28px;
  height: 28px;
  z-index: 72;
  box-sizing: content-box;
  background-color: yellowgreen;
}

.plan-dim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: none;
}

.tLocked {
  background-color: #cccccc;
  cursor: not-allowed;
}

.tBooked {
  background-color: indianred;
  cursor: not-allowed;
}

.tBooked:not(.tOwn) {
  border: none;
}

.tUnlocked {
  background-color: mediumseagreen;
  cursor: pointer;
}

.tReserved {
  background-color: #f0ad4e;
}

.tLocked.tReserved {
  background-color: #f0ad4e;
  cursor: not-allowed;
}

.tReservedOwn {
  background-color: #5bc0de;
}

.has-booking .tUnlocked {
  background-color: #2f4f4f;
  opacity: 0.7;
  cursor: not-allowed;
}

.tOwn {
  background-color: cornflowerblue;
}

@media (max-width: 1200px) {
  #plan_layout {
    flex-direction: column;
    align-items: center;
  }
  #plan_details {
    width: 100%;
    max-width: 720px;
  }
}

/* Coords editor */
body.coords-page {
  background: radial-gradient(
    circle at top,
    #101826 0%,
    #0b1118 45%,
    #0a0f15 100%
  );
  color: #e6edf3;
  font-family: "Trebuchet MS", "Lucida Sans", sans-serif;
  display: block;
  align-items: stretch;
  justify-content: flex-start;
  padding: 24px;
}

.coords-page .wrap {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.coords-page h1 {
  font-size: 1.4rem;
  margin: 0 0 0.5rem 0;
}

.coords-page p {
  margin: 0 0 0.75rem 0;
  color: #b6c2d3;
}

.coords-page .panel {
  background: #0f1723;
  border: 1px solid #1e2b3a;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.coords-page .group {
  background: #0c1520;
  border: 1px solid #1b2634;
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 12px 0;
}

.coords-page .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}

.coords-page .section-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #112234;
  color: #7cc7ff;
  font-size: 0.8rem;
}

.coords-page label {
  display: block;
  margin: 0.45rem 0 0.25rem 0;
  color: #b6c2d3;
  font-size: 0.9rem;
}

.coords-page .label-tight {
  margin: 0;
}

.coords-page input,
.coords-page select,
.coords-page textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #223244;
  background: #0b1118;
  color: #e6edf3;
  font-size: 0.95rem;
  outline: none;
}

.coords-page input:focus,
.coords-page select:focus,
.coords-page textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.coords-page .row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.coords-page .row input[type="checkbox"],
.coords-page .row input[type="radio"] {
  width: auto;
  margin: 0;
}

.coords-page button {
  border: 1px solid #2b3b4f;
  background: #0f1a26;
  color: #e6edf3;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.coords-page button:hover {
  border-color: #3b82f6;
  color: #ffffff;
}

.coords-page button.secondary {
  background: #0b121b;
  color: #c9d4e3;
}

.coords-page .hotkey-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #2b3b4f;
  color: #9fb3c8;
  font-size: 0.75rem;
  cursor: help;
}

.coords-page .status {
  min-height: 20px;
  font-size: 0.9rem;
  color: #9fb3c8;
}

.coords-page .board {
  display: grid;
  grid-template-columns: auto 320px;
  gap: 16px;
  align-items: start;
}

.coords-page .stage {
  position: relative;
  width: 1024px;
  max-width: 100%;
  display: inline-block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #1e2b3a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.coords-page .stage img {
  display: block;
  width: 100%;
  height: auto;
}

.coords-page .grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: var(--grid, 8px) var(--grid, 8px);
}

.coords-page .grid.hidden {
  display: none;
}

.coords-page .drag-rect {
  position: absolute;
  border: 1px dashed #7cc7ff;
  background: rgba(124, 199, 255, 0.12);
  pointer-events: none;
}

.coords-page .marker {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #7cc7ff;
  border-radius: 50%;
  transform: translate(0, 0);
  pointer-events: none;
}

.coords-page .marker.selected {
  background: #fbbf24;
}

.coords-page .seat-rect {
  position: absolute;
  border: 1px solid rgba(124, 199, 255, 0.8);
  background: rgba(124, 199, 255, 0.18);
  box-sizing: content-box;
  pointer-events: auto;
}

.coords-page .seat-rect.selected {
  border-color: #fbbf24;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.6);
}

.coords-page .table-rect {
  position: absolute;
  border: 2px solid rgba(255, 231, 75, 0.6);
  background: rgba(255, 231, 75, 0.08);
  color: #ffe74b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  box-sizing: content-box;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.coords-page .table-rect.selected {
  border-color: #fbbf24;
  color: #fbbf24;
}

.coords-page .side-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 300px;
}

.coords-page .side {
  background: #0f1723;
  border: 1px solid #1e2b3a;
  border-radius: 16px;
  padding: 12px;
}

.coords-page .help strong {
  display: block;
  margin-bottom: 8px;
}

.coords-page .help-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.coords-page .help-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #b6c2d3;
  font-size: 0.9rem;
}

.coords-page .help-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #112234;
  color: #7cc7ff;
  font-size: 0.8rem;
}

.coords-page .collapsible summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 8px;
}

.coords-page #seatList {
  min-height: 220px;
  font-family: "Courier New", monospace;
  white-space: pre;
  overflow: hidden;
  resize: none;
}

@media (max-width: 1200px) {
  .coords-page .wrap {
    grid-template-columns: 1fr;
  }
  .coords-page .board {
    grid-template-columns: 1fr;
  }
  .coords-page .side-column {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
