.cat-match-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 40px;
    min-height: 70vh;
}

.cat-match-wrapper h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #524C45;
    margin-bottom: 5px;
    font-size: 2rem;
}

.cat-match-wrapper .subtitle {
    font-family: 'Poppins', sans-serif;
    color: #A29A90;
    margin-bottom: 14px;
    font-size: 1rem;
}

/* Mode tabs */
.mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-radius: 25px;
    overflow: hidden;
    border: 2px solid #F6A32D;
}

.mode-tab {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 22px;
    border: none;
    cursor: pointer;
    background: #fff;
    color: #F6A32D;
    transition: all 0.2s ease;
}

.mode-tab.active {
    background: #F6A32D;
    color: #fff;
}

.mode-tab:hover:not(.active) {
    background: #FFF3DC;
}

.daily-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    color: #E74C8B;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
}

/* Stats bar */
.game-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    font-family: 'Poppins', sans-serif;
}

.game-stats .stat {
    text-align: center;
}

.game-stats .stat-label {
    font-size: 0.75rem;
    color: #A29A90;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-stats .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #F6A32D;
}

.game-stats .stat-value-best {
    color: #E74C8B;
}

.streak-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.streak-value {
    display: flex;
    align-items: center;
    gap: 2px;
}

.streak-flame {
    font-size: 1.4rem;
}

.bonus-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bonus-value {
    color: #8E5AE0;
}

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% - 20px);
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    padding: 8px 10px;
    background: #4A3F35;
    color: #FFF9F0;
    font-size: 0.75rem;
    line-height: 1.35;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 20;
    pointer-events: none;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 26px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #4A3F35;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 20;
    pointer-events: none;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Board */
.game-board-container {
    position: relative;
    border-radius: 16px;
    background: #FFF9F0;
    box-shadow: 0 4px 20px rgba(82, 76, 69, 0.12);
    padding: 12px;
    touch-action: none;
}

#gameCanvas {
    display: block;
    border-radius: 10px;
    cursor: pointer;
}

/* Controls */
.game-controls {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.game-controls button {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    padding: 10px 28px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-new-game {
    background: #F6A32D;
    color: #fff;
}

.btn-new-game:hover {
    background: #e5931c;
    transform: translateY(-1px);
}

/* Game Over overlay */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 249, 240, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.game-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.game-overlay h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #524C45;
    font-size: 1.6rem;
    margin-bottom: 2px;
}

.stars-display {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: 4px;
}

.game-overlay .final-score {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: #F6A32D;
    margin-bottom: 6px;
    line-height: 1.1;
}

.new-best-badge {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #E74C8B, #F6A32D);
    padding: 4px 18px;
    border-radius: 20px;
    margin-bottom: 12px;
    animation: bestPulse 0.6s ease-in-out infinite alternate;
}

@keyframes bestPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.game-overlay button {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    padding: 10px 28px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    background: #F6A32D;
    color: #fff;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.game-overlay button:hover {
    background: #e5931c;
}

/* Combo popup */
.combo-popup {
    position: absolute;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: #fff;
    background: linear-gradient(135deg, #F6A32D, #E74C8B);
    padding: 8px 22px;
    border-radius: 30px;
    pointer-events: none;
    animation: comboFloat 1.2s ease-out forwards;
    text-shadow: 0 2px 4px rgba(0,0,0,0.25);
    box-shadow: 0 4px 15px rgba(246, 163, 45, 0.5);
    z-index: 10;
    white-space: nowrap;
}

@keyframes comboFloat {
    0% { opacity: 0; transform: translateX(-50%) translateY(0) scale(0.5); }
    15% { opacity: 1; transform: translateX(-50%) translateY(-5px) scale(1.1); }
    30% { transform: translateX(-50%) translateY(-10px) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(1.2); }
}

/* Legend */
.game-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: #A29A90;
}

.game-legend span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.special-legend {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #B8AFA5;
}

/* Daily submit in overlay */
.daily-submit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.nickname-input {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    padding: 8px 16px;
    border: 2px solid #F6A32D;
    border-radius: 25px;
    outline: none;
    text-align: center;
    width: 180px;
    transition: border-color 0.2s;
}

.nickname-input:focus {
    border-color: #E74C8B;
}

.btn-submit-score {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 22px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #F6A32D, #E74C8B);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-submit-score:hover {
    transform: translateY(-1px);
}

.btn-submit-score:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.submit-status {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    color: #A29A90;
    min-height: 1.2em;
}

/* Leaderboard */
.daily-leaderboard {
    width: 100%;
    max-width: 400px;
    margin-top: 24px;
}

.daily-leaderboard h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #524C45;
    text-align: center;
    margin-bottom: 12px;
}

.leaderboard-list {
    background: #FFF9F0;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(82, 76, 69, 0.1);
    overflow: hidden;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(210, 180, 140, 0.2);
    transition: background 0.15s;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row:hover {
    background: #FFF3DC;
}

.leaderboard-row.top-1 {
    background: linear-gradient(135deg, rgba(246, 163, 45, 0.12), rgba(231, 76, 139, 0.08));
}

.leaderboard-rank {
    width: 32px;
    font-weight: 700;
    color: #A29A90;
    flex-shrink: 0;
}

.leaderboard-row.top-1 .leaderboard-rank { color: #F6A32D; font-size: 1.1rem; }
.leaderboard-row.top-2 .leaderboard-rank { color: #A0A0A0; }
.leaderboard-row.top-3 .leaderboard-rank { color: #CD7F32; }

.leaderboard-name {
    flex: 1;
    color: #524C45;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-stars {
    width: 70px;
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.leaderboard-score {
    width: 60px;
    text-align: right;
    font-weight: 700;
    color: #F6A32D;
}

.leaderboard-empty {
    text-align: center;
    padding: 20px;
    color: #A29A90;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

/* Banked power-up badge */
.banked-badge {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    background: linear-gradient(135deg, #3498DB, #9B59B6);
    padding: 4px 16px;
    border-radius: 20px;
    margin-bottom: 10px;
    animation: bestPulse 0.6s ease-in-out infinite alternate;
}

/* Banked power-up toast (on board) */
.banked-toast {
    position: absolute;
    left: 50%;
    top: 12%;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(135deg, #3498DB, #9B59B6);
    padding: 8px 20px;
    border-radius: 30px;
    pointer-events: none;
    animation: comboFloat 1.8s ease-out forwards;
    text-shadow: 0 2px 4px rgba(0,0,0,0.25);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
    z-index: 10;
    white-space: nowrap;
}

/* Cat Skins */
.skin-section {
    width: 100%;
    max-width: 460px;
    margin-top: 24px;
    text-align: center;
}

.skin-section h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #524C45;
    margin-bottom: 12px;
}

.skin-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.skin-option {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #FFF9F0;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 10px 14px;
    min-width: 92px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(82, 76, 69, 0.1);
    transition: all 0.2s ease;
}

.skin-option:hover:not(.locked) {
    transform: translateY(-2px);
    border-color: #F6A32D;
}

.skin-option.active {
    border-color: #F6A32D;
    background: #FFF3DC;
}

.skin-option.locked {
    opacity: 0.55;
    cursor: default;
}

.skin-preview {
    font-size: 1.3rem;
    letter-spacing: 2px;
}

.skin-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #524C45;
}

.skin-req {
    font-size: 0.65rem;
    color: #A29A90;
}

/* Responsive */
@media (max-width: 500px) {
    .cat-match-wrapper h1 {
        font-size: 1.5rem;
    }
    .game-stats {
        gap: 16px;
    }
    .game-stats .stat-value {
        font-size: 1.4rem;
    }
    .game-board-container {
        padding: 8px;
    }
    .mode-tab {
        padding: 6px 16px;
        font-size: 0.82rem;
    }
    .combo-popup {
        font-size: 1.4rem;
        padding: 6px 16px;
    }
    .stars-display {
        font-size: 2.2rem;
    }
}
