/* Shared scope also takes precedence over the legacy page-local styles. */
body.halloween {
    --night: #120e1d;
    --panel: #21192e;
    --panel-soft: #2b213a;
    --line: #493653;
    --ink: #f5ecfa;
    --muted: #bfb0ca;
    --orange: #ffad61;
    --purple: #c5a0ef;
    --green: #b1deb2;
    --red: #ffb4bc;
    color-scheme: dark;
    color: var(--ink);
    background: radial-gradient(ellipse at 12% 24%, #40223866, transparent 48%),
                radial-gradient(ellipse at 88% 12%, #52366b44, transparent 40%), var(--night);
    line-height: 1.6;
}

.halloween ::selection { background: #775033; color: #fff; }
.halloween a { color: var(--orange); }
.halloween :focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.halloween .skip-link { position: fixed; top: -80px; left: 16px; z-index: 20000; padding: 12px 20px; background: var(--ink); color: var(--night); border-radius: 8px; }
.halloween .skip-link:focus { top: 10px; }
.halloween .navbar { background: #120e1df5; border-bottom: 1px solid var(--line); box-shadow: none; padding: 18px 0; }
.halloween .navbar .container { gap: 20px; flex-wrap: wrap; }
.halloween .navbar-brand a { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--ink); font-size: 1.25rem; letter-spacing: .04em; }
.halloween .brand-icon { display: grid; place-items: center; width: 40px; height: 40px; background: #342334; border: 1px solid #654133; border-radius: 12px; }
.halloween .brand-caption { color: var(--muted); font-size: .6rem; font-weight: 500; letter-spacing: .12em; border-left: 1px solid var(--line); padding-left: 15px; margin-left: 5px; }
.halloween .navbar-menu { flex-wrap: wrap; gap: 16px; }
.halloween .navbar-item { color: var(--muted); font-size: .9rem; }
.halloween .navbar-item:hover { color: var(--orange); }
.halloween .main-content { padding-top: 42px; padding-bottom: 42px; min-height: calc(100vh - 195px); }
.halloween .footer { background: transparent; color: var(--muted); border-top: 1px solid var(--line); padding: 22px 0; text-align: center; font-size: .85rem; }
.halloween .footer span { color: var(--orange); padding: 0 6px; }
.halloween .footer-credit { font-size: .7rem; margin-top: 5px; opacity: .8; }

.halloween .login-container { display: grid; grid-template-columns: 1.3fr 1fr; gap: 70px; min-height: 68vh; align-items: center; padding: 28px 0; }
.halloween .hunt-intro { min-width: 0; }
.halloween .season-label { display: block; color: var(--orange); font-size: .7rem; letter-spacing: .2em; font-weight: 700; }
.halloween .hunt-intro h1 { font-size: clamp(2.8rem, 5vw, 4.6rem); line-height: 1.2; letter-spacing: -.04em; margin: 22px 0; font-weight: 800; }
.halloween .hunt-intro h1 span { color: var(--orange); }
.halloween .hunt-description { color: var(--muted); line-height: 1.9; font-size: .95rem; }
.halloween .hunt-art { display: block; width: 100%; height: auto; margin: 0 auto; }
.halloween .hunt-steps { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.halloween .hunt-steps b { color: var(--orange); font-size: .7rem; margin-right: 6px; }
.halloween .login-card { justify-self: end; max-width: 430px; margin: 0; background: linear-gradient(145deg, #2c2036, #1d1729); border: 1px solid #62434d; border-radius: 24px; padding: 38px; box-shadow: 0 25px 70px #0004, 0 0 60px #e5782110; }
.halloween .login-header { text-align: left; margin-bottom: 30px; }
.halloween .login-emblem { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; background: #ffad6112; border: 1px solid #ffad6133; font-size: 2rem; margin-bottom: 24px; }
.halloween .login-header .season-label { font-size: .6rem; letter-spacing: .15em; margin-bottom: 10px; }
.halloween .login-header h2 { font-size: 1.5rem; color: var(--ink); margin-bottom: 8px; }
.halloween .login-header p { font-size: .85rem; color: var(--muted); }
.halloween .login-form .btn { margin-top: 8px; padding: 15px 18px; font-weight: 700; }
.halloween .login-form .btn span { margin-left: 14px; }
.halloween .login-footer { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
.halloween .login-footer p { font-size: .75rem; }

.halloween .dashboard-header,
.halloween .section,
.halloween .user-photos-section,
.halloween .route-card,
.halloween .task-item,
.halloween .task-card,
.halloween .upload-card,
.halloween .status-card,
.halloween .no-route-message,
.halloween .reward-content,
.halloween .modal-content {
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: 0 10px 32px #0002;
}
.halloween .dashboard-header { background: linear-gradient(120deg, #39243e, #271d35); border-top: 3px solid var(--orange); }
.halloween .dashboard-header h2,
.halloween .section h3,
.halloween .upload-card h3,
.halloween .status-card h3,
.halloween .route-card h3,
.halloween .task-item h4,
.halloween .user-header h4,
.halloween .task-title,
.halloween .no-route-message h2,
.halloween .reward-header h1 { color: var(--ink); }
.halloween .dashboard-header p,
.halloween .route-description,
.halloween .route-info,
.halloween .task-description,
.halloween .info-text p,
.halloween .photo-details p,
.halloween .no-route-message p,
.halloween .text-muted,
.halloween .empty-state { color: var(--muted); }
.halloween .section h3 { border-color: var(--line); }
.halloween .route-card:hover,
.halloween .task-card:hover { border-color: #8c5f59; box-shadow: 0 8px 28px #0004; }
.halloween .user-dashboard { background: transparent; max-width: 1100px; padding: 0; min-height: auto; }
.halloween .task-card.status-pending { border-left: 5px solid #e6be70; }
.halloween .task-card.status-approved { border-left: 5px solid var(--green); }
.halloween .task-card.status-rejected { border-left: 5px solid var(--red); }
.halloween .task-card.status-hint { border-left: 5px solid var(--purple); }
.halloween .task-card.status-not-started { border-left: 5px solid #93869f; }
.halloween .task-badge,
.halloween .route-card .route-order,
.halloween .badge-primary { background: #503445; color: #ffd6ad; box-shadow: none; }
.halloween .progress-bar { background: #ffffff18; }
.halloween .progress-fill { background: linear-gradient(90deg, #f28a42, #ffd18e); box-shadow: none; }
.halloween .completion-badge { background: linear-gradient(120deg, #4b304c, #3c2841); color: var(--ink); border: 1px solid var(--orange); box-shadow: none; }
.halloween .clue-box,
.halloween .task-item .task-clue,
.halloween .route-info-box,
.halloween .add-user-card,
.halloween .photo-details,
.halloween .user-header,
.halloween .location-description { background: var(--panel-soft); color: var(--ink); border-color: var(--purple); }
.halloween .clue-title { color: var(--purple); }
.halloween .clue-text { color: var(--muted); }
.halloween .reject-reason { background: #3b2e20; border-color: #a27a3e; }
.halloween .reject-title,
.halloween .reject-text { color: #f3d197; }
.halloween .approval-comment { background: #22372d; border-color: #557e61; }
.halloween .approval-title,
.halloween .approval-text { color: var(--green); }
.halloween .photo-comment { background: #412532; color: var(--red); }
.halloween .clue-image,
.halloween .photo-preview,
.halloween .photo-card { border-color: var(--line); }
.halloween .photo-image { background: var(--panel-soft); }
.halloween .stat-badge { background: var(--panel-soft); color: var(--ink); }

.halloween .form-group label,
.halloween .checkbox-label { color: var(--ink); }
.halloween .form-control { background: #16111f; color: var(--ink); border: 1px solid #695574; border-radius: 10px; min-height: 46px; }
.halloween .form-control::placeholder { color: #a795b3; opacity: 1; }
.halloween .form-control:focus { border-color: var(--orange); box-shadow: 0 0 0 3px #ffad611c; }
.halloween input[type="checkbox"] { accent-color: var(--orange); }
.halloween input[type="file"]::file-selector-button { background: var(--panel-soft); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; margin-right: 10px; }
.halloween .btn { border-radius: 9px; font-weight: 600; min-height: 42px; }
.halloween .btn-primary,
.halloween .btn-upload { background: linear-gradient(115deg, #ffbd7c, #f69a50); color: #2b1720; box-shadow: none; }
.halloween .btn-primary:hover,
.halloween .btn-upload:hover { background: #ffc58e; color: #2b1720; box-shadow: 0 5px 20px #ffad6120; }
.halloween .btn-secondary,
.halloween .btn-delete { background: #43344f; color: #f0e2fc; }
.halloween .btn-secondary:hover,
.halloween .btn-delete:hover { background: #594368; }
.halloween .btn-success { background: #b1deb2; color: #17331d; }
.halloween .btn-success:hover { background: #c5ebc6; }
.halloween .btn-danger { background: #f2a1ad; color: #401c27; }
.halloween .btn-danger:hover { background: #ffc1ca; }
.halloween .btn-warning { background: #e9c17b; color: #382714; }
.halloween .btn-warning:hover { background: #ffda9a; }
.halloween .btn-info,
.halloween .btn-reward { background: #c5a0ef; color: #28183e; box-shadow: none; }
.halloween .btn-info:hover,
.halloween .btn-reward:hover { background: #d9bcfa; }
.halloween .btn:disabled,
.halloween .btn-upload:disabled { opacity: .55; transform: none; cursor: not-allowed; box-shadow: none; }
.halloween .badge-success,
.halloween .status-tag.approved,
.halloween .timestamp.approved-time { background: #253d2c; color: #b1deb2; border-color: #557e61; }
.halloween .badge-danger,
.halloween .status-tag.rejected,
.halloween .timestamp.rejected-time { background: #472735; color: #ffb4bc; border-color: #a46676; }
.halloween .badge-warning,
.halloween .status-tag.pending,
.halloween .timestamp.pending-time { background: #44351f; color: #f3d197; border-color: #a27a3e; }
.halloween .badge-secondary,
.halloween .status-tag.not-started { background: #40344b; color: #ddd0e8; }
.halloween .status-tag.hint { background: #36284b; color: #d8b9fb; border-color: #8b6cb0; }
.halloween .alert-success { background: #253d2c; color: #b1deb2; border-color: #557e61; }
.halloween .alert-danger { background: #472735; color: #ffb4bc; border-color: #a46676; }
.halloween .alert-warning { background: #44351f; color: #f3d197; border-color: #a27a3e; }
.halloween .alert-info,
.halloween .upload-progress { background: #36284b; color: #d8b9fb; border-color: #8b6cb0; }
.halloween .upload-progress p { color: #d8b9fb; }
.halloween .spinner { border-color: var(--line); border-top-color: var(--orange); }
.halloween .data-table thead,
.halloween .data-table tbody tr:hover { background: var(--panel-soft); }
.halloween .data-table th { color: var(--muted); border-color: var(--line); }
.halloween .data-table td { color: var(--ink); border-color: var(--line); }
.halloween .modal-header,
.halloween .modal-footer { background: transparent; color: var(--ink); border-color: var(--line); }
.halloween .close-btn { color: var(--muted); }
.halloween .qrcode-description { color: var(--ink); }
.halloween .qrcode-container { background: #fff; }
.halloween .reward-page { min-height: auto; }
.halloween .success-icon { animation: none; }
.halloween .feedback-settings { max-width: 850px; margin: auto; }
.halloween .feedback-settings fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-width: 0; }
.halloween .feedback-settings fieldset:disabled { opacity: .55; }
.halloween .feedback-settings legend { color: var(--orange); padding: 0 8px; }
.halloween .feedback-settings .text-muted { margin: 10px 0; }
.halloween .feedback-image-preview { max-width: 260px; margin: 16px auto; padding: 12px; background: white; border-radius: 12px; }
.halloween .feedback-image-preview img { display: block; max-width: 100%; height: auto; }
.halloween .feedback-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.halloween .reward-page { max-width: 600px; margin: auto; padding: 20px; }
.halloween .reward-header { text-align: center; padding: 24px 10px; }
.halloween .reward-header h1 { overflow-wrap: anywhere; font-size: 2rem; }
.halloween .success-icon { font-size: 5rem; }
.halloween .reward-content { border-radius: 20px; padding: 30px 20px; }
.halloween .qrcode-section { text-align: center; }
.halloween .qrcode-description { font-size: 1.2rem; margin-bottom: 24px; }
.halloween .qrcode-container { display: inline-block; max-width: 100%; border-radius: 12px; padding: 16px; }
.halloween .qrcode-image { width: 100%; max-width: 300px; height: auto; display: block; }
.halloween .reward-actions { display: flex; justify-content: center; margin-top: 24px; }
.halloween .login-qr-panel { max-width: 720px; margin: 0 auto; text-align: center; }
.halloween .login-qr-panel h2,
.halloween .login-qr-panel h1 { margin: 12px 0; overflow-wrap: anywhere; }
.halloween .login-qr-image { background: white; border-radius: 16px; padding: 12px; margin: 24px auto; width: min(100%, 344px); }
.halloween .login-qr-image img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.halloween .login-qr-panel .alert { margin-top: 20px; text-align: left; }
.halloween .qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }

@media (max-width: 900px) {
    .halloween .login-container { gap: 30px; }
    .halloween .brand-caption { display: none; }
    .halloween .login-card { padding: 28px; }
}
@media (max-width: 680px) {
    .halloween .navbar { padding: 12px 0; }
    .halloween .navbar .container { gap: 12px; }
    .halloween .navbar-brand a { font-size: 1.1rem; }
    .halloween .navbar-menu { gap: 12px; width: 100%; }
    .halloween .navbar-menu:empty { display: none; }
    .halloween .main-content { padding-top: 26px; padding-bottom: 28px; }
    .halloween .login-container { grid-template-columns: 1fr; gap: 28px; padding: 0; }
    .halloween .hunt-intro { text-align: center; }
    .halloween .hunt-intro h1 { font-size: 2.7rem; margin: 15px 0; }
    .halloween .hunt-description { font-size: .8rem; }
    .halloween .hunt-art { max-width: 380px; margin-top: -8px; }
    .halloween .hunt-steps { justify-content: center; gap: 14px; font-size: .7rem; padding-top: 12px; }
    .halloween .season-label { font-size: .6rem; }
    .halloween .login-card { max-width: none; padding: 26px 22px; border-radius: 18px; }
    .halloween .login-emblem { display: none; }
    .halloween .login-header h2 { font-size: 1.35rem; }
    .halloween .login-header { margin-bottom: 24px; }
    .halloween .tasks-grid,
    .halloween .routes-grid,
    .halloween .photos-grid { grid-template-columns: minmax(0, 1fr); }
    .halloween .section-header { flex-wrap: wrap; gap: 12px; }
    .halloween .section-header h2 { font-size: 1.2rem; overflow-wrap: anywhere; }
    .halloween .dashboard-header,
    .halloween .section { padding: 20px 16px; }
    .halloween .task-card { padding: 16px; }
    .halloween .task-header,
    .halloween .task-item h4 { flex-wrap: wrap; gap: 8px; }
    .halloween .form-row { grid-template-columns: minmax(0, 1fr); }
    .halloween .modal-content { width: calc(100% - 24px); margin: 12px auto; }
    .halloween .reward-header h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    .halloween *,
    .halloween *::before,
    .halloween *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
