﻿:root {
    --ui-scale: 1;
    --ui-scale-size: 100%;
}
/* Base layout */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000000; 
    touch-action: none;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
#game-container {
    position: relative;
    width: min(100vw, calc(100vh * 16 / 9));
    height: min(100vh, calc(100vw * 9 / 16));
    aspect-ratio: 16 / 9;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}
canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}
#orientation-warning {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #000000;
    color: white;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
@media (max-aspect-ratio: 1/1) {
    #orientation-warning {
        display: flex;
    }
}

/* UI shell and overlays */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--ui-scale-size);
    height: var(--ui-scale-size);
    padding: 0.5rem;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    zoom: var(--ui-scale);
}
@media (min-width: 640px) {
    #ui-layer {
        padding: 0.75rem;
    }
}
@media (min-width: 768px) {
    #ui-layer {
        padding: 1.5rem;
    }
}
.pointer-events-auto {
    pointer-events: auto;
}
.screen-overlay {
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.screen-overlay:not(.hidden) {
    display: flex;
}
.start-overlay {
    z-index: 20;
    background: rgba(0, 0, 0, 0.35);
}
.pause-overlay {
    z-index: 25;
    background: rgba(0, 0, 0, 0.55);
}
.death-overlay {
    z-index: 30;
    background: rgba(0, 0, 0, 0.75);
}

/* HUD */
.hud-card {
    position: relative;
    min-width: clamp(120px, 20vmin, 190px);
    padding: clamp(6px, 1.2vmin, 10px) clamp(10px, 2vmin, 16px) clamp(8px, 1.5vmin, 14px);
    background: linear-gradient(90deg, rgba(0, 12, 18, 0.82), rgba(0, 0, 0, 0.34));
    clip-path: polygon(0 0, 100% 0, 100% 72%, 86% 72%, 76% 100%, 0 100%);
    filter: drop-shadow(0 0 13px var(--hud-glow));
}
.hud-card--right {
    min-width: clamp(148px, 24vmin, 230px);
    padding-right: clamp(18px, 4vmin, 34px);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 24% 100%, 14% 72%, 0 72%);
}
.hud-card--score {
    --hud-color: #22f7ff;
    --hud-glow: rgba(34, 247, 255, 0.68);
    --hud-line: #22f7ff;
}
.hud-card--shards {
    --hud-color: #facc15;
    --hud-glow: rgba(250, 204, 21, 0.62);
    --hud-line: #facc15;
}
.hud-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--hud-line);
    clip-path: polygon(0 calc(100% - 3px), 75% calc(100% - 3px), 85% calc(72% - 3px), 100% calc(72% - 3px), 100% 72%, 86% 72%, 76% 100%, 0 100%);
    filter: drop-shadow(0 0 8px var(--hud-glow));
}
.hud-card--right::after {
    clip-path: polygon(0 72%, 14% 72%, 24% 100%, 100% 100%, 100% calc(100% - 3px), 26% calc(100% - 3px), 16% calc(72% - 3px), 0 calc(72% - 3px));
}
.hud-run-metrics {
    display: flex;
    align-items: flex-start;
    gap: 0;
    pointer-events: none;
}
.hud-run-metrics .hud-card {
    min-width: clamp(108px, 18vmin, 172px);
}
.hud-card--run-shards {
    margin-left: clamp(-18px, -2.8vmin, -10px);
    padding-left: clamp(18px, 4vmin, 34px);
    background: linear-gradient(270deg, rgba(0, 12, 18, 0.82), rgba(0, 0, 0, 0.34));
}
.hud-label {
    color: var(--hud-color);
    font-size: clamp(0.62rem, 1.55vmin, 0.9rem);
    font-weight: 900;
    letter-spacing: 0.14em;
    line-height: 1;
    text-shadow: 0 0 8px var(--hud-glow);
}
.hud-value {
    color: #eaffff;
    font-size: clamp(1.15rem, 4.2vmin, 2.1rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.1;
    text-shadow: 0 0 8px var(--hud-color), 0 0 18px var(--hud-glow);
}
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 15;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.hud-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding-right: 0.5rem;
}
@media (min-width: 640px) {
    .hud-actions {
        padding-right: 0.75rem;
    }
}
@media (min-width: 768px) {
    .hud-actions {
        padding-right: 1rem;
    }
}
.start-total-points {
    position: absolute;
    top: clamp(8px, 1.8vmin, 24px);
    right: clamp(8px, 1.8vmin, 24px);
    z-index: 30;
}

/* Start screen */
#pressStartPrompt.is-countdown {
    background: transparent;
    pointer-events: none;
}
#pressStartPrompt.is-countdown #soundHud,
#pressStartPrompt.is-countdown #shopHud,
#pressStartPrompt.is-countdown .start-total-points,
#pressStartPrompt.is-countdown #startRatingBtn,
#pressStartPrompt.is-countdown #questToggleBtn,
#pressStartPrompt.is-countdown #roadmapToggleBtn,
#pressStartPrompt.is-countdown #readyScore,
#pressStartPrompt.is-countdown #bestScoreDisplay,
#pressStartPrompt.is-countdown #scoreMessage,
#pressStartPrompt.is-countdown #startChallengeText {
    display: none !important;
}
.start-copy-stack {
    transform: translateY(clamp(28px, 8vh, 84px));
    width: min(90vw, 38rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.start-last-score {
    margin-bottom: 1.25rem;
    color: #67e8f9;
    font-size: 1.5rem;
    font-weight: 700;
    filter: drop-shadow(0 0 10px #00ffff);
}
.start-best-score {
    margin-bottom: 1.25rem;
    color: #e5e7eb;
    font-size: 1.125rem;
    filter: drop-shadow(0 0 8px #00ffff);
}
.start-score-message {
    min-height: 1.75rem;
    margin-bottom: 1.25rem;
    color: #fef08a;
    font-size: 1.125rem;
    filter: drop-shadow(0 0 8px #ffff00);
}
@media (min-width: 768px) {
    .start-last-score {
        font-size: 2.25rem;
    }
    .start-best-score,
    .start-score-message {
        font-size: 1.5rem;
    }
}
.neon-heading {
    color: #ffffff;
    text-shadow: 0 0 10px #00ffff, 0 0 25px #00ffff;
}
.pause-action {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.pause-action--resume {
    margin-top: 1.5rem;
    border: 2px solid #67e8f9;
    background: rgba(103, 232, 249, 0.1);
    color: #cffafe;
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.35);
}
.pause-action--restart {
    border: 2px solid #f87171;
    background: rgba(248, 113, 113, 0.1);
    color: #fee2e2;
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.45), inset 0 0 14px rgba(248, 113, 113, 0.12);
}
#startRatingBtn {
    position: absolute;
    z-index: 95;
    left: calc(1rem + clamp(34px, 7.5vmin, 48px) + clamp(8px, 1.4vmin, 12px));
    bottom: clamp(8px, 2.2vmin, 16px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(34px, 7.5vmin, 48px);
    height: clamp(34px, 7.5vmin, 48px);
    border-radius: 8px;
    border: 2px solid rgba(250, 204, 21, 0.78);
    background: rgba(250, 204, 21, 0.12);
    padding: 0;
    color: #fef9c3;
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.22), inset 0 0 14px rgba(250, 204, 21, 0.08);
    pointer-events: auto;
}
#startRatingBtn svg {
    width: clamp(18px, 4vmin, 24px);
    height: clamp(18px, 4vmin, 24px);
    fill: currentColor;
}
@media (max-width: 720px), (max-height: 430px) {
    .hud-card {
        min-width: clamp(92px, 18vmin, 150px);
        padding: clamp(5px, 1vmin, 8px) clamp(8px, 1.55vmin, 13px) clamp(6px, 1.2vmin, 10px);
    }
    .hud-card--right {
        min-width: clamp(112px, 21vmin, 170px);
        padding-right: clamp(14px, 3vmin, 24px);
    }
    .hud-run-metrics .hud-card {
        min-width: clamp(84px, 17vmin, 132px);
    }
    .hud-card--run-shards {
        margin-left: clamp(-14px, -2.4vmin, -8px);
        padding-left: clamp(14px, 3vmin, 24px);
    }
    .hud-label {
        font-size: clamp(0.48rem, 1.35vmin, 0.72rem);
        letter-spacing: 0.1em;
    }
    .hud-value {
        font-size: clamp(0.9rem, 3.45vmin, 1.55rem);
        letter-spacing: 0.035em;
    }
}

/* Start screen actions */
#soundHud,
#shopHud {
    z-index: 80;
}
#soundHud {
    position: absolute;
    left: 1rem;
    display: flex;
    align-items: center;
    text-align: left;
}
#shopHud {
    position: absolute;
    right: 1rem;
    text-align: left;
}
#soundHud,
#shopHud {
    bottom: clamp(8px, 2.2vmin, 16px);
}
#shopHud > .flex {
    gap: clamp(6px, 1.4vmin, 12px);
}
.hud-icon-button:not(.hidden),
.hud-shop-button:not(.hidden) {
    display: flex;
}
.hud-icon-button,
.hud-shop-button {
    align-items: center;
    justify-content: center;
    border: 2px solid var(--hud-button-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--hud-button-text);
    box-shadow: 0 0 16px var(--hud-button-glow);
}
.hud-shop-button {
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
}
.hud-icon-button--cyan {
    --hud-button-color: #67e8f9;
    --hud-button-text: #cffafe;
    --hud-button-glow: rgba(0, 255, 255, 0.35);
}
.hud-icon-button--yellow {
    --hud-button-color: #fde047;
    --hud-button-text: #fef9c3;
    --hud-button-glow: rgba(255, 255, 0, 0.28);
}
.hud-icon-button--pink {
    --hud-button-color: #f9a8d4;
    --hud-button-text: #fce7f3;
    --hud-button-glow: rgba(244, 114, 182, 0.32);
}
.hud-icon-button--green {
    --hud-button-color: #86efac;
    --hud-button-text: #dcfce7;
    --hud-button-glow: rgba(74, 222, 128, 0.32);
}
#pauseBtn,
#soundToggleBtn {
    width: clamp(34px, 7.5vmin, 48px);
    height: clamp(34px, 7.5vmin, 48px);
    border-radius: 8px;
}
#achievementToggleBtn,
#themeToggleBtn,
#questToggleBtn,
#roadmapToggleBtn {
    width: clamp(78px, 15vmin, 108px);
    height: clamp(34px, 7.5vmin, 48px);
    gap: clamp(5px, 1.1vmin, 8px);
    padding: 0 clamp(7px, 1.5vmin, 11px);
    border-radius: 8px;
}
#pauseBtn svg,
#soundToggleBtn svg,
#achievementToggleBtn svg,
#themeToggleBtn svg,
#questToggleBtn svg,
#roadmapToggleBtn svg,
#shopToggleBtn svg {
    width: clamp(17px, 3.7vmin, 26px);
    height: clamp(17px, 3.7vmin, 26px);
}
.remove-ads-shop-button {
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: clamp(10px, 2vmin, 18px);
    text-align: left;
    color: #ecfccb;
}
.remove-ads-shop-button:not(.hidden) {
    display: flex;
}
.remove-ads-shop-copy {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: clamp(9px, 1.8vmin, 14px);
}
.remove-ads-shop-button img {
    width: clamp(22px, 5vmin, 34px);
    height: clamp(22px, 5vmin, 34px);
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(248, 250, 252, 0.7));
}
.remove-ads-shop-button [data-remove-ads-action] {
    border-color: #bef264;
    color: #ecfccb;
}
.remove-ads-shop-button .shop-card-title {
    color: #ffffff;
    font-weight: 700;
}
.remove-ads-shop-button .shop-card-description {
    color: #d1d5db;
}
.discord-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(7px, 1.5vmin, 12px);
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(129, 140, 248, 0.72);
    background: rgba(88, 101, 242, 0.14);
    padding: clamp(7px, 1.5vmin, 11px) clamp(9px, 2vmin, 14px);
    color: #e0e7ff;
    font-size: clamp(0.7rem, 1.65vmin, 0.9rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.2);
    pointer-events: auto;
}
.discord-link img {
    width: clamp(38px, 8.5vmin, 58px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.55));
}

/* HUD counters */
#shopToggleBtn {
    width: clamp(78px, 15vmin, 108px);
    height: clamp(34px, 7.5vmin, 48px);
    justify-content: center;
    gap: clamp(5px, 1.1vmin, 8px);
    padding: 0 clamp(7px, 1.5vmin, 11px);
    border-radius: 8px;
    font-size: clamp(0.72rem, 2vmin, 1rem);
    line-height: 1;
}
#shopCoinsDisplay {
    min-width: clamp(2rem, 6vmin, 2.85rem);
    text-align: right;
    font-size: clamp(0.66rem, 1.75vmin, 0.92rem);
    font-weight: 700;
    line-height: 1;
    color: #fef08a;
}
#achievementCountDisplay {
    min-width: clamp(2rem, 6vmin, 2.85rem);
    text-align: right;
    font-size: clamp(0.66rem, 1.75vmin, 0.92rem);
    font-weight: 900;
    line-height: 1;
    color: #fef08a;
}

/* Shared panels */
#soundPanel {
    max-width: none;
}
#soundPanel p,
#soundPanel label,
#soundPanel select,
#soundPanel input,
#soundPanel span,
#soundPanel button {
    font-size: clamp(0.66rem, 1.65vmin, 0.88rem);
    line-height: 1.15;
}
.game-panel {
    background: rgba(0, 0, 0, 0.95);
    text-align: left;
}
#soundPanel,
#shopPanel,
#themePanel,
#questPanel,
#roadmapPanel,
#achievementPanel {
    position: fixed;
    top: var(--game-panel-top, 0px);
    left: var(--game-panel-left, 0px);
    width: var(--game-panel-width, 100vw);
    height: var(--game-panel-height, 100vh);
    z-index: 90;
    overscroll-behavior: contain;
    padding: clamp(10px, 2.5vmin, 28px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}
.panel-header {
    max-width: 72rem;
    margin: 0 auto clamp(10px, 2.1vmin, 22px);
    padding-bottom: clamp(8px, 1.7vmin, 16px);
    border-bottom: 1px solid rgba(34, 211, 238, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(8px, 2vmin, 16px);
}
.panel-header--achievement {
    border-bottom-color: rgba(253, 224, 71, 0.42);
}
.panel-header--theme {
    border-bottom-color: rgba(244, 114, 182, 0.42);
}
.panel-header--quests {
    border-bottom-color: rgba(34, 247, 255, 0.42);
}
.panel-header--roadmap {
    border-bottom-color: rgba(74, 222, 128, 0.42);
}
.panel-content {
    max-width: 42rem;
    margin: 0 auto;
    padding-bottom: clamp(24px, 8vmin, 72px);
}
.panel-title {
    margin: 0;
    font-size: clamp(1.1rem, 4.2vmin, 2.35rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.panel-title--cyan {
    color: #cffafe;
    filter: drop-shadow(0 0 14px #00ffff);
}
.panel-title--pink {
    color: #fce7f3;
    filter: drop-shadow(0 0 14px #ff4fd8);
}
.panel-title--green {
    color: #dcfce7;
    filter: drop-shadow(0 0 14px #4ade80);
}
.panel-title--yellow {
    color: #fef9c3;
    filter: drop-shadow(0 0 14px #ffff00);
}
.panel-subtitle {
    margin-top: clamp(3px, 0.7vmin, 6px);
    font-size: clamp(0.68rem, 1.85vmin, 0.95rem);
    line-height: 1.2;
}
.panel-subtitle--muted {
    color: #d1d5db;
}
.panel-subtitle--shards,
.panel-status {
    color: #fef08a;
    font-weight: 700;
}
.feedback-status {
    margin-top: 0.5rem;
    color: #fef08a;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Settings panel */
.settings-section {
    border-top: 1px solid rgba(34, 211, 238, 0.25);
    padding-top: 1rem;
}
.settings-section--first {
    margin-bottom: 1rem;
    border-top: 0;
    border-bottom: 1px solid rgba(34, 211, 238, 0.25);
    padding-top: 0;
    padding-bottom: 1rem;
}
.settings-section-title {
    margin-bottom: 0.75rem;
    color: #cffafe;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.settings-field {
    display: block;
}
.settings-field + .settings-field,
.settings-field + .settings-toggle,
.settings-toggle + .settings-field,
.settings-toggle + .settings-toggle {
    margin-top: 0.75rem;
}
.settings-field--spaced {
    margin-bottom: 1rem;
}
.settings-row,
.settings-toggle,
.credit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.settings-row {
    margin-bottom: 0.5rem;
}
.settings-row,
.settings-toggle,
.debug-readouts,
.credit-list {
    color: #d1d5db;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.settings-value {
    color: #a5f3fc;
}
.settings-control {
    width: 100%;
    border: 1px solid rgba(6, 182, 212, 0.5);
    border-radius: 0.25rem;
    background: #000000;
    padding: 0.5rem;
    color: #cffafe;
    font-size: 0.875rem;
    font-weight: 700;
    outline: none;
}
.settings-range {
    width: 100%;
    accent-color: #67e8f9;
}
.settings-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #67e8f9;
}
.settings-action {
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.settings-action--full {
    width: 100%;
}
.settings-action--cyan {
    border: 1px solid rgba(6, 182, 212, 0.5);
    background: rgba(103, 232, 249, 0.1);
    color: #cffafe;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.18);
}
.settings-action--yellow {
    border: 1px solid rgba(253, 224, 71, 0.7);
    background: rgba(253, 224, 71, 0.1);
    color: #fef9c3;
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.18);
}
.settings-action--lime {
    border: 1px solid rgba(190, 242, 100, 0.7);
    background: rgba(190, 242, 100, 0.1);
    color: #ecfccb;
}
.settings-action--muted {
    border: 1px solid #6b7280;
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
}
.settings-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.feedback-box {
    margin-top: 0.75rem;
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.75rem;
}
.feedback-input {
    min-height: 5rem;
    width: 100%;
    resize: vertical;
    border: 1px solid rgba(6, 182, 212, 0.5);
    border-radius: 0.25rem;
    background: #000000;
    padding: 0.5rem;
    color: #ecfeff;
    font-size: 0.875rem;
    outline: none;
}
.feedback-input::placeholder {
    color: rgba(207, 250, 254, 0.35);
}
.credit-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    line-height: 1.6;
    text-transform: none;
}
.credit-label {
    color: #9ca3af;
}
.credit-value {
    min-width: 0;
    flex: 1;
    text-align: right;
}
.credit-value--strong {
    color: #cffafe;
    font-weight: 700;
}
.credit-link {
    color: #a5f3fc;
    text-decoration: underline;
    text-decoration-color: rgba(103, 232, 249, 0.5);
    text-underline-offset: 2px;
}
.debug-readouts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.debug-stat-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
}
.debug-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(103, 232, 249, 0.1);
    padding-bottom: 0.3rem;
}
.debug-stat-label {
    min-width: 0;
    color: #9ca3af;
}
.debug-stat-value {
    flex: 0 0 auto;
    color: #cffafe;
    font-weight: 800;
    text-align: right;
}

/* Panel controls */
.panel-close {
    width: clamp(34px, 7.5vmin, 44px);
    height: clamp(34px, 7.5vmin, 44px);
    flex: 0 0 auto;
    border-radius: 8px;
    border: 1px solid #6b7280;
    color: #e5e7eb;
    font-size: clamp(0.82rem, 2vmin, 1rem);
}
.panel-close--cyan:hover {
    border-color: #67e8f9;
    color: #cffafe;
}
.panel-close--pink:hover {
    border-color: #f9a8d4;
    color: #fce7f3;
}
.panel-close--green:hover {
    border-color: #86efac;
    color: #dcfce7;
}
.panel-close--yellow:hover {
    border-color: #fde047;
    color: #fef9c3;
}
#shopItems,
#themeItems,
#questItems,
#roadmapItems,
#achievementItems {
    max-width: 72rem;
    padding-bottom: clamp(12px, 2.4vmin, 28px);
}
#shopItems {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2.4vmin, 28px);
}
#themeItems {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2.4vmin, 28px);
}
#achievementItems {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2.4vmin, 28px);
}
#questItems {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vmin, 18px);
}
#roadmapItems {
    position: relative;
    width: min(100%, 46rem);
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(12px, 2.2vmin, 20px);
    padding: clamp(6px, 1.3vmin, 12px) 0 clamp(18px, 3.4vmin, 34px);
}
#roadmapItems::before {
    content: "";
    position: absolute;
    top: clamp(22px, 4.8vmin, 34px);
    bottom: clamp(28px, 5.4vmin, 44px);
    left: clamp(23px, 5.2vmin, 35px);
    width: 2px;
    background: linear-gradient(180deg, rgba(34, 247, 255, 0.92), rgba(74, 222, 128, 0.72), rgba(255, 79, 216, 0.46));
    box-shadow:
        0 0 10px rgba(34, 247, 255, 0.68),
        0 0 22px rgba(74, 222, 128, 0.32);
}

/* Daily quests */
.quest-card {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(8rem, 0.8fr) auto;
    align-items: center;
    width: min(100%, 56rem);
    min-height: clamp(68px, 10vmin, 88px);
    gap: clamp(8px, 1.6vmin, 14px);
    border: 1px solid rgba(34, 247, 255, 0.46);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(34, 247, 255, 0.16), transparent 38%, rgba(74, 222, 128, 0.13)),
        rgba(0, 0, 0, 0.76);
    padding: clamp(8px, 1.5vmin, 12px) clamp(10px, 2vmin, 16px);
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(34, 247, 255, 0.16),
        inset 0 0 20px rgba(74, 222, 128, 0.07);
}
.quest-reward-ad-row {
    width: min(100%, 56rem);
    margin: 0 auto clamp(10px, 2vmin, 18px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    border: 1px solid rgba(250, 204, 21, 0.42);
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(250, 204, 21, 0.13), rgba(34, 247, 255, 0.08));
    padding: clamp(8px, 1.5vmin, 12px) clamp(10px, 2vmin, 16px);
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.12), inset 0 0 16px rgba(250, 204, 21, 0.06);
}
.quest-reward-ad-title {
    margin: 0;
    color: #fef9c3;
    font-size: clamp(0.72rem, 1.75vmin, 0.94rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-transform: uppercase;
}
.quest-reward-ad-status {
    margin: 0.2rem 0 0;
    color: #d1fae5;
    font-size: clamp(0.66rem, 1.5vmin, 0.8rem);
    font-weight: 700;
    line-height: 1.2;
}
.quest-reward-ad-btn {
    flex: 0 0 auto;
    border: 1px solid rgba(250, 204, 21, 0.78);
    border-radius: 8px;
    background: rgba(250, 204, 21, 0.12);
    padding: 0.42rem 0.68rem;
    color: #fef9c3;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.22);
}
.quest-reward-ad-btn:disabled {
    cursor: not-allowed;
    border-color: rgba(107, 114, 128, 0.68);
    background: rgba(31, 41, 55, 0.56);
    color: #9ca3af;
    box-shadow: none;
}
.quest-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(34, 247, 255, 0.18) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 100%);
    background-size: 34px 34px;
    opacity: 0.18;
    mask-image: linear-gradient(135deg, black, transparent 84%);
}
.quest-card.is-complete {
    border-color: rgba(250, 204, 21, 0.68);
    box-shadow:
        0 0 22px rgba(250, 204, 21, 0.2),
        inset 0 0 22px rgba(250, 204, 21, 0.08);
}
.quest-card.is-claimed {
    border-color: rgba(74, 222, 128, 0.42);
    opacity: 0.78;
}
.quest-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}
.quest-title {
    margin: 0;
    color: #e0faff;
    font-size: clamp(0.76rem, 1.75vmin, 0.98rem);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(34, 247, 255, 0.58);
}
.quest-difficulty {
    flex: 0 0 auto;
    border: 1px solid rgba(134, 239, 172, 0.58);
    border-radius: 999px;
    background: rgba(20, 83, 45, 0.26);
    padding: 0.12rem 0.4rem;
    color: #bbf7d0;
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.quest-progress-text {
    color: #d1fae5;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 0.28rem;
}
.quest-progress-track {
    height: 0.42rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.65);
}
.quest-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22f7ff, #4ade80, #facc15);
    box-shadow: 0 0 14px rgba(34, 247, 255, 0.62);
}
.quest-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
}
.quest-reward {
    color: #fef08a;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.45);
}
.quest-claim-btn {
    border: 1px solid rgba(103, 232, 249, 0.7);
    border-radius: 8px;
    background: rgba(34, 211, 238, 0.12);
    padding: 0.34rem 0.58rem;
    color: #cffafe;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 0 14px rgba(34, 247, 255, 0.22);
}
@media (max-width: 720px), (max-height: 430px) {
    .quest-reward-ad-row {
        align-items: stretch;
        flex-direction: column;
    }
    .quest-reward-ad-btn {
        width: 100%;
    }
    .quest-card {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }
    .quest-card-footer {
        justify-content: space-between;
    }
}
.quest-claim-btn:disabled {
    cursor: not-allowed;
    border-color: rgba(107, 114, 128, 0.68);
    background: rgba(31, 41, 55, 0.56);
    color: #9ca3af;
    box-shadow: none;
}

/* Roadmap */
.roadmap-item {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: clamp(12px, 2.2vmin, 20px);
    min-height: clamp(62px, 11vmin, 84px);
    border: 1px solid rgba(74, 222, 128, 0.46);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(6, 78, 59, 0.46), rgba(8, 47, 73, 0.36) 48%, rgba(88, 28, 135, 0.18)),
        rgba(0, 0, 0, 0.72);
    padding: clamp(11px, 2.1vmin, 17px) clamp(12px, 2.5vmin, 22px);
    color: #dcfce7;
    overflow: hidden;
    box-shadow:
        0 0 18px rgba(74, 222, 128, 0.18),
        0 0 34px rgba(34, 247, 255, 0.08),
        inset 0 0 22px rgba(74, 222, 128, 0.08);
}
.roadmap-item::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(34, 247, 255, 0.22) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 100%);
    background-size: 36px 36px;
    opacity: 0.2;
    mask-image: linear-gradient(90deg, black, transparent 82%);
}
.roadmap-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #22f7ff, #4ade80);
    box-shadow: 0 0 16px rgba(34, 247, 255, 0.75);
}
.roadmap-index {
    position: relative;
    z-index: 1;
    width: clamp(36px, 7.2vmin, 52px);
    height: clamp(36px, 7.2vmin, 52px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(165, 243, 252, 0.84);
    background:
        radial-gradient(circle at 50% 35%, rgba(34, 247, 255, 0.34), transparent 60%),
        rgba(0, 0, 0, 0.72);
    color: #e0faff;
    font-size: clamp(0.9rem, 2.2vmin, 1.2rem);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 10px rgba(34, 247, 255, 0.9);
    box-shadow:
        0 0 14px rgba(34, 247, 255, 0.48),
        inset 0 0 14px rgba(74, 222, 128, 0.18);
}
.roadmap-label {
    min-width: 0;
    color: #f0fdfa;
    font-size: clamp(0.9rem, 2.2vmin, 1.18rem);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow:
        0 0 8px rgba(74, 222, 128, 0.55),
        0 0 18px rgba(34, 247, 255, 0.26);
}
.roadmap-item.is-done {
    border-color: rgba(34, 247, 255, 0.42);
    background:
        linear-gradient(90deg, rgba(15, 118, 110, 0.26), rgba(8, 47, 73, 0.26) 48%, rgba(31, 41, 55, 0.2)),
        rgba(0, 0, 0, 0.68);
    opacity: 0.72;
}
.roadmap-item.is-done .roadmap-index {
    border-color: rgba(103, 232, 249, 0.68);
    color: #a5f3fc;
}
.roadmap-item.is-done .roadmap-label {
    color: #a7f3d0;
    text-decoration: line-through;
    text-decoration-thickness: 0.16em;
    text-decoration-color: rgba(250, 204, 21, 0.86);
    text-shadow: 0 0 10px rgba(34, 247, 255, 0.28);
}
@media (max-width: 520px) {
    #roadmapItems::before {
        left: clamp(20px, 6.5vmin, 29px);
    }
    .roadmap-item {
        gap: 0.75rem;
        padding-right: 0.85rem;
    }
    .roadmap-label {
        letter-spacing: 0.06em;
    }
}

/* Shop, themes, and achievements */
.shop-section-title {
    margin-bottom: clamp(9px, 1.9vmin, 16px);
    display: flex;
    align-items: center;
    gap: clamp(7px, 1.6vmin, 14px);
}
.shop-section-title h2 {
    margin: 0;
    font-size: clamp(1rem, 3.25vmin, 1.62rem);
    font-weight: 900;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
    color: #e0faff;
    text-shadow:
        0 0 7px rgba(224, 250, 255, 0.95),
        0 0 16px rgba(34, 247, 255, 0.85),
        0 0 30px rgba(255, 79, 216, 0.45);
    filter: drop-shadow(0 0 9px rgba(34, 247, 255, 0.32));
}
.shop-section-title .shop-section-rule {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, rgba(34, 247, 255, 0.72), rgba(255, 79, 216, 0.32), transparent);
    box-shadow: 0 0 12px rgba(34, 247, 255, 0.36);
}
.shop-card-grid,
.theme-card-grid,
.achievement-card-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(7px, 1.6vmin, 14px);
}
.achievement-subgroups {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vmin, 20px);
}
.achievement-subgroup-title {
    margin: 0 0 clamp(6px, 1.2vmin, 10px);
    color: #fef08a;
    font-size: clamp(0.68rem, 1.85vmin, 0.95rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
}
.shop-card,
.theme-card,
.achievement-card {
    border-radius: 8px;
    padding: clamp(8px, 1.8vmin, 14px);
}
.shop-card-grid .shop-card,
.theme-card-grid .theme-card,
.achievement-card-grid .achievement-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(10px, 2vmin, 18px);
}
.point-pack-card {
    border-color: rgba(250, 204, 21, 0.45);
    background: rgba(250, 204, 21, 0.08);
}
.point-pack-card .shop-card-kicker,
.point-pack-card .shop-card-status {
    color: #fef08a;
}
.shop-card-head,
.theme-card-head,
.achievement-card-head {
    grid-column: 1;
    margin-bottom: clamp(7px, 1.5vmin, 12px);
    gap: clamp(7px, 1.5vmin, 12px);
}
.shop-card-kicker,
.theme-card-kicker,
.achievement-card-kicker,
.shop-card-status,
.theme-card-status,
.achievement-card-status {
    font-size: clamp(0.56rem, 1.45vmin, 0.75rem);
    line-height: 1.1;
    letter-spacing: 0.09em;
}
.shop-card-title,
.theme-card-title,
.achievement-card-title {
    font-size: clamp(0.78rem, 2vmin, 1rem);
    line-height: 1.15;
}
.shop-card-description,
.theme-card-description,
.achievement-card-description {
    grid-column: 1;
    margin-top: clamp(3px, 0.8vmin, 6px);
    margin-bottom: clamp(7px, 1.5vmin, 12px);
    min-height: 0;
    font-size: clamp(0.66rem, 1.7vmin, 0.88rem);
    line-height: 1.25;
}
.shop-card-badges {
    grid-column: 1;
    display: flex;
    flex-wrap: wrap;
    gap: clamp(4px, 0.9vmin, 7px);
    margin: 0 0 clamp(7px, 1.5vmin, 12px);
}
.shop-bonus-badge,
.shop-tier-badge {
    border-radius: 999px;
    padding: clamp(3px, 0.65vmin, 5px) clamp(6px, 1.25vmin, 9px);
    font-size: clamp(0.52rem, 1.32vmin, 0.68rem);
    font-weight: 900;
    letter-spacing: 0.07em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}
.shop-bonus-badge {
    border: 1px solid rgba(250, 204, 21, 0.65);
    background: rgba(250, 204, 21, 0.12);
    color: #fef08a;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.18);
}

        .theme-stat-badge {
    border: 1px solid rgba(244, 114, 182, 0.48);
    border-radius: 999px;
    background: rgba(244, 114, 182, 0.1);
    color: #fbcfe8;
    padding: clamp(3px, 0.65vmin, 5px) clamp(6px, 1.25vmin, 9px);
    font-size: clamp(0.52rem, 1.32vmin, 0.68rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}
.shop-tier-badge {
    border: 1px solid rgba(34, 211, 238, 0.42);
    background: rgba(34, 211, 238, 0.1);
    color: #a5f3fc;
}
.shop-card-footer,
.theme-card-footer,
.achievement-card-footer {
    gap: clamp(7px, 1.5vmin, 12px);
}
.shop-card-grid .shop-card-footer,
.theme-card-grid .theme-card-footer,
.achievement-card-grid .achievement-card-footer {
    grid-column: 2;
    grid-row: 1 / span 4;
    min-width: clamp(8.2rem, 17vmin, 11rem);
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
}
.shop-action-btn,
.theme-action-btn,
.achievement-action-btn {
    padding: clamp(5px, 1.1vmin, 8px) clamp(7px, 1.5vmin, 12px);
    border-radius: 7px;
    font-size: clamp(0.56rem, 1.45vmin, 0.74rem);
    line-height: 1.05;
    letter-spacing: 0.08em;
}
.item-preview {
    width: clamp(34px, 7.5vmin, 56px);
    height: clamp(34px, 7.5vmin, 56px);
}
.item-preview img {
    width: 72%;
    height: 72%;
}
.item-preview-dot {
    width: clamp(22px, 4.6vmin, 36px);
    height: clamp(22px, 4.6vmin, 36px);
}
.achievement-progress {
    grid-column: 1;
    height: clamp(5px, 1.2vmin, 8px);
    margin-bottom: clamp(7px, 1.5vmin, 12px);
}
.achievement-progress + .achievement-card-status {
    grid-column: 1;
}
.achievement-toast {
    position: fixed;
    z-index: 9999;
    border: 1px solid rgba(103, 232, 249, 0.7);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.85);
    padding: 0.5rem 0.75rem;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 0 20px rgba(34, 247, 255, 0.32);
    pointer-events: none;
}
.achievement-toast-label {
    color: #a5f3fc;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.achievement-toast-name {
    margin-top: 0.125rem;
    font-size: 0.875rem;
    font-weight: 900;
    line-height: 1.25;
}
.achievement-toast-reward {
    margin-top: 0.125rem;
    color: #fef08a;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Compact shop layout */
@media (max-width: 720px), (max-height: 430px) {
    #soundPanel,
    #shopPanel,
    #themePanel,
    #achievementPanel {
        padding: clamp(8px, 2vmin, 14px);
    }
    .shop-card-grid,
    .theme-card-grid,
    .achievement-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .shop-card-grid .shop-card,
    .theme-card-grid .theme-card,
    .achievement-card-grid .achievement-card {
        grid-template-columns: 1fr;
    }
    .shop-card-grid .shop-card-footer,
    .theme-card-grid .theme-card-footer,
    .achievement-card-grid .achievement-card-footer {
        grid-column: 1;
        grid-row: auto;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }
}

/* Death screen and sharing */
#deathPopup {
    padding: clamp(10px, 2.4vmin, 24px);
    overflow-y: auto;
    gap: clamp(6px, 1.35vmin, 14px);
    background:
        radial-gradient(circle at 50% 16%, rgba(34, 247, 255, 0.16), transparent 34%),
        radial-gradient(circle at 18% 78%, rgba(236, 72, 153, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.78), rgba(3, 7, 18, 0.94));
}
.death-card {
    position: relative;
    isolation: isolate;
    width: min(46rem, 94vw);
    max-height: min(92vh, 44rem);
    overflow-y: auto;
    border: 1px solid rgba(34, 247, 255, 0.58);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(34, 247, 255, 0.13), transparent 24%, rgba(236, 72, 153, 0.12) 78%, rgba(250, 204, 21, 0.1)),
        linear-gradient(180deg, rgba(4, 10, 24, 0.96), rgba(0, 0, 0, 0.93));
    box-shadow:
        0 0 34px rgba(34, 247, 255, 0.26),
        0 0 54px rgba(236, 72, 153, 0.13),
        inset 0 0 28px rgba(34, 247, 255, 0.08);
    padding: clamp(14px, 3.1vmin, 30px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(7px, 1.45vmin, 14px);
}
.death-card::before {
    content: "";
    position: absolute;
    inset: 8px;
    z-index: -1;
    pointer-events: none;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(90deg, rgba(34, 247, 255, 0.22) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 100%);
    background-size: 38px 38px;
    mask-image: radial-gradient(circle at 50% 20%, black, transparent 78%);
    opacity: 0.45;
}
.death-title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.55rem, 5.7vmin, 3.45rem);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.9),
        0 0 18px rgba(34, 247, 255, 0.85),
        0 0 34px rgba(236, 72, 153, 0.74);
}
.death-score {
    margin: 0;
    padding: clamp(7px, 1.3vmin, 11px) clamp(11px, 2.2vmin, 18px);
    border: 1px solid rgba(34, 247, 255, 0.34);
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(34, 247, 255, 0.1), rgba(236, 72, 153, 0.08));
    color: #dffcff;
    font-size: clamp(0.95rem, 2.75vmin, 1.55rem);
    font-weight: 800;
    line-height: 1.2;
    white-space: pre-line;
    text-shadow: 0 0 12px rgba(34, 247, 255, 0.78);
    box-shadow: inset 0 0 16px rgba(34, 247, 255, 0.08);
}
.death-gap,
.death-copy,
.death-status {
    max-width: min(42rem, 92%);
    margin: 0;
    font-size: clamp(0.76rem, 2.1vmin, 1.15rem);
    line-height: 1.25;
}
.death-gap {
    color: #f0fdfa;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(45, 212, 191, 0.82), 0 0 18px rgba(236, 72, 153, 0.34);
}
.death-copy {
    color: #d1d5db;
    font-weight: 650;
}
.death-status {
    font-weight: 800;
}
.death-status--ad {
    color: #fef08a;
    filter: drop-shadow(0 0 8px #ffff00);
}
.death-status--share {
    color: #a5f3fc;
    filter: drop-shadow(0 0 8px #00ffff);
}
#sharePanel {
    max-width: min(42rem, 94%);
    gap: clamp(5px, 1vmin, 10px);
    margin: 0;
}
#sharePanel:not(.hidden) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.share-preview-wrap {
    flex-basis: 100%;
    display: flex;
    justify-content: center;
}
#scoreSharePreview {
    width: min(28rem, 88vw);
    max-height: 34vh;
    object-fit: contain;
    border: 2px solid rgba(34, 247, 255, 0.72);
    border-radius: 8px;
    box-shadow: 0 0 22px rgba(34, 247, 255, 0.32);
}
.share-link {
    border: 1px solid var(--share-link-border);
    border-radius: 6px;
    background: var(--share-link-bg);
    padding: clamp(5px, 1.2vmin, 8px) clamp(7px, 1.7vmin, 12px);
    color: var(--share-link-text);
    font-size: clamp(0.62rem, 1.55vmin, 0.86rem);
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.share-link--facebook {
    --share-link-border: #60a5fa;
    --share-link-bg: rgba(96, 165, 250, 0.1);
    --share-link-text: #dbeafe;
}
.share-link--reddit {
    --share-link-border: #fb923c;
    --share-link-bg: rgba(251, 146, 60, 0.1);
    --share-link-text: #ffedd5;
}
.share-link--whatsapp {
    --share-link-border: #4ade80;
    --share-link-bg: rgba(74, 222, 128, 0.1);
    --share-link-text: #dcfce7;
}
.share-link--x {
    --share-link-border: #d1d5db;
    --share-link-bg: rgba(255, 255, 255, 0.1);
    --share-link-text: #f3f4f6;
}
.share-link--copy {
    --share-link-border: #67e8f9;
    --share-link-bg: rgba(103, 232, 249, 0.1);
    --share-link-text: #cffafe;
}
.death-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: min(36rem, 94%);
    gap: clamp(8px, 1.5vmin, 14px);
    margin-top: clamp(2px, 0.5vmin, 8px);
}
.death-primary-actions,
.death-secondary-actions {
    display: grid;
    gap: clamp(6px, 1.25vmin, 12px);
}
.death-primary-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.death-primary-actions.is-centered,
.death-secondary-actions.is-centered {
    justify-content: center;
    grid-template-columns: repeat(var(--visible-actions, 1), minmax(min(10rem, 100%), 14rem));
}
.death-secondary-actions.is-centered {
    grid-template-columns: repeat(var(--visible-actions, 1), minmax(min(7.5rem, 100%), 9.5rem));
}
.death-secondary-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(5px, 1vmin, 9px);
}
.death-button {
    --death-btn-color: #22f7ff;
    --death-btn-rgb: 34, 247, 255;
    --death-btn-border: #a5f3fc;
    position: relative;
    isolation: isolate;
    min-width: 0;
    min-height: clamp(42px, 8vmin, 58px);
    padding: clamp(8px, 1.55vmin, 13px) clamp(8px, 1.9vmin, 16px);
    border: 2px solid var(--death-btn-border);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(var(--death-btn-rgb), 0.2), rgba(var(--death-btn-rgb), 0.06)),
        rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: clamp(0.72rem, 1.85vmin, 1rem);
    font-weight: 900;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
    box-shadow:
        0 0 16px rgba(var(--death-btn-rgb), 0.38),
        0 0 28px rgba(var(--death-btn-rgb), 0.16),
        inset 0 0 18px rgba(var(--death-btn-rgb), 0.1);
    transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.death-button::before {
    content: "";
    position: absolute;
    inset: 3px;
    z-index: -1;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
    opacity: 0.65;
}
.death-button:not(:disabled):hover {
    transform: translateY(-1px);
    background:
        linear-gradient(180deg, rgba(var(--death-btn-rgb), 0.28), rgba(var(--death-btn-rgb), 0.1)),
        rgba(0, 0, 0, 0.52);
    box-shadow:
        0 0 20px rgba(var(--death-btn-rgb), 0.55),
        0 0 42px rgba(var(--death-btn-rgb), 0.24),
        inset 0 0 20px rgba(var(--death-btn-rgb), 0.14);
    filter: saturate(1.16);
}
.death-button:not(:disabled):active {
    transform: translateY(1px) scale(0.99);
}
.death-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.28);
}
.death-secondary-actions .death-button {
    min-height: clamp(32px, 5.6vmin, 42px);
    padding: clamp(6px, 1.1vmin, 9px) clamp(5px, 1.15vmin, 9px);
    font-size: clamp(0.56rem, 1.32vmin, 0.76rem);
    letter-spacing: 0.04em;
}
.death-button--continue,
#watchAdBtn {
    --death-btn-color: #22f7ff;
    --death-btn-rgb: 34, 247, 255;
    --death-btn-border: #67e8f9;
}
.death-button--restart,
#restartRunBtn {
    --death-btn-color: #fb7185;
    --death-btn-rgb: 251, 113, 133;
    --death-btn-border: #fda4af;
}
.death-button--share,
#shareResultBtn {
    --death-btn-color: #a3e635;
    --death-btn-rgb: 163, 230, 53;
    --death-btn-border: #bef264;
}
.death-button--replay,
#replayBtn {
    --death-btn-color: #facc15;
    --death-btn-rgb: 250, 204, 21;
    --death-btn-border: #fde047;
}
.death-button--download,
#downloadReplayBtn {
    --death-btn-color: #a78bfa;
    --death-btn-rgb: 167, 139, 250;
    --death-btn-border: #c4b5fd;
}
.death-button--share-replay,
#shareReplayBtn {
    --death-btn-color: #f472b6;
    --death-btn-rgb: 244, 114, 182;
    --death-btn-border: #f9a8d4;
}
.watch-ad-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.52em;
}
.watch-ad-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.72em;
    height: 1.16em;
    border: 0.11em solid rgba(187, 247, 208, 0.9);
    border-radius: 0.22em;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.55), inset 0 0 8px rgba(34, 247, 255, 0.18);
    flex: 0 0 auto;
}
.watch-ad-icon::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 0.08em;
    border-top: 0.28em solid transparent;
    border-bottom: 0.28em solid transparent;
    border-left: 0.42em solid #bbf7d0;
    filter: drop-shadow(0 0 5px rgba(187, 247, 208, 0.85));
}
@media (max-width: 720px), (max-height: 430px) {
    #deathPopup {
        justify-content: flex-start;
    }
    .death-secondary-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Debug tools and utility states */
#touchTestButton {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 120;
    display: none;
    padding: 12px 16px;
    border: 2px solid #facc15;
    border-radius: 8px;
    background: #111827;
    color: #fef3c7;
    font-weight: 700;
    pointer-events: auto;
}
body.touch-test-enabled #touchTestButton {
    display: block;
}
.runtime-debug-panel {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 120;
    border: 1px solid rgba(250, 204, 21, 0.72);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    padding: 6px 8px;
    color: #fef08a;
    font: 700 11px/1.35 monospace;
    text-align: right;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.75);
    white-space: pre;
    pointer-events: none;
}
.hidden {
    display: none !important;
}
.neon-pulse {
    animation: neonPulse 1.35s ease-in-out infinite;
}
#readyScore {
    margin-bottom: clamp(8px, 1.8vmin, 20px);
    font-size: clamp(1rem, 3.8vmin, 2.25rem);
    line-height: 1.1;
}
#bestScoreDisplay,
#scoreMessage {
    margin-bottom: clamp(8px, 1.8vmin, 20px);
    font-size: clamp(0.86rem, 2.6vmin, 1.4rem);
    line-height: 1.18;
    max-width: 92%;
}
#startPromptText {
    max-width: 92%;
    font-size: clamp(1.25rem, 5.2vmin, 3rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
}
#startChallengeText {
    position: absolute;
    left: clamp(18px, 7vw, 112px);
    top: clamp(48px, 20vh, 150px);
    max-width: min(48vw, 30rem);
    margin: 0;
    transform: rotate(-13deg);
    transform-origin: left center;
    font-size: clamp(0.82rem, 2.55vmin, 1.45rem);
    font-weight: 900;
    line-height: 1.08;
    color: #e0faff;
    letter-spacing: 0.08em;
    text-shadow:
        0 0 6px rgba(224, 250, 255, 0.95),
        0 0 14px rgba(34, 247, 255, 0.85),
        0 0 28px rgba(255, 79, 216, 0.62),
        0 0 42px rgba(34, 247, 255, 0.3);
    text-transform: uppercase;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(255, 79, 216, 0.28));
}
#pauseOverlay p {
    margin: 0;
    font-size: clamp(1.25rem, 5.2vmin, 3rem);
    line-height: 1.05;
}
#resumeBtn,
#pauseRestartBtn {
    margin-top: clamp(10px, 2.5vmin, 24px);
    padding: clamp(6px, 1.35vmin, 10px) clamp(10px, 2.2vmin, 24px);
    border-radius: 8px;
    font-size: clamp(0.68rem, 1.8vmin, 0.95rem);
    line-height: 1;
    letter-spacing: 0.12em;
}
@keyframes neonPulse {
    0%, 100% {
        opacity: 0.78;
        transform: scale(1);
        filter: brightness(0.92);
    }
    50% {
        opacity: 1;
        transform: scale(1.035);
        filter: brightness(1.35);
    }
}


