* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; background: #0b1020; color: #e6e9f2; }
header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: #121a36; }
header h1, header h1 a { margin: 0; color: #4cc9f0; text-decoration: none; }
nav a { color: #e6e9f2; text-decoration: none; margin-left: 1rem; }
main { max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 320px; }
label { display: flex; flex-direction: column; font-size: 0.9rem; }
input { padding: 0.5rem; border-radius: 4px; border: 1px solid #2a3566; background: #0f1631; color: #e6e9f2; }
button { padding: 0.6rem; border: none; border-radius: 4px; background: #4cc9f0; color: #0b1020; font-weight: 600; cursor: pointer; }
button:hover { background: #7cd7f5; }
button { margin-top: 0.5rem; }
.mono { background: #0f1631; padding: 0.75rem; border-radius: 4px; border: 1px solid #2a3566; word-break: break-all; white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }
.error { color: #ff7b7b; min-height: 1.2em; }
code { background: #0f1631; padding: 0.1rem 0.35rem; border-radius: 3px; }
.stack { display: flex; flex-direction: column; gap: 0.6rem; max-width: 420px; margin: 1rem 0; }
details { background: #121a36; border: 1px solid #2a3566; border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 1rem; }
summary { cursor: pointer; font-weight: 600; }
.tickets { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; }
.ticket { background: #121a36; border: 1px solid #2a3566; border-radius: 6px; padding: 1rem; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.ticket-id { font-family: ui-monospace, Consolas, monospace; color: #7cd7f5; }
.ticket-body { font-size: 0.95rem; line-height: 1.5; }
.meta { color: #9aa5c9; font-size: 0.8rem; }
.status { font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; letter-spacing: 0.05em; }
.status-VALID { background: #1a5a3a; color: #9df0c2; }
.status-PENDING_REDEMPTION { background: #5a4a1a; color: #f0df9d; }
.status-REDEEMED { background: #3a3a3a; color: #c0c0c0; }
.status-INVALID { background: #5a1a1a; color: #f09d9d; }
.empty { color: #9aa5c9; font-style: italic; }
.ticket-actions { margin-top: 0.75rem; }
.ticket-actions a { color: #4cc9f0; text-decoration: none; font-weight: 600; border: 1px solid #4cc9f0; padding: 0.35rem 0.75rem; border-radius: 4px; display: inline-block; }
.ticket-actions a:hover { background: #4cc9f0; color: #0b1020; }
.ticket-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.burn-btn { font-size: 0.85rem; padding: 0.35rem 0.75rem; }
#qr-image { display: block; background: white; padding: 8px; border-radius: 8px; margin: 1rem 0; }
.countdown { max-width: 336px; margin-bottom: 1rem; }
.countdown-label { font-size: 0.9rem; color: #9aa5c9; margin-bottom: 0.25rem; }
.countdown-bar { height: 6px; background: #2a3566; border-radius: 3px; overflow: hidden; }
#countdown-fill { height: 100%; width: 100%; background: #4cc9f0; transition: width 0.5s linear, background 0.3s; }
#countdown-fill.expiring { background: #ff7b7b; }
.payload { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 0.75rem; max-width: 600px; font-size: 0.9rem; }
.payload dt { color: #9aa5c9; }
.payload dd { margin: 0; word-break: break-all; }

#reader { width: 100%; max-width: 480px; margin: 1rem 0; background: #000; border-radius: 8px; overflow: hidden; }
#reader:empty { display: none; }
.scan-controls { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.scan-controls button { min-width: 140px; }
.result-card { border: 2px solid #2a3566; border-radius: 8px; padding: 1.25rem; margin: 1rem 0; background: #121a36; }
.result-VALID { border-color: #2ecc71; background: #0d2a1a; }
.result-REDEEMED { border-color: #f1c40f; background: #2a2410; }
.result-PENDING_REDEMPTION { border-color: #3498db; background: #0d1a2a; }
.result-INVALID { border-color: #e74c3c; background: #2a1214; }
.status-big { display: inline-block; font-size: 1.2rem; font-weight: 800; letter-spacing: 0.05em; padding: 0.5rem 1rem; border-radius: 999px; margin-bottom: 0.75rem; }
.status-big.status-VALID { background: #2ecc71; color: #0b1020; }
.status-big.status-REDEEMED { background: #f1c40f; color: #0b1020; }
.status-big.status-PENDING_REDEMPTION { background: #3498db; color: #fff; }
.status-big.status-INVALID { background: #e74c3c; color: #fff; }
.result-card h3 { margin: 0.25rem 0; }
.actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.actions button.secondary { background: transparent; color: #4cc9f0; border: 1px solid #4cc9f0; }
.actions button.secondary:hover { background: #4cc9f0; color: #0b1020; }
#confirm-entry { min-width: 160px; }
#confirm-entry:disabled { background: #2ecc71; opacity: 0.7; cursor: default; }
.paste-fallback { margin-top: 2rem; opacity: 0.85; }

#toast-wrap { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 1000; max-width: 360px; }
.toast { background: #121a36; border: 1px solid #4cc9f0; border-left: 4px solid #4cc9f0; color: #e6e9f2; padding: 0.75rem 1rem; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.45); opacity: 0; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s; font-size: 0.9rem; }
.toast.show { opacity: 1; transform: translateY(0); }

#challenge-qr { display: block; background: white; padding: 12px; border-radius: 8px; margin: 1rem 0; }
.hint { color: #9aa5c9; font-size: 0.9rem; }




