/* eShowcase Gesture Directory — wood + glass lobby look */
:root {
  --wood1: #6b4a32;
  --wood2: #8b6344;
  --wood3: #a07850;
  --ink: #111;
  --muted: #3a3a3a;
  --line: rgba(0,0,0,.22);
  --glass: rgba(255,255,255,.18);
  --glass-edge: rgba(255,255,255,.55);
  --shadow: rgba(40,24,12,.45);
  --font: "Helvetica Neue", Helvetica, Arial, "PingFang HK", "Noto Sans TC", sans-serif;
  --row-h: clamp(42px, 5.2vh, 58px);
  --board-w: min(720px, 88vw);
  --board-h: min(78vh, 860px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--font);
  background: #3e2a1c;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  user-select: none; touch-action: none;
}
.stage {
  position: relative;
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* Warm wood grain wall */
.wood {
  position: absolute; inset: 0; z-index: 0;
  background:
    repeating-linear-gradient(
      92deg,
      #5a3c28 0px,
      #6e4a30 8px,
      #8a5f3d 14px,
      #7a5236 22px,
      #9a6b45 30px,
      #6b4630 40px,
      #5a3c28 48px
    ),
    radial-gradient(ellipse at 30% 20%, rgba(255,220,170,.18), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(40,20,10,.35), transparent 50%);
  background-blend-mode: soft-light, normal, normal;
  filter: contrast(1.05) saturate(1.05);
}
.wood::after {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 3px,
      rgba(0,0,0,.03) 3px 4px
    ),
    linear-gradient(180deg, rgba(255,255,255,.06), transparent 30%, rgba(0,0,0,.18));
  pointer-events: none;
}

/* Glass panel with corner standoffs */
.board {
  position: relative;
  z-index: 2;
  width: var(--board-w);
  height: var(--board-h);
  padding: 0;
}
.glass {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,.08) 40%, rgba(255,255,255,.14) 100%),
    rgba(245,240,230,.22);
  backdrop-filter: blur(1.5px) saturate(1.1);
  -webkit-backdrop-filter: blur(1.5px) saturate(1.1);
  border: 1px solid var(--glass-edge);
  box-shadow:
    0 18px 50px var(--shadow),
    0 2px 0 rgba(255,255,255,.35) inset,
    0 -1px 0 rgba(0,0,0,.12) inset,
    0 0 0 1px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.glass-shine {
  pointer-events: none;
  position: absolute; inset: 0;
  background: linear-gradient(
    115deg,
    rgba(255,255,255,.35) 0%,
    rgba(255,255,255,.05) 18%,
    transparent 42%,
    transparent 70%,
    rgba(255,255,255,.08) 100%
  );
  mix-blend-mode: soft-light;
}

.standoff {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  z-index: 5;
  background:
    radial-gradient(circle at 35% 30%, #f0f0f0, #b8b8b8 45%, #7a7a7a 70%, #cfcfcf 100%);
  box-shadow:
    0 2px 4px rgba(0,0,0,.45),
    0 0 0 2px #9a9a9a,
    inset 0 1px 1px rgba(255,255,255,.8);
}
.standoff::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ddd, #555);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.5);
}
.standoff.tl { top: -6px; left: -6px; }
.standoff.tr { top: -6px; right: -6px; }
.standoff.bl { bottom: -6px; left: -6px; }
.standoff.br { bottom: -6px; right: -6px; }

.hdr {
  flex: 0 0 auto;
  padding: clamp(22px, 3.5vh, 36px) clamp(28px, 4vw, 48px) 10px;
  text-align: center;
  position: relative; z-index: 1;
}
.hdr h1 {
  margin: 0 0 14px;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 800;
  letter-spacing: .14em;
  color: #0a0a0a;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.rule-thick {
  height: 4px;
  background: #0a0a0a;
  width: 100%;
  border-radius: 1px;
}

.viewport {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  z-index: 1;
  mask-image: linear-gradient(180deg, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
}
.list {
  will-change: transform;
  padding: 4px clamp(28px, 4vw, 48px) 28px;
  transform: translate3d(0,0,0);
}

.row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  min-height: var(--row-h);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  gap: 18px;
}
.row.floor {
  grid-template-columns: 1fr;
  justify-items: center;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: clamp(13px, 1.6vw, 16px);
  color: #111;
  border-bottom-color: rgba(0,0,0,.35);
  margin-top: 6px;
}
.row .num {
  font-weight: 700;
  font-size: clamp(15px, 1.9vw, 20px);
  letter-spacing: .04em;
  color: #111;
  font-variant-numeric: tabular-nums;
}
.row .name {
  font-weight: 600;
  font-size: clamp(14px, 1.85vw, 19px);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #151515;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row.blank {
  border-bottom-color: rgba(0,0,0,.12);
  min-height: calc(var(--row-h) * .85);
}
.row.blank .num, .row.blank .name { visibility: hidden; }

/* HUD */
.hud {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  top: max(12px, env(safe-area-inset-top));
  z-index: 10;
  max-width: min(280px, 42vw);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(20,12,8,.62);
  color: #f6efe6;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  pointer-events: none;
}
.brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #ff5c06;
  margin-bottom: 6px;
}
.status {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.status.ok { color: #9dffb0; }
.status.warn { color: #ffd27a; }
.status.err { color: #ff8f8f; }
.hint {
  margin: 0;
  font-size: 12px;
  opacity: .85;
  line-height: 1.35;
}

/* Camera preview */
.cam-wrap {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 10;
  width: min(200px, 28vw);
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,.4);
  border: 2px solid rgba(255,255,255,.35);
  background: #111;
}
.cam-wrap video, .cam-wrap canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.cam-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  letter-spacing: .04em;
}

@media (max-width: 700px) {
  :root { --board-w: 94vw; --board-h: 70vh; }
  .hud { max-width: 55vw; }
  .cam-wrap { width: 120px; }
  .row { grid-template-columns: 56px 1fr; gap: 10px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  :root { --board-h: 88vh; --row-h: 36px; }
  .hdr { padding-top: 12px; padding-bottom: 6px; }
  .hdr h1 { font-size: 18px; margin-bottom: 8px; }
}


/* ---- Row hover / selected (gesture) ---- */
.row.tenant {
  cursor: pointer;
  transition: background .12s ease, box-shadow .12s ease, transform .12s ease;
}
.row.tenant:hover,
.row.tenant.is-hover {
  background: rgba(255,92,6,.12);
  box-shadow: inset 0 0 0 1px rgba(255,92,6,.45);
}
.row.tenant.is-pressed {
  background: rgba(255,92,6,.28);
  transform: scale(0.995);
  box-shadow: inset 0 0 0 2px #ff5c06;
}

/* ---- Hand cursor ---- */
.hand-cursor {
  position: fixed;
  left: 0; top: 0;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  z-index: 40;
  pointer-events: none;
  transform: translate3d(-100px,-100px,0);
  transition: opacity .15s ease;
}
.hand-cursor[hidden] { display: none; }
.hand-cursor .cursor-dot {
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #ff5c06;
  box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(0,0,0,.35);
}
.hand-cursor .cursor-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,92,6,.85);
  background: rgba(255,92,6,.12);
  box-shadow: 0 0 18px rgba(255,92,6,.35);
}
.hand-cursor.is-pinch .cursor-dot {
  background: #fff;
  box-shadow: 0 0 0 3px #ff5c06, 0 0 20px rgba(255,92,6,.7);
  transform: scale(1.35);
}
.hand-cursor.is-pinch .cursor-ring {
  animation: cursor-pulse .35s ease-out;
  border-color: #fff;
  background: rgba(255,92,6,.35);
}
.hand-cursor.is-click {
  animation: cursor-click .28s ease-out;
}
@keyframes cursor-pulse {
  0% { transform: scale(.7); opacity: 1; }
  100% { transform: scale(1.45); opacity: .35; }
}
@keyframes cursor-click {
  0% { transform: translate3d(var(--cx,0), var(--cy,0), 0) scale(1); }
  50% { transform: translate3d(var(--cx,0), var(--cy,0), 0) scale(0.75); }
  100% { transform: translate3d(var(--cx,0), var(--cy,0), 0) scale(1); }
}

/* ---- Detail panel ---- */
.detail {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(20,12,8,.45);
  backdrop-filter: blur(4px);
  padding: 24px;
}
.detail[hidden] { display: none !important; }
.detail-card {
  position: relative;
  width: min(440px, 92vw);
  padding: 36px 32px 28px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(245,240,230,.88));
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  text-align: center;
  color: #111;
}
.detail-close {
  position: absolute;
  right: 12px; top: 8px;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.06);
  font-size: 24px; line-height: 1;
  cursor: pointer; color: #333;
}
.detail-close:hover { background: rgba(255,92,6,.15); color: #ff5c06; }
.detail-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  color: #ff5c06;
  margin-bottom: 10px;
}
.detail-room {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.detail-name {
  margin: 0 0 14px;
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.35;
}
.detail-note {
  margin: 0;
  font-size: 12px;
  color: #666;
  letter-spacing: .04em;
}
