:root{
  --hall-w: 1000px;
  --hall-h: 780px;

  --green: #dff7e6;
  --yellow: #fff4cc;
  --red: #ffd9d9;
  --gray: #e5e5e5;
  --ink: #1b1b1b;
  --muted: #666;
  --line: #ddd;
}

*,
*::before,
*::after{ box-sizing: border-box; }

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  background: #fafafa;
  color: var(--ink);
}

.page{
  max-width: 1100px;
  margin: 20px auto 60px;
  padding: 0 14px;
}

h1{ margin: 6px 0 16px; font-size: 28px; }

.card{
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 22px rgba(0,0,0,.04);
  margin-bottom: 14px;
}
.center{ max-width:720px; margin:40px auto; text-align:center; }
.event-card h2{ margin:0; }
.event-card p{ margin:6px 0 0; color:#555; }

/* ===== Responsive Viewport + Canvas ===== */
#hallViewport{
  width: 100%;
  overflow: auto;
  background: transparent;
  padding-bottom: 8px;
}

#hallCanvas{
  position: relative;
  width: var(--hall-w);
  height: var(--hall-h);
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 6px 22px rgba(0,0,0,.06);
  transform-origin: top left;
  margin: 0 auto;
}

/* Bühne */
.stage{
  position:absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: #f2f2f2;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  border: 1px dashed #cfcfcf;
}

/* ===========================
   BANKETT-TISCHE
   =========================== */
.table.long_table{
  position:absolute;
  width: 70px;
  border-radius: 8px;
  border: 3px solid #222;
  background: var(--green);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 6px;
  cursor:pointer;
  user-select:none;
  transition: transform .08s ease, box-shadow .12s ease;
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
}
.table.long_table:hover{ transform: translateY(-2px); }

.table.long_table.short{ height: 130px; }
.table.long_table.long{ height: 260px; }

.table.long_table .inner{
  background: rgba(255,255,255,0.6);
  border-radius: 6px;
  width: 100%;
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  font-size:12px;
  text-align:center;
}

/* Stühle links/rechts */
.table.long_table .chairs{
  position:absolute;
  top: 8px;
  bottom: 8px;
  width: 16px;
  display:flex;
  flex-direction:column;
  justify-content:space-evenly;
  gap: 4px;
}
.table.long_table .chairs.left  { left: -20px; }
.table.long_table .chairs.right { right: -20px; }

/* Einzelner Stuhl = frei (grün) */
.table.long_table .chair{
  width: 14px;
  height: 14px;
  border: 2px solid #222;
  border-radius: 3px;
  background: #bff0c8; /* frei = grün */
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* belegte Stühle rot */
.table .chair.taken{
  background: #ff9b9b; /* belegt = rot */
  border-color: #444;
}

/* Statusfarben Tisch */
.table.long_table.full{
  background: var(--red);
  cursor:not-allowed;
  opacity:.85;
  box-shadow: none;
}
.table.long_table.partial{ background: var(--yellow); }
.table.long_table.disabled{
  background: var(--gray) !important;
  border-color: #777;
  color: #666;
  cursor: not-allowed;
  opacity: .9;
  box-shadow: none;
}

/* ===========================
   RUNDE STEHTISCHE
   =========================== */
.table.round_standing{
  position:absolute;
  width: 95px;
  height: 95px;
  border-radius: 999px;
  border: 3px solid #222;
  background: var(--green);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  user-select:none;
  transition: transform .08s ease, box-shadow .12s ease;
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
}
.table.round_standing:hover{ transform: translateY(-2px); }
.table.round_standing.full{ background: var(--red); cursor:not-allowed; opacity:.85; }
.table.round_standing.partial{ background: var(--yellow); }
.table.round_standing.disabled{
  background: var(--gray) !important;
  border-color:#777; color:#666; cursor:not-allowed; opacity:.9; box-shadow:none;
}

/* Inhalte */
.table .name{ font-weight:700; font-size: 13px; }
.table .free{ font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===========================
   MODAL Reservierung
   =========================== */
.modal{
  position: fixed;
  inset: 0;
  z-index: 999;
}
.hidden{ display:none; }

.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
}

.modal-card{
  position: relative;
  width: min(92vw, 380px);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin: 6vh auto;
}

.modal-close{
  position:absolute;
  right: 8px;
  top: 6px;
  border: none;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}

/* Form */
label{ font-size: 13px; font-weight:600; display:block; margin-top:10px; }
input, select, button{
  width: 100%;
  padding: 9px 10px;
  margin-top:5px;
  border-radius: 10px;
  border: 1px solid #cfcfcf;
  font-size: 14px;
  display:block;
}
button{
  margin-top: 12px;
  background:#111;
  color:white;
  border:none;
  cursor:pointer;
  font-weight:700;
}
button:hover{ opacity:.92; }
#msg{ margin-top:10px; font-size:14px; }

/* Legend */
.legend{
  display:flex;
  gap:10px;
  margin-top: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.legend .item{ display:flex; align-items:center; gap:6px; }
.dot{
  width: 12px; height:12px; border-radius: 50%;
  border:1px solid #333;
}
.dot.green{ background: var(--green);}
.dot.yellow{ background: var(--yellow);}
.dot.red{ background: var(--red);}
.dot.gray{ background: var(--gray);}

/* ===== Mobile Bottom-Sheet ===== */
@media (max-width: 700px){
  .modal-card{
    width: 100vw;
    max-height: 82vh;
    margin: auto 0 0 0;
    border-radius: 16px 16px 0 0;
  }
}
