        :root {
            --bg: #f5f1e8;
            --panel: rgba(255, 252, 247, 0.92);
            --ink: #1e2430;
            --muted: #5f6a78;
            --accent: #0f766e;
            --accent-soft: #d8f2ee;
            --danger: #b91c1c;
            --border: rgba(30, 36, 48, 0.12);
            --shadow: 0 20px 60px rgba(30, 36, 48, 0.08);
        }

        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", sans-serif;
            color: var(--ink);
            background:
                radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 30%),
                linear-gradient(135deg, #faf7f1 0%, #efe6d7 100%);
            min-height: 100vh;
        }

        a {
            color: var(--accent);
        }

        .shell {
            max-width: 920px;
            margin: 0 auto;
            padding: 32px 20px 60px;
        }

        .hero {
            margin-bottom: 24px;
        }

        .eyebrow {
            display: inline-block;
            padding: 6px 10px;
            border-radius: 999px;
            background: var(--accent-soft);
            color: var(--accent);
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        h1 {
            margin: 12px 0 8px;
            font-size: clamp(30px, 5vw, 52px);
            line-height: 1.03;
        }

        .subtitle {
            max-width: 760px;
            color: var(--muted);
            font-size: 17px;
            line-height: 1.6;
        }

        .panel {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 24px;
            box-shadow: var(--shadow);
            backdrop-filter: blur(12px);
            padding: 24px;
        }

        .grid {
            display: grid;
            gap: 18px;
        }

        .quiz-card {
            padding: 18px 20px;
            border-radius: 20px;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.7);
        }

        .status {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            border-radius: 999px;
            background: #ffffff;
            border: 1px solid var(--border);
            font-size: 13px;
            color: var(--muted);
        }

        .status.active {
            color: #065f46;
            border-color: rgba(6, 95, 70, 0.18);
            background: rgba(236, 253, 245, 0.9);
        }

        .status.closed {
            color: var(--danger);
            border-color: rgba(185, 28, 28, 0.15);
            background: rgba(254, 242, 242, 0.92);
        }

        form {
            display: grid;
            gap: 18px;
        }

        label {
            display: block;
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        input:not([type="checkbox"]):not([type="radio"]),
        textarea,
        select {
            width: 100%;
            padding: 14px 16px;
            border-radius: 14px;
            border: 1px solid rgba(30, 36, 48, 0.18);
            font: inherit;
            background: #fff;
        }

        input:not([type="checkbox"]):not([type="radio"]):focus,
        textarea:focus,
        select:focus {
            outline: 2px solid rgba(15, 118, 110, 0.18);
            border-color: var(--accent);
        }

        .check-row {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 12px 14px;
            border-radius: 16px;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.78);
            margin-bottom: 0;
            font-weight: 600;
        }

        .check-row input {
            width: auto;
            margin: 0;
        }

        .meta {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            color: var(--muted);
            font-size: 14px;
        }

        .question {
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 20px;
            background: rgba(255, 255, 255, 0.75);
        }

        .question h3 {
            margin: 0 0 10px;
            font-size: 18px;
        }

        .hint {
            color: var(--muted);
            font-size: 13px;
        }

        .error {
            color: var(--danger);
            font-size: 13px;
            margin-top: 6px;
        }

        .button {
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            padding: 14px 18px;
            border-radius: 999px;
            border: none;
            background: linear-gradient(135deg, #0f766e 0%, #155e75 100%);
            color: white;
            font: inherit;
            font-weight: 700;
            cursor: pointer;
        }

        .button:hover {
            filter: brightness(1.03);
        }

        .empty {
            padding: 18px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.65);
            color: var(--muted);
        }

        .countdown {
            font-size: clamp(36px, 8vw, 68px);
            line-height: 1;
            margin: 10px 0;
            font-weight: 800;
            letter-spacing: -0.04em;
        }

        .stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 16px;
        }

        .stat-card {
            padding: 18px;
            border-radius: 18px;
            background: rgba(255, 255, 255, 0.72);
            border: 1px solid var(--border);
        }

        .stat-label {
            color: var(--muted);
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .stat-value {
            margin-top: 10px;
            font-size: clamp(26px, 5vw, 40px);
            font-weight: 800;
            line-height: 1;
        }

        .toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: center;
            justify-content: space-between;
        }

        .button-inline {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 12px 18px;
            border-radius: 999px;
            text-decoration: none;
            background: linear-gradient(135deg, #0f766e 0%, #155e75 100%);
            color: white;
            font-weight: 700;
            border: none;
        }

        .button-inline.secondary {
            background: #ffffff;
            color: var(--ink);
            border: 1px solid var(--border);
        }

        .table-wrap {
            overflow-x: auto;
            border-radius: 18px;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.72);
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th,
        td {
            padding: 14px 16px;
            text-align: left;
            border-bottom: 1px solid rgba(30, 36, 48, 0.08);
            white-space: nowrap;
        }

        th {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--muted);
            background: rgba(15, 118, 110, 0.06);
        }

        tr:last-child td {
            border-bottom: none;
        }

        .review-answer {
            display: grid;
            gap: 12px;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            margin-top: 14px;
        }

        .review-block {
            padding: 14px 16px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.85);
            border: 1px solid var(--border);
        }

        .review-label {
            display: block;
            color: var(--muted);
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 8px;
        }

        .score-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border-radius: 999px;
            font-size: 13px;
            font-weight: 700;
            background: rgba(255, 255, 255, 0.9);
            border: 1px solid var(--border);
        }

        .score-chip.good {
            color: #065f46;
            background: rgba(236, 253, 245, 0.92);
            border-color: rgba(6, 95, 70, 0.15);
        }

        .score-chip.bad {
            color: var(--danger);
            background: rgba(254, 242, 242, 0.92);
            border-color: rgba(185, 28, 28, 0.15);
        }

        .question.good {
            border-color: rgba(6, 95, 70, 0.18);
            background: linear-gradient(180deg, rgba(236, 253, 245, 0.78), rgba(255, 255, 255, 0.82));
        }

        .question.bad {
            border-color: rgba(185, 28, 28, 0.18);
            background: linear-gradient(180deg, rgba(254, 242, 242, 0.82), rgba(255, 255, 255, 0.82));
        }

        .filter-bar {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
        }

        .filter-chip {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 10px 14px;
            border-radius: 999px;
            background: #fff;
            border: 1px solid var(--border);
            text-decoration: none;
            color: var(--ink);
            font-weight: 600;
        }

        .filter-chip.active {
            background: linear-gradient(135deg, #0f766e 0%, #155e75 100%);
            border-color: transparent;
            color: #fff;
        }

        .hero-score {
            display: grid;
            grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
            gap: 18px;
        }

        .score-stage {
            padding: 24px;
            border-radius: 24px;
            background: linear-gradient(135deg, #0f766e 0%, #164e63 100%);
            color: white;
            position: relative;
            overflow: hidden;
            isolation: isolate;
        }

        .score-stage::after {
            content: "";
            position: absolute;
            inset: auto -30px -30px auto;
            width: 140px;
            height: 140px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 999px;
        }

        .score-stage .eyebrow {
            background: rgba(255, 255, 255, 0.14);
            color: white;
        }

        .score-stage.tier-bronze,
        .rank-summary-card.tier-bronze,
        .tier-card.tier-bronze {
            --tier-start: #6c4427;
            --tier-mid: #9a6237;
            --tier-end: #c78957;
            --tier-glow: rgba(199, 137, 87, 0.34);
        }

        .score-stage.tier-silver,
        .rank-summary-card.tier-silver,
        .tier-card.tier-silver {
            --tier-start: #5c6774;
            --tier-mid: #8893a2;
            --tier-end: #c4cdd9;
            --tier-glow: rgba(196, 205, 217, 0.34);
        }

        .score-stage.tier-gold,
        .rank-summary-card.tier-gold,
        .tier-card.tier-gold {
            --tier-start: #6f5211;
            --tier-mid: #b98514;
            --tier-end: #f1d06a;
            --tier-glow: rgba(241, 208, 106, 0.34);
        }

        .score-stage.tier-diamond,
        .rank-summary-card.tier-diamond,
        .tier-card.tier-diamond {
            --tier-start: #1b4560;
            --tier-mid: #3b7aa2;
            --tier-end: #84d8ff;
            --tier-glow: rgba(132, 216, 255, 0.32);
        }

        .score-stage.tier-king,
        .rank-summary-card.tier-king,
        .tier-card.tier-king {
            --tier-start: #361554;
            --tier-mid: #9033b4;
            --tier-end: #ff6d9f;
            --tier-glow: rgba(255, 109, 159, 0.34);
        }

        .score-stage[class*="tier-"] {
            background: linear-gradient(145deg, var(--tier-start) 0%, var(--tier-mid) 52%, var(--tier-end) 100%);
        }

        .score-stage.royal {
            box-shadow:
                0 24px 70px rgba(30, 36, 48, 0.16),
                0 0 0 1px rgba(255, 255, 255, 0.1),
                0 0 26px var(--tier-glow);
        }

        .score-stage.royal::before {
            content: "";
            position: absolute;
            inset: -2px;
            border-radius: 26px;
            padding: 2px;
            background: conic-gradient(from 0deg, rgba(255, 255, 255, 0.18), #ffe08a, rgba(255, 255, 255, 0.18), #ffd166, rgba(255, 255, 255, 0.18));
            -webkit-mask:
                linear-gradient(#000 0 0) content-box,
                linear-gradient(#000 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            z-index: -1;
            animation: royal-ring-spin 7s linear infinite;
        }

        .score-stage.perfect {
            background:
                linear-gradient(140deg, rgba(10, 26, 68, 0.95) 0%, rgba(65, 18, 109, 0.92) 48%, rgba(3, 83, 96, 0.94) 100%);
            box-shadow:
                0 24px 70px rgba(30, 36, 48, 0.16),
                0 0 0 1px rgba(255, 255, 255, 0.08);
        }

        .score-stage.perfect::before {
            content: "";
            position: absolute;
            inset: -2px;
            border-radius: 26px;
            padding: 2px;
            background: conic-gradient(
                from 0deg,
                #ff6b6b,
                #ffd166,
                #7ae582,
                #4cc9f0,
                #9b5de5,
                #ff6b6b
            );
            -webkit-mask:
                linear-gradient(#000 0 0) content-box,
                linear-gradient(#000 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            animation: rainbow-spin 6s linear infinite;
            z-index: -1;
        }

        .score-stage.perfect::after {
            content: "";
            position: absolute;
            inset: 10px;
            border-radius: 18px;
            border: 1px solid rgba(255, 255, 255, 0.18);
            box-shadow:
                0 0 18px rgba(255, 214, 102, 0.36),
                0 0 30px rgba(76, 201, 240, 0.24),
                inset 0 0 18px rgba(255, 255, 255, 0.08);
            pointer-events: none;
        }

        .score-stage.perfect .eyebrow {
            background: rgba(255, 255, 255, 0.18);
        }

        .score-stage.perfect .pill {
            background: rgba(255, 255, 255, 0.16);
            color: white;
            border-color: rgba(255, 255, 255, 0.22);
        }

        .perfect-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 14px;
            padding: 8px 14px;
            border-radius: 999px;
            background: linear-gradient(90deg, rgba(255, 214, 102, 0.92), rgba(255, 107, 107, 0.92), rgba(76, 201, 240, 0.92));
            color: #fff;
            font-size: 12px;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            box-shadow: 0 10px 26px rgba(255, 107, 107, 0.24);
        }

        .rank-header {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 18px;
        }

        .rank-emblem {
            position: relative;
            width: 88px;
            height: 88px;
            flex: 0 0 88px;
            filter: drop-shadow(0 12px 22px rgba(9, 15, 34, 0.24));
        }

        .rank-emblem-svg {
            display: block;
            width: 100%;
            height: 100%;
        }

        .rank-emblem.royal .rank-emblem-svg {
            animation: badge-float 2.6s ease-in-out infinite;
        }

        .rank-copy {
            display: grid;
            gap: 4px;
        }

        .rank-kicker {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: rgba(255, 255, 255, 0.72);
        }

        .rank-title {
            font-size: clamp(22px, 4vw, 34px);
            line-height: 1.05;
        }

        .rank-note {
            margin: 0;
            color: rgba(255, 255, 255, 0.8);
            font-size: 14px;
            line-height: 1.5;
        }

        .tier-energy {
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            z-index: 0;
        }

        .tier-energy span {
            position: absolute;
            display: block;
        }

        .tier-wave {
            width: 220px;
            height: 28px;
            border-radius: 999px;
            opacity: 0.42;
            filter: blur(6px);
            animation: tier-wave-drift 7.6s linear infinite;
        }

        .tier-wave.wave-a {
            --wave-rotate: -16deg;
            top: 22px;
            left: -36px;
        }

        .tier-wave.wave-b {
            --wave-rotate: 18deg;
            top: 108px;
            right: -58px;
            animation-duration: 8.4s;
            animation-direction: reverse;
        }

        .tier-wave.wave-c {
            --wave-rotate: -10deg;
            bottom: 24px;
            left: 20%;
            animation-duration: 9.2s;
        }

        .tier-glint {
            width: 90px;
            height: 2px;
            border-radius: 999px;
            opacity: 0.82;
            transform: rotate(-32deg);
            animation: tier-glint-flash 3.1s ease-in-out infinite;
        }

        .tier-glint.glint-a {
            top: 46px;
            right: 48px;
        }

        .tier-glint.glint-b {
            bottom: 56px;
            left: 32px;
            animation-delay: -1.4s;
        }

        .tier-orb {
            width: 88px;
            height: 88px;
            border-radius: 999px;
            opacity: 0.36;
            filter: blur(3px);
            animation: tier-orb-float 4.8s ease-in-out infinite;
        }

        .tier-orb.orb-a {
            top: 18px;
            right: 14px;
        }

        .tier-orb.orb-b {
            bottom: 10px;
            left: 14px;
            animation-delay: -2.1s;
        }

        .tier-energy-king .tier-wave {
            background: linear-gradient(90deg, rgba(255, 214, 102, 0), rgba(255, 214, 102, 0.96), rgba(76, 201, 240, 0.94), rgba(255, 107, 107, 0));
            opacity: 0.62;
        }

        .tier-energy-king .tier-glint {
            background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff7d6, rgba(255, 255, 255, 0));
            box-shadow: 0 0 18px rgba(255, 214, 102, 0.5);
        }

        .tier-energy-king .tier-orb {
            background: radial-gradient(circle, rgba(255, 214, 102, 0.76) 0%, rgba(255, 107, 107, 0.28) 48%, transparent 72%);
        }

        .tier-energy-diamond .tier-wave {
            background: linear-gradient(90deg, rgba(132, 216, 255, 0), rgba(132, 216, 255, 0.96), rgba(255, 255, 255, 0.94), rgba(132, 216, 255, 0));
            opacity: 0.54;
        }

        .tier-energy-diamond .tier-glint {
            height: 3px;
            background: linear-gradient(90deg, rgba(255, 255, 255, 0), #e7f9ff, rgba(255, 255, 255, 0));
            box-shadow: 0 0 16px rgba(132, 216, 255, 0.48);
        }

        .tier-energy-diamond .tier-orb {
            background: radial-gradient(circle, rgba(132, 216, 255, 0.72) 0%, rgba(255, 255, 255, 0.18) 54%, transparent 74%);
        }

        .tier-energy-gold .tier-wave {
            background: linear-gradient(90deg, rgba(241, 208, 106, 0), rgba(241, 208, 106, 0.95), rgba(255, 244, 199, 0.9), rgba(241, 208, 106, 0));
            opacity: 0.52;
        }

        .tier-energy-gold .tier-glint {
            background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff1a8, rgba(255, 255, 255, 0));
            box-shadow: 0 0 16px rgba(241, 208, 106, 0.46);
        }

        .tier-energy-gold .tier-orb {
            background: radial-gradient(circle, rgba(241, 208, 106, 0.68) 0%, rgba(255, 255, 255, 0.12) 54%, transparent 74%);
        }

        .tier-energy-silver .tier-wave {
            background: linear-gradient(90deg, rgba(196, 205, 217, 0), rgba(196, 205, 217, 0.82), rgba(255, 255, 255, 0.78), rgba(196, 205, 217, 0));
            opacity: 0.38;
        }

        .tier-energy-silver .tier-glint {
            background: linear-gradient(90deg, rgba(255, 255, 255, 0), #f5f8fc, rgba(255, 255, 255, 0));
            box-shadow: 0 0 12px rgba(196, 205, 217, 0.36);
        }

        .tier-energy-silver .tier-orb {
            background: radial-gradient(circle, rgba(196, 205, 217, 0.52) 0%, rgba(255, 255, 255, 0.08) 54%, transparent 74%);
        }

        .tier-energy-bronze .tier-wave {
            background: linear-gradient(90deg, rgba(199, 137, 87, 0), rgba(199, 137, 87, 0.78), rgba(255, 218, 190, 0.52), rgba(199, 137, 87, 0));
            opacity: 0.34;
        }

        .tier-energy-bronze .tier-glint {
            background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ffd5b0, rgba(255, 255, 255, 0));
            box-shadow: 0 0 10px rgba(199, 137, 87, 0.3);
        }

        .tier-energy-bronze .tier-orb {
            background: radial-gradient(circle, rgba(199, 137, 87, 0.44) 0%, rgba(255, 255, 255, 0.06) 54%, transparent 74%);
        }

        .rank-header,
        .perfect-badge,
        .score-stage .eyebrow,
        .score-total,
        .score-caption,
        .pill-row {
            position: relative;
            z-index: 1;
        }

        .celebration-layer {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: -0;
        }

        .celebration-ribbon {
            position: absolute;
            width: 150px;
            height: 14px;
            border-radius: 999px;
            opacity: 0.92;
            filter: blur(0.2px);
            animation: ribbon-float 2.6s ease-in-out infinite;
        }

        .celebration-ribbon.ribbon-a {
            --ribbon-rotate: -18deg;
            top: 22px;
            left: -22px;
            transform: rotate(var(--ribbon-rotate));
            background: linear-gradient(90deg, #ff6b6b, #ffd166);
        }

        .celebration-ribbon.ribbon-b {
            --ribbon-rotate: 24deg;
            top: 38px;
            right: -28px;
            transform: rotate(var(--ribbon-rotate));
            background: linear-gradient(90deg, #4cc9f0, #9b5de5);
            animation-delay: -0.7s;
        }

        .celebration-ribbon.ribbon-c {
            --ribbon-rotate: 22deg;
            bottom: 34px;
            left: -40px;
            transform: rotate(var(--ribbon-rotate));
            background: linear-gradient(90deg, #7ae582, #4cc9f0);
            animation-delay: -1.1s;
        }

        .celebration-ribbon.ribbon-d {
            --ribbon-rotate: -20deg;
            bottom: 18px;
            right: -34px;
            transform: rotate(var(--ribbon-rotate));
            background: linear-gradient(90deg, #ffd166, #ff6b6b, #9b5de5);
            animation-delay: -1.6s;
        }

        .firework {
            position: absolute;
            width: 108px;
            height: 108px;
            border-radius: 999px;
            opacity: 0.82;
            animation: firework-pop 1.9s ease-out infinite;
            background:
                radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 6px, transparent 7px) 50% 0 / 18px 18px no-repeat,
                radial-gradient(circle, #ffd166 0 5px, transparent 6px) 85% 18% / 16px 16px no-repeat,
                radial-gradient(circle, #ff6b6b 0 5px, transparent 6px) 100% 50% / 16px 16px no-repeat,
                radial-gradient(circle, #7ae582 0 5px, transparent 6px) 85% 82% / 16px 16px no-repeat,
                radial-gradient(circle, #4cc9f0 0 5px, transparent 6px) 50% 100% / 16px 16px no-repeat,
                radial-gradient(circle, #9b5de5 0 5px, transparent 6px) 15% 82% / 16px 16px no-repeat,
                radial-gradient(circle, #ffd166 0 5px, transparent 6px) 0 50% / 16px 16px no-repeat,
                radial-gradient(circle, #ff6b6b 0 5px, transparent 6px) 15% 18% / 16px 16px no-repeat;
        }

        .firework-left {
            top: 18px;
            right: 86px;
        }

        .firework-right {
            bottom: 26px;
            right: 24px;
            animation-delay: -0.9s;
        }

        .light-band {
            position: absolute;
            border-radius: 999px;
            opacity: 0.88;
            filter: blur(0.4px);
            background-size: 220% 100%;
            animation: light-band-move 3.2s linear infinite;
        }

        .light-band.band-top,
        .light-band.band-bottom {
            height: 4px;
            left: 28px;
            right: 28px;
            background-image: linear-gradient(90deg, #ff6b6b, #ffd166, #7ae582, #4cc9f0, #9b5de5, #ff6b6b);
        }

        .light-band.band-top {
            top: 12px;
        }

        .light-band.band-bottom {
            bottom: 12px;
            animation-direction: reverse;
        }

        .light-band.band-left,
        .light-band.band-right {
            top: 28px;
            bottom: 28px;
            width: 4px;
            background-image: linear-gradient(180deg, #ff6b6b, #ffd166, #7ae582, #4cc9f0, #9b5de5, #ff6b6b);
        }

        .light-band.band-left {
            left: 12px;
        }

        .light-band.band-right {
            right: 12px;
            animation-direction: reverse;
        }

        .floating-timer {
            position: fixed;
            right: 18px;
            bottom: 18px;
            z-index: 40;
            display: grid;
            gap: 4px;
            min-width: 150px;
            padding: 10px 12px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.86);
            border: 1px solid rgba(30, 36, 48, 0.12);
            box-shadow: 0 12px 30px rgba(30, 36, 48, 0.12);
            backdrop-filter: blur(12px);
        }

        .floating-timer.warning {
            background: rgba(255, 244, 214, 0.94);
            border-color: rgba(217, 119, 6, 0.24);
            box-shadow: 0 14px 34px rgba(217, 119, 6, 0.18);
            animation: timer-pulse-soft 1.2s ease-in-out infinite;
        }

        .floating-timer.danger {
            background: rgba(254, 226, 226, 0.96);
            border-color: rgba(220, 38, 38, 0.28);
            box-shadow: 0 16px 38px rgba(220, 38, 38, 0.22);
            animation: timer-pulse-strong 0.7s ease-in-out infinite;
        }

        .floating-timer-label {
            font-size: 11px;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .floating-timer-value {
            font-size: 24px;
            line-height: 1;
            letter-spacing: -0.05em;
        }

        .floating-timer-status {
            font-size: 11px;
            color: var(--muted);
        }

        .score-total {
            margin-top: 14px;
            font-size: clamp(42px, 8vw, 78px);
            font-weight: 900;
            line-height: 0.95;
            letter-spacing: -0.05em;
        }

        .score-caption {
            margin-top: 8px;
            font-size: 15px;
            color: rgba(255, 255, 255, 0.86);
        }

        .score-summary {
            display: grid;
            gap: 16px;
        }

        .mini-metric {
            padding: 18px;
            border-radius: 18px;
            background: rgba(255, 255, 255, 0.72);
            border: 1px solid var(--border);
        }

        .mini-metric strong {
            display: block;
            font-size: 28px;
            margin-top: 8px;
        }

        .rank-summary-card {
            position: relative;
            overflow: hidden;
        }

        .rank-summary-card::after {
            content: "";
            position: absolute;
            inset: auto -18px -28px auto;
            width: 110px;
            height: 110px;
            border-radius: 999px;
            background: radial-gradient(circle, var(--tier-glow, rgba(15, 118, 110, 0.18)) 0%, transparent 68%);
            pointer-events: none;
        }

        .rank-track {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;
        }

        .rank-step {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 8px 10px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.58);
            border: 1px solid rgba(30, 36, 48, 0.08);
            color: var(--muted);
            font-size: 12px;
            font-weight: 700;
        }

        .rank-step.reached {
            color: var(--ink);
            background: rgba(255, 255, 255, 0.78);
        }

        .rank-step.active {
            color: white;
            border-color: transparent;
            background: linear-gradient(135deg, var(--tier-mid), var(--tier-end));
            box-shadow: 0 10px 22px var(--tier-glow);
        }

        .tier-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 14px;
        }

        .tier-card {
            position: relative;
            overflow: hidden;
            padding: 18px;
            border-radius: 20px;
            background: rgba(255, 255, 255, 0.76);
            border: 1px solid var(--border);
            text-decoration: none;
            color: inherit;
            transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
        }

        .tier-card::after {
            content: "";
            position: absolute;
            inset: auto -18px -24px auto;
            width: 96px;
            height: 96px;
            border-radius: 999px;
            background: radial-gradient(circle, var(--tier-glow, rgba(15, 118, 110, 0.16)) 0%, transparent 72%);
            pointer-events: none;
        }

        .tier-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 16px 34px rgba(30, 36, 48, 0.1);
        }

        .tier-card.active {
            border-color: var(--tier-mid);
            box-shadow: 0 18px 36px var(--tier-glow);
        }

        .tier-card-top {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .tier-card-badge {
            width: 72px;
            height: 72px;
            flex: 0 0 72px;
        }

        .tier-card-badge .rank-emblem-svg {
            width: 100%;
            height: 100%;
            display: block;
        }

        .tier-card-title {
            font-size: 18px;
            font-weight: 800;
            line-height: 1.1;
        }

        .tier-card-metrics {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 10px;
            margin-top: 16px;
        }

        .tier-card-metrics strong {
            font-size: 34px;
            line-height: 1;
        }

        .tier-card-metrics span {
            color: var(--muted);
            font-size: 14px;
            font-weight: 700;
        }

        .table-tier {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 10px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.72);
            border: 1px solid rgba(30, 36, 48, 0.08);
            font-size: 12px;
            font-weight: 700;
        }

        .table-tier svg {
            width: 28px;
            height: 28px;
            display: block;
        }

        .table-tier.royal {
            box-shadow: 0 10px 20px rgba(255, 214, 102, 0.22);
        }

        .pill-row {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .pill {
            display: inline-flex;
            align-items: center;
            padding: 9px 12px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.88);
            border: 1px solid var(--border);
            font-size: 13px;
            font-weight: 700;
        }

        .option-list {
            display: grid;
            gap: 10px;
            margin-top: 14px;
        }

        .option-item {
            display: flex;
            gap: 10px;
            align-items: flex-start;
            padding: 12px 14px;
            border-radius: 16px;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.78);
        }

        .option-item input {
            width: auto;
            margin-top: 2px;
        }

        .distribution-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
            gap: 12px;
            align-items: end;
            min-height: 240px;
        }

        .distribution-bar {
            display: grid;
            gap: 10px;
            align-items: end;
            justify-items: center;
            grid-template-rows: auto 190px auto;
        }

        .distribution-bar-slot {
            width: 100%;
            height: 190px;
            display: flex;
            align-items: flex-end;
            padding-top: 8px;
            border-bottom: 1px solid rgba(15, 23, 42, 0.12);
        }

        .distribution-bar .bar {
            width: 100%;
            min-height: 0;
            border-radius: 16px 16px 8px 8px;
            background: linear-gradient(180deg, #0f766e 0%, #164e63 100%);
            box-shadow: inset 0 -8px 18px rgba(255, 255, 255, 0.12);
        }

        .distribution-bar .bar.zero {
            opacity: 0.28;
        }

        .distribution-bar .count {
            font-weight: 800;
            font-size: 18px;
        }

        .distribution-bar .label {
            font-size: 12px;
            text-align: center;
            color: var(--muted);
        }

        .compact-table table th,
        .compact-table table td {
            white-space: normal;
        }

        @keyframes rainbow-spin {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }

        @keyframes royal-ring-spin {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }

        @keyframes halo-pulse {
            0%, 100% {
                transform: scale(1.06);
                opacity: 0.88;
            }
            50% {
                transform: scale(1.14);
                opacity: 1;
            }
        }

        @keyframes badge-float {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-2px);
            }
        }

        @keyframes tier-wave-drift {
            0% {
                transform: translateX(0) rotate(var(--wave-rotate, -10deg));
            }
            50% {
                transform: translateX(28px) rotate(calc(var(--wave-rotate, -10deg) + 4deg));
            }
            100% {
                transform: translateX(0) rotate(var(--wave-rotate, -10deg));
            }
        }

        @keyframes tier-glint-flash {
            0%, 100% {
                opacity: 0.22;
                transform: rotate(-32deg) scaleX(0.92);
            }
            50% {
                opacity: 0.92;
                transform: rotate(-32deg) scaleX(1.08);
            }
        }

        @keyframes tier-orb-float {
            0%, 100% {
                transform: translateY(0) scale(1);
            }
            50% {
                transform: translateY(-8px) scale(1.08);
            }
        }

        @keyframes ribbon-float {
            0%, 100% {
                transform: rotate(var(--ribbon-rotate)) translateY(0) scaleX(1);
            }
            50% {
                transform: rotate(var(--ribbon-rotate)) translateY(-8px) scaleX(1.03);
            }
        }

        @keyframes firework-pop {
            0%, 100% {
                transform: scale(0.82);
                opacity: 0.72;
            }
            45% {
                transform: scale(1.04);
                opacity: 1;
            }
        }

        @keyframes light-band-move {
            from {
                background-position: 0% 50%;
            }
            to {
                background-position: 200% 50%;
            }
        }

        @keyframes timer-pulse-soft {
            0%, 100% {
                transform: translateY(0);
                opacity: 0.94;
            }
            50% {
                transform: translateY(-1px);
                opacity: 1;
            }
        }

        @keyframes timer-pulse-strong {
            0%, 100% {
                transform: scale(1);
                opacity: 0.94;
            }
            50% {
                transform: scale(1.035);
                opacity: 1;
            }
        }

        @media (max-width: 820px) {
            .hero-score {
                grid-template-columns: 1fr;
            }

            .firework-left {
                right: 26px;
            }

            .rank-header {
                align-items: flex-start;
            }
        }

        @media (max-width: 640px) {
            .shell {
                padding: 20px 14px 48px;
            }

            .panel,
            .question {
                padding: 18px;
                border-radius: 18px;
            }

            .floating-timer {
                right: 12px;
                bottom: 12px;
                min-width: 132px;
                padding: 9px 10px;
            }

            .rank-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .rank-emblem {
                width: 76px;
                height: 76px;
                flex-basis: 76px;
            }
        }

        .katex-display {
            overflow-x: auto;
            overflow-y: hidden;
            padding: 0.1rem 0;
        }
    
