/* Kiosk styles — trang bốc thăm chính, tối ưu tablet quầy */

.app-header {
  background: linear-gradient(135deg, var(--brand-primary-darker) 0%, var(--brand-primary) 100%);
  color: var(--text-invert);
  padding: 18px 24px;
  display: flex; align-items: center; gap: 18px;
  box-shadow: var(--shadow-md);
  position: sticky; top: 0; z-index: 20;
}
.app-header .logo { height: 56px; width: auto; }
.app-header .title-block { flex: 1; min-width: 0; }
.app-header h1 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700; letter-spacing: .02em;
  line-height: 1.15;
}
.app-header .subtitle {
  font-size: 12px; opacity: .78; letter-spacing: .15em; text-transform: uppercase;
  margin-top: 2px;
}
.app-header .status-chip {
  background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px;
  font-size: 12px; letter-spacing: .08em;
}
.app-header .status-chip.ok { background: rgba(30,132,73,.5); }
.app-header .status-chip.err { background: rgba(192,57,43,.75); }

.container {
  max-width: 1200px; margin: 0 auto; padding: 20px;
}

/* ================= SECTION CARD ================= */
.section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.section-title {
  font-size: 18px; font-weight: 700; color: var(--brand-primary-darker);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 10px;
}
.section-title .step {
  background: var(--brand-primary); color: #fff;
  width: 30px; height: 30px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.section-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }

/* ================= FORM ================= */
.form-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  letter-spacing: .02em;
}
.field label .req { color: var(--danger); }
.field input, .field select, .field textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(111,45,168,.12);
}
.field .hint { font-size: 12px; color: var(--text-muted); }
.field .err-msg { font-size: 12px; color: var(--danger); }

/* ================= CHECKBOX ================= */
.check-row {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 12px;
}
.check-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border: 2px solid var(--border-strong);
  border-radius: var(--radius-md); background: var(--surface-2);
  cursor: pointer; transition: all .18s;
  user-select: none;
}
.check-card:hover { border-color: var(--brand-primary-light); }
.check-card.checked {
  border-color: var(--brand-primary);
  background: linear-gradient(135deg, rgba(111,45,168,.06), rgba(255,193,7,.05));
  box-shadow: var(--shadow-purple);
}
.check-card input[type=checkbox] {
  width: 24px; height: 24px; accent-color: var(--brand-primary);
  margin-top: 2px; cursor: pointer;
}
.check-card .label { font-weight: 600; }
.check-card .desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ================= DRAW CARDS ================= */
.draw-cards {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 12px;
}
.draw-card {
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  color: #fff;
  cursor: pointer; transition: transform .18s, box-shadow .18s;
  position: relative; overflow: hidden;
  min-height: 200px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
}
.draw-card.voucher {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  box-shadow: var(--shadow-purple);
}
.draw-card.mypham {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--festive-red) 100%);
  box-shadow: 0 12px 32px rgba(192,57,43,.28);
}
.draw-card:hover:not(.disabled):not(.done) {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-purple), 0 20px 60px rgba(230, 178, 60, .3);
}
.draw-card::before {
  content: ''; position: absolute; inset: -30%;
  background: radial-gradient(circle, rgba(230, 178, 60, .18), transparent 65%);
  animation: ring-pulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.draw-card.disabled::before, .draw-card.done::before { animation: none; opacity: 0; }
.draw-card > * { position: relative; z-index: 1; }
@keyframes ring-pulse {
  0%, 100% { transform: scale(0.95); opacity: .5; }
  50%      { transform: scale(1.08); opacity: 1; }
}
.draw-card .card-icon { font-size: 48px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.35)); }
.draw-card .card-title {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  text-shadow: 0 2px 20px rgba(255,193,7,.35);
}
.draw-card .card-desc { font-size: 13px; opacity: .88; letter-spacing: .04em; }
.draw-card .card-btn {
  background: linear-gradient(135deg, var(--gala-gold), var(--brand-gold-strong));
  color: var(--brand-primary-darker);
  padding: 12px 26px; border-radius: 999px;
  font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  margin-top: 8px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(230, 178, 60, .45);
  border: 2px solid transparent;
}
.draw-card.mypham .card-btn { color: var(--festive-red); }
.draw-card.disabled { opacity: .4; cursor: not-allowed; filter: grayscale(60%); }
.draw-card.disabled .card-btn::after { content: ' 🔒'; }
.draw-card.done { opacity: .55; cursor: not-allowed; }
.draw-card.done::after {
  content: 'ĐÃ BỐC'; position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,.9); color: var(--brand-primary-darker);
  font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  letter-spacing: .1em;
}

/* ================= BUTTONS ================= */
.btn {
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 700; letter-spacing: .04em;
  transition: all .15s; display: inline-flex; align-items: center; gap: 8px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: #fff; box-shadow: var(--shadow-purple);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(111,45,168,.32); }
.btn-secondary {
  background: var(--surface-2); color: var(--brand-primary-darker);
  border: 1.5px solid var(--brand-primary-soft);
}
.btn-secondary:hover:not(:disabled) { background: var(--brand-primary-soft); }
.btn-gold {
  background: linear-gradient(135deg, var(--gala-gold), var(--brand-gold-strong));
  color: var(--brand-primary-darker); box-shadow: var(--shadow-gold);
}
.btn-lg { padding: 16px 34px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

.actions-row { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.actions-row .btn { flex: 1; min-width: 200px; }

/* ================= DRAW STAGE OVERLAY — Royal Grand Prize style ================= */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(ellipse at 50% 30%, rgba(74, 31, 112, .96), rgba(14, 6, 32, .99));
  backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.stage {
  background: radial-gradient(ellipse at top, #4A1F70 0%, #1a0530 55%, #0E0620 100%);
  border-radius: var(--radius-xl);
  padding: 48px 40px; max-width: 720px; width: 100%;
  color: #fff; text-align: center;
  border: 2px solid rgba(255, 215, 0, .35);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, .7),
    0 0 60px rgba(255, 215, 0, .2),
    inset 0 1px 0 rgba(255, 255, 255, .12);
  position: relative; overflow: hidden;
}
/* Royal aura — 2 lớp rays gold + cam quay chậm */
.stage::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 800px; height: 800px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 215, 0, .32), transparent 65%);
  animation: aura-rotate 8s linear infinite;
  pointer-events: none;
}
.stage::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 900px; height: 900px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(244, 130, 32, .22), transparent 65%);
  animation: aura-rotate 12s linear infinite reverse;
  pointer-events: none;
}
@keyframes aura-rotate { to { transform: translate(-50%, -50%) rotate(360deg); } }
.stage > * { position: relative; z-index: 2; }

/* Title — mega gold-shift shimmer */
.stage-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 40px; letter-spacing: .06em;
  margin-bottom: 6px; text-transform: uppercase;
  background: linear-gradient(135deg, #FFE28A 0%, #FFD700 45%, #FFA000 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(255, 215, 0, .5);
  animation: gold-shift 3s ease-in-out infinite alternate;
}
@keyframes gold-shift {
  from { filter: hue-rotate(-4deg) brightness(1); }
  to   { filter: hue-rotate(4deg) brightness(1.14); }
}
.stage-sub { font-size: 11px; opacity: .65; letter-spacing: .28em; text-transform: uppercase; margin-bottom: 22px; color: var(--gala-gold-light); }

/* Roulette box — gold frame + inner glow */
.roulette {
  background: linear-gradient(180deg, rgba(255, 215, 0, .05), rgba(0, 0, 0, .35));
  border-radius: var(--radius-lg);
  padding: 44px 24px; margin: 20px 0;
  min-height: 180px; display: flex; align-items: center; justify-content: center;
  border: 3px solid rgba(255, 215, 0, .55);
  box-shadow:
    inset 0 0 60px rgba(255, 215, 0, .12),
    0 0 80px rgba(255, 215, 0, .25),
    0 0 30px rgba(244, 130, 32, .18);
  position: relative;
}
.roulette .name {
  font-family: var(--font-display); font-size: 40px; font-weight: 800;
  color: #fff; text-shadow: 0 4px 40px rgba(255, 215, 0, .75);
  transition: opacity .1s;
}
.roulette.spinning .name {
  background: linear-gradient(90deg, var(--gala-gold), #FFE28A, #fff, #FFE28A, var(--gala-gold));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shake .07s infinite alternate, gold-slide 1.2s linear infinite;
}
@keyframes shake { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
@keyframes gold-slide { to { background-position: -200% 0; } }

/* MEGA VOUCHER VALUE — royal gold gradient text với mega-pulse */
.stage .voucher-value {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(72px, 12vw, 130px);
  margin: 18px 0 8px;
  background: linear-gradient(180deg, #FFF9E5 0%, #FFD700 40%, #F48220 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 0 100px rgba(255, 215, 0, .9);
  filter: drop-shadow(0 0 40px rgba(255, 215, 0, .8));
  animation: mega-pulse 1.8s ease-in-out infinite alternate;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}
@keyframes mega-pulse {
  from { filter: drop-shadow(0 0 30px rgba(255, 215, 0, .6)); transform: scale(1); }
  to   { filter: drop-shadow(0 0 60px rgba(255, 215, 0, 1));  transform: scale(1.03); }
}

/* Winner name (mỹ phẩm) — royal serif */
.stage .prize-name {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(28px, 4vw, 44px);
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF3CD 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255, 215, 0, .7), 0 0 80px rgba(244, 130, 32, .4);
  line-height: 1.2;
}

/* Crown icon phía trên tên khách */
.stage .crown {
  font-size: 44px;
  filter: drop-shadow(0 4px 24px rgba(255, 215, 0, .8));
  animation: crown-float 3s ease-in-out infinite alternate;
  display: inline-block; margin-bottom: 6px;
}
@keyframes crown-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-6px); }
}
.stage .winner-name {
  font-family: var(--font-display); font-weight: 800;
  font-size: 32px; margin-top: 8px;
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 215, 0, .5);
}
.stage .winner-label {
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gala-gold-light); opacity: .8;
  margin: 6px 0;
}

.stage-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; justify-content: center; }

/* ================= KIOSK-STYLE PILL BUTTONS (post-reveal) ================= */
.stage-actions .btn {
  min-width: 220px;
  padding: 16px 32px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-sans);
  font-weight: 700; font-size: 15px;
  letter-spacing: .14em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: all .18s;
}
.stage-actions .btn:hover:not(:disabled) { transform: translateY(-2px); }
.stage-actions .btn-gold {
  background: linear-gradient(135deg, var(--gala-gold), var(--brand-gold-strong));
  color: var(--brand-primary-darker);
  box-shadow: 0 12px 36px rgba(230, 178, 60, .5), inset 0 -4px 12px rgba(198, 154, 46, .3);
}
.stage-actions .btn-primary {
  background: linear-gradient(135deg, var(--brand-primary-light), var(--brand-primary));
  color: #fff;
  box-shadow: 0 12px 32px rgba(111, 45, 168, .5);
}
.stage-actions .btn-secondary {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-color: rgba(255, 255, 255, .25);
  box-shadow: none;
}
.stage-actions .btn-secondary:hover { background: rgba(255, 255, 255, .16); }

/* ================= CUSTOMER SUMMARY ================= */
.customer-summary {
  background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.04));
  border-radius: var(--radius-md); padding: 14px 20px;
  margin-bottom: 20px; text-align: left;
  font-size: 13px; line-height: 1.6;
}
.customer-summary strong { color: var(--gala-gold-light); font-weight: 700; }

/* ================= WARNING BOX ================= */
.warn-box {
  background: var(--warning-soft); border-left: 4px solid var(--warning);
  padding: 12px 16px; border-radius: var(--radius-sm);
  color: #7C4A08; margin: 12px 0;
  font-size: 13px;
}
.warn-box strong { color: var(--warning); }

/* ================= TOAST ================= */
.toast-host {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--brand-primary-darker); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s;
  min-width: 260px; max-width: 400px;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ================= SPINNER ================= */
.spinner {
  width: 40px; height: 40px;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--gala-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= RESPONSIVE ================= */
@media (max-width: 640px) {
  .app-header h1 { font-size: 18px; }
  .app-header .logo { height: 44px; }
  .container { padding: 12px; }
  .section { padding: 18px; }
  .stage { padding: 24px 18px; }
  .stage-title { font-size: 22px; }
  .stage .voucher-value { font-size: 44px; }
  .stage-actions .btn { min-width: 0; width: 100%; }
}
