:root {
  --bg: #0b0a0d;
  --paper: #f1e6c8;
  --paper-dim: #b9ad90;
  --red: #c8341f;
  --red-dark: #7a1d10;
  --gold: #e3b341;
  --ink: #1a1619;
  --card: #15121a;
  --line: #2b2430;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--paper); font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 17px; line-height: 1.45; }
body { min-height: 100vh; }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 20px 18px 40px; padding-top: max(20px, env(safe-area-inset-top)); display: flex; flex-direction: column; }

.topbar { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--paper-dim); margin-bottom: 14px; letter-spacing: .3px; }
.topbar .name { font-weight: 600; color: var(--paper); }
.topbar .stats span { margin-left: 10px; }

.slot { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 34px; line-height: 1.1; margin: 10px 0 8px; color: var(--paper); }
h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 24px; line-height: 1.2; margin: 6px 0 10px; }
h3 { font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: var(--paper-dim); margin: 0 0 8px; font-weight: 600; }
p { margin: 8px 0; }
.small { font-size: 13px; color: var(--paper-dim); }
.muted { color: var(--paper-dim); }
.center { text-align: center; }
.big { font-size: 22px; line-height: 1.3; }
.situation { font-size: 20px; line-height: 1.4; margin: 6px 0 18px; }
.speaker { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--red); font-weight: 700; margin-bottom: 4px; }
.speaker.quy { color: var(--red); }
.speaker.ba { color: var(--gold); }
.speaker.bach { color: #cfd8ff; }
.speaker.hac { color: #8e8e9c; }
.quote { font-family: Georgia, "Times New Roman", serif; font-size: 21px; line-height: 1.4; color: var(--paper); margin: 6px 0; }
.quote.wis { font-style: italic; font-size: 22px; }
.src { font-size: 12px; color: var(--paper-dim); letter-spacing: .5px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 10px 0; }
.card.red { border-color: var(--red-dark); background: #1a0f0f; }
.card.gold { border-color: #6b531e; background: #1a160d; }
.card.cam { border-color: #2f3a2f; background: #0f1410; font-family: "Courier New", monospace; font-size: 15px; }
.cam .tag { color: #7cff9a; font-size: 12px; letter-spacing: 2px; }

.btns { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
button { appearance: none; border: 1px solid var(--line); background: #1d1823; color: var(--paper); font: inherit; font-size: 17px; text-align: left; padding: 14px 16px; border-radius: 12px; min-height: 56px; width: 100%; cursor: pointer; line-height: 1.35; }
button:active { transform: scale(.985); background: #2a2231; }
button.primary { background: var(--red-dark); border-color: var(--red); text-align: center; font-weight: 600; }
button.gold { background: #3a2c10; border-color: var(--gold); text-align: center; font-weight: 600; }
button.ghost { background: transparent; border-color: var(--line); color: var(--paper-dim); text-align: center; min-height: 44px; font-size: 15px; }
button.sec { text-align: center; }
button:disabled { opacity: .45; }

.spacer { flex: 1; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }

.lantern { display: inline-block; font-size: 15px; letter-spacing: 2px; }
.pct { font-size: 15px; color: var(--paper-dim); margin-top: 10px; }
.pct b { color: var(--gold); }

.nghiep { display: inline-block; font-weight: 800; letter-spacing: 1px; padding: 4px 10px; border-radius: 8px; }
.nghiep.up { color: #ff6b4a; }
.nghiep.down { color: #8ef0a0; }

#float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.floaty { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-weight: 900; font-size: 34px; letter-spacing: 1px; animation: floatUp 1.5s ease-out forwards; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.floaty.bad { color: #ff5a3c; }
.floaty.good { color: #8ef0a0; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -120px) scale(1); } }

.shake { animation: shake .5s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.fadein { animation: fadein .5s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.quiet { background: #050406; }
.glow { text-shadow: 0 0 18px rgba(227,179,65,.6); }

.beat { opacity: 0; animation: fadein .6s ease-out forwards; }
.beat.b2 { animation-delay: 1.4s; }
.beat.b3 { animation-delay: 2.8s; }

.ticket { background: var(--paper); color: var(--ink); border-radius: 6px; padding: 18px 16px; font-family: Georgia, "Times New Roman", serif; position: relative; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.ticket .t-head { text-align: center; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #5b4a2a; border-bottom: 1px dashed #b9a67a; padding-bottom: 8px; margin-bottom: 10px; }
.ticket .t-title { font-size: 26px; font-weight: 700; color: var(--red-dark); margin: 6px 0 2px; }
.ticket .t-row { font-size: 15px; margin: 4px 0; }
.ticket .t-stamp { position: absolute; right: 14px; top: 44px; border: 3px solid var(--red); color: var(--red); font-weight: 800; font-size: 13px; letter-spacing: 2px; padding: 4px 8px; transform: rotate(-12deg); opacity: .8; border-radius: 4px; }
.ticket .t-foot { text-align: center; font-size: 12px; color: #5b4a2a; border-top: 1px dashed #b9a67a; padding-top: 8px; margin-top: 10px; }

textarea, input[type=text] { width: 100%; font: inherit; font-size: 16px; background: #1d1823; color: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 6px 0 10px; }
label { display: block; font-size: 14px; color: var(--paper-dim); margin-top: 8px; }
.radio-row { display: flex; gap: 8px; margin: 6px 0 10px; }
.radio-row button { min-height: 44px; font-size: 15px; text-align: center; }
.radio-row button.on { border-color: var(--gold); background: #3a2c10; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; animation: fadein .3s; }
