/* SeatWala POC - dark cinema theme, mobile-first */
:root {
  --bg: #0c0e14;
  --bg2: #141824;
  --card: #171c2b;
  --card2: #1d2334;
  --line: #262e44;
  --text: #eef1f8;
  --dim: #8b93ab;
  --pop: #ffb43a;        /* seatwala amber */
  --green: #35d07f;
  --amber: #f5b63f;
  --red: #ef5350;
  --t3: #ffd166;         /* sofa/recliner/platinum */
  --t2: #6fb1ff;         /* balcony/first/gold */
  --t1: #9dd6a7;         /* second/silver */
  --t0: #b8bfcf;         // third
  --taken: #333a4f;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  display: flex; flex-direction: column;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-top) * 0);
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, #12161f, #0c0e14);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.back { font-size: 26px; line-height: 1; color: var(--pop); width: 30px; }
.brand { display: flex; flex-direction: column; line-height: 1.1; flex: 1; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.brand-pop { color: var(--pop); }
.brand-sub { font-size: 11px; color: var(--dim); letter-spacing: 1.5px; text-transform: uppercase; }
.snapshot { font-size: 10.5px; color: var(--dim); text-align: right; line-height: 1.3; }
.snapshot b { color: var(--amber); font-weight: 600; }

main { flex: 1; overflow-y: auto; padding: 14px 14px 20px; }
.loading { color: var(--dim); text-align: center; margin-top: 60px; }

.foot {
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--dim); font-size: 10.5px; text-align: center;
  background: #0a0c11;
}

/* ---------- home: cinema cards ---------- */
.section-title { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1.6px; margin: 4px 2px 10px; }
.cinema-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; display: block; width: 100%; text-align: left;
}
.cinema-card:active { background: var(--card2); }
.cinema-head { display: flex; align-items: baseline; gap: 8px; }
.cinema-name { font-size: 16px; font-weight: 700; flex: 1; }
.chip {
  font-size: 9.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px; border: 1px solid var(--line); color: var(--dim);
}
.chip.district { color: #7ee2b0; border-color: #1f4d36; background: #10231a; }
.chip.bms { color: #ff9db4; border-color: #5b2438; background: #2a121b; }
.cinema-area { color: var(--dim); font-size: 12px; margin-top: 2px; }
.cinema-stats { display: flex; gap: 14px; margin-top: 10px; }
.cstat { font-size: 12px; color: var(--dim); }
.cstat b { color: var(--text); font-size: 14px; }
.cstat .free { color: var(--green); }
.movie-mini { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.movie-mini span { font-size: 11px; color: var(--dim); background: var(--bg2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 8px; }

/* ---------- cinema page: movies + shows ---------- */
.movie-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.movie-top { display: flex; gap: 12px; }
.poster { width: 64px; height: 88px; border-radius: 8px; object-fit: cover; background: var(--bg2); border: 1px solid var(--line); }
.movie-info { flex: 1; min-width: 0; }
.movie-name { font-size: 16.5px; font-weight: 700; }
.movie-name .tag { font-size: 9px; vertical-align: middle; background: var(--pop); color: #201600; border-radius: 5px; padding: 2px 5px; font-weight: 800; letter-spacing: .5px; margin-left: 6px; text-transform: uppercase; }
.movie-meta { color: var(--dim); font-size: 12px; margin-top: 3px; }
.movie-genre { color: var(--dim); font-size: 11px; margin-top: 2px; }
.shows { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.show-pill {
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; min-width: 86px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; background: var(--bg2);
}
.show-pill:active { transform: scale(.97); }
.show-pill .t { font-weight: 700; font-size: 13.5px; }
.show-pill .a { font-size: 10px; color: var(--dim); }
.show-pill .a.free-hi { color: var(--green); }
.show-pill .a.free-mid { color: var(--amber); }
.show-pill .a.free-lo { color: var(--red); }
.show-pill.has-map { border-color: #3a5a8c; box-shadow: 0 0 0 1px #3a5a8c inset; }
.show-pill .mapdot { font-size: 9px; color: #6fb1ff; letter-spacing: .5px; }
.show-pill.done { opacity: .45; }
.show-pill.done .t { text-decoration: line-through; }
.show-screen { font-size: 10px; color: var(--dim); margin-top: 4px; letter-spacing: 1px; }

/* ---------- seat map page ---------- */
.map-head { margin-bottom: 10px; }
.map-title { font-size: 17px; font-weight: 800; }
.map-sub { color: var(--dim); font-size: 12px; margin-top: 2px; }
.map-sub b { color: var(--text); }
.view-toggle { display: flex; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin: 10px 0; }
.view-toggle button { flex: 1; padding: 7px 0; border-radius: 8px; color: var(--dim); font-weight: 700; font-size: 13px; }
.view-toggle button.on { background: var(--card2); color: var(--pop); }

.bestbar {
  background: linear-gradient(90deg, #2a2113, #1a1608);
  border: 1px solid #4d3c17; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
  font-size: 12.5px;
}
.bestbar .bb-title { color: var(--t3); font-weight: 800; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.bestbar .bb-pick { color: var(--text); font-weight: 600; }
.bestbar .bb-why { color: var(--dim); font-size: 11px; margin-top: 2px; }

.screen-wrap { margin: 14px 0 4px; text-align: center; }
.screen-arc {
  height: 26px; margin: 0 24px; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border-top: 3px solid #4a5680;
  box-shadow: 0 -6px 18px rgba(111, 145, 255, .25);
}
.screen-label { color: var(--dim); font-size: 9.5px; letter-spacing: 3px; margin-top: 5px; }

.seatmap { overflow-x: auto; padding: 6px 2px 16px; }
.class-band { margin-bottom: 14px; }
.class-label { font-size: 10px; color: var(--dim); letter-spacing: 1.5px; margin: 0 0 5px 2px; display: flex; justify-content: space-between; }
.class-label .price { color: var(--text); font-weight: 600; }
.seat-row { display: flex; align-items: center; gap: 3px; margin-bottom: 3px; }
.row-label { width: 34px; flex: 0 0 34px; font-size: 9.5px; color: var(--dim); text-align: right; padding-right: 6px; }
.seat {
  width: 15px; height: 14px; flex: 0 0 auto;
  border-radius: 4px 4px 2px 2px;
  border: 1px solid;
  font-size: 0;
}
.seat.free { cursor: pointer; }
.seat.free:active { transform: scale(1.25); }
.seat.taken { background: var(--taken); border-color: var(--taken); opacity: .5; }
.seat.tier3 { background: rgba(255, 209, 102, .16); border-color: var(--t3); }
.seat.tier2 { background: rgba(111, 177, 255, .14); border-color: var(--t2); }
.seat.tier1 { background: rgba(157, 214, 167, .12); border-color: var(--t1); }
.seat.tier0 { background: rgba(184, 191, 207, .10); border-color: var(--t0); }
.seat.gap { visibility: hidden; }
.seat.best {
  background: var(--pop); border-color: var(--pop);
  box-shadow: 0 0 8px rgba(255, 180, 58, .8);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 2px rgba(255, 180, 58, .3); } }

.legend { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 2px 0; border-top: 1px dashed var(--line); margin-top: 6px; }
.legend .li { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--dim); }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; border: 1px solid; }

.no-map { text-align: center; color: var(--dim); padding: 40px 20px; font-size: 13px; line-height: 1.7; }
.no-map b { color: var(--text); }
.count-cards { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.count-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-align: center; min-width: 92px; }
.count-card .cl { font-size: 9.5px; color: var(--dim); letter-spacing: 1px; }
.count-card .cv { font-size: 15px; font-weight: 800; margin-top: 2px; }
.count-card .cp { font-size: 10px; color: var(--dim); }

/* ---------- seat sheet ---------- */
.sheet-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--card); border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
}
.sheet .s-seat { font-size: 18px; font-weight: 800; }
.sheet .s-cls { color: var(--t3); font-size: 12px; font-weight: 700; margin-top: 2px; }
.sheet .s-row { margin-top: 10px; font-size: 12.5px; color: var(--dim); display: flex; justify-content: space-between; }
.sheet .s-row b { color: var(--text); }
.sheet .s-close { margin-top: 14px; width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-weight: 700; }

/* ---------- 3D hall ---------- */
.hall-wrap { margin-top: 6px; }
.hall {
  position: relative; height: 430px; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(ellipse at 50% -10%, #232c4d 0%, #0b0d15 62%);
  perspective: 620px; perspective-origin: 50% 6%;
  border: 1px solid var(--line);
}
.hall-screen {
  position: absolute; left: 8%; right: 8%; top: 4%; height: 27%;
  border-radius: 6px;
  background: #000;
  box-shadow: 0 10px 44px rgba(120, 160, 255, .35), 0 0 0 1px #2c3a66;
  overflow: hidden;
}
.hall-screen iframe { width: 100%; height: 100%; border: 0; }
.hall-screen .no-trailer {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--dim); font-size: 12px; background: linear-gradient(160deg, #131a30, #080a12);
}
.hall-screen .no-trailer a { color: #6fb1ff; font-weight: 700; text-decoration: none; border: 1px solid #2c3a66; padding: 6px 14px; border-radius: 8px; }
.hall-floor {
  position: absolute; left: -14%; right: -14%; top: 34%; bottom: -24%;
  transform: rotateX(64deg); transform-origin: 50% 0;
  background: linear-gradient(180deg, #1a2033, #0d0f18 80%);
}
.hall-seats { position: absolute; inset: 0; transform-style: preserve-3d; }
.hseat {
  position: absolute; width: 9px; height: 9px; border-radius: 2px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(0,0,0,.4);
}
.hseat.taken { background: #2a3040; opacity: .45; }
.hseat.tier3 { background: var(--t3); box-shadow: 0 0 5px rgba(255,209,102,.6); }
.hseat.tier2 { background: var(--t2); }
.hseat.tier1 { background: var(--t1); }
.hseat.tier0 { background: var(--t0); }
.hseat.best { background: var(--pop); box-shadow: 0 0 10px 3px rgba(255,180,58,.9); animation: pulse 1.6s infinite; }
.hall-caption { text-align: center; color: var(--dim); font-size: 10.5px; margin-top: 8px; }

@media (min-width: 700px) {
  main { max-width: 720px; margin: 0 auto; width: 100%; }
  .seat { width: 19px; height: 17px; }
  .hall { height: 520px; }
}
