.game-popup,
.game-popup * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Launcher Button */
.game-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    /*background: linear-gradient(135deg, #ff6b6b, #ee5a24);*/
    background: #F47C2F;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(238, 90, 36, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.game-launcher:hover,
.game-launcher:focus {
    background: #F47C2F;
    box-shadow: 0 12px 35px rgba(238, 90, 36, 0.5);
    transform: scale(1.1);
}

.game-launcher .logo {
    /*font-size: 28px;*/
    margin-bottom: 2px;
}

.game-launcher .logo img {
    height: 32px;
}

.game-launcher .text {
    font-size: 10px;
    color: white;
    font-weight: 600;
}

/* Game Popup */
.game-popup {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 380px;
    height: 580px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    border: 2px solid #F47C2F;
}

.game-popup.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.game-header {
    /*background: linear-gradient(135deg, #e94560, #c73e54);*/
    background: #F47C2F;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-header h2 {
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-header h2 img {
    height: 24px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.close-btn:hover,
.close-btn:focus {
    background: rgba(255, 255, 255, 0.3);
}

/* Game Content */
.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
}

/* Name Input Screen */
.name-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.name-screen.active {
    display: flex;
}

.name-screen h3 {
    color: #F47C2F;
    font-size: 24px;
    margin-bottom: 10px;
}

.name-screen p {
    color: #a0a0a0;
    margin-bottom: 25px;
    font-size: 14px;
}

.name-input {
    width: 100%;
    max-width: 250px;
    padding: 15px 20px;
    border: 2px solid #e94560;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    text-align: center;
    outline: none;
    margin-bottom: 15px;
}

.name-input::placeholder {
    color: #888;
}

.start-btn {
    padding: 15px 40px;
    /*background: linear-gradient(135deg, #e94560, #c73e54);*/
    background: #F47C2F;
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover,
.start-btn:focus {
    background: #F47C2F;
    box-shadow: 0 8px 20px rgba(233, 69, 96, 0.4);
    transform: translateY(-2px);
}

/* Game Screen */
.game-screen {
    display: none;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.game-screen.active {
    display: flex;
}

/* Score Board */
.score-board {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px 15px;
    /*background: rgba(233, 69, 96, 0.1);*/
    background: rgba(244, 124, 47, 0.1);
    border-radius: 10px;
}

.score-item {
    text-align: center;
}

.score-item .label {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
}

.score-item .value {
    color: #F47C2F;
    font-size: 20px;
    font-weight: bold;
}

.player-name {
    color: #fff;
    font-size: 12px;
    text-align: center;
    margin-bottom: 10px;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 10px;
    margin: 0 auto;
}

.cell {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.2s ease;
    user-select: none;
    background-repeat: no-repeat;
    background-size: 100%;
}

.cell:hover {
    transform: scale(1.1);
}

.cell.selected {
    box-shadow: 0 0 0 3px #fff, 0 0 15px rgba(255, 255, 255, 0.5);
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.cell.matched {
    animation: matchPop 0.3s ease;
}

@keyframes matchPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(0); opacity: 0; }
}

.cell.falling {
    animation: fall 0.3s ease;
}

@keyframes fall {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Candy Colors */
/*.candy-red { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
.candy-blue { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.candy-green { background: linear-gradient(135deg, #55efc4, #00b894); }
.candy-yellow { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); }
.candy-purple { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.candy-orange { background: linear-gradient(135deg, #fab1a0, #e17055); }*/

/* Candy Icons */
.candy-red    { background-image: url('../images/match-youtube.png'); }
.candy-blue   { background-image: url('../images/match-facebook.png'); }
.candy-green  { background-image: url('../images/match-tiktok.png'); }
.candy-yellow { background-image: url('../images/match-linkedin.png'); }
.candy-purple { background-image: url('../images/match-instagram.png'); }
.candy-orange { background-image: url('../images/match-anomaly.png'); }

/* High Scores Screen */
.highscores-screen {
    display: none;
    flex-direction: column;
    height: 100%;
}

.highscores-screen.active {
    display: flex;
}

.highscores-screen h3 {
    color: #F47C2F;
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
}

.scores-list {
    flex: 1;
    overflow-y: auto;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.score-row:nth-child(1) {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.score-row:nth-child(2) {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1));
    border: 1px solid rgba(192, 192, 192, 0.3);
}

.score-row:nth-child(3) {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1));
    border: 1px solid rgba(205, 127, 50, 0.3);
}

.score-rank {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.score-rank.gold { background: #ffd700; color: #333; }
.score-rank.silver { background: #c0c0c0; color: #333; }
.score-rank.bronze { background: #cd7f32; }
.score-rank.normal { background: #444; }

.score-player {
    flex: 1;
    margin-left: 15px;
    color: white;
    font-size: 14px;
}

.score-points {
    color: #F47C2F;
    font-weight: bold;
    font-size: 16px;
}

/* Bottom Navigation */
.game-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.game-popup .game-nav .nav-link {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
    cursor: pointer;
}

.game-popup .game-nav .nav-link:hover,
.game-popup .game-nav .nav-link.active {
    color: #F47C2F;
}

/* Combo Text */
.combo-text {
    position: absolute;
    color: #ffd700;
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
    animation: comboFloat 1s ease forwards;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

@keyframes comboFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.2);
    }
}

.game-area {
    position: relative;
}

.game-over {
    background: rgba(18, 7, 0, 0.8);
    display: none;
    height: 100%;
    width: 100%;

    position: absolute;
    top: 0;
    left: 0;
}
.game-over.active {
    display: block;
}

/* Responsive */
@media (max-width: 480px) {
    .game-popup {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        bottom: 100px;
    }

    .cell {
        width: calc((100vw - 130px) / 8);
        height: calc((100vw - 130px) / 8);
        font-size: 18px;
    }
}