* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --bg: #0a0e18;
  --panel: #111927;
  --panel-2: #161c2a;
  --border: rgba(255,255,255,.08);
  --accent: #00d9d9;
  --accent-hover: #33e5e5;
  --accent-ink: #06222a;
  --text: #f5f7fb;
  --text-soft: #c7d0de;
  --green: #10b981;
  --amber: #ffca28;
  --red: #ff5c5c;
}
html, body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; margin: 0; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-bottom: 1px solid var(--border); }
.back-link { color: var(--text-soft); text-decoration: none; font-size: .85rem; }
.back-link:hover { color: var(--accent); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

main { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }

.intro { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.intro-eyebrow { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.intro h1 { font-size: 1.9rem; margin: 0 0 14px; line-height: 1.25; }
.intro p { color: var(--text-soft); line-height: 1.6; font-size: .96rem; }
.intro-actions { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 24px; flex-wrap: wrap; }

.btn-play { background: linear-gradient(135deg, var(--accent), #00b8b8); color: var(--accent-ink); border: none; border-radius: 10px; padding: 13px 26px; font-weight: 700; font-size: .95rem; cursor: pointer; transition: transform .15s ease, opacity .15s ease; }
.btn-play:hover { transform: translateY(-1px); }
.btn-play:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.subtitle-toggle { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-soft); cursor: pointer; }
.subtitle-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

.mode-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.mode-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text-soft); border-radius: 8px; padding: 8px 14px; font-size: .82rem; font-weight: 600; cursor: pointer; transition: color .15s ease, border-color .15s ease; }
.mode-btn:hover { color: var(--text); }
.mode-btn.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.mode-btn-fullscreen { background: var(--panel-2); border: 1px solid var(--border); color: var(--text-soft); border-radius: 8px; padding: 8px 14px; font-size: .82rem; cursor: pointer; }
.mode-btn-fullscreen:hover { color: var(--accent); border-color: var(--accent); }

.stage-wrap { max-width: 1080px; margin: 0 auto; }
.stage-wrap.pseudo-fullscreen { position: fixed; inset: 0; z-index: 9999; max-width: none; overflow: auto; background: var(--bg); display: flex; flex-direction: column; justify-content: center; padding: 24px; }
body.pseudo-fullscreen-lock { overflow: hidden; }

.stage { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2px; background: var(--border); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); min-height: 640px; }
@media (max-width: 860px) { .stage:not([data-mode="mobile"]) { grid-template-columns: 1fr; } }

/* ---------- Modo mobile: un solo marco de teléfono; el panel de gestión y la página pública
   son "pantallas" secuenciales dentro del mismo marco (una visible a la vez). script.js
   alterna la clase .mob-screen-active entre ambas. ---------- */
.stage[data-mode="mobile"] {
  display: block;
  position: relative;
  width: 320px; height: 640px;
  margin: 0 auto;
  background: #05070c;
  border: 10px solid #1c2536;
  border-radius: 42px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  overflow: hidden;
  min-height: 0;
}
.stage[data-mode="mobile"]::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 22px; background: #1c2536; border-radius: 0 0 14px 14px; z-index: 5;
}
.stage[data-mode="mobile"] .stage-half {
  position: absolute; inset: 0;
  padding-top: 22px; /* despeja el notch del marco de teléfono */
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(16px);
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
}
.stage[data-mode="mobile"] .stage-half.mob-screen-active {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0); z-index: 2;
}
@media (max-width: 480px) {
  #btnModeDesktop { display: none; }
  .stage[data-mode="mobile"] { width: 100%; max-width: 100%; height: 78vh; border-radius: 0; border-width: 6px; }
}

.stage-half { position: relative; background: var(--panel); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.device-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }

/* ===================== Panel de gestión (escritorio simulado) ===================== */
.rm-escritorio { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }

.rm-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.rm-topbar h4 { margin: 0; font-size: .86rem; display: flex; align-items: center; gap: 6px; }
.rm-topbar-icon { font-size: .95rem; }

.rm-body { flex: 1; display: flex; min-height: 0; }

.rm-rail { display: flex; flex-direction: column; width: 118px; flex-shrink: 0; background: var(--panel-2); border-right: 1px solid var(--border); padding: 8px; gap: 4px; }
.rm-rail-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 9px; font-size: .68rem; font-weight: 600; color: var(--text-soft); cursor: pointer; text-align: center; transition: background .15s ease, color .15s ease; }
.rm-rail-tab:hover { color: var(--text); }
.rm-rail-tab.active { background: rgba(0,217,217,.14); color: var(--accent); }
.rm-rail-ico { font-size: 1.05rem; }

.rm-content { flex: 1; overflow-y: auto; padding: 14px; min-width: 0; }
.rm-panel { display: flex; flex-direction: column; gap: 12px; }

.rm-panel-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.rm-panel-card h5 { margin: 0 0 4px; font-size: .86rem; }
.rm-hint { color: var(--text-soft); font-size: .74rem; line-height: 1.5; margin: 4px 0 10px; }
.rm-hint-inline { color: var(--text-soft); font-size: .72rem; }
.rm-card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }

.rm-limite-badge { padding: 2px 9px; border-radius: 999px; background: #0b0f19; border: 1px solid var(--border); font-size: .68rem; font-weight: 700; color: var(--text); white-space: nowrap; }

.rm-input { width: 100%; background: #0b0f19; border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; color: var(--text); font-size: .76rem; }
.rm-sede-switcher { max-width: 180px; width: auto; transition: box-shadow .3s ease, border-color .3s ease; }
.rm-sede-switcher-highlight { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,217,217,.25); }

.rm-btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text-soft); border-radius: 8px; padding: 6px 10px; font-size: .72rem; cursor: pointer; white-space: nowrap; }
.rm-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Salas / Sedes */
.rm-salas-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rm-sala-card { background: #0b0f19; border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; transition: border-color .2s ease, transform .2s ease; }
.rm-sala-nombre { font-weight: 700; font-size: .82rem; }
.rm-sala-badge { font-size: .66rem; color: var(--accent); background: rgba(0,217,217,.12); border-radius: 999px; padding: 2px 8px; }
.rm-btn-abrir-editor { margin-top: 2px; }
.rm-sede-card { cursor: pointer; }
.rm-sede-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rm-sede-link { word-break: break-all; }

/* Editor de plano */
.rm-editor-toolbar { display: flex; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.rm-tool-btn { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--text-soft); }
.rm-tool-shape { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--text-soft); }
.rm-tool-circulo { border-radius: 50%; }
.rm-tool-cuadrado { border-radius: 3px; }
.rm-tool-rectangulo { border-radius: 3px; width: 24px; height: 12px; }

.rm-plano-canvas {
  position: relative; height: 180px; border-radius: 10px; margin-bottom: 8px;
  background:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0/22px 22px,
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0/22px 22px,
    #0b0f19;
  border: 1px solid var(--border);
  overflow: hidden;
}
.rm-mesa-shape { position: absolute; width: 32px; height: 32px; box-shadow: 0 4px 10px rgba(0,0,0,.35); animation: mesaIn .25s ease; }
.rm-mesa-circulo { border-radius: 50%; }
.rm-mesa-cuadrado { border-radius: 6px; }
.rm-mesa-rectangulo { width: 52px; height: 26px; border-radius: 6px; }
@keyframes mesaIn { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }

/* Reservas */
.rm-subtabs { display: flex; gap: 4px; margin-bottom: 8px; }
.rm-subtab { padding: 6px 12px; border-radius: 8px 8px 0 0; font-size: .74rem; font-weight: 600; color: var(--text-soft); background: transparent; border: 1px solid transparent; }
.rm-subtab.active { color: var(--accent); background: var(--panel-2); border-color: var(--border); }
.rm-subtab-count { display: inline-block; margin-left: 5px; font-size: .64rem; background: rgba(0,217,217,.15); color: var(--accent); border-radius: 999px; padding: 1px 6px; }

.rm-tabla-scroll { overflow-x: auto; }
.rm-tabla { width: 100%; border-collapse: collapse; font-size: .72rem; table-layout: fixed; }
.rm-tabla th { text-align: left; color: var(--text-soft); font-weight: 600; padding: 7px 5px; border-bottom: 1px solid var(--border); word-break: break-word; }
.rm-tabla td { padding: 8px 5px; border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-word; }
.rm-tabla th:nth-child(2), .rm-tabla td:nth-child(2) { width: 22%; }
.rm-tabla th:nth-child(3), .rm-tabla td:nth-child(3) { width: 13%; }
.rm-tabla th:nth-child(4), .rm-tabla td:nth-child(4) { width: 16%; }
.rm-tabla th:nth-child(5), .rm-tabla td:nth-child(5) { width: 21%; }
.rm-fila-nueva { animation: filaIn .4s ease; background: rgba(0,217,217,.08); }
@keyframes filaIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.rm-badge { display: inline-block; padding: 2px 6px; border-radius: 999px; font-size: .6rem; font-weight: 600; white-space: nowrap; }
.rm-badge-confirmada { background: rgba(16,185,129,.15); color: var(--green); }

/* Configuración */
.franja-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #0b0f19; border-radius: 8px; margin-bottom: 6px; font-size: .78rem; animation: msgIn .2s ease; }
.franja-row span { flex: 1; }
.franja-row .franja-icon { color: var(--accent); flex: none; }

.rm-toggle-row { display: flex; gap: 4px; background: #0b0f19; border: 1px solid var(--border); border-radius: 9px; padding: 3px; margin-bottom: 10px; }
.rm-toggle-btn { flex: 1; text-align: center; padding: 7px; border-radius: 7px; font-size: .74rem; font-weight: 600; color: var(--text-soft); cursor: default; transition: .15s; }
.rm-toggle-btn.active { background: var(--accent); color: var(--accent-ink); }

.rm-code-board { background: #0b0f19; border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow-x: auto; }
.rm-code-board pre { margin: 0; font-size: .68rem; color: var(--text-soft); font-family: "SFMono-Regular", Consolas, monospace; }
.rm-link-board { display: flex; align-items: center; background: #0b0f19; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: .74rem; word-break: break-all; }
.rm-slug-prefix, .rm-slug-suffix { color: var(--text-soft); }
#rmLinkSlug { color: var(--accent); font-weight: 700; }

@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===================== Página pública (comensal) ===================== */
.stage-client { position: relative; }
.client-viewport { position: relative; flex: 1; background: #05070c; overflow-y: auto; }
.mock-site-topbar { height: 34px; background: #10151f; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 12px; gap: 6px; flex-shrink: 0; }
.mock-site-dot { width: 8px; height: 8px; border-radius: 50%; background: #333; }
.mock-url-bar { margin-left: 8px; font-size: .66rem; color: var(--text-soft); background: rgba(255,255,255,.05); border-radius: 6px; padding: 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rm-portada {
  height: 150px;
  background: linear-gradient(160deg, #2b1c14, #1a120d);
  display: flex; align-items: flex-end; padding: 16px;
}
.rm-portada-texto h4 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 1.35rem; color: #f7ead9; }
.rm-portada-texto p { margin: 0; color: #e2c9a8; font-size: .84rem; }

.rm-widget-reservar { margin: 16px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; transition: opacity .3s ease, transform .3s ease; }
.rm-widget-reservar.rm-widget-enviando { opacity: .55; transform: scale(.98); }
.rm-widget-titulo { display: block; font-weight: 700; font-size: .86rem; margin-bottom: 8px; }
.rm-widget-campo { font-size: .76rem; color: var(--text-soft); background: #0b0f19; border-radius: 7px; padding: 8px 10px; margin-bottom: 10px; }
.rm-widget-btn { width: 100%; background: var(--accent); color: var(--accent-ink); border: none; border-radius: 8px; padding: 10px; font-weight: 700; font-size: .82rem; transition: transform .15s ease, box-shadow .2s ease; }
.rm-widget-btn-highlight { box-shadow: 0 0 0 4px rgba(0,217,217,.3); transform: translateY(-1px); }

.rm-toast { margin: 0 16px 16px; background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.35); color: var(--green); border-radius: 9px; padding: 10px 12px; font-size: .78rem; font-weight: 600; animation: popIn .25s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stage-half, .rm-content { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.stage-half::-webkit-scrollbar, .rm-content::-webkit-scrollbar { width: 8px; }
.stage-half::-webkit-scrollbar-thumb, .rm-content::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,.25); border-radius: 8px; }

.subtitle-bar { position: fixed; left: 50%; top: 38vh; transform: translateX(-50%); z-index: 500; max-width: min(560px, 88vw); text-align: center; font-size: .9rem; line-height: 1.5; color: var(--text); background: rgba(10, 14, 22, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 14px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: subtitleIn .2s ease; }
@keyframes subtitleIn { from { opacity: 0; transform: translateX(-50%) translateY(6px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.replay-wrap { text-align: center; margin-top: 24px; }
.btn-replay { background: transparent; border: 1px solid var(--accent); color: var(--accent); }

.footnote { max-width: 720px; margin: 40px auto 0; text-align: center; }
.footnote p { color: var(--text-soft); font-size: .78rem; line-height: 1.6; }

/* ---------- Mobile: el rail lateral se vuelve una barra horizontal, calcando la propia
   responsividad del panel real (ver restaurante-escritorio.css @media 860px). ---------- */
@media (max-width: 860px) {
  .rm-body { flex-direction: column; }
  .rm-rail { flex-direction: row; width: 100%; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .rm-rail-tab { flex-direction: row; flex-shrink: 0; }
}
.stage[data-mode="mobile"] .rm-body { flex-direction: column; }
.stage[data-mode="mobile"] .rm-rail { flex-direction: row; width: 100%; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
.stage[data-mode="mobile"] .rm-rail-tab { flex-direction: row; flex-shrink: 0; }
.stage[data-mode="mobile"] .rm-salas-grid { grid-template-columns: 1fr; }
