/* ===== Trạm Tính Tết – FE CREDIT ===== */
:root {
  --green: #0F8A3E;
  --green-dark: #0B6B33;
  --green-deep: #0B3D24;
  --green-ink: #1F3B2C;
  --red: #E4252B;
  --red-dark: #B8161B;
  --gold: #F5B400;
  --gold-light: #FFE38A;
  --cream: #FFF4D6;
  --mint: #E8F6EE;
  --mint-2: #CFE8D8;
  --ink: #15291D;
  --muted: #6B8F7A;
  --white: #fff;
  --shadow: 0 10px 30px rgba(11, 61, 36, .25);
  --radius: 22px;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 700px at 20% 0%, #15994a 0%, var(--green-dark) 45%, var(--green-deep) 100%);
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button, input { font-family: inherit; }
img { -webkit-user-drag: none; }
[hidden] { display: none !important; }

.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blossom { position: absolute; font-size: 64px; opacity: .18; animation: float 9s ease-in-out infinite; }
.b1 { left: 4%; top: 12%; } .b2 { left: 90%; top: 8%; animation-delay: -2s; }
.b3 { left: 8%; top: 78%; font-size: 90px; animation-delay: -4s; } .b4 { left: 82%; top: 70%; animation-delay: -1s; }
.b5 { left: 50%; top: 88%; animation-delay: -6s; } .b6 { left: 94%; top: 45%; font-size: 80px; animation-delay: -3s; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-22px) rotate(6deg); } }

/* ===== Top bar ===== */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 32px; height: 76px;
  background: rgba(255,255,255,.92); box-shadow: 0 2px 14px rgba(0,0,0,.15);
}
.logo { height: 38px; }
.topbar-title { font-weight: 900; letter-spacing: .08em; color: var(--green-dark); font-size: 20px; white-space: nowrap; }
.steps { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; gap: 6px; counter-reset: s; }
.steps li {
  counter-increment: s; font-size: 13px; font-weight: 700; color: var(--muted);
  padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--mint); display: flex; align-items: center; gap: 6px;
}
.steps li::before {
  content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--mint-2); color: var(--green-ink); font-size: 12px;
}
.steps li.active { background: var(--red); color: #fff; }
.steps li.active::before { background: #fff; color: var(--red); }
.steps li.done { background: var(--green); color: #fff; }
.steps li.done::before { content: '✓'; background: #fff; color: var(--green); }

/* ===== Screens ===== */
#app { position: relative; z-index: 1; height: calc(100% - 76px); }
.screen { display: none; height: 100%; padding: clamp(14px, 2.2vw, 28px) clamp(16px, 3vw, 40px); overflow: auto; }
.screen.active { display: flex; flex-direction: column; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.screen-title { margin: 0; color: #fff; font-size: clamp(26px, 3vw, 40px); font-weight: 900; letter-spacing: .02em; line-height: 1.25; text-align: center; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.screen-sub { margin: 8px 0 clamp(12px, 2vh, 24px); color: var(--gold-light); font-size: clamp(15px, 1.5vw, 20px); text-align: center; }
.lbl { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lbl.center { text-align: center; color: var(--gold-light); }
.big { font-size: 30px; font-weight: 900; color: var(--green-dark); }
.red { color: var(--red) !important; }

/* ===== Buttons ===== */
.btn {
  border: 0; cursor: pointer; border-radius: 999px; font-weight: 900; letter-spacing: .05em;
  padding: 16px 32px; font-size: 20px; box-shadow: 0 6px 0 rgba(0,0,0,.18), var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s; text-decoration: none; display: inline-block; text-align: center;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn:disabled { filter: grayscale(.6) brightness(.8); cursor: not-allowed; }
.btn-lg { padding: 18px 36px; font-size: 22px; }
.btn-xl { padding: clamp(16px, 2.2vh, 22px) clamp(32px, 4vw, 48px); font-size: clamp(20px, 2.2vw, 28px); }
.btn-xxl { padding: clamp(22px, 3.5vh, 34px) clamp(44px, 6vw, 80px); font-size: clamp(30px, 3.6vw, 44px); }
.btn-red { background: linear-gradient(180deg, #ff3f45, var(--red)); color: #fff; }
.btn-green { background: linear-gradient(180deg, #19a84f, var(--green)); color: #fff; }
.btn-blue { background: linear-gradient(180deg, #4a7ff0, #1E5BD8); color: #fff; }
.btn-ghost { background: #fff; color: var(--green-dark); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ===== Intro ===== */
.intro { margin: auto; text-align: center; max-width: 1100px; width: 100%; }
.intro-kicker { color: var(--gold-light); font-weight: 800; letter-spacing: .25em; font-size: 16px; margin-bottom: .6em; }
.intro-title { margin: 0 0 10px; font-size: clamp(56px, 9vw, 120px); line-height: 1.12; padding-top: .08em; font-weight: 900; color: #fff; text-shadow: 0 6px 0 rgba(0,0,0,.2); }
.intro-title span { display: inline-block; margin: 0 .15em; line-height: 1.12; }
.intro-title .red { color: var(--gold) !important; }
.intro-sub { color: #fff; font-size: 22px; margin: 10px 0 20px; opacity: .95; }
.intro-chars { display: flex; justify-content: center; align-items: flex-end; gap: 10px; height: 34vh; margin-bottom: 18px; }
.intro-chars img { height: 100%; max-width: 32%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 12px 18px rgba(0,0,0,.35)); animation: bob 3s ease-in-out infinite; }
.intro-chars img:nth-child(2) { height: 108%; animation-delay: -1s; }
.intro-chars img:nth-child(3) { animation-delay: -2s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.intro-tag { margin-top: 18px; color: var(--gold-light); font-weight: 700; letter-spacing: .1em; }

/* ===== Đăng ký ===== */
.register { margin: auto; width: min(680px, 100%); text-align: center; }
.reg-form { background: #fff; border-radius: var(--radius); padding: 28px 32px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; text-align: left; }
.reg-field { display: flex; flex-direction: column; gap: 6px; }
.reg-field span { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.reg-field input { font-size: 26px; font-weight: 700; padding: 14px 18px; border-radius: 16px; border: 3px solid var(--mint-2); background: var(--cream); color: var(--ink); width: 100%; }
.reg-field input:focus { outline: 0; border-color: var(--green); background: #fff; }
.reg-field input.bad { border-color: var(--red); }
.reg-error { background: #FDE8E8; color: var(--red-dark); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.reg-form .btn { align-self: center; margin-top: 4px; }
.reg-consent { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.4; }
.reg-back { margin-top: 14px; font-size: 16px; padding: 10px 22px; box-shadow: none; background: rgba(255,255,255,.15); color: #fff; }
.share-registered { font-size: 17px; line-height: 1.5; }

/* ===== Chọn vai ===== */
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; flex: 1; min-height: 0; max-width: 1300px; margin: 0 auto; width: 100%; }
.role-card {
  position: relative; background: var(--cream); border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow); border: 5px solid transparent; transition: transform .15s, border-color .15s; display: flex; flex-direction: column; min-height: 0;
}
.role-card:hover { transform: translateY(-4px); }
.role-card.selected { border-color: var(--red); background: #fff; transform: translateY(-6px) scale(1.02); }
.role-card.selected::after { content: '✓'; position: absolute; top: -18px; right: -18px; width: 52px; height: 52px; border-radius: 50%; background: var(--red); color: #fff; font-size: 30px; font-weight: 900; display: grid; place-items: center; box-shadow: var(--shadow); }
.role-card img { flex: 1; min-height: 0; width: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 10px rgba(0,0,0,.25)); }
.role-card .role-name { font-weight: 900; font-size: 24px; color: var(--green-dark); margin-top: 10px; }
.role-card .role-tag { color: var(--red); font-weight: 700; font-size: 17px; }
.role-card .role-budget { font-size: 14px; color: var(--muted); margin-top: 4px; }
.role-detail { margin: 20px auto 0; background: #fff; border-radius: var(--radius); padding: 18px 28px; display: flex; align-items: center; gap: 40px; box-shadow: var(--shadow); animation: fadeIn .3s; }
.role-detail-row { display: flex; gap: 40px; }

/* ===== AR ===== */
.ar-wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; flex: 1; min-height: 0; }
.ar-stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); perspective: 900px; }
#ar-video, #ar-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
#ar-overlay { pointer-events: none; }
.ar-status { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.65); color: #fff; padding: 14px 24px; border-radius: 999px; font-weight: 700; font-size: 18px; z-index: 5; }
.ar-hud { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; padding: 16px 20px; z-index: 6; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent); color: #fff; }
.ar-hud .lbl { color: var(--gold-light); }
.ar-hud-left { display: flex; align-items: center; gap: 12px; }
.ar-avatar { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--gold); background: #fff; }
.ar-role { font-weight: 900; font-size: 20px; }
.ar-hud-right { text-align: right; }
.ar-bonus { font-weight: 900; font-size: 26px; color: var(--gold); }
.ar-round { font-weight: 700; opacity: .9; }
.ar-prompt { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #fff; font-weight: 900; font-size: 30px; text-shadow: 0 2px 10px rgba(0,0,0,.8); z-index: 6; }
.ar-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 4; transition: opacity .2s; }
.ar-flash.ok { background: rgba(15,138,62,.55); opacity: 1; }
.ar-flash.miss { background: rgba(228,37,43,.55); opacity: 1; }

/* Bức tường gạch lao tới – lỗ trong suốt bám theo mặt người chơi */
.ar-wall {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  --hx: 50%; --hy: 50%; --hr: 120px; --prog: 0;
  transform-origin: var(--hx) var(--hy); transform: scale(.05); will-change: transform;
}
.ar-bricks {
  position: absolute; inset: 0;
  background-color: #7a2f22;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='60'><rect width='120' height='60' fill='%237a2f22'/><rect x='2' y='2' width='56' height='26' rx='3' fill='%23c2563f'/><rect x='62' y='2' width='56' height='26' rx='3' fill='%23b44b36'/><rect x='-28' y='32' width='56' height='26' rx='3' fill='%23b84f3a'/><rect x='32' y='32' width='56' height='26' rx='3' fill='%23c95c45'/><rect x='92' y='32' width='56' height='26' rx='3' fill='%23b44b36'/><rect x='2' y='2' width='56' height='5' rx='2' fill='%23d4705a' opacity='.6'/><rect x='32' y='32' width='56' height='5' rx='2' fill='%23d4705a' opacity='.6'/></svg>");
  background-size: 120px 60px;
  box-shadow: inset 0 0 160px rgba(0,0,0,.55);
  -webkit-mask: radial-gradient(circle var(--hr) at var(--hx) var(--hy), transparent 97%, #000 100%);
  mask: radial-gradient(circle var(--hr) at var(--hx) var(--hy), transparent 97%, #000 100%);
}
.ar-ring {
  position: absolute; left: var(--hx); top: var(--hy); width: calc(var(--hr) * 2.16); height: calc(var(--hr) * 2.16);
  transform: translate(-50%,-50%); filter: drop-shadow(0 0 10px rgba(0,0,0,.6));
}
.ar-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ar-ring circle { fill: none; stroke-width: 7; }
.ar-ring .bg { stroke: rgba(0,0,0,.55); }
.ar-ring .prog { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; transition: stroke-dashoffset .08s linear; }
.ar-emoji {
  position: absolute; left: var(--hx); top: var(--hy); transform: translate(-50%,-50%);
  font-size: calc(var(--hr) * 1.15); line-height: 1; opacity: .82;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); animation: emojiPulse 1s ease-in-out infinite;
}
@keyframes emojiPulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.08); } }
.ar-wall.matched .ar-emoji { animation: emojiPop .5s ease-out forwards; }
@keyframes emojiPop { to { transform: translate(-50%,-50%) scale(1.8); opacity: 0; } }
.ar-wall.miss .ar-bricks { filter: brightness(.6) sepia(1) hue-rotate(-30deg) saturate(3); }
#ar-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.ar-countdown {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(.5); z-index: 7;
  font-size: 160px; font-weight: 900; color: #fff; -webkit-text-stroke: 4px var(--red); text-shadow: 0 10px 30px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none;
}
.ar-countdown.show { animation: cdPop .7s ease-out forwards; }
@keyframes cdPop { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.4); } 25% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.3); } }
.ar-float { position: absolute; left: 50%; top: 40%; transform: translate(-50%,-50%); z-index: 7; font-size: 54px; font-weight: 900; color: var(--gold); -webkit-text-stroke: 2px var(--red); opacity: 0; pointer-events: none; white-space: nowrap; }
.ar-float.show { animation: floatUp 1.2s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%,-30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%,-160%) scale(1); } }
.ar-timebar { position: absolute; left: 20px; right: 20px; bottom: 76px; height: 10px; border-radius: 999px; background: rgba(0,0,0,.45); z-index: 6; overflow: hidden; opacity: 0; transition: opacity .2s; }
.ar-timebar.show { opacity: 1; }
.ar-timefill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); transform-origin: left; }
.ar-side { background: var(--cream); border-radius: var(--radius); padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); min-height: 0; overflow: auto; }
.ar-side .screen-title { color: var(--green-dark); font-size: 30px; text-shadow: none; text-align: left; }
.ar-side p { font-size: 18px; margin: 0; }
.ar-legend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ar-legend li { background: #fff; border-radius: 14px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.ar-legend li span.e { font-size: 30px; }
.ar-legend li small { display: block; font-weight: 400; color: var(--muted); }
.ar-actions { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

/* ===== Đi chợ ===== */
.market { display: grid; grid-template-columns: minmax(230px, 300px) 1fr minmax(230px, 300px); gap: clamp(14px, 1.6vw, 24px); flex: 1; min-height: 0; }
.panel { background: var(--cream); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; }
.avatar-panel { align-items: center; text-align: center; }
.avatar-wrap { position: relative; width: 170px; height: 170px; }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; border: 6px solid var(--gold); background: #fff; object-fit: cover; transition: transform .2s; }
.avatar-mood { position: absolute; right: -6px; bottom: -4px; font-size: 54px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); transition: transform .2s; }
.sweat { position: absolute; left: 0; right: 0; top: 0; display: none; }
.sweat span { position: absolute; font-size: 26px; animation: drop 1s linear infinite; }
.sweat span:nth-child(1) { left: 10%; } .sweat span:nth-child(2) { left: 45%; animation-delay: -.4s; } .sweat span:nth-child(3) { left: 78%; animation-delay: -.7s; }
@keyframes drop { from { transform: translateY(-10px); opacity: 1; } to { transform: translateY(150px); opacity: 0; } }
.avatar-panel.worried .avatar-img { animation: shake .4s ease-in-out infinite; }
.avatar-panel.worried .sweat, .avatar-panel.panic .sweat { display: block; }
.avatar-panel.panic .avatar-img { animation: shake .18s ease-in-out infinite; border-color: var(--red); }
.avatar-panel.happy .avatar-img { animation: bob 1.4s ease-in-out infinite; }
@keyframes shake { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.avatar-name { font-weight: 900; font-size: 20px; color: var(--green-dark); margin-top: 12px; }
.avatar-value { font-size: 14px; color: var(--ink); margin-top: 2px; }
.avatar-value b { color: var(--red); }
.budget { width: 100%; margin-top: 18px; background: #fff; border-radius: 16px; padding: 14px; }
.budget-num { font-size: 34px; font-weight: 900; color: var(--green-dark); transition: color .2s; letter-spacing: -.01em; }
.budget-num.low { color: #D9820B; } .budget-num.neg { color: var(--red); }
.budget-bar { height: 14px; background: var(--mint-2); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.budget-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), #35c56e); border-radius: 999px; transition: width .35s ease, background .3s; }
.budget-fill.low { background: linear-gradient(90deg, #d9820b, var(--gold)); }
.budget-fill.neg { background: var(--red); }
.budget-total { font-size: 13px; color: var(--muted); }
.avatar-say { margin-top: auto; background: #fff; border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 16px; position: relative; width: 100%; min-height: 64px; display: grid; place-items: center; }
.avatar-say::before { content: ''; position: absolute; top: -10px; left: 50%; border: 10px solid transparent; border-top: 0; border-bottom-color: #fff; transform: translateX(-50%); }

.market-center { display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 0; position: relative; }
.item-card {
  width: min(560px, 100%); background: #fff; border-radius: 30px; padding: 26px 30px 22px; text-align: center; box-shadow: var(--shadow);
  animation: slideIn .35s cubic-bezier(.2,.9,.3,1.2); position: relative; overflow: hidden;
}
.item-card.out { animation: slideOut .25s ease forwards; }
@keyframes slideIn { from { transform: translateX(120%) rotate(6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideOut { to { transform: translateX(-120%) rotate(-6deg); opacity: 0; } }
.item-icon { font-size: clamp(64px, 9vh, 110px); line-height: 1.1; }
.item-name { line-height: 1.25; font-size: clamp(22px, 2.4vw, 32px); font-weight: 900; color: var(--green-dark); margin-top: 6px; }
.item-price { font-size: clamp(30px, 3.4vw, 44px); font-weight: 900; color: var(--red); margin-top: 2px; }
.item-tag { display: inline-block; margin-top: 8px; background: var(--gold-light); color: #7a4b00; font-weight: 800; padding: 6px 14px; border-radius: 999px; font-size: 15px; }
.timer { height: 12px; background: var(--mint-2); border-radius: 999px; overflow: hidden; margin-top: 16px; }
.timer-fill { height: 100%; width: 100%; background: var(--gold); transform-origin: left; }
.timer-fill.run { animation: shrink var(--t, 5s) linear forwards; }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.item-actions { display: flex; gap: 24px; }
.item-actions .btn { min-width: 220px; }
.pip { position: absolute; left: 50%; top: 20%; transform: translate(-50%,-50%) scale(.4); font-size: 90px; font-weight: 900; color: var(--gold); -webkit-text-stroke: 3px var(--red); opacity: 0; pointer-events: none; z-index: 5; }
.pip.show { animation: pip .6s ease forwards; }
@keyframes pip { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.4) rotate(-10deg); } 30% { opacity: 1; transform: translate(-50%,-50%) scale(1.2) rotate(4deg); } 100% { opacity: 0; transform: translate(-50%,-90%) scale(1) rotate(0); } }
.queue { display: flex; gap: 8px; margin-top: auto; }
.queue span { width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 24px; }

.cart { list-style: none; padding: 0; margin: 10px 0; flex: 1; overflow: auto; }
.cart li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-radius: 12px; margin-bottom: 6px; font-size: 15px; font-weight: 600; animation: fadeIn .25s; }
.cart li.removed { text-decoration: line-through; opacity: .5; }
.cart li b { color: var(--red); white-space: nowrap; }
.cart-total { border-top: 2px dashed var(--mint-2); padding-top: 10px; font-size: 16px; }
.cart-total b { color: var(--red); font-size: 20px; }

/* ===== Biến cố ===== */
.event { display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: clamp(14px, 1.6vw, 24px); flex: 1; min-height: 0; }
.avatar-panel.small .avatar-wrap { width: 150px; height: 150px; }
.event-card { background: #fff; border-radius: var(--radius); padding: 32px 40px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: auto; animation: slideIn .35s cubic-bezier(.2,.9,.3,1.2); }
.event-kicker { color: var(--red); font-weight: 900; letter-spacing: .2em; font-size: 16px; }
.event-title { margin: 6px 0 8px; line-height: 1.25; font-size: clamp(24px, 2.8vw, 38px); font-weight: 900; color: var(--green-dark); }
.event-text { font-size: clamp(16px, 1.6vw, 22px); margin: 0 0 clamp(12px, 2vh, 22px); }
.event-options { display: grid; gap: 14px; }
.opt { display: flex; align-items: center; gap: 18px; text-align: left; background: var(--cream); border: 4px solid transparent; border-radius: 18px; padding: clamp(10px, 1.6vh, 16px) 20px; font-size: clamp(16px, 1.6vw, 22px); font-weight: 700; cursor: pointer; transition: transform .1s, border-color .15s; }
.opt:hover { transform: translateX(6px); }
.opt .key { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 24px; }
.opt.picked { border-color: var(--red); background: #fff; }
.opt.picked.good .key { background: var(--green); } .opt.picked.meh .key { background: var(--gold); color: #5a3a00; } .opt.picked.bad .key { background: var(--red); }
.opt:disabled { cursor: default; opacity: .55; } .opt.picked:disabled { opacity: 1; }
.event-feedback { margin-top: 18px; background: var(--mint); border-radius: 18px; padding: 18px 22px; display: flex; align-items: center; gap: 20px; animation: fadeIn .3s; }
.event-feedback-text { font-size: 20px; font-weight: 700; flex: 1; }
.event-feedback-delta { font-size: 28px; font-weight: 900; white-space: nowrap; }
.event-feedback-delta.neg { color: var(--red); } .event-feedback-delta.pos { color: var(--green); }

/* ===== Chốt bill / kết quả ===== */
.bill { margin: auto; text-align: center; }
.bill .screen-sub { font-size: 26px; margin-bottom: 40px; }
.bill .screen-sub b { color: var(--gold); }
.result { margin: auto; text-align: center; max-width: 1000px; width: 100%; max-height: 100%; display: flex; flex-direction: column; animation: popIn .5s cubic-bezier(.2,.9,.3,1.3); position: relative; z-index: 2; }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.result-stamp { display: inline-block; align-self: center; line-height: 1.2; font-size: 60px; font-weight: 900; letter-spacing: .1em; padding: 10px 40px; border: 8px solid; border-radius: 20px; transform: rotate(-4deg); background: #fff; }
.result.dang .result-stamp { color: var(--green); border-color: var(--green); }
.result.tinhlai .result-stamp { color: var(--red); border-color: var(--red); }
.result-title { color: #fff; font-size: 38px; font-weight: 900; line-height: 1.25; margin: 16px 0 4px; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.result-msg { color: var(--gold-light); font-size: 20px; margin: 0 0 14px; }
.result-detail { background: #fff; border-radius: var(--radius); padding: 16px 24px; text-align: left; margin-bottom: 18px; box-shadow: var(--shadow); overflow: auto; min-height: 0; flex: 0 1 auto; }
.result > .btn { align-self: center; flex: none; }
.result-detail .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--mint-2); font-size: 17px; }
.result-detail .row:last-child { border: 0; }
.result-detail .tip { background: var(--mint); border-radius: 14px; padding: 12px 16px; margin-top: 12px; font-size: 17px; }
.result-detail .cut { background: var(--cream); border-radius: 14px; padding: 12px 16px; margin-top: 10px; font-size: 18px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.result-detail .cut small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
.result-detail .cut b { color: var(--green-dark); white-space: nowrap; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* ===== Hóa đơn ===== */
.receipt-wrap { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: clamp(14px, 2vw, 28px); flex: 1; min-height: 0; max-width: 1300px; margin: 0 auto; width: 100%; }
.receipt {
  background: #fff; color: #222; font-family: 'Courier New', monospace; padding: 26px 26px 36px; font-size: 15px; line-height: 1.5;
  box-shadow: var(--shadow); overflow: auto; min-height: 0; animation: slideDown .6s ease;
  -webkit-mask: linear-gradient(#000 0 0) padding-box; border-radius: 8px 8px 0 0;
  background-image: linear-gradient(135deg, transparent 75%, #fff 75%), linear-gradient(45deg, transparent 75%, #fff 75%);
}
@keyframes slideDown { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.receipt h3 { text-align: center; margin: 0; font-size: 22px; letter-spacing: .15em; }
.receipt .c { text-align: center; }
.receipt .sep { border-top: 2px dashed #999; margin: 10px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 10px; }
.receipt .r.removed { text-decoration: line-through; color: #999; }
.receipt .tot { font-weight: 900; font-size: 18px; }
.receipt .stamp { text-align: center; font-size: 28px; font-weight: 900; margin: 10px 0; padding: 6px; border: 4px double; }
.receipt .stamp.dang { color: var(--green); } .receipt .stamp.tinhlai { color: var(--red); }

.next-steps { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 20px; min-height: 0; }
.title-card { background: linear-gradient(160deg, #fff, var(--cream)); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); border: 5px solid var(--gold); }
.tc-avatar { width: 120px; height: 120px; border-radius: 50%; border: 5px solid var(--red); background: #fff; margin: 10px auto 6px; display: block; object-fit: cover; }
.tc-name { font-size: 24px; font-weight: 900; color: var(--green-dark); }
.tc-result { font-weight: 900; font-size: 18px; margin-top: 6px; }
.tc-result.dang { color: var(--green); } .tc-result.tinhlai { color: var(--red); }
.tc-left { color: var(--muted); font-weight: 700; margin-top: 4px; }
.qr-box { background: #fff; border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow); }
#qr { width: 150px; height: 150px; flex: none; display: grid; place-items: center; }
#qr img, #qr canvas { width: 150px !important; height: 150px !important; }
.qr-text { font-size: 17px; }
.gift-ladder { grid-column: 1 / -1; background: var(--cream); border-radius: var(--radius); padding: 16px 22px; box-shadow: var(--shadow); }
.gift-ladder ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gift-ladder li { background: #fff; border-radius: 14px; padding: 10px 14px; font-size: 15px; }
.gift-ladder li b { display: block; color: var(--red); font-size: 13px; letter-spacing: .05em; }
.next-actions { grid-column: 1 / -1; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== Share (mobile) ===== */
.share { margin: 0 auto; max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 16px; overflow: auto; }
.title-card.big .tc-avatar { width: 150px; height: 150px; }
.share-form { background: #fff; border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.share-form input { font-size: 18px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--mint-2); }
.share-form input:focus { outline: 0; border-color: var(--green); }
.share-done { color: var(--green-dark); font-weight: 700; }
.share-actions { display: flex; flex-direction: column; gap: 10px; }
.share-tags { text-align: center; color: var(--gold-light); font-weight: 800; }
.share-app { text-align: center; color: #fff; font-weight: 700; }

/* ===== Admin ===== */
.admin { background: #fff; border-radius: var(--radius); padding: 24px; overflow: auto; }
.admin .screen-title { color: var(--green-dark); text-shadow: none; font-size: 28px; margin-bottom: 16px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 18px; }
.admin th, .admin td { padding: 8px 10px; border-bottom: 1px solid var(--mint-2); text-align: left; }

/* ===== Laptop nhỏ / tablet ngang ===== */
@media (max-width: 1200px) and (orientation: landscape) {
  .topbar { padding: 10px 20px; height: 64px; gap: 14px; }
  .logo { height: 30px; }
  .topbar-title { font-size: 16px; }
  .steps li { font-size: 11px; padding: 4px 9px 4px 5px; }
  #app { height: calc(100% - 64px); }
  .intro-chars { height: 30vh; }
  .intro-sub { font-size: 17px; }
  .role-card img { max-height: 36vh; }
  .role-card .role-name { font-size: 19px; }
  .role-detail { padding: 12px 20px; gap: 20px; }
  .big { font-size: 24px; }
  .ar-wrap { grid-template-columns: 1.7fr 1fr; gap: 16px; }
  .ar-side { padding: 16px 18px; gap: 10px; }
  .ar-side .screen-title { font-size: 22px; }
  .ar-side p { font-size: 15px; }
  .ar-legend li { font-size: 13px; padding: 6px 8px; } .ar-legend li span.e { font-size: 24px; }
  .ar-prompt { font-size: 22px; }
  .ar-countdown { font-size: 110px; }
  .avatar-wrap { width: 120px; height: 120px; } .avatar-mood { font-size: 40px; }
  .budget-num { font-size: 26px; }
  .avatar-say { font-size: 14px; min-height: 52px; }
  .item-card { padding: 18px 22px 16px; }
  .item-actions .btn { min-width: 170px; }
  .queue span { width: 38px; height: 38px; font-size: 20px; }
  .cart li { font-size: 13px; padding: 6px 8px; }
  .result-stamp { font-size: 44px; padding: 6px 28px; border-width: 6px; }
  .result-title { font-size: 28px; } .result-msg { font-size: 16px; }
  .result-detail .row { font-size: 15px; padding: 4px 0; }
  .receipt { font-size: 13px; padding: 18px; }
  .tc-avatar { width: 90px; height: 90px; } .tc-name { font-size: 19px; }
  #qr, #qr img, #qr canvas { width: 120px !important; height: 120px !important; }
  .qr-text { font-size: 14px; }
  .gift-ladder li { font-size: 13px; }
}

/* ===== Responsive (điện thoại / dọc) ===== */
@media (max-width: 699px), (max-height: 500px) {
  body { overflow: auto; }
  .topbar { height: auto; padding: 8px 14px; flex-wrap: wrap; gap: 8px; }
  .logo { height: 26px; } .topbar-title { font-size: 15px; }
  .steps { width: 100%; margin: 0; overflow-x: auto; }
  .steps li { font-size: 11px; padding: 4px 8px 4px 4px; white-space: nowrap; }
  #app { height: auto; min-height: calc(100vh - 110px); }
  .screen { padding: 16px; height: auto; min-height: calc(100vh - 110px); overflow: visible; }
  .screen-title { font-size: 28px; }
  .screen-sub { font-size: 16px; }
  .intro-chars { height: 28vh; }
  .intro-title { font-size: clamp(44px, 14vw, 60px); }
  .intro-kicker { font-size: 12px; letter-spacing: .15em; }
  .intro-sub { font-size: 16px; }
  .btn-xl { padding: 18px 30px; font-size: 22px; } .btn-xxl { padding: 24px 40px; font-size: 32px; }
  .reg-form { padding: 18px 16px; gap: 12px; }
  .reg-field input { font-size: 20px; padding: 12px 14px; }
  .role-grid { grid-template-columns: 1fr; gap: 14px; }
  .role-card { flex-direction: row; text-align: left; align-items: center; gap: 14px; }
  .role-card img { width: 110px; height: 130px; flex: none; }
  .role-card .role-name { font-size: 19px; margin: 0; }
  .role-detail { flex-direction: column; gap: 14px; padding: 16px; }
  .ar-wrap { grid-template-columns: 1fr; gap: 14px; }
  .ar-stage { aspect-ratio: 4/5; max-height: 62vh; }
  .ar-side { padding: 16px; gap: 10px; }
  .ar-side .screen-title { font-size: 20px; }
  .ar-side p { font-size: 14px; }
  .ar-actions { order: -1; margin: 0; flex-direction: row; }
  .ar-actions .btn { flex: 1; padding: 14px 10px; font-size: 15px; }
  .ar-legend li { font-size: 12px; padding: 6px 8px; } .ar-legend li span.e { font-size: 22px; }
  .ar-hud { padding: 10px 12px; } .ar-avatar { width: 40px; height: 40px; } .ar-role { font-size: 14px; } .ar-bonus { font-size: 18px; }
  .ar-prompt { font-size: 17px; bottom: 10px; padding: 0 10px; }
  .ar-timebar { bottom: 52px; left: 12px; right: 12px; height: 7px; }
  .ar-countdown { font-size: 90px; } .ar-float { font-size: 32px; }
  .ar-status { font-size: 14px; padding: 10px 16px; width: 86%; text-align: center; }
  .market { grid-template-columns: 1fr; }
  .avatar-panel { display: grid; grid-template-columns: 76px 1fr; grid-template-areas: "av name" "av value" "budget budget"; column-gap: 12px; row-gap: 2px; text-align: left; align-items: center; padding: 12px 14px; }
  .avatar-wrap { grid-area: av; width: 76px; height: 76px; }
  .avatar-img { border-width: 4px; }
  .avatar-mood { font-size: 28px; right: -4px; bottom: -4px; }
  .avatar-name { grid-area: name; margin: 0; font-size: 16px; }
  .avatar-value { grid-area: value; font-size: 13px; }
  .budget { grid-area: budget; margin: 8px 0 0; padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "lbl num" "bar bar" "tot tot"; column-gap: 10px; align-items: baseline; }
  .budget .lbl { grid-area: lbl; } .budget-num { grid-area: num; font-size: 22px; text-align: right; } .budget-bar { grid-area: bar; margin: 4px 0; height: 10px; } .budget-total { grid-area: tot; font-size: 12px; }
  .avatar-say { display: none; }
  .market-center { justify-content: center; min-height: 52vh; }
  .event .avatar-panel { grid-template-areas: "av name" "av value" "av budget"; } .event .budget { margin: 2px 0 0; padding: 4px 0; background: none; }
  .avatar-panel.small .avatar-wrap { width: 76px; height: 76px; }
  .item-icon { font-size: 70px; }
  .item-name { font-size: 22px; } .item-price { font-size: 30px; }
  .item-actions .btn { min-width: 0; flex: 1; }
  .queue { display: none; }
  .cart-panel { max-height: 200px; }
  .event { grid-template-columns: 1fr; }
  .event-card { padding: 18px; }
  .event-title { font-size: 26px; } .event-text { font-size: 17px; }
  .opt { font-size: 17px; padding: 12px 14px; gap: 12px; }
  .opt .key { width: 40px; height: 40px; font-size: 18px; }
  .result-stamp { font-size: 38px; padding: 6px 22px; border-width: 5px; }
  .result-title { font-size: 24px; } .result-msg { font-size: 15px; }
  .result-detail { padding: 12px 14px; } .result-detail .row { font-size: 14px; }
  .result-detail .cut { font-size: 14px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .bill .screen-sub { font-size: 18px; }
  .receipt-wrap { grid-template-columns: 1fr; }
  .receipt { font-size: 12px; padding: 16px; max-height: 60vh; }
  .qr-box { flex-direction: column; text-align: center; }
  .next-steps { grid-template-columns: 1fr; }
  .gift-ladder ul { grid-template-columns: 1fr; }
}

/* ===== Standee dọc 9:16 (65" 4K 2160x3840, hoặc 1080x1920) – mọi kích thước theo vw ===== */
@media (orientation: portrait) and (min-width: 700px) {
  body { overflow: hidden; }
  .lbl { font-size: 1.3vw; }
  .big { font-size: 3vw; }
  .topbar { height: 6.5vw; padding: 1vw 3vw; gap: 2vw; }
  .logo { height: 3.4vw; }
  .topbar-title { font-size: 1.9vw; }
  .steps { gap: .6vw; }
  .steps li { font-size: 1.25vw; padding: .5vw 1.1vw .5vw .6vw; gap: .5vw; }
  .steps li::before { width: 2.1vw; height: 2.1vw; font-size: 1.1vw; }
  #app { height: calc(100% - 6.5vw); }
  .screen { padding: 2.5vw 3vw; overflow: hidden; }
  .screen-title { font-size: 4.2vw; }
  .screen-sub { font-size: 2vw; margin: .8vw 0 2.2vw; }
  .btn { font-size: 2.2vw; padding: 1.6vw 3.4vw; border-radius: 99vw; }
  .btn-lg { font-size: 2.5vw; padding: 1.9vw 4vw; }
  .btn-xl { font-size: 3.1vw; padding: 2.3vw 5.5vw; }
  .btn-xxl { font-size: 4.8vw; padding: 3.4vw 9vw; }
  .blossom { font-size: 7vw; }

  /* Màn chờ */
  .intro { max-width: none; }
  .intro-kicker { font-size: 1.7vw; margin-bottom: 1vw; }
  .intro-title { font-size: 11vw; }
  .intro-sub { font-size: 2.4vw; margin: 1.2vw 0 2.5vw; }
  .intro-chars { height: 38vh; gap: 1vw; margin-bottom: 3vw; }
  .intro-tag { font-size: 1.8vw; margin-top: 2.2vw; }

  /* Đăng ký */
  .register { width: 100%; }
  .reg-form { padding: 3.4vw 3.6vw 2.8vw; gap: 2.2vw; border-radius: 2.4vw; }
  .reg-field span { font-size: 1.5vw; }
  .reg-field input { font-size: 3.6vw; padding: 2vw 2.4vw; border-radius: 1.8vw; border-width: .4vw; }
  .reg-error { font-size: 2vw; padding: 1.4vw 1.8vw; border-radius: 1.4vw; }
  .reg-consent { font-size: 1.6vw; }
  .reg-back { font-size: 2vw; margin-top: 2vw; padding: 1.4vw 3vw; }

  /* Chọn vai */
  #s-role { justify-content: center; }
  .role-grid { gap: 2.4vw; max-width: none; flex: 0 0 auto; }
  .role-card img { flex: none; height: 44vh; }
  .role-card { padding: 1.8vw; border-radius: 2.4vw; border-width: .5vw; }
  .role-card .role-name { font-size: 2.4vw; margin-top: 1vw; }
  .role-card .role-tag { font-size: 1.8vw; }
  .role-card .role-budget { font-size: 1.35vw; margin-top: .4vw; }
  .role-card.selected::after { width: 5vw; height: 5vw; font-size: 3vw; top: -1.6vw; right: -1.6vw; }
  .role-detail { margin-top: 2.4vw; padding: 2vw 3vw; gap: 4vw; border-radius: 2.4vw; }
  .role-detail-row { gap: 4vw; }

  /* Hóa thân AR */
  .ar-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 2vw; }
  .ar-stage { aspect-ratio: 1 / 1; max-height: 56vh; width: 100%; border-radius: 2.4vw; }
  .ar-side { padding: 2vw 2.6vw; gap: 1.4vw; border-radius: 2.4vw; overflow: hidden; }
  .ar-side .screen-title { font-size: 3vw; }
  .ar-side p { font-size: 1.9vw; }
  .ar-legend { grid-template-columns: repeat(3, 1fr); gap: 1vw; }
  .ar-legend li { font-size: 1.6vw; padding: .8vw 1.2vw; gap: 1vw; border-radius: 1.4vw; }
  .ar-legend li span.e { font-size: 3.2vw; }
  .ar-legend li small { font-size: 1.3vw; }
  .ar-actions { flex-direction: row; gap: 1.6vw; margin-top: auto; }
  .ar-actions .btn { flex: 1; }
  .ar-hud { padding: 1.6vw 2vw; gap: 2vw; }
  .ar-hud-left { gap: 1.2vw; }
  .ar-avatar { width: 5.5vw; height: 5.5vw; border-width: .3vw; }
  .ar-role { font-size: 2.2vw; }
  .ar-bonus { font-size: 3vw; }
  .ar-round { font-size: 1.6vw; }
  .ar-prompt { font-size: 3vw; bottom: 1.8vw; }
  .ar-timebar { left: 2vw; right: 2vw; bottom: 7.5vw; height: 1vw; }
  .ar-status { font-size: 2vw; padding: 1.4vw 2.4vw; max-width: 80%; text-align: center; }
  .ar-countdown { font-size: 20vw; }
  .ar-float { font-size: 5.5vw; }
  .ar-ring circle { stroke-width: 6; }

  /* Đi chợ */
  .market { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; gap: 2vw; }
  .panel { border-radius: 2.4vw; padding: 1.8vw 2.2vw; }
  .avatar-panel {
    display: grid; grid-template-columns: 13vw 1fr 36vw; grid-template-areas: "av name budget" "av value budget" "av say budget";
    column-gap: 2vw; row-gap: .4vw; align-items: center; text-align: left;
  }
  .avatar-wrap { grid-area: av; width: 13vw; height: 13vw; }
  .avatar-img { border-width: .5vw; }
  .avatar-mood { font-size: 4.2vw; right: -.6vw; bottom: -.4vw; }
  .sweat span { font-size: 2.2vw; }
  .avatar-name { grid-area: name; font-size: 2.6vw; margin: 0; }
  .avatar-value { grid-area: value; font-size: 1.7vw; }
  .avatar-say { grid-area: say; margin: .6vw 0 0; font-size: 1.7vw; min-height: 0; padding: 1vw 1.4vw; width: auto; border-radius: 1.4vw; }
  .avatar-say::before { display: none; }
  .budget { grid-area: budget; margin: 0; padding: 1.4vw 1.8vw; border-radius: 1.6vw; }
  .budget-num { font-size: 4.2vw; }
  .budget-bar { height: 1.4vw; margin: .8vw 0 .6vw; }
  .budget-total { font-size: 1.4vw; }
  .market-center { gap: 2vw; justify-content: center; }
  .queue { margin-top: 0; }
  .item-card { width: min(74vw, 100%); padding: 2.4vw 3vw 2vw; border-radius: 3vw; }
  .item-icon { font-size: 15vw; }
  .item-name { font-size: 3.6vw; margin-top: .6vw; }
  .item-price { font-size: 5vw; }
  .item-tag { font-size: 1.8vw; padding: .7vw 1.6vw; margin-top: 1vw; }
  .timer { height: 1.4vw; margin-top: 1.8vw; }
  .item-actions { gap: 3vw; }
  .item-actions .btn { min-width: 30vw; font-size: 3.6vw; padding: 2.6vw 4vw; }
  .pip { font-size: 11vw; -webkit-text-stroke: .4vw var(--red); }
  .queue { gap: 1vw; }
  .queue span { width: 5.5vw; height: 5.5vw; font-size: 3vw; border-radius: 1.2vw; }
  .cart-panel { max-height: 24vh; }
  .cart { display: grid; grid-template-columns: 1fr 1fr; gap: .8vw; margin: 1vw 0; }
  .cart li { font-size: 1.7vw; padding: .9vw 1.3vw; margin: 0; border-radius: 1.2vw; }
  .cart-total { font-size: 2vw; padding-top: 1vw; }
  .cart-total b { font-size: 2.4vw; }

  /* Biến cố */
  .event { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: start; gap: 2vw; }
  .avatar-panel.small .avatar-wrap { width: 13vw; height: 13vw; }
  .event-card { padding: 3vw 3.4vw; border-radius: 2.4vw; }
  .event-kicker { font-size: 1.7vw; }
  .event-title { font-size: 3.8vw; margin: .6vw 0 1vw; }
  .event-text { font-size: 2.3vw; margin-bottom: 2.4vw; }
  .event-options { gap: 1.6vw; }
  .opt { font-size: 2.3vw; padding: 1.9vw 2.4vw; gap: 2vw; border-radius: 1.8vw; border-width: .4vw; }
  .opt .key { width: 5.2vw; height: 5.2vw; font-size: 2.5vw; }
  .event-feedback { padding: 2vw 2.4vw; gap: 2vw; margin-top: 2vw; border-radius: 1.8vw; flex-wrap: wrap; }
  .event-feedback-text { font-size: 2.1vw; }
  .event-feedback-delta { font-size: 3vw; }

  /* Chốt bill / kết quả */
  .bill .screen-sub { font-size: 2.6vw; margin-bottom: 4vw; }
  .result { max-width: none; }
  .result-stamp { font-size: 7.5vw; padding: 1vw 4.5vw; border-width: .8vw; border-radius: 2vw; }
  .result-title { font-size: 4.2vw; margin: 2vw 0 .6vw; }
  .result-msg { font-size: 2.2vw; margin-bottom: 2vw; }
  .result-detail { padding: 2vw 3vw; margin-bottom: 2.4vw; border-radius: 2.4vw; }
  .result-detail .row { font-size: 2vw; padding: .8vw 0; }
  .result-detail .tip { font-size: 1.9vw; padding: 1.4vw 1.8vw; border-radius: 1.4vw; margin-top: 1.4vw; }
  .result-detail .cut { font-size: 2vw; padding: 1.4vw 1.8vw; border-radius: 1.4vw; margin-top: 1vw; }
  .result-detail .cut small { font-size: 1.6vw; }

  /* Hóa đơn + kết quả */
  .receipt-wrap { grid-template-columns: 1fr 1.15fr; gap: 2.4vw; max-width: none; }
  .receipt { font-size: 1.55vw; padding: 2.4vw 2.4vw 3.4vw; border-radius: 1vw 1vw 0 0; }
  .receipt h3 { font-size: 2.4vw; }
  .receipt .tot { font-size: 1.9vw; }
  .receipt .stamp { font-size: 3vw; border-width: .4vw; }
  .next-steps { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; gap: 2vw; align-content: start; }
  .title-card { padding: 2vw; border-radius: 2.4vw; border-width: .5vw; }
  .tc-avatar { width: 13vw; height: 13vw; border-width: .5vw; margin: 1vw auto .6vw; }
  .tc-name { font-size: 2.8vw; }
  .tc-result { font-size: 2vw; }
  .qr-box { padding: 2vw; gap: 2vw; border-radius: 2.4vw; }
  #qr, #qr img, #qr canvas { width: 17vw !important; height: 17vw !important; }
  .qr-text { font-size: 1.9vw; }
  .gift-ladder { grid-column: auto; padding: 1.6vw 2.2vw; border-radius: 2.4vw; }
  .gift-ladder ul { grid-template-columns: 1fr; gap: 1vw; }
  .gift-ladder li { font-size: 1.7vw; padding: 1vw 1.4vw; border-radius: 1.4vw; }
  .gift-ladder li b { font-size: 1.4vw; }
  .next-actions { grid-column: auto; flex-direction: column; gap: 1.4vw; }
  .next-actions .btn { width: 100%; }

  /* Admin */
  .admin th, .admin td { font-size: 1.6vw; padding: 1vw; }
}

/* ===== Modal tải app (2 QR + hướng dẫn Zalo) ===== */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(11,61,36,.94); display: grid; place-items: center; padding: 24px; overflow: auto; animation: fadeIn .25s; }
.modal-card { background: #fff; border-radius: 30px; padding: 26px 34px 24px; width: min(1000px, 100%); text-align: center; box-shadow: var(--shadow); }
.modal-kicker { color: var(--red); font-weight: 900; letter-spacing: .25em; font-size: 14px; }
.modal-title { margin: 4px 0 2px; line-height: 1.25; font-size: 40px; font-weight: 900; color: var(--green-dark); }
.modal-sub { margin: 0 0 18px; font-size: 19px; color: var(--ink); }
.qr-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.qr-card { background: var(--cream); border-radius: 22px; padding: 16px 16px 14px; border: 5px solid transparent; }
.qr-card.ios { border-color: #1d1d1f; } .qr-card.android { border-color: #3DDC84; }
.qr-os { font-weight: 900; font-size: 21px; color: var(--green-dark); margin-bottom: 10px; }
.qr-img { width: 230px; height: 230px; margin: 0 auto; background: #fff; padding: 10px; border-radius: 14px; display: grid; place-items: center; }
.qr-img img, .qr-img canvas { width: 210px !important; height: 210px !important; }
.qr-store { margin-top: 10px; font-weight: 700; color: var(--muted); font-size: 15px; }
.howto { margin-top: 18px; background: var(--mint); border-radius: 22px; padding: 16px 22px; text-align: left; }
.howto-title { font-weight: 900; font-size: 20px; color: var(--green-dark); margin-bottom: 10px; }
.howto-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.howto-steps li { display: flex; gap: 14px; align-items: flex-start; font-size: 17px; line-height: 1.4; background: #fff; border-radius: 14px; padding: 10px 14px; }
.howto-steps .n { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; font-size: 18px; display: grid; place-items: center; }
.qr-ico { display: inline-block; font-family: monospace; font-weight: 900; background: #fff; border: 2px solid var(--green-ink); border-radius: 6px; padding: 0 5px; line-height: 1.3; }
.howto-note { margin-top: 10px; font-size: 15px; color: var(--green-ink); }
.modal-actions { display: flex; gap: 14px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 60; background: var(--green-dark); color: #fff; font-weight: 800; font-size: 22px; padding: 16px 28px; border-radius: 999px; box-shadow: var(--shadow); animation: fadeIn .3s; }
@media (max-width: 699px) {
  .modal { padding: 12px; align-items: start; }
  .modal-card { padding: 18px 16px; border-radius: 20px; }
  .modal-title { font-size: 26px; } .modal-sub { font-size: 15px; }
  .qr-pair { grid-template-columns: 1fr; gap: 12px; }
  .qr-img { width: 190px; height: 190px; } .qr-img img, .qr-img canvas { width: 170px !important; height: 170px !important; }
  .howto { padding: 12px 14px; } .howto-steps li { font-size: 14px; } .howto-title { font-size: 17px; }
}
@media (orientation: portrait) and (min-width: 700px) {
  .modal { padding: 3vw; }
  .modal-card { width: 100%; padding: 3vw 3.4vw; border-radius: 3vw; }
  .modal-kicker { font-size: 1.5vw; } .modal-title { font-size: 4.6vw; } .modal-sub { font-size: 2.2vw; margin-bottom: 2vw; }
  .qr-pair { gap: 2.4vw; }
  .qr-card { padding: 2vw; border-radius: 2.4vw; border-width: .5vw; }
  .qr-os { font-size: 2.3vw; margin-bottom: 1.2vw; }
  .qr-img { width: 30vw; height: 30vw; padding: 1.2vw; border-radius: 1.6vw; }
  .qr-img img, .qr-img canvas { width: 27.6vw !important; height: 27.6vw !important; }
  .qr-store { font-size: 1.7vw; margin-top: 1.2vw; }
  .howto { margin-top: 2.4vw; padding: 2vw 2.6vw; border-radius: 2.4vw; }
  .howto-title { font-size: 2.4vw; margin-bottom: 1.4vw; }
  .howto-steps { gap: 1.2vw; }
  .howto-steps li { font-size: 2vw; padding: 1.3vw 1.8vw; gap: 1.6vw; border-radius: 1.6vw; }
  .howto-steps .n { width: 4.2vw; height: 4.2vw; font-size: 2.2vw; }
  .howto-note { font-size: 1.7vw; margin-top: 1.4vw; }
  .modal-actions { gap: 1.8vw; margin-top: 2.4vw; }
  .toast { font-size: 2.4vw; padding: 1.8vw 3.2vw; bottom: 4vw; }
}
