:root {
    --grid-size: 6;
    --cell-size: 80px;
    --board-padding: 8px;
    --bg-main: #090d17;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.72);
    --accent: #8b5cf6;
    --accent-2: #3b82f6;
    --danger: #ef4444;
    --ok: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Exo 2', sans-serif;
    min-height: 100vh;
    background: var(--bg-main);
    color: var(--text-main);
    padding: 20px;
    overflow-x: hidden;
}

body.splash-open {
    overflow: hidden;
}

body.modal-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

button {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.cosmic-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.stars {
    position: absolute;
    inset: -24px;
    opacity: 0.6;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 80% 15%, white, transparent),
        radial-gradient(2px 2px at 30% 80%, white, transparent);
    background-size: 220% 220%;
    animation: twinkle 9s ease-in-out infinite;
}

.nebula {
    position: absolute;
    inset: -24px;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(59, 130, 246, 0.18), transparent 52%),
        radial-gradient(ellipse at 80% 68%, rgba(236, 72, 153, 0.14), transparent 50%),
        radial-gradient(ellipse at 50% 52%, rgba(139, 92, 246, 0.18), transparent 58%);
    animation: drift 20s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.92; }
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to { transform: translate(12px, 8px); }
}

.game-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.app-splash {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: opacity 280ms ease, visibility 280ms ease;
}

.app-splash.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-splash-backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 10, 18, 0.38), rgba(8, 10, 18, 0.92)),
        url("/assets/img/splash_bg.webp") center / cover no-repeat;
    transform: scale(1.02);
}

.app-splash-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    place-items: center;
    text-align: center;
    padding: 20px;
}

.app-splash-logo {
    width: min(82vw, 420px);
    height: auto;
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.55));
}

.app-splash-label {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(13px, 2.5vw, 16px);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
}

.app-head {
    display: grid;
    gap: 10px;
}

.head-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.language-row {
    display: flex;
    justify-content: flex-end;
}

.lang-switch {
    position: relative;
    border: none;
    border-radius: 10px;
    background: transparent;
    padding: 4px 8px;
    min-width: 78px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lang-flag {
    font-size: 17px;
    line-height: 1;
}

.lang-code {
    font-weight: 700;
    letter-spacing: 0.6px;
    line-height: 1;
}

.logo-image {
    max-height: 168px;
    width: auto;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.35));
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stat-card {
    border: 2px solid rgba(139, 92, 246, 0.35);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    width: 100%;
    color: var(--text-main);
    padding: 10px;
    display: grid;
    gap: 2px;
    text-align: center;
}

.stat-card-clickable {
    cursor: pointer;
}

.stat-card-clickable:hover {
    border-color: rgba(139, 92, 246, 0.7);
    background: rgba(36, 28, 70, 0.7);
}

.stat-label {
    font-size: 10px;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.topbar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.lang-select {
    position: absolute;
    inset: 0;
    width: 100%;
    border: none;
    background: transparent;
    color: transparent;
    cursor: pointer;
    opacity: 0;
    appearance: none;
    -webkit-appearance: none;
}

.move-info {
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
    padding: 8px 14px;
    font-size: 14px;
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 2px auto 0;
    justify-content: center;
    flex-wrap: wrap;
}

.move-info-arrow {
    color: rgba(255, 255, 255, 0.85);
}

.move-info-btn {
    appearance: none;
    color: inherit;
    cursor: pointer;
}

.move-info-btn:hover {
    background: rgba(34, 25, 64, 0.75);
}

.auth-box {
    border: none;
    border-radius: 12px;
    background: transparent;
    padding: 0;
    width: auto;
    display: grid;
    gap: 8px;
    text-align: center;
}

.auth-box-clickable {
    appearance: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.auth-head {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.auth-label {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.auth-value {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    border: none;
}

.auth-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mini-btn {
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.18);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    cursor: pointer;
}

.mini-btn:hover {
    background: rgba(139, 92, 246, 0.32);
}

.board-wrapper {
    display: grid;
    justify-items: center;
    gap: 8px;
}

.game-board {
    position: relative;
    box-sizing: content-box;
    width: calc(var(--grid-size) * var(--cell-size) + 2 * var(--board-padding));
    height: calc(var(--grid-size) * var(--cell-size) + 2 * var(--board-padding));
    background: #000;
    border: 6px solid #fff;
    border-radius: 6px;
    overflow: visible;
    box-shadow:
        0 0 50px rgba(139, 92, 246, 0.3),
        inset 0 0 80px rgba(139, 92, 246, 0.1);
}

.daily-run-box {
    width: min(100%, 496px);
    border: 1px solid rgba(16, 185, 129, 0.45);
    border-radius: 12px;
    background: rgba(5, 46, 38, 0.76);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.18);
}

.daily-run-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: rgba(255, 255, 255, 0.82);
}

.daily-run-time {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
}

.daily-next-time {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.94);
}

.game-board.is-loading {
    overflow: hidden;
}

.game-board::before {
    content: "";
    position: absolute;
    top: var(--board-padding);
    left: var(--board-padding);
    width: calc(100% - (2 * var(--board-padding)) + 1px);
    height: calc(100% - (2 * var(--board-padding)) + 1px);
    border-radius: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: var(--cell-size) var(--cell-size);
    z-index: 1;
    pointer-events: none;
}

.game-board.is-loading .exit-opening,
.game-board.is-loading .exit-slot {
    opacity: 0;
}

.board-loading {
    position: absolute;
    inset: var(--board-padding);
    z-index: 9;
    display: grid;
    place-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.42);
    pointer-events: none;
}

.board-loading-spinner {
    width: clamp(44px, 16vw, 66px);
    height: clamp(44px, 16vw, 66px);
    border-radius: 999px;
    border: 4px solid rgba(255, 255, 255, 0.22);
    border-top-color: #a78bfa;
    box-shadow: 0 0 18px rgba(167, 139, 250, 0.45);
    animation: boardSpinner 0.8s linear infinite;
}

.board-loading-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    text-align: center;
}

.board-end-overlay {
    position: absolute;
    inset: var(--board-padding);
    z-index: 10;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.38);
    pointer-events: auto;
}

.board-end-overlay-content {
    width: min(100%, 280px);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    background: rgba(5, 5, 5, 0.72);
    box-shadow: 0 0 22px rgba(0, 0, 0, 0.45);
    padding: 14px 16px;
    text-align: center;
    display: grid;
    gap: 8px;
}

.board-end-overlay-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.board-end-overlay-line {
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    font-weight: 700;
}

@keyframes boardSpinner {
    to {
        transform: rotate(360deg);
    }
}

.exit-opening {
    position: absolute;
    right: -6px;
    width: 12px;
    background: #000;
    border-left: 2px solid #000;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85);
    z-index: 3;
}

.exit-slot {
    position: absolute;
    right: -62px;
    width: 90px;
    background: transparent;
    z-index: 7;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 6px;
    overflow: visible;
    pointer-events: none;
}

.exit-arrows {
    position: relative;
    display: flex;
    gap: 8px;
    z-index: 8;
    margin-right: -6px;
    transform: translateY(-4px);
}

.exit-arrow {
    color: #ff3030;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    animation: arrowFade 2s ease-in-out infinite;
    opacity: 0.2;
}

.exit-arrow:nth-child(1) {
    animation-delay: 0s;
}

.exit-arrow:nth-child(2) {
    animation-delay: 0.3s;
}

.exit-arrow:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes arrowFade {
    0%, 100% {
        opacity: 0.2;
        text-shadow:
            0 0 5px rgba(255, 48, 48, 0.3),
            0 0 10px rgba(255, 48, 48, 0.2);
    }
    50% {
        opacity: 1;
        text-shadow:
            0 0 15px #ff3030,
            0 0 30px #ff3030,
            0 0 45px rgba(255, 48, 48, 0.8);
    }
}

.piece {
    position: absolute;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.58);
    touch-action: none;
    cursor: grab;
    user-select: none;
    transition: left 0.1s ease, top 0.1s ease;
    z-index: 5;
    filter: saturate(1.2) contrast(1.08);
}

.piece::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.34), transparent 60%);
    pointer-events: none;
}

.piece.target {
    border-color: rgba(255, 48, 48, 0.75);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 48, 48, 0.72);
}

.piece.target.piece-target-intro {
    animation: targetPieceIntroNudge 1.1s ease-in-out 1;
}

.piece:active {
    cursor: grabbing;
}

@keyframes targetPieceIntroNudge {
    0% { transform: translateX(0); }
    12.5% { transform: translateX(10px); }
    25% { transform: translateX(0); }
    37.5% { transform: translateX(10px); }
    50% { transform: translateX(0); }
    100% { transform: translateX(0); }
}

.controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.btn {
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 16px 10px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: rgba(15, 23, 42, 0.6);
    cursor: pointer;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    transition: all 0.25s ease;
}

.btn:hover {
    background: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.38;
    filter: grayscale(0.7) saturate(0.55);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    background: rgba(91, 99, 116, 0.34);
    border-color: rgba(148, 163, 184, 0.28);
    color: rgba(255, 255, 255, 0.62);
}

.btn:disabled:hover,
.btn[aria-disabled="true"]:hover {
    background: rgba(91, 99, 116, 0.34);
    box-shadow: none;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    border-color: rgba(255, 255, 255, 0.22);
}

.cards {
    display: grid;
    gap: 10px;
}

.legal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.2;
    opacity: 0.82;
}

.legal-link {
    appearance: none;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    padding: 0;
    margin: 0;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.legal-link:hover {
    color: rgba(255, 255, 255, 0.95);
}

.legal-separator {
    color: rgba(255, 255, 255, 0.5);
}

.challenge-card {
    text-align: left;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.68);
    color: white;
    padding: 14px;
    cursor: pointer;
}

.challenge-card:hover {
    background: rgba(34, 25, 64, 0.73);
}

.challenge-card p {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pill {
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 14, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 90;
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: min(100%, 430px);
    border: 2px solid rgba(139, 92, 246, 0.55);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.97);
    padding: 20px;
    display: grid;
    gap: 12px;
}

.modal-wide {
    width: min(100%, 520px);
}

.legal-modal {
    width: min(100%, 680px);
}

.legal-scroll {
    max-height: min(68vh, 520px);
    overflow-y: auto;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 10px;
    background: rgba(6, 11, 20, 0.68);
    padding: 12px;
    display: grid;
    gap: 10px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
}

.legal-scroll h4,
.legal-scroll h5 {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.96);
}

.legal-scroll ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
}

.modal h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
}

.modal p {
    color: var(--text-muted);
    line-height: 1.5;
}

.victory-modal {
    gap: 14px;
}

.victory-breakdown {
    margin: 4px 0;
    padding: 12px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.1);
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.55;
}

.field-block {
    display: grid;
    gap: 5px;
}

.field-block label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.field-input {
    border: 1px solid rgba(139, 92, 246, 0.55);
    border-radius: 10px;
    background: rgba(7, 11, 20, 0.9);
    color: white;
    padding: 10px 12px;
    font-size: 14px;
}

.field-input:focus {
    outline: 1px solid rgba(167, 139, 250, 0.65);
}

.level-grid {
    display: grid;
    gap: 8px;
}

.level-btn {
    border: none;
    border-radius: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: white;
    padding: 14px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.level-easy {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.42);
}
.level-medium {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.42);
}
.level-hard {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.42);
}

.level-btn:hover {
    transform: translateY(-2px);
    filter: saturate(1.08) brightness(1.04);
}

.level-btn:active {
    transform: translateY(0);
}

.modal-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.modal-btn {
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    padding: 12px;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.score-auth-actions {
    display: grid;
    gap: 8px;
}

.ghost-btn {
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.14);
    color: white;
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.26);
}

.confirm-btn {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
}

.modal-btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.08) brightness(1.04);
}

.modal-btn:active {
    transform: translateY(0);
}

.modal-btn:disabled,
.modal-btn:disabled:hover {
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.75);
    opacity: 0.55;
    box-shadow: none;
}

.full-width {
    width: 100%;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.12);
}

.stats-row > div {
    flex: 1 1 0;
}

.stats-row > div:last-child {
    text-align: right;
}

.mini-label {
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    text-transform: uppercase;
}

.mini-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
}

#pointsValue {
    text-align: right;
}

.leaderboard-head,
.leaderboard-row {
    display: grid;
    grid-template-columns: 40px 1fr 90px 90px;
    gap: 10px;
    align-items: center;
    padding-left: 10px;
    padding-right: 12px;
}

.leaderboard-head {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.56);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.25);
}

.leaderboard-rank-head {
    cursor: pointer;
    user-select: none;
}

.leaderboard-list {
    max-height: 260px;
    overflow: auto;
}

.leaderboard-row {
    padding-top: 9px;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.14);
}

.leaderboard-row.is-self {
    background: rgba(167, 139, 250, 0.38);
    box-shadow:
        inset 4px 0 0 rgba(221, 214, 254, 0.98),
        inset 0 0 0 1px rgba(196, 181, 253, 0.42);
    font-weight: 700;
}

.leaderboard-row.leaderboard-row-separator {
    color: rgba(255, 255, 255, 0.48);
    border-bottom-style: dashed;
}

.leaderboard-row.is-self-fixed {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(88, 28, 135, 0.92), rgba(124, 58, 237, 0.92));
    border-top: 1px solid rgba(196, 181, 253, 0.72);
    border-bottom: 1px solid rgba(196, 181, 253, 0.72);
}

.leaderboard-head span:last-child,
.leaderboard-row span:last-child {
    text-align: right;
    justify-self: end;
}

.leaderboard-head span:nth-child(3),
.leaderboard-row span:nth-child(3) {
    text-align: center;
    justify-self: center;
}

.daily-player-stats > div:last-child {
    text-align: right;
}

.daily-leaderboard-head,
.daily-leaderboard-list .leaderboard-row {
    grid-template-columns: 40px minmax(0, 1fr) 110px 70px;
}

.daily-result-flash {
    border: 1px solid rgba(16, 185, 129, 0.6);
    border-radius: 10px;
    padding: 9px 11px;
    background: rgba(16, 185, 129, 0.16);
    animation: dailyPulse 1s ease-in-out 3;
}

.daily-cooldown-info {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 10px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.82);
}

.daily-cooldown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.daily-cooldown-info strong {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
}

.daily-top-leader {
    display: block;
    width: 100%;
    margin-top: 8px;
    border: 1px solid #fbbf24;
    border-radius: 10px;
    padding: 8px 10px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.34), rgba(234, 179, 8, 0.24));
    color: #fff8db;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.18);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.daily-date-filter {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

.daily-date-filter label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
}

@keyframes dailyPulse {
    0%, 100% {
        background: rgba(16, 185, 129, 0.16);
    }
    50% {
        background: rgba(16, 185, 129, 0.42);
    }
}

.leaderboard-head span:nth-child(2),
.leaderboard-row span:nth-child(2) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-row.is-self-jump {
    box-shadow: 0 0 0 2px rgba(196, 181, 253, 0.9) inset;
}

.hidden {
    display: none;
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.payment-option {
    border-radius: 10px;
    border: 2px solid rgba(139, 92, 246, 0.55);
    background: rgba(139, 92, 246, 0.14);
    color: white;
    font-weight: 700;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.payment-option.selected {
    border-color: #a78bfa;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(139, 92, 246, 0.48));
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.32);
}

.payment-option:hover {
    transform: translateY(-1px);
    filter: saturate(1.08);
}

.toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translate(-50%, 100px);
    opacity: 0;
    transition: all 0.22s ease;
    z-index: 100;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.6);
    border-radius: 10px;
    padding: 12px 16px;
    color: white;
    font-weight: 700;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

@media (max-width: 700px) {
    :root {
        --cell-size: 52px;
    }

    .head-top {
        grid-template-columns: auto minmax(0, 1fr) auto;
        justify-items: stretch;
        gap: 6px;
    }

    .logo-image {
        max-height: 84px;
    }

    .topbar {
        justify-content: center;
    }

    .language-row {
        justify-content: flex-end;
    }

    .header-stats {
        grid-template-columns: 1fr 1fr;
    }

    .lang-switch {
        padding: 5px 8px;
    }

    .exit-slot {
        width: 60px;
        right: -40px;
        padding-right: 2px;
    }

    .exit-arrows {
        margin-right: 3px;
        gap: 5px;
    }

    .exit-arrow {
        font-size: 28px;
    }

    .leaderboard-head,
    .leaderboard-row {
        grid-template-columns: 32px minmax(0, 1fr) 58px 66px;
        gap: 6px;
    }

    .daily-run-box {
        width: 100%;
        padding: 8px 10px;
    }

    .daily-run-time {
        font-size: 17px;
    }

    .daily-leaderboard-head,
    .daily-leaderboard-list .leaderboard-row {
        grid-template-columns: 30px minmax(0, 1fr) 76px 44px;
        gap: 6px;
    }

    .leaderboard-head {
        font-size: 10px;
    }

    .leaderboard-row {
        font-size: 13px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}
