:root { --ink: #18212d; --cream: #fffaf1; --wine: #8e292f; --gold: #e7b95d; --night: #0b1015; --lime: #a6ff3f; --muted: #667085; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
input:focus-visible, button:focus-visible { outline: 3px solid #f8ca6d; outline-offset: 3px; }
.eyebrow { margin: 0 0 10px; color: var(--wine); font-size: 12px; font-weight: 800; letter-spacing: .14em; }

.claim-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at top right, #f2d698, transparent 35%), var(--cream); color: var(--ink); }
.claim-card { width: min(100%, 460px); text-align: center; padding: 38px 26px; border: 1px solid #efdcb8; border-radius: 28px; background: #fffdf8; box-shadow: 0 18px 55px #50350e1f; }
.brand-mark { width: 48px; height: 48px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; background: var(--wine); color: white; font-family: Georgia, serif; font-weight: 700; letter-spacing: .06em; }
.claim-card h1, .merchant-page h1, .dashboard-page h1 { margin: 0; line-height: 1.25; }
.claim-card h1 { font-size: clamp(28px, 8vw, 38px); }
.lead { margin: 12px 0 30px; color: var(--muted); }
.claim-card form { text-align: left; }
label { display: block; margin-bottom: 9px; font-weight: 700; }
.claim-card input { width: 100%; height: 58px; padding: 0 16px; border: 1px solid #d8cbb1; border-radius: 12px; font-size: 18px; color: var(--ink); }
.claim-card button { width: 100%; min-height: 60px; margin-top: 16px; border: 0; border-radius: 12px; background: var(--wine); color: white; font-size: 19px; font-weight: 800; transition: background .2s, box-shadow .2s; }
.claim-card button:hover { background: #6e1d25; box-shadow: 0 8px 18px #8e292f3d; }
.form-message { min-height: 24px; margin: 14px 0 0; color: #b42318; text-align: center; }
.prize-composition { margin: 16px 0 0; color: #6b5839; font-size: 14px; line-height: 1.6; text-align: center; }
.coupon-result { padding-top: 8px; }
.coupon-result .success-title { margin: 16px 0 5px; color: var(--wine); font-weight: 800; }
.coupon-result strong { display: block; color: var(--wine); font-size: clamp(66px, 20vw, 100px); letter-spacing: .08em; line-height: 1.1; }
.coupon-result p { color: var(--muted); }
.coupon-result .save-tip { margin-top: 22px; font-size: 14px; color: #4a3a22; }
.claim-warning { display: grid; gap: 3px; margin: 16px 0 0; padding: 13px 16px; border: 1px solid #d8a53f; border-radius: 12px; background: #fff0c9; color: #6f3d00; text-align: center; }
.claim-warning strong { display: block; color: #8e292f; font-size: 17px; letter-spacing: .04em; }.claim-warning span { font-size: 14px; line-height: 1.55; }

.merchant-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 90% 10%, #574127, transparent 32%), #171411; color: #fff8e9; }
.redeem-shell { width: min(100%, 800px); padding: clamp(28px, 6vw, 60px); border: 1px solid #5d4830; border-radius: 28px; background: #211a15; box-shadow: 0 22px 55px #0007; }
.merchant-page .eyebrow { color: var(--gold); }
.merchant-page h1 { font-size: clamp(31px, 7vw, 52px); }
.merchant-page h1 span { color: var(--gold); }
.merchant-page header > p:last-child { margin: 12px 0 42px; color: #cabfad; }
.verify-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
.verify-controls input { width: 100%; min-width: 0; height: 92px; border: 2px solid #856c4b; border-radius: 14px; background: #120f0d; color: white; text-align: center; font-size: 52px; font-weight: 800; letter-spacing: .18em; }
.verify-controls button { min-height: 92px; padding: 0 28px; border: 0; border-radius: 14px; background: var(--gold); color: #2c1b07; font-size: 22px; font-weight: 900; transition: background .2s; }
.verify-controls button:hover { background: #f3ca74; }
.verify-result { min-height: 58px; margin-top: 24px; padding: 16px; border: 1px solid #594832; border-radius: 12px; background: #18120e; color: #dac9b0; font-size: 18px; font-weight: 700; text-align: center; }
.verify-result.is-success { border-color: #51b576; color: #93f7b6; background: #113621; }
.verify-result.is-error { border-color: #c95d55; color: #ffb4ae; background: #421b1a; }

.dashboard-page { min-height: 100vh; padding: clamp(20px, 4vw, 56px); background: var(--night); color: #ecffdb; }
.dashboard-shell { max-width: 1060px; margin: auto; }
.dashboard-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.dashboard-page .eyebrow { color: var(--lime); }
.dashboard-page h1 { font-size: clamp(27px, 5vw, 48px); }
.dashboard-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.live-status { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #28452a; border-radius: 999px; color: var(--lime); white-space: nowrap; }
.live-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.clear-records-button { min-height: 38px; padding: 0 13px; border: 1px solid #a94444; border-radius: 999px; background: #2d1618; color: #ffb4ae; font-size: 14px; font-weight: 800; transition: background .2s, border-color .2s; }
.clear-records-button:hover { border-color: #ff8178; background: #482022; }
.dashboard-message { min-height: 24px; margin: -12px 0 16px; color: #ffb4ae; font-weight: 700; }.dashboard-message.is-success { color: var(--lime); }.dashboard-message.is-error { color: #ffb4ae; }
.metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.metric-card, .visit-panel { border: 1px solid #253724; background: linear-gradient(135deg, #121c16, #0d1410); box-shadow: 0 0 30px #a6ff3f0a; }
.metric-card { padding: 28px; border-radius: 20px; }
.metric-card p { margin: 0; color: #98b698; font-size: 16px; }
.metric-card strong { color: var(--lime); font-family: ui-monospace, Consolas, monospace; font-size: clamp(70px, 18vw, 130px); line-height: 1; text-shadow: 0 0 22px #a6ff3f66; }
.metric-card span { margin-left: 10px; color: #b5ceaf; font-size: 22px; }
.metric-card--claims { border-color: #28505c; background: linear-gradient(135deg, #0d1d23, #0b1317); }
.metric-card--claims strong { color: #6ee7ff; text-shadow: 0 0 22px #6ee7ff66; }
.metric-card--claims p, .metric-card--claims span { color: #a7cbd4; }
.activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.visit-panel { padding: 24px; border-radius: 20px; }
.claim-panel { border-color: #28505c; }
.claim-panel .panel-heading span, .claim-panel time { color: #6ee7ff; }
.panel-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid #2b3e2a; }
.panel-heading h2 { margin: 0; font-size: 20px; }.panel-heading span { color: var(--lime); font-family: ui-monospace, Consolas, monospace; }
.visit-list { margin: 0; padding: 0; list-style: none; }
.visit-list li { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 17px 4px; border-bottom: 1px solid #202f20; color: #d7ead2; }
.visit-list time, .visit-list b { color: var(--lime); font-family: ui-monospace, Consolas, monospace; }.visit-list b { font-weight: 700; }
.empty-state { padding: 30px 0 4px; color: #9ab394; text-align: center; }
.clear-dialog { width: min(calc(100% - 32px), 440px); margin: auto; padding: 0; border: 1px solid #7d3d40; border-radius: 18px; background: #241316; color: #fff0ed; box-shadow: 0 24px 70px #000c; }.clear-dialog::backdrop { background: #050403c9; backdrop-filter: blur(3px); }.clear-dialog section { padding: 26px; }.clear-dialog h2 { margin: 0; font-size: 24px; }.clear-dialog p { margin: 14px 0 0; color: #e4bcb8; line-height: 1.6; }.clear-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }.clear-dialog-actions button { min-height: 44px; padding: 0 15px; border-radius: 10px; font-weight: 800; }.clear-dialog-actions .secondary-button { border: 1px solid #685455; background: transparent; color: #f0d7d4; }.clear-dialog-actions .danger-button { border: 1px solid #dc5d57; background: #b8322c; color: white; }.clear-dialog-actions .danger-button:hover { background: #d5433c; }
@media (max-width: 600px) { .claim-card { padding: 32px 20px; }.verify-controls { grid-template-columns: 1fr; }.verify-controls button { min-height: 68px; }.dashboard-header { flex-direction: column; }.dashboard-actions { width: 100%; justify-content: space-between; }.metrics-grid, .activity-grid { grid-template-columns: 1fr; gap: 14px; }.visit-panel { padding: 17px; }.visit-list li { grid-template-columns: 1fr; gap: 5px; }.visit-list time { font-size: 14px; }.clear-dialog-actions { flex-direction: column-reverse; }.clear-dialog-actions button { width: 100%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }

/* Blind-box configuration is deliberately compact enough for a phone screen. */
.merchant-header { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: start; }
.merchant-header > p:last-child { grid-column: 1 / -1; }
.config-trigger, .dialog-actions button { min-height: 44px; padding: 0 15px; border: 1px solid #8b704c; border-radius: 10px; background: #302315; color: #ffe4a7; font-weight: 800; }
.config-trigger:hover { background: #45321d; }
.verify-result { white-space: pre-line; }
.config-dialog { width: min(calc(100% - 24px), 680px); max-height: min(90vh, 780px); margin: auto; padding: 0; overflow: auto; border: 1px solid #705836; border-radius: 20px; background: #211a15; color: #fff8e9; box-shadow: 0 28px 80px #000b; }
.config-dialog::backdrop { background: #050403bf; backdrop-filter: blur(3px); }
.config-dialog form { padding: clamp(20px, 5vw, 32px); }
.dialog-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.dialog-header h2 { margin: 0; font-size: clamp(24px, 6vw, 32px); }
.icon-button { width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid #705836; border-radius: 50%; background: transparent; color: #fff8e9; font-size: 28px; line-height: 1; }
.dialog-note { margin: 16px 0 22px; color: #cfbea5; line-height: 1.55; }
.prize-fields { display: grid; gap: 12px; }
.prize-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(108px, .55fr); gap: 10px; align-items: end; padding: 12px; border: 1px solid #594832; border-radius: 12px; background: #18120e; }
.prize-row > strong { padding: 0 0 12px; color: var(--gold); font-size: 18px; }
.prize-row label { position: relative; margin: 0; color: #e7d9c2; font-size: 13px; }
.prize-row input { width: 100%; height: 42px; margin-top: 6px; padding: 0 10px; border: 1px solid #856c4b; border-radius: 8px; background: #120f0d; color: white; }
.prize-row label:last-child input { padding-right: 28px; }
.prize-row label span { position: absolute; right: 10px; bottom: 11px; color: #c4ad83; font-size: 14px; }
.prize-row input[readonly] { border-color: #4e493f; background: #282623; color: #b1aaa0; }
.probability-total { margin: 16px 0 5px; color: #ffbfad; font-weight: 700; }.probability-total.is-valid { color: #93f7b6; }
.config-message { min-height: 24px; margin: 7px 0 0; color: #ffb4ae; font-weight: 700; }.config-message.is-success { color: #93f7b6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }.dialog-actions button[type="submit"] { border-color: var(--gold); background: var(--gold); color: #2c1b07; }.dialog-actions .secondary-button { background: transparent; color: #ead7b4; }
@media (max-width: 520px) { .merchant-header { grid-template-columns: 1fr; }.config-trigger { justify-self: start; }.merchant-header > p:last-child { grid-column: auto; }.prize-row { grid-template-columns: 42px minmax(0, 1fr); }.prize-row > strong { grid-row: span 2; align-self: center; padding: 0; }.dialog-actions { flex-direction: column-reverse; }.dialog-actions button { width: 100%; }.config-dialog form { padding: 20px 16px; } }
