/* =========================
   Reset & Theme
   ========================= */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --bg:#0e0c09;
  --surface:#1a1714;
  --surface2:#242018;
  --border:#2e2a22;
  --text:#e8e0d4;
  --muted:#8a8278;
  --accent:#d4a574;
  --accent-dim:#a07848;
  --accent-glow:rgba(212,165,116,.18);
  --ok:#5ad47d;
  --wait:#d4c05a;
  --radius:10px;
  --mono:'SF Mono','Fira Code',monospace;
  --body:'Segoe UI',system-ui,sans-serif;
}
html{scroll-behavior:smooth}
body{
  font-family:var(--body);
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
  line-height:1.55;
}
body::after{
  content:'';
  position:fixed;inset:0;
  pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

/* =========================
   Layout
   ========================= */
.page{max-width:680px;margin:0 auto;padding:48px 20px 80px;position:relative}
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}
.brand{font-family:var(--mono);font-size:.85rem;color:var(--muted);letter-spacing:.6px}
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:24px;
  margin-bottom:28px;
}
.card-title{
  font-size:.75rem;
  text-transform:uppercase;
  letter-spacing:1.1px;
  color:var(--muted);
  margin-bottom:14px;
  display:flex;
  align-items:center;
  gap:8px;
}
.card-title .dot{
  width:6px;height:6px;border-radius:50%;
  background:var(--accent);
}
.divider{height:1px;background:var(--border);margin:18px 0}

/* =========================
   Lang toggle
   ========================= */
.lang-toggle{display:flex;border:1px solid var(--border);background:var(--surface);border-radius:18px;overflow:hidden}
.lang-btn{background:none;border:none;color:var(--muted);font-size:.72rem;font-family:var(--mono);padding:5px 10px;cursor:pointer}
.lang-btn.active{background:var(--accent-dim);color:#fff}

/* =========================
   Hero
   ========================= */
.hero{text-align:center;margin-bottom:42px}
.hero .icon{font-size:42px;margin-bottom:10px;display:block}
.hero h1{color:var(--accent);font-weight:600}
.hero p{color:var(--muted);font-size:.9rem;margin-top:6px}

/* =========================
   Tabs
   ========================= */
.tabs{display:flex;gap:6px;margin-bottom:14px}
.tab{
  flex:1;text-align:center;
  padding:7px;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--surface2);
  color:var(--muted);
  cursor:pointer;
}
.tab.active{
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-glow);
}

/* =========================
   Inputs
   ========================= */
.input-row{margin-bottom:14px}
label{font-size:.8rem;color:var(--muted);display:block;margin-bottom:5px}
input,textarea{
  width:100%;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:6px;
  padding:9px 12px;
  color:var(--text);
}
textarea{resize:vertical;min-height:70px}
.toggle-row{display:flex;align-items:center;gap:8px;margin:8px 0 14px}
.toggle-row input{width:auto}
.hint{font-size:.72rem;color:var(--muted);margin-top:6px}
.hint.warn{color:#e3b25d}

/* =========================
   Track list
   ========================= */
.list{
  border:1px solid var(--border);
  border-radius:8px;
  max-height:280px;
  overflow-y:auto;
  background:var(--surface2);
}
.item{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  cursor:pointer;
}
.item:last-child{border-bottom:none}
.item:hover{background:var(--surface)}
.item.selected{
  border-left:3px solid var(--accent);
  background:linear-gradient(90deg, rgba(212,165,116,.12), rgba(0,0,0,0));
}
.sel-badge{
  display:inline-block;
  margin-left:6px;
  padding:2px 6px;
  border-radius:10px;
  border:1px solid var(--accent-dim);
  color:var(--accent);
  font-size:.65rem;
}
.item.gifted{opacity:.4;cursor:not-allowed}
.item.reserved{opacity:.55;cursor:not-allowed}
.track{font-weight:500}
.artist{font-size:.75rem;color:var(--muted)}

/* =========================
   Selected track
   ========================= */
.selected{
  display:none;
  margin-top:12px;
  padding:10px 14px;
  border:1px solid var(--accent-dim);
  border-radius:8px;
  background:var(--surface2);
}
.selected.show{display:block}
.selected .label{
  display:inline-block;
  font-size:.7rem;
  text-transform:uppercase;
  letter-spacing:1px;
  color:var(--muted);
  margin-bottom:6px;
}
.selected-list{display:flex;flex-direction:column;gap:6px}
.selected-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:1px solid var(--border);border-radius:6px;background:var(--surface)}
.selected-text{font-weight:600;font-size:.85rem}
.sel-remove{
  border:none;
  background:var(--surface2);
  color:var(--muted);
  width:26px;height:26px;border-radius:6px;
  cursor:pointer;font-size:1rem;line-height:1;
}
.sel-remove:hover{color:var(--accent);border:1px solid var(--accent)}
.summary{padding:10px 12px;border-radius:8px;background:var(--surface2);border:1px solid var(--border);font-size:.9rem}
.summary-list{margin:8px 0 10px 18px}
.summary-list li{margin:4px 0;line-height:1.4}
.notice{font-size:.78rem;color:var(--muted);margin:10px 0}
.confirm-actions{display:flex;gap:10px;margin-top:10px}
.confirm-actions .btn{flex:1}

/* =========================
   Modal
   ========================= */
.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:50}
.modal.show{display:flex}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.6)}
.modal-card{
  position:relative;
  z-index:1;
  width:min(520px, 92vw);
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  box-shadow:0 12px 32px rgba(0,0,0,.35);
}

/* =========================
   Buttons
   ========================= */
.btn{
  width:100%;
  padding:12px;
  border:none;
  border-radius:8px;
  font-weight:700;
  cursor:pointer;
  background:var(--accent);
  color:var(--bg);
}
.btn:disabled{
  background:var(--border);
  color:var(--muted);
  cursor:not-allowed;
}
.btn-ghost{
  background:transparent;
  border:1px solid var(--border);
  color:var(--text);
}
.btn-ghost:hover{border-color:var(--accent);color:var(--accent)}

/* =========================
   Payment
   ========================= */
.pay-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:12px}
.method{
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.method.active{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent-dim) inset}
.method-title{font-weight:600}
.method-price{font-size:.8rem;color:var(--muted);margin-top:4px}
.pay-details{margin-top:12px;padding:12px;border-radius:8px;background:var(--surface2);border:1px solid var(--border);font-size:.85rem}
.pay-total{margin-top:6px;color:var(--muted);font-size:.78rem}
.pay-ref{margin-top:6px;color:var(--muted);font-size:.78rem}
.qr-wrap{margin-top:12px;display:flex;flex-direction:column;align-items:center;gap:10px}
#payQr{width:220px;height:220px;border-radius:8px;border:1px solid var(--border);background:#fff;padding:8px}
.qr-actions{width:100%}

/* =========================
   Gifts
   ========================= */
.gift{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px 16px;
}
.gift + .gift{margin-top:10px}
.gift a{color:var(--text);text-decoration:none}
.gift a:hover{color:var(--accent);text-decoration:underline}
.badge{
  display:inline-block;
  font-size:.65rem;
  padding:2px 7px;
  border-radius:20px;
  border:1px solid var(--border);
  color:var(--muted);
}
.badge.ok{color:var(--ok)}
.badge.wait{color:var(--wait)}
.badge.reserve{color:var(--accent)}
.meta{margin-top:6px;font-size:.75rem;color:var(--muted)}

@media (max-width: 540px){
  .pay-grid{grid-template-columns:1fr}
  .confirm-actions{flex-direction:column}
}
