:root {
  --night: #1c1430;
  --night-2: #271d3f;
  --night-3: #342852;
  --line: #4a3b6b;
  --ink: #f6eef2;
  --ink-soft: #bfb1cf;
  --neon: #ff4f9a;
  --neon-soft: rgba(255, 79, 154, 0.16);
  --amber: #ffc56b;
  --ok: #5fd4a0;
  --bad: #ff7a7a;
  --radius-lg: 18px;
  --radius-sm: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--night);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 96px; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ─── Header ─────────────────────────────────────────── */
.brand { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.brand h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.brand h1 span { color: var(--neon); }
.brand p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ─── Branch switch ──────────────────────────────────── */
.branches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.branch {
  background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; text-align: left;
}
.branch strong { display: block; font-size: 15px; }
.branch small { color: var(--ink-soft); font-size: 12px; line-height: 1.3; display: block; }
.branch[aria-pressed='true'] { border-color: var(--neon); background: var(--neon-soft); }
.updated { color: var(--ink-soft); font-size: 13px; margin: 0 0 16px; }

/* ─── Room tiles ─────────────────────────────────────── */
.rooms { display: grid; gap: 16px; }
.room {
  display: block; width: 100%; padding: 0; text-align: left; border: 0;
  background: var(--night-2); border-radius: var(--radius-lg); overflow: hidden;
}
.room:disabled { cursor: default; }
.room-photo { position: relative; aspect-ratio: 4 / 3; background: var(--night-3); }
.room-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-photo .placeholder {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 18px;
  background:
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(255, 255, 255, 0.03) 22px 23px),
    var(--night-3);
}
.room-photo .placeholder b { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.left {
  position: absolute; top: 12px; right: 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--night); color: var(--neon); font-weight: 700; font-size: 14px;
  border: 1.5px solid var(--neon); box-shadow: 0 0 14px rgba(255, 79, 154, 0.55);
}
.room:disabled .left { color: var(--ink-soft); border-color: var(--line); box-shadow: none; }
.room:disabled .room-photo { filter: grayscale(1) brightness(0.6); }
.room-body { padding: 14px 16px 16px; }
.room-body h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prices div { font-size: 13px; color: var(--ink-soft); }
.prices b { display: block; color: var(--amber); font-size: 18px; font-weight: 700; }

.notice {
  background: var(--night-2); border-radius: var(--radius-lg); padding: 24px 20px; color: var(--ink-soft);
}
.notice h2 { color: var(--ink); margin: 0 0 6px; font-size: 22px; }
.notice p { margin: 0; }

/* ─── Bottom sheet ───────────────────────────────────── */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 6, 20, 0.7); display: none; z-index: 10; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; max-height: 92vh; overflow-y: auto;
  background: var(--night-2); border-radius: 22px 22px 0 0; padding: 20px 16px 28px;
  transform: translateY(100%); transition: transform 0.25s ease-out;
}
.sheet-inner { max-width: 480px; margin: 0 auto; }
.sheet.open { transform: none; }
.sheet-bg.open { display: block; }
.sheet h2 { margin: 0 0 14px; font-size: 22px; }
.close { float: right; background: none; border: 0; color: var(--ink-soft); font-size: 26px; line-height: 1; padding: 0 4px; }

.stay { display: grid; gap: 10px; margin-bottom: 18px; }
.stay label {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px;
}
.stay label:has(input:checked) { border-color: var(--neon); background: var(--neon-soft); }
.stay label.sold { opacity: 0.45; }
.stay input { accent-color: var(--neon); width: 20px; height: 20px; margin: 0; }
.stay span small { display: block; color: var(--ink-soft); font-size: 13px; }
.stay b { color: var(--amber); font-size: 17px; }

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 4px; }
.field input {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--night); font-size: 17px;
}
.field input:focus { border-color: var(--neon); outline: none; }

.btn {
  display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px;
  background: var(--neon); color: #fff; font-weight: 700; font-size: 17px; text-align: center;
}
.btn:disabled { opacity: 0.5; cursor: wait; }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); margin-top: 10px; }
.error { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ─── Payment ────────────────────────────────────────── */
.timer { height: 4px; background: var(--night-3); border-radius: 4px; overflow: hidden; margin: 6px 0 4px; }
.timer i { display: block; height: 100%; background: var(--neon); transition: width 1s linear; }
.timer-text { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
.amount-label { color: var(--ink-soft); font-size: 14px; margin: 0; }
.amount { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; color: var(--amber); margin: 0 0 4px; line-height: 1.1; }
.summary { color: var(--ink-soft); margin: 0 0 18px; font-size: 15px; }
.qr { background: #fff; border-radius: var(--radius-lg); padding: 14px; text-align: center; margin-bottom: 14px; }
.qr img { width: 100%; max-width: 300px; display: block; margin: 0 auto; }
.qr-missing {
  border: 1.5px dashed var(--line); border-radius: var(--radius-lg); padding: 28px 16px; text-align: center;
  color: var(--ink-soft); margin-bottom: 14px;
}
.bank { background: var(--night-2); border-radius: var(--radius-lg); padding: 6px 16px; margin-bottom: 18px; }
.bank-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--night-3); }
.bank-row:last-child { border-bottom: 0; }
.bank-row span { color: var(--ink-soft); font-size: 14px; }
.bank-row b { font-weight: 600; text-align: right; word-break: break-word; }
.copy { background: var(--night-3); border: 0; border-radius: 8px; padding: 4px 10px; font-size: 13px; margin-left: 8px; }
.code { color: var(--neon); letter-spacing: 0.04em; }

.upload {
  display: block; border: 1.5px dashed var(--neon); border-radius: var(--radius-lg); padding: 18px;
  text-align: center; margin-bottom: 12px; background: var(--neon-soft);
}
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { outline: 3px solid var(--amber); outline-offset: 2px; }
.upload b { display: block; font-size: 17px; }
.upload small { color: var(--ink-soft); }
.preview { width: 100%; max-height: 360px; object-fit: contain; border-radius: var(--radius-sm); margin-bottom: 12px; display: none; }

/* ─── Done ───────────────────────────────────────────── */
.done h2 { font-size: 28px; margin: 12px 0 8px; letter-spacing: -0.02em; }
.done p { color: var(--ink-soft); margin: 0 0 14px; }
.ticket { background: var(--night-2); border-radius: var(--radius-lg); padding: 16px; margin: 18px 0; border-left: 4px solid var(--neon); }
.ticket div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.ticket span { color: var(--ink-soft); white-space: nowrap; }
.ticket b { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .timer i { transition: none; }
}
