.minigames-card {
    padding: 18px;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(13, 24, 66, 0.98) 0%, rgba(7, 16, 45, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.minigames-header {
    margin-bottom: 14px;
}

.minigames-title {
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.01em;
}

.minigames-subtitle {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

#minigamesWrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.minigame-box {
    padding: 16px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(21, 34, 86, 0.94) 0%, rgba(10, 20, 55, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.minigame-box-header {
    margin-bottom: 12px;
}

.minigame-name {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
}

.minigame-desc {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.minigame-status {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

#startMemoryBtn,
#tapChallengeTapBtn,
#tapChallengeClaimBtn,
#animalHuntStartBtn,
#animalHuntClaimBtn {
    width: 100%;
    min-height: 50px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 900;
    color: #1d1d1d;
    background: linear-gradient(180deg, #ffd84c 0%, #f0b90b 100%);
    box-shadow: 0 12px 24px rgba(240, 185, 11, 0.22);
    transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

#startMemoryBtn:hover,
#tapChallengeTapBtn:hover,
#tapChallengeClaimBtn:hover,
#animalHuntStartBtn:hover,
#animalHuntClaimBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(240, 185, 11, 0.26);
}

#startMemoryBtn:active,
#tapChallengeTapBtn:active,
#tapChallengeClaimBtn:active,
#animalHuntStartBtn:active,
#animalHuntClaimBtn:active {
    transform: scale(0.99);
}

#startMemoryBtn:disabled,
#tapChallengeTapBtn:disabled,
#tapChallengeClaimBtn:disabled,
#animalHuntStartBtn:disabled,
#animalHuntClaimBtn:disabled {
    cursor: not-allowed;
    box-shadow: none;
}

.memory-mode-bar {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.memory-mode-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.memory-mode-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.memory-mode-btn {
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.memory-mode-btn:hover {
    transform: translateY(-1px);
}

.memory-mode-btn.is-active {
    border-color: rgba(255, 216, 76, 0.85);
    background: linear-gradient(180deg, rgba(255, 216, 76, 0.22) 0%, rgba(240, 185, 11, 0.10) 100%);
    color: #fff3c4;
    box-shadow: 0 10px 20px rgba(240, 185, 11, 0.14);
}

.memory-mode-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.memory-hud {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.memory-stat-chip {
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.memory-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.62);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.memory-stat-value {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
}

.memory-grid,
.memory-grid-pro {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.memory-card-pro {
    position: relative;
    width: 100%;
    min-height: 92px;
    border: none;
    border-radius: 18px;
    background: transparent;
    cursor: pointer;
    padding: 0;
    perspective: 900px;
}

.memory-card-pro:disabled {
    cursor: default;
}

.memory-card-inner {
    position: relative;
    display: block;
    width: 100%;
    min-height: 92px;
    transform-style: preserve-3d;
    transition: transform 0.35s ease;
}

.memory-card-pro.is-flipped .memory-card-inner,
.memory-card-pro.is-matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    backface-visibility: hidden;
    font-size: 32px;
    font-weight: 900;
}

.memory-card-front {
    background:
        linear-gradient(180deg, rgba(29, 45, 109, 0.96) 0%, rgba(13, 24, 66, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 12px 22px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.memory-card-back {
    transform: rotateY(180deg);
    background:
        linear-gradient(180deg, rgba(255, 216, 76, 0.24) 0%, rgba(240, 185, 11, 0.14) 100%);
    border: 1px solid rgba(255, 216, 76, 0.32);
    color: #ffffff;
    box-shadow:
        0 12px 22px rgba(240, 185, 11, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.memory-card-pro.is-matched .memory-card-back {
    background:
        linear-gradient(180deg, rgba(84, 214, 120, 0.24) 0%, rgba(44, 163, 77, 0.12) 100%);
    border-color: rgba(84, 214, 120, 0.34);
    box-shadow:
        0 12px 22px rgba(44, 163, 77, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#tapChallengeHud,
#animalHuntHud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#tapChallengeHud > div,
#animalHuntHud > div {
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#tapChallengeResultBox,
#animalHuntResultBox {
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#animalHuntBoard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

#animalHuntBoard button {
    min-height: 86px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}

#animalHuntBoard button:hover {
    transform: translateY(-1px);
}

#animalHuntBoard button:active {
    transform: scale(0.97);
}

@media (max-width: 420px) {
    .minigames-card {
        padding: 14px;
        border-radius: 22px;
    }

    .minigame-box {
        padding: 14px;
        border-radius: 18px;
    }

    .memory-grid,
    .memory-grid-pro {
        gap: 8px;
    }

    .memory-card-pro,
    .memory-card-inner {
        min-height: 82px;
    }

    .memory-card-face {
        font-size: 28px;
    }

    #animalHuntBoard button {
        min-height: 76px;
        font-size: 26px !important;
    }

    #tapChallengeTapBtn,
    #animalHuntStartBtn {
        min-height: 54px;
        font-size: 16px !important;
    }
}