/* ─── CSS Custom Properties ─── */
:root {
    /* Mobile-first defaults */
    --grid-max-width: 340px;
    --cell-font-size: 1.1rem;
    --numpad-size: 30px;
    --numpad-font-size: 0.9rem;
    --action-size: 0.55rem;
    --action-padding: 3px 8px;
    --action-min-width: 30px;
    --card-padding: 12px 10px 10px;
    --card-border-radius: 24px;
    --title-font-size: 1.0rem;
    --logo-font-size: 1.4rem;
    --badge-font-size: 0.5rem;
    --badge-padding: 2px 8px;
    --stat-font-size: 0.6rem;
    --stat-value-font-size: 0.8rem;
    --status-font-size: 0.65rem;
    --controls-font-size: 0.7rem;
    --controls-padding: 5px 14px;
    --modal-padding: 16px 18px;
    --modal-max-width: 340px;
    --modal-h2-size: 1.0rem;
    --modal-btn-size: 0.8rem;
    --modal-btn-padding: 8px;
    --donate-label-size: 0.7rem;
    --donate-address-size: 0.6rem;
    --copy-btn-size: 0.65rem;
    --go-title-size: 1.4rem;
    --go-points-size: 1.8rem;
    --go-stats-size: 0.75rem;
    --resume-title-size: 1.2rem;
}

/* ─── Tablet & Desktop overrides ─── */
@media (min-width: 600px) {
    :root {
        --grid-max-width: 420px;
        --cell-font-size: 1.4rem;
        --numpad-size: 38px;
        --numpad-font-size: 1.1rem;
        --action-size: 0.7rem;
        --action-padding: 4px 12px;
        --action-min-width: 40px;
        --card-padding: 20px 16px 16px;
        --card-border-radius: 32px;
        --title-font-size: 1.3rem;
        --logo-font-size: 1.8rem;
        --badge-font-size: 0.6rem;
        --badge-padding: 2px 10px;
        --stat-font-size: 0.7rem;
        --stat-value-font-size: 0.95rem;
        --status-font-size: 0.75rem;
        --controls-font-size: 0.8rem;
        --controls-padding: 6px 20px;
        --modal-padding: 20px 24px;
        --modal-max-width: 380px;
        --modal-h2-size: 1.2rem;
        --modal-btn-size: 0.9rem;
        --modal-btn-padding: 10px;
        --donate-label-size: 0.8rem;
        --donate-address-size: 0.7rem;
        --copy-btn-size: 0.75rem;
        --go-title-size: 1.8rem;
        --go-points-size: 2.2rem;
        --go-stats-size: 0.85rem;
        --resume-title-size: 1.4rem;
    }
}

@media (min-width: 1024px) {
    :root {
        --grid-max-width: 520px;
        --cell-font-size: 1.8rem;
        --numpad-size: 48px;
        --numpad-font-size: 1.4rem;
        --action-size: 0.85rem;
        --action-padding: 6px 16px;
        --action-min-width: 50px;
        --card-padding: 28px 24px 24px;
        --card-border-radius: 40px;
        --title-font-size: 1.8rem;
        --logo-font-size: 2.2rem;
        --badge-font-size: 0.75rem;
        --badge-padding: 4px 14px;
        --stat-font-size: 0.85rem;
        --stat-value-font-size: 1.2rem;
        --status-font-size: 0.9rem;
        --controls-font-size: 0.95rem;
        --controls-padding: 8px 32px;
        --modal-padding: 28px 32px;
        --modal-max-width: 440px;
        --modal-h2-size: 1.4rem;
        --modal-btn-size: 1.0rem;
        --modal-btn-padding: 12px;
        --donate-label-size: 0.9rem;
        --donate-address-size: 0.85rem;
        --copy-btn-size: 0.9rem;
        --go-title-size: 2.4rem;
        --go-points-size: 2.8rem;
        --go-stats-size: 1.0rem;
        --resume-title-size: 1.8rem;
    }
}

/* ─── Reset & Base ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rajdhani', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    padding: 8px;
    margin: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0a0e1a 0%, #03050b 100%);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    -webkit-filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}
.blob-blue {
    width: 55vmax;
    height: 55vmax;
    background: rgba(20, 80, 220, 0.20);
}
.blob-pink {
    width: 55vmax;
    height: 55vmax;
    background: rgba(220, 20, 100, 0.40);
}
.blob-purple {
    width: 65vmax;
    height: 65vmax;
    background: rgba(90, 20, 180, 0.65);
}

.card {
    position: relative;
    z-index: 10;
    max-width: 600px;
    width: 100%;
    padding: var(--card-padding);
    background: rgba(4, 6, 18, 0.85);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-radius: var(--card-border-radius);
    border: 2px solid rgba(0, 212, 255, 0.35);
    box-shadow: 0 0 70px rgba(0, 100, 255, 0.25),
        0 0 150px rgba(150, 0, 255, 0.10),
        0 20px 60px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.4s ease;
    max-height: 98vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.card::-webkit-scrollbar {
    width: 3px;
}
.card::-webkit-scrollbar-track {
    background: transparent;
}
.card::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 4px;
}
.card:hover {
    transform: scale(1.01);
    box-shadow: 0 0 90px rgba(0, 150, 255, 0.4),
        0 0 180px rgba(200, 0, 255, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.9);
}

.card * {
    position: relative;
    z-index: 2;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.logo {
    font-size: var(--logo-font-size);
    line-height: 1;
    filter: drop-shadow(0 0 25px rgba(0, 180, 255, 0.5));
}
.title {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--title-font-size);
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #a0d0ff, #80b0ff, #c084fc, #80b0ff, #a0d0ff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
    text-shadow: none;
}
@keyframes shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.difficulty-badge {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: var(--badge-font-size);
    color: #b0d4ff;
    background: rgba(0, 180, 255, 0.12);
    padding: var(--badge-padding);
    border-radius: 30px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.difficulty-badge.hidden {
    display: none;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.lang-btn, .settings-btn, .donate-btn-small {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.15);
    color: #b0d4ff;
    border-radius: 30px;
    padding: 4px 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.lang-btn:hover, .settings-btn:hover, .donate-btn-small:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.4);
    color: #fff;
}
.donate-btn-small {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    font-size: 0.95rem;
}
.donate-btn-small:hover {
    background: rgba(255, 215, 0, 0.18);
    border-color: #ffd700;
    color: #ffd700;
}

.controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.controls button {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: var(--controls-font-size);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: var(--controls-padding);
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
#startBtn {
    background: linear-gradient(135deg, #0088ff, #6600cc);
    color: #fff;
    box-shadow: 0 0 30px rgba(0, 100, 255, 0.3);
}
#startBtn:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 0 50px rgba(0, 100, 255, 0.5);
}
#startBtn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}
#resetBtn {
    background: rgba(255, 255, 255, 0.06);
    color: #c0e0ff;
    border: 1px solid rgba(0, 212, 255, 0.15);
}
#resetBtn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.4);
    color: #fff;
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2px 8px 2px;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
    margin-bottom: 8px;
    flex-shrink: 0;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #b0d4ff;
    font-size: var(--stat-font-size);
    font-weight: 500;
}
.stat-item .icon {
    font-size: calc(var(--stat-font-size) * 1.2);
}
.stat-item .value {
    color: #fff;
    font-weight: 700;
    font-size: var(--stat-value-font-size);
    min-width: 36px;
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(0, 150, 255, 0.2);
}
.stat-item .value.timer-value {
    min-width: 44px;
}
.stat-item .label {
    font-weight: 400;
    opacity: 0.6;
    font-size: calc(var(--stat-font-size) * 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grid-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: rgba(0, 212, 255, 0.12);
    border: 2px solid rgba(0, 212, 255, 0.25);
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    max-width: var(--grid-max-width);
    aspect-ratio: 1/1;
    box-shadow: 0 0 40px rgba(0, 100, 255, 0.08);
    position: relative;
    direction: ltr;
}
.cell {
    background: rgba(6, 6, 30, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: var(--cell-font-size);
    color: #d0e8ff;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    aspect-ratio: 1/1;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    text-shadow: 0 0 10px rgba(0, 180, 255, 0.1);
}
.cell:active {
    transform: scale(0.92);
}
.cell:hover {
    background: rgba(0, 180, 255, 0.08);
}
.cell:nth-child(9n+4),
.cell:nth-child(9n+7) {
    border-left: 2px solid rgba(0, 212, 255, 0.35);
}
html[dir="rtl"] .cell:nth-child(9n+4),
html[dir="rtl"] .cell:nth-child(9n+7) {
    border-left: 2px solid rgba(0, 212, 255, 0.35);
    border-right: none;
}
.cell:nth-child(n+28):nth-child(-n+36),
.cell:nth-child(n+55):nth-child(-n+63) {
    border-top: 2px solid rgba(0, 212, 255, 0.35);
}

.cell.fixed {
    color: #88ccff;
    font-weight: 800;
    text-shadow: 0 0 18px rgba(0, 150, 255, 0.25);
}
.cell.user {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(100, 200, 255, 0.15);
}
.cell.selected {
    background: rgba(0, 180, 255, 0.18) !important;
    box-shadow: inset 0 0 30px rgba(0, 150, 255, 0.15);
}
.cell.highlight {
    background: rgba(0, 180, 255, 0.06);
}
.cell.error {
    color: #ff2d55 !important;
    text-shadow: 0 0 30px #ff2d55, 0 0 60px #ff0040;
    animation: errorPulse 0.5s ease;
}
.cell.correct-flash {
    color: #4cd964 !important;
    text-shadow: 0 0 30px #4cd964, 0 0 60px #00cc44;
    animation: correctPulse 0.5s ease;
}
.cell.completed {
    color: #4cd964 !important;
    text-shadow: 0 0 30px #4cd964, 0 0 70px #00cc44;
}
.cell .notes-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}
.cell .notes-container span {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--cell-font-size) * 0.33);
    font-weight: 600;
    color: rgba(180, 200, 255, 0.7);
    text-shadow: 0 0 6px rgba(0, 150, 255, 0.2);
}
.cell .main-number {
    position: relative;
    z-index: 1;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.action-toolbar {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
    direction: ltr;
    flex-direction: row;
    flex-shrink: 0;
}
.action-toolbar button {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: var(--action-size);
    padding: var(--action-padding);
    border-radius: 16px;
    border: 1.5px solid rgba(0, 212, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #b0d4ff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-width: var(--action-min-width);
    justify-content: center;
}
.action-toolbar button:hover:not(:disabled) {
    background: rgba(0, 180, 255, 0.10);
    border-color: rgba(0, 212, 255, 0.3);
    color: #fff;
}
.action-toolbar button:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}
.action-toolbar button.active-mode {
    border-color: #00d4ff;
    background: rgba(0, 180, 255, 0.15);
    color: #fff;
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.1);
}
.action-toolbar .hint-btn {
    color: #ffd700;
}
.action-toolbar .hint-btn:hover:not(:disabled) {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
}

.numpad-row {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
    direction: ltr;
    flex-direction: row;
    flex-shrink: 0;
}
.numpad-row button {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: var(--numpad-font-size);
    width: var(--numpad-size);
    height: var(--numpad-size);
    border-radius: 10px;
    border: 1.5px solid rgba(0, 212, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #c0e0ff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 10px rgba(0, 180, 255, 0.1);
    letter-spacing: 0.5px;
}
.numpad-row button:hover:not(:disabled) {
    background: rgba(0, 180, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.35);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.08);
}
.numpad-row button:active:not(:disabled) {
    transform: scale(0.92);
}
.numpad-row button:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    transform: none !important;
}
.numpad-row button.erase-btn {
    color: #ff6b6b;
    border-color: rgba(255, 100, 100, 0.12);
    font-size: calc(var(--numpad-font-size) * 0.75);
}
.numpad-row button.erase-btn:hover:not(:disabled) {
    border-color: rgba(255, 100, 100, 0.3);
    background: rgba(255, 100, 100, 0.08);
    color: #ff6b6b;
}

.status {
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: var(--status-font-size);
    color: #88bbdd;
    min-height: 1.4rem;
    padding: 2px 0;
    opacity: 0.7;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.status.success {
    color: #4cd964;
    opacity: 1;
    text-shadow: 0 0 40px rgba(76, 217, 100, 0.25);
}
.status.error {
    color: #ff2d55;
    opacity: 1;
    text-shadow: 0 0 40px rgba(255, 45, 85, 0.2);
}

/* ─── Modals ─── */
.modal-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--card-border-radius);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.show {
    display: flex;
}
.modal-panel {
    background: rgba(10, 12, 30, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 24px;
    padding: var(--modal-padding);
    max-width: var(--modal-max-width);
    width: 100%;
    box-shadow: 0 0 60px rgba(0, 100, 255, 0.2);
    text-align: center;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}
.modal-panel h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--modal-h2-size);
    color: #c0e0ff;
    margin-bottom: 12px;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.modal-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    overflow-y: auto;
    max-height: 35vh;
    padding-right: 4px;
}
.modal-options::-webkit-scrollbar {
    width: 3px;
}
.modal-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.modal-options::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 4px;
}
.modal-panel .modal-options button {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: var(--modal-btn-size);
    padding: var(--modal-btn-padding);
    border-radius: 30px;
    border: 1.5px solid rgba(0, 212, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: #b0d4ff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.modal-panel .modal-options button:hover {
    background: rgba(0, 180, 255, 0.10);
    border-color: rgba(0, 212, 255, 0.4);
    color: #fff;
}
.modal-panel .modal-options button:active {
    transform: scale(0.96);
}
.modal-close {
    display: block;
    margin: 0 auto;
    padding: 8px 24px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, #0088ff, #6600cc);
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: var(--modal-btn-size);
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    flex-shrink: 0;
}
.modal-close:hover {
    transform: scale(1.04);
    box-shadow: 0 0 30px rgba(0, 100, 255, 0.3);
}

/* ─── Donate Modal ─── */
.donate-address {
    margin-bottom: 10px;
    text-align: left;
}
.donate-address label {
    font-weight: 600;
    color: #b0d4ff;
    font-size: var(--donate-label-size);
    display: block;
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}
.address-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    gap: 6px;
}
.address-box span {
    font-family: 'Rajdhani', monospace;
    font-size: var(--donate-address-size);
    word-break: break-all;
    color: #d0e8ff;
    flex: 1;
}
.copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #b0d4ff;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    font-size: var(--copy-btn-size);
    white-space: nowrap;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}
.copy-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* ─── Settings ─── */
.settings-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--card-border-radius);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
.settings-overlay.show {
    display: flex;
}
.settings-panel {
    background: rgba(10, 12, 30, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 24px;
    padding: var(--modal-padding);
    max-width: 360px;
    width: 100%;
    box-shadow: 0 0 60px rgba(0, 100, 255, 0.2);
}
.settings-panel h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--modal-h2-size);
    color: #c0e0ff;
    text-align: center;
    margin-bottom: 14px;
    letter-spacing: 1px;
}
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.setting-item:last-child {
    border-bottom: none;
}
.setting-item label {
    color: #b0d4ff;
    font-weight: 500;
    font-size: var(--modal-btn-size);
    letter-spacing: 0.3px;
}
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s ease;
    border: 1px solid rgba(0, 212, 255, 0.15);
}
.toggle-switch.active {
    background: rgba(0, 180, 255, 0.3);
    border-color: #00d4ff;
}
.toggle-switch .toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.toggle-switch.active .toggle-knob {
    transform: translateX(20px);
    background: #00d4ff;
}
.settings-close {
    display: block;
    margin: 14px auto 0;
    padding: 8px 24px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, #0088ff, #6600cc);
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: var(--modal-btn-size);
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}
.settings-close:hover {
    transform: scale(1.04);
    box-shadow: 0 0 30px rgba(0, 100, 255, 0.3);
}

/* ─── Resume & Game Over ─── */
.resume-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--card-border-radius);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    animation: fadeIn 0.4s ease;
}
.resume-overlay.show {
    display: flex;
}
.resume-overlay .resume-title {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--resume-title-size);
    font-weight: 700;
    color: #c0e0ff;
    text-shadow: 0 0 40px rgba(0, 150, 255, 0.2);
    margin-bottom: 12px;
}
.resume-overlay .resume-buttons {
    display: flex;
    gap: 14px;
}
.resume-overlay .resume-buttons button {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: var(--modal-btn-size);
    padding: 10px 28px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.resume-overlay .resume-buttons .resume-yes {
    background: linear-gradient(135deg, #0088ff, #6600cc);
    color: #fff;
    box-shadow: 0 0 30px rgba(0, 100, 255, 0.3);
}
.resume-overlay .resume-buttons .resume-yes:hover {
    transform: scale(1.04);
    box-shadow: 0 0 50px rgba(0, 100, 255, 0.5);
}
.resume-overlay .resume-buttons .resume-no {
    background: rgba(255, 255, 255, 0.06);
    color: #c0e0ff;
    border: 1px solid rgba(0, 212, 255, 0.15);
}
.resume-overlay .resume-buttons .resume-no:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.4);
}

.game-over-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--card-border-radius);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}
.game-over-overlay.show {
    display: flex;
}
@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}
.game-over-overlay .go-title {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--go-title-size);
    font-weight: 900;
    background: linear-gradient(135deg, #4cd964, #00cc88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(76, 217, 100, 0.2);
    margin-bottom: 4px;
    letter-spacing: 2px;
}
.game-over-overlay .go-stats {
    font-family: 'Rajdhani', sans-serif;
    color: #c0e0ff;
    font-size: var(--go-stats-size);
    text-align: center;
    line-height: 1.8;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.game-over-overlay .go-stats span {
    color: #fff;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.5px;
}
.game-over-overlay .go-points {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--go-points-size);
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 50px #ffd700, 0 0 100px #ff8800;
    margin: 4px 0 10px;
    letter-spacing: 1px;
}
.game-over-overlay .go-close {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: var(--modal-btn-size);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 10px;
    padding: 10px 36px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, #0088ff, #6600cc);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(0, 100, 255, 0.2);
}
.game-over-overlay .go-close:hover {
    transform: scale(1.04);
    box-shadow: 0 0 50px rgba(0, 100, 255, 0.35);
}

body {
    scrollbar-width: none;
}
body::-webkit-scrollbar {
    display: none;
}

/* ─── RTL adjustments ─── */
html[dir="rtl"] .stat-item .icon {
    margin-left: 4px;
    margin-right: 0;
}
html[dir="rtl"] .header-left {
    flex-direction: row;
}
html[dir="rtl"] .cell .notes-container {
    direction: ltr;
}
html[dir="rtl"] .modal-options {
    padding-right: 0;
    padding-left: 4px;
}
html[dir="rtl"] .donate-address {
    text-align: right;
}