/* ========================
   Mouse Tester Styles
   ======================== */

.mouse-tester-section {
    padding: 0 0 2rem;
}

.mouse-tester-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Tool Header */
.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.tool-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.tool-subtitle {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 4px 0 0;
}

.reset-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(255, 87, 87, 0.15);
    border: 1px solid rgba(255, 87, 87, 0.3);
    border-radius: 10px;
    color: #ff5757;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-all-btn:hover {
    background: rgba(255, 87, 87, 0.25);
    transform: translateY(-2px);
}

/* ========================
   Tab Navigation
   ======================== */
.mt-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.mt-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mt-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.mt-tab.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(124, 58, 237, 0.2));
    color: #fff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.15);
}

.mt-tab-content {
    display: none;
}

.mt-tab-content.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Grid */
.mouse-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Glass Card */
.mouse-visual-card,
.info-card,
.history-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
}

.game-fullscreen .card-title {
    color: #fff;
}

/* ========================
   3D Mouse Visualization
   ======================== */
.mouse-3d-container {
    position: relative;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.realistic-mouse {
    position: relative;
    width: 140px;
    height: 220px;
    perspective: 800px;
}

.mouse-body {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #555 0%, #333 40%, #2a2a2a 100%);
    border-radius: 35% 35% 45% 45% / 20% 20% 50% 50%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    transform: rotateX(15deg);
    transition: transform 0.3s ease;
    overflow: visible;
}

/* Mouse Buttons */
.mouse-btn {
    position: absolute;
    top: 0;
    height: 45%;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.mouse-left-btn {
    left: 0;
    width: 48%;
    border-radius: 35% 5% 0 0 / 40% 10% 0 0;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.15), transparent);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mouse-right-btn {
    right: 0;
    width: 48%;
    border-radius: 5% 35% 0 0 / 10% 40% 0 0;
    background: linear-gradient(180deg, rgba(245, 87, 108, 0.15), transparent);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mouse-btn.active {
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.4), rgba(0, 212, 255, 0.05));
    box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.3), 0 0 15px rgba(0, 212, 255, 0.2);
    transform: translateY(2px);
}

.btn-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-weight: 600;
    pointer-events: none;
    padding-top: 20px;
}

.mouse-btn.active .btn-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Mouse Wheel + Scroll Arrows */
.mouse-wheel-area {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 70px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* Scroll Arrows */
.scroll-arrow {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1;
}

.scroll-arrow.glow {
    color: #00f2fe;
    text-shadow: 0 0 8px #00f2fe, 0 0 20px rgba(0, 242, 254, 0.5);
    animation: arrowPulse 0.5s ease;
}

.scroll-arrow-down.glow {
    color: #f5576c;
    text-shadow: 0 0 8px #f5576c, 0 0 20px rgba(245, 87, 108, 0.5);
}

@keyframes arrowPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
    }

    100% {
        transform: scale(1);
    }
}

.mouse-wheel {
    width: 14px;
    height: 28px;
    background: linear-gradient(180deg, #666, #444, #555);
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.wheel-indicator {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.15s ease;
}

.wheel-indicator.scroll-up {
    animation: scrollUpAnim 0.3s ease;
}

.wheel-indicator.scroll-down {
    animation: scrollDownAnim 0.3s ease;
}

@keyframes scrollUpAnim {
    0% {
        transform: translate(-50%, -50%);
    }

    50% {
        transform: translate(-50%, -120%);
        background: #00f2fe;
    }

    100% {
        transform: translate(-50%, -50%);
    }
}

@keyframes scrollDownAnim {
    0% {
        transform: translate(-50%, -50%);
    }

    50% {
        transform: translate(-50%, 20%);
        background: #f5576c;
    }

    100% {
        transform: translate(-50%, -50%);
    }
}

.mouse-middle-btn {
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 6;
}

.mouse-middle-btn.active {
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
}

/* DPI Light */
.mouse-dpi-light {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
    transition: all 0.3s ease;
}

.mouse-dpi-light.active {
    background: #00f2fe;
    box-shadow: 0 0 8px #00f2fe, 0 0 25px rgba(0, 242, 254, 0.4);
}

/* Mouse Logo */
.mouse-logo {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    opacity: 0.3;
    z-index: 3;
}

/* Side Buttons */
.mouse-side-btns {
    position: absolute;
    left: -16px;
    top: 35%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 4;
}

.mouse-side-btn {
    width: 14px;
    height: 28px;
    background: linear-gradient(90deg, #444 0%, #333 100%);
    border-radius: 4px 0 0 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mouse-side-btn span {
    font-size: 0.45rem;
    color: rgba(255, 255, 255, 0.4);
}

.mouse-side-btn.active {
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.4), rgba(0, 212, 255, 0.1));
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.mouse-side-btn.active span {
    color: #fff;
}

/* Mouse Shadow */
.mouse-shadow {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.25) 0%, transparent 70%);
    border-radius: 50%;
}

.click-instruction {
    position: absolute;
    bottom: 12px;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
    width: 100%;
}

/* ========================
   Info Panel
   ======================== */
.mouse-info-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pos-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pos-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 600;
}

.pos-value {
    font-family: 'Inter', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: #00f2fe;
}

/* Click Counter Grid */
.click-counter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.6rem;
}

.counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s;
}

.counter-item:hover {
    transform: translateY(-2px);
}

.counter-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.left-icon {
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.right-icon {
    background: rgba(245, 87, 108, 0.3);
    color: #f5576c;
}

.middle-icon {
    background: rgba(0, 242, 254, 0.3);
    color: #00f2fe;
}

.scroll-icon {
    background: rgba(240, 147, 251, 0.3);
    color: #f093fb;
}

.dbl-icon {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.counter-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    text-align: center;
}

.counter-value {
    font-family: 'Inter', monospace;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-top: 2px;
}

.counter-value.flash {
    animation: counterFlash 0.4s ease;
}

@keyframes counterFlash {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
        color: #00f2fe;
    }
}

/* Scroll Info */
.scroll-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scroll-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.scroll-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 600;
}

.scroll-value {
    font-family: 'Inter', monospace;
    font-weight: 700;
    color: #f093fb;
}

/* ========================
   History Log
   ======================== */
.history-card {
    margin-top: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-header .card-title {
    margin-bottom: 0;
}

.clear-log-btn {
    padding: 6px 16px;
    background: rgba(255, 87, 87, 0.2);
    border: 1px solid rgba(255, 87, 87, 0.3);
    border-radius: 8px;
    color: #ff5757;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-log-btn:hover {
    background: rgba(255, 87, 87, 0.3);
}

.history-log {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-empty {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.82rem;
    animation: logSlideIn 0.3s ease;
}

@keyframes logSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-time {
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Inter', monospace;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.log-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.log-text {
    color: rgba(255, 255, 255, 0.8);
    flex: 1;
}

.log-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.log-badge.left {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.log-badge.right {
    background: rgba(245, 87, 108, 0.2);
    color: #f5576c;
}

.log-badge.middle {
    background: rgba(0, 242, 254, 0.2);
    color: #00f2fe;
}

.log-badge.scroll {
    background: rgba(240, 147, 251, 0.2);
    color: #f093fb;
}

.log-badge.dbl {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* ========================
   GAME SHARED STYLES
   ======================== */
.game-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1rem;
}

.game-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.difficulty-select {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 3px;
}

.diff-btn,
.cps-dur-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.diff-btn.active,
.cps-dur-btn.active {
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.game-start-btn {
    padding: 8px 24px;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.game-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}

.game-stats-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.game-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.game-stat-value {
    font-family: 'Inter', monospace;
    font-size: 1.1rem;
    font-weight: 800;
    color: #00f2fe;
}

/* ========================
   ACCURACY GAME ARENA
   ======================== */
.game-arena {
    position: relative;
    height: 450px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(20, 5, 40, 0.4));
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    cursor: crosshair;
}

.game-overlay,
.game-result-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10;
    border-radius: 12px;
}

.game-overlay.hidden,
.game-result-overlay.hidden {
    display: none;
}

.game-overlay-content,
.game-result-content {
    text-align: center;
}

.game-overlay-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.game-overlay-content h3,
.game-result-content h3 {
    font-size: 1.5rem;
    margin: 0 0 8px;
}

.game-overlay-content p {
    opacity: 0.7;
    margin: 4px 0;
}

.game-hint {
    font-size: 0.9rem;
    margin-top: 10px;
    color: #ffc107;
}

.game-sub-hint {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 2px 0;
}

/* ========================
   Game Settings Row (Color + Size)
   ======================== */
.game-settings-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    margin-bottom: 1rem;
    align-items: center;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-label {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    white-space: nowrap;
}

.color-picker-row {
    display: flex;
    gap: 6px;
}

.color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.color-dot:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.color-dot.active {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    transform: scale(1.15);
}

.size-select {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 3px;
}

.size-btn {
    padding: 5px 14px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.size-btn.active {
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

/* Fullscreen Button */
.fullscreen-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Exit Fullscreen Button */
.fullscreen-exit-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, #ff4757, #c0392b);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.fullscreen-exit-btn:hover {
    background: linear-gradient(135deg, #ff6b81, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.fullscreen-exit-btn.hidden {
    display: none;
}

/* Inline Stats (mini) */
.inline-stats {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    flex-wrap: wrap;
}

/* Icon Toggle Buttons (fullscreen, sound, music) */
.icon-toggle-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.icon-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.icon-toggle-btn.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(124, 58, 237, 0.3));
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.stats-divider {
    color: rgba(255, 255, 255, 0.15);
    font-size: 1.1rem;
    user-select: none;
}

.game-stat-mini {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gs-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    white-space: nowrap;
}

.gs-val {
    font-family: 'Inter', monospace;
    font-size: 0.85rem;
    font-weight: 800;
    color: #00f2fe;
}

/* Fullscreen Mode */
.game-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    background: linear-gradient(135deg, #0a0a1a, #1a0a2e) !important;
    padding: 1rem !important;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.game-fullscreen .game-arena {
    flex: 1;
    height: auto !important;
    min-height: 500px;
}

/* ========================
   Bloom Animation (flower-like appearance)
   ======================== */
.acc-target.bloom {
    animation: bloomAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bloomAppear {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.3) rotate(15deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Hit Burst Particles */
.hit-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 20;
    animation: particleBurst 0.5s ease forwards;
}

@keyframes particleBurst {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(50px);
        opacity: 0;
    }
}

/* Accuracy Target */
.acc-target {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #ff4757 0%, #c0392b 50%, transparent 70%);
    border: 3px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.5);
}

.acc-target-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35%;
    height: 35%;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.acc-target.hit {
    animation: targetHit 0.15s ease forwards;
}

.acc-target.miss {
    animation: targetMiss 0.2s ease forwards;
}

@keyframes targetAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes targetHit {
    to {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes targetMiss {
    to {
        transform: scale(0.5);
        opacity: 0;
        background: rgba(255, 255, 255, 0.2);
    }
}

.miss-ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 87, 87, 0.6);
    animation: missRipple 0.6s ease forwards;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

@keyframes missRipple {
    to {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

/* Game Result */
.result-emoji-big {
    font-size: 3rem;
    margin-bottom: 8px;
}

.result-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.rs-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #00f2fe;
    font-family: 'Inter', monospace;
}

.rs-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* ========================
   CPS TEST
   ======================== */
.cps-arena {
    text-align: center;
}

.cps-display {
    padding: 20px;
    margin-bottom: 16px;
}

.cps-big-number {
    font-size: 4rem;
    font-weight: 900;
    font-family: 'Inter', monospace;
    color: #00f2fe;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
}

.cps-unit {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.cps-total-clicks {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.cps-timer-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.cps-timer-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00d4ff, #7c3aed);
    border-radius: 3px;
}

.cps-click-zone {
    position: relative;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(124, 58, 237, 0.08));
    border: 2px dashed rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    overflow: hidden;
}

.cps-click-zone:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(124, 58, 237, 0.12));
}

.cps-click-zone.active {
    border-style: solid;
    border-color: rgba(0, 212, 255, 0.5);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(124, 58, 237, 0.15));
}

.cps-click-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.cps-ripple-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cps-ripple {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.4);
    animation: cpsRipple 0.5s ease forwards;
    transform: translate(-50%, -50%);
}

@keyframes cpsRipple {
    to {
        width: 40px;
        height: 40px;
        opacity: 0;
    }
}

.cps-best-score {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #ffc107;
}

/* ========================
   REACTION TIME TEST
   ======================== */
.reaction-arena {
    min-height: 400px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    user-select: none;
}

.reaction-arena[data-state="idle"] {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
    border: 2px solid rgba(0, 212, 255, 0.2);
}

.reaction-arena[data-state="waiting"] {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(192, 57, 43, 0.4));
    border: 2px solid rgba(231, 76, 60, 0.5);
}

.reaction-arena[data-state="ready"] {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.4), rgba(39, 174, 96, 0.5));
    border: 2px solid rgba(46, 204, 113, 0.6);
    animation: readyPulse 0.3s ease;
}

.reaction-arena[data-state="result"] {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(124, 58, 237, 0.15));
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.reaction-arena[data-state="tooearly"] {
    background: linear-gradient(135deg, rgba(255, 87, 87, 0.3), rgba(231, 76, 60, 0.4));
    border: 2px solid rgba(255, 87, 87, 0.5);
}

@keyframes readyPulse {
    0% {
        transform: scale(0.98);
    }

    50% {
        transform: scale(1.01);
    }

    100% {
        transform: scale(1);
    }
}

.reaction-display {
    text-align: center;
}

.reaction-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.reaction-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 8px;
}

.reaction-desc {
    opacity: 0.7;
    font-size: 0.9rem;
}

.reaction-time {
    margin-top: 12px;
}

.reaction-ms {
    font-size: 3.5rem;
    font-weight: 900;
    font-family: 'Inter', monospace;
    color: #00f2fe;
}

.reaction-unit {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
}

.reaction-time.hidden {
    display: none;
}

.reaction-history {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 12px;
}

.rx-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.reaction-avg {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #ffc107;
}

.reaction-avg.hidden {
    display: none;
}

/* ========================
   AD SLOT
   ======================== */
.ad-slot {
    margin: 2rem 0;
    padding: 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-placeholder {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* ========================
   SEO CONTENT
   ======================== */
.seo-content-section {
    margin-top: 2rem;
}

.seo-hero {
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.seo-hero h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #00d4ff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.seo-hero p {
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
}

.seo-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 1rem;
    background: linear-gradient(135deg, #00d4ff, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-card {
    padding: 1.5rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.feature-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #fff;
}

.feature-card p {
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* FAQ */
.faq-section {
    margin-bottom: 2rem;
}

.faq-item {
    margin-bottom: 8px;
    border-radius: 12px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.faq-item summary {
    padding: 14px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.9);
}

.faq-item summary::after {
    content: '▶';
    font-size: 0.7rem;
    transition: transform 0.3s;
    color: rgba(255, 255, 255, 0.4);
}

.faq-item[open] summary::after {
    transform: rotate(90deg);
}

.faq-item p {
    padding: 0 20px 14px;
    font-size: 0.88rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

/* Tips */
.tips-section {
    padding: 1.5rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.tips-section h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.tips-list {
    padding-left: 20px;
    margin: 0;
}

.tips-list li {
    font-size: 0.88rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 8px;
}

.tips-list li strong {
    color: rgba(255, 255, 255, 0.9);
}

/* ========================
   Light Mode
   ======================== */
body:not(.dark-mode) .mt-tab {
    color: #4a5568;
}

body:not(.dark-mode) .mt-tab.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(124, 58, 237, 0.2));
    color: #1a202c;
}

body:not(.dark-mode) .seo-hero p,
body:not(.dark-mode) .feature-card p,
body:not(.dark-mode) .faq-item p,
body:not(.dark-mode) .tips-list li {
    color: #4a5568;
}

body:not(.dark-mode) .feature-card h4 {
    color: #2d3748;
}

body:not(.dark-mode) .faq-item summary {
    color: #2d3748;
}

body:not(.dark-mode) .seo-section-title {
    background: linear-gradient(135deg, #2d3748, #4a5568);
    -webkit-background-clip: text;
    background-clip: text;
}

body:not(.dark-mode) .tips-list li strong {
    color: #2d3748;
}

body:not(.dark-mode) .counter-value {
    color: #2d3748;
}

body:not(.dark-mode) .game-stat-value {
    color: #2d3748;
}

body:not(.dark-mode) .cps-big-number {
    color: #2d3748;
}

/* Added light mode overrides */
body:not(.dark-mode) .tool-header h1,
body:not(.dark-mode) .card-title,
body:not(.dark-mode) .game-header .card-title {
    color: #1a202c;
}

body:not(.dark-mode) .tool-subtitle,
body:not(.dark-mode) .pos-label,
body:not(.dark-mode) .scroll-label,
body:not(.dark-mode) .counter-label,
body:not(.dark-mode) .log-time,
body:not(.dark-mode) .log-text {
    color: #4a5568;
}

body:not(.dark-mode) .mouse-visual-card,
body:not(.dark-mode) .info-card,
body:not(.dark-mode) .history-card,
body:not(.dark-mode) .game-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

body:not(.dark-mode) .pos-item,
body:not(.dark-mode) .counter-item,
body:not(.dark-mode) .scroll-item,
body:not(.dark-mode) .log-entry {
    background: #f7fafc;
    border-color: #e2e8f0;
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 768px) {
    .mouse-main-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .result-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-stats-bar {
        gap: 10px;
    }

    .game-arena {
        height: 350px;
    }

    .mt-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .click-counter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .mouse-3d-container {
        min-height: 320px;
    }

    .realistic-mouse {
        transform: scale(0.85);
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .click-counter-grid {
        grid-template-columns: 1fr;
    }

    .game-arena {
        height: 300px;
    }

    .cps-big-number {
        font-size: 3rem;
    }

    .reaction-ms {
        font-size: 2.5rem;
    }
}

/* ============================================
   LARGE DESKTOP RESPONSIVE - Match Header Width
   ============================================ */

/* Standard Laptop (1366-1919px) */
@media (min-width: 1366px) and (max-width: 1919px) {
    .mouse-tester-container {
        max-width: 1250px;
    }
}

/* Full HD Desktop (1920-2047px) */
@media (min-width: 1920px) and (max-width: 2047px) {
    .mouse-tester-container {
        max-width: 1500px;
    }

    .tool-header h1 {
        font-size: 1.7rem;
    }

    .mouse-3d-container {
        min-height: 420px;
    }
}

/* iMac Retina 4k 21.5" (2048x1152) */
@media (min-width: 2048px) and (max-width: 2239px) {
    .mouse-tester-container {
        max-width: 1650px;
    }

    .tool-header h1 {
        font-size: 1.8rem;
    }

    .tool-subtitle {
        font-size: 0.95rem;
    }

    .mouse-3d-container {
        min-height: 440px;
    }

    .counter-value {
        font-size: 1.5rem;
    }

    .pos-value {
        font-size: 1.1rem;
    }

    .mt-tab {
        font-size: 1rem;
        padding: 12px 20px;
    }

    .card-title {
        font-size: 1.15rem;
    }
}

/* iMac Retina 4.5k 24" (2240x1800) */
@media (min-width: 2240px) and (max-width: 2559px) {
    .mouse-tester-container {
        max-width: 1800px;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .tool-subtitle {
        font-size: 1rem;
    }

    .mouse-3d-container {
        min-height: 460px;
    }

    .counter-value {
        font-size: 1.6rem;
    }

    .pos-value {
        font-size: 1.15rem;
    }

    .mt-tab {
        font-size: 1.05rem;
        padding: 13px 22px;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .mouse-main-grid {
        gap: 2rem;
    }

    .diff-btn,
    .cps-dur-btn {
        font-size: 0.9rem;
        padding: 8px 20px;
    }

    .game-start-btn {
        font-size: 1rem;
        padding: 10px 28px;
    }
}

/* QHD Desktop / Desktop hidpi XL (2560x1440) */
@media (min-width: 2560px) and (max-width: 3199px) {
    .mouse-tester-container {
        max-width: 2000px;
    }

    .tool-header h1 {
        font-size: 2.2rem;
    }

    .tool-subtitle {
        font-size: 1.1rem;
    }

    .mouse-3d-container {
        min-height: 500px;
    }

    .realistic-mouse {
        width: 170px;
        height: 260px;
    }

    .counter-value {
        font-size: 1.8rem;
    }

    .pos-value {
        font-size: 1.2rem;
    }

    .mt-tab {
        font-size: 1.1rem;
        padding: 14px 24px;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .mouse-main-grid {
        gap: 2.5rem;
    }

    .game-start-btn {
        font-size: 1.1rem;
        padding: 12px 32px;
    }

    .game-arena {
        height: 500px;
    }

    .cps-big-number {
        font-size: 5rem;
    }

    .reaction-ms {
        font-size: 4.5rem;
    }
}

/* iMac pro Retina 5k 27" (3200x1800) */
@media (min-width: 3200px) and (max-width: 3839px) {
    .mouse-tester-container {
        max-width: 2400px;
    }

    .tool-header h1 {
        font-size: 2.5rem;
    }

    .tool-subtitle {
        font-size: 1.2rem;
    }

    .mouse-3d-container {
        min-height: 540px;
    }

    .realistic-mouse {
        width: 190px;
        height: 290px;
    }

    .counter-value {
        font-size: 2rem;
    }

    .mt-tab {
        font-size: 1.2rem;
        padding: 16px 28px;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .mouse-main-grid {
        gap: 3rem;
    }
}

/* Desktop 4K (3840x2160+) */
@media (min-width: 3840px) {
    .mouse-tester-container {
        max-width: 2800px;
    }

    .tool-header {
        padding: 1.8rem 2.5rem;
        border-radius: 22px;
    }

    .tool-header h1 {
        font-size: 2.8rem;
    }

    .tool-subtitle {
        font-size: 1.4rem;
    }

    .mouse-3d-container {
        min-height: 600px;
    }

    .realistic-mouse {
        width: 210px;
        height: 320px;
    }

    .counter-value {
        font-size: 2.2rem;
    }

    .mt-tab {
        font-size: 1.3rem;
        padding: 18px 32px;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .mouse-main-grid {
        gap: 3.5rem;
    }

    .game-arena {
        height: 600px;
    }

    .cps-big-number {
        font-size: 6rem;
    }

    .reaction-ms {
        font-size: 5.5rem;
    }
}

/* ========================
   Theme Architecture Updates (Light/Dark Mode Fixes)
   ======================== */

.mouse-visual-card,
.info-card,
.history-card,
.game-card,
.ad-slot,
.seo-hero,
.feature-card,
.faq-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.card-title,
.feature-card h4,
.cps-click-text,
.log-text,
.reaction-title,
.faq-item summary {
    color: var(--text-dark);
}

.click-instruction,
.counter-label,
.scroll-label,
.setting-label,
.gs-label,
.rs-label,
.cps-unit,
.cps-total-clicks,
.reaction-desc,
.reaction-unit,
.ad-placeholder,
.feature-card p,
.log-time,
.log-empty {
    color: var(--text-muted);
}

.game-overlay,
.game-result-overlay {
    color: #ffffff;
}

.game-overlay-content h3,
.game-result-content h3 {
    color: #ffffff;
}

/* Glass items like pos-item, counter-item */
.pos-item,
.counter-item,
.scroll-item,
.log-entry,
.icon-toggle-btn,
.game-stat-mini,
.result-stat,
.difficulty-select,
.size-select,
.game-settings-row {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* Base text elements */
.pos-label {
    color: var(--text-muted);
}
.pos-value,
.scroll-value {
    color: var(--primary-color);
}

.counter-value {
    color: var(--text-dark);
}
body.dark-mode .counter-value {
    color: #e8eaed;
}

/* Buttons and toggles text */
.diff-btn,
.cps-dur-btn,
.size-btn {
    color: var(--text-muted);
}
.diff-btn.active,
.cps-dur-btn.active,
.size-btn.active {
    color: #ffffff;
}

/* CPS and Reaction text */
.cps-big-number,
.reaction-ms {
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

/* Tab unselected text */
.mt-tab {
    color: var(--text-muted);
}
.mt-tab:hover {
    color: var(--text-dark);
    background: rgba(0, 0, 0, 0.05);
}
body.dark-mode .mt-tab:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Keeping mouse object text light, since its background is always dark gradient */
.btn-label,
.mouse-side-btn span,
.scroll-arrow {
    color: rgba(255, 255, 255, 0.4);
}
.mouse-btn.active .btn-label,
.mouse-side-btn.active span {
    color: #ffffff;
}
.scroll-arrow.glow {
    color: #00f2fe;
}
.scroll-arrow-down.glow {
    color: #f5576c;
}

/* Fullscreen mode needs specific text fixes */
.game-fullscreen .card-title,
.game-fullscreen .setting-label,
.game-fullscreen .gs-label,
.game-fullscreen .game-sub-hint {
    color: #ffffff;
}

/* Override icons outline */
.icon-toggle-btn, .fullscreen-btn, .clear-log-btn, .reset-all-btn {
    color: var(--text-dark);
}
body.dark-mode .icon-toggle-btn, body.dark-mode .fullscreen-btn {
    color: #e8eaed;
}

/* Small adjustments to ensure borders match the theme nicely */
.history-card, .game-card {
    box-shadow: var(--shadow-color) 0px 4px 12px;
}