/* =============================================
   🌻 PLANTS VS ZOMBIES TẾT - STYLES
   ============================================= */

:root {
    --primary-red: #dc2626;
    --primary-gold: #fbbf24;
    --bg-gradient: linear-gradient(135deg, #166534 0%, #15803d 50%, #22c55e 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --overlay-bg: rgba(0, 0, 0, 0.85);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Baloo 2', cursive, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ HEADER - BRUTALIST STYLE ============ */
.game-header.brutalist {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #1e1b4b 0%, #2e1065 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-bottom: 4px solid #bef264;
    min-height: 70px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-link {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.1);
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 0 #f472b6);
}

.logo-link-center {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo-link-center:hover {
    transform: scale(1.05);
}

.logo-center {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(3px 3px 0 #f472b6);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0d0d1a;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: #bef264;
    border: 2px solid #bef264;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    font-size: 0.85rem;
    box-shadow: 4px 4px 0 #f472b6;
    transition: all 0.2s ease;
}

.back-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #f472b6;
}

.back-arrow {
    font-weight: bold;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.game-title {
    font-family: 'Baloo 2', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    text-shadow: 3px 3px 0 #f472b6;
}

.vs-text {
    font-size: 1.2rem;
    color: #f472b6;
    padding: 0 0.5rem;
    text-shadow: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 1rem;
    background: #1e1b4b;
    border: 2px solid #bef264;
}

.stat-label {
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #bef264;
    letter-spacing: 0.1em;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.stat-box.lixi .stat-value {
    color: #fbbf24;
}

.stat-box.wave .stat-value {
    color: #38bdf8;
}

.fullscreen-btn.brutalist {
    background: #f472b6;
    color: #0d0d1a;
    border: 2px solid #f472b6;
    font-size: 1.3rem;
    padding: 0.5rem 0.7rem;
    box-shadow: 4px 4px 0 #bef264;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fullscreen-btn.brutalist:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #bef264;
}

/* Keep old header styles for backwards compatibility */
.game-header:not(.brutalist) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    color: white;
    box-shadow: var(--shadow);
}

.game-header:not(.brutalist) h1 {
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 1.2rem;
}

.header-stats span {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.lixi-count {
    color: var(--primary-gold);
    font-weight: bold;
}

/* ============ GAME CONTAINER - BRUTALIST ============ */
.game-container {
    display: flex;
    gap: 0;
    padding: 0;
    max-width: 100%;
    margin: 0 auto;
    background: #0d0d1a;
}

/* ============ PLANT TOOLBAR - BRUTALIST ============ */
.plant-toolbar {
    width: 80px;
    background: rgba(30, 27, 75, 0.9);
    border-right: 4px solid #bef264;
    padding: 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.plant-toolbar h3 {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    text-align: center;
    color: #bef264;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-weight: bold;
}

.plant-cards {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    align-items: center;
}

.plant-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    width: 60px;
    height: 72px;
    background: rgba(30, 27, 75, 0.8);
    border: 2px solid #bef264;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    gap: 0.15rem;
}

.plant-card:hover {
    background: #bef264;
    transform: translate(2px, 2px);
}

.plant-card:hover img {
    filter: brightness(0) saturate(100%);
}

.plant-card.selected {
    background: #bef264;
    box-shadow: 4px 4px 0 #f472b6;
}

.plant-card.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(190, 242, 100, 0.3);
}

.plant-card img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.plant-name {
    display: none;
}

.plant-cost {
    font-size: 0.6rem;
    color: #fbbf24;
    font-weight: bold;
    white-space: nowrap;
}

.shovel-btn {
    width: 55px;
    height: 55px;
    margin-top: auto;
    padding: 0;
    background: #f472b6;
    color: #0d0d1a;
    border: none;
    font-size: 1.5rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shovel-btn:hover {
    background: #bef264;
    transform: translate(2px, 2px);
}

.shovel-btn.active {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

/* ============ GAME AREA - BRUTALIST ============ */
.game-area {
    position: relative;
    flex: 1;
    padding: 1rem;
    background: #0d0d1a;
}

#game-canvas {
    display: block;
    background: url('../img/pvz/background/lawn.png') center center no-repeat;
    background-size: 100% 100%;
    border: 4px solid #bef264;
    box-shadow: 8px 8px 0 #f472b6;
    cursor: crosshair;
}

/* ============ OVERLAYS - BRUTALIST ============ */
.overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: auto;
    height: auto;
    background: rgba(13, 13, 26, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 2.5rem 4rem;
    background: linear-gradient(135deg, #1e1b4b, #2e1065);
    border: 4px solid #bef264;
    box-shadow: 8px 8px 0 #f472b6;
}

.overlay-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 3px 3px 0 #f472b6;
}

.overlay-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.overlay-content.win {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.9), rgba(202, 138, 4, 0.9));
}

.overlay-content.win .reward {
    font-size: 1.5rem;
    color: #fef3c7;
    font-weight: bold;
    animation: pulse 1s ease infinite;
}

.overlay-content.lose {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.9), rgba(153, 27, 27, 0.9));
}

.lose-tip {
    font-size: 1rem;
    color: #fecaca;
    margin-top: 0.5rem;
}

/* ============ MEME IMAGES ============ */
.meme-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ============ LEVEL SELECTOR ============ */
.level-selector {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.level-selector h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #fef3c7;
}

.level-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.level-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid transparent;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
    font-family: inherit;
}

.level-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.level-btn.selected {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.3);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.level-icon {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.level-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.level-waves {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ============ FULLSCREEN BUTTON ============ */
.fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ============ OVERLAY BUTTONS ============ */
.overlay-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ============ LEVEL DISPLAY ============ */
.level-display {
    color: #fbbf24;
    font-weight: bold;
}

/* ============ FULLSCREEN MODE ============ */
.game-container:fullscreen,
.game-container:-webkit-full-screen {
    background: var(--bg-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.game-container:fullscreen .game-area,
.game-container:-webkit-full-screen .game-area {
    max-width: 100%;
    max-height: 100%;
}

.game-container:fullscreen #game-canvas,
.game-container:-webkit-full-screen #game-canvas {
    max-height: 80vh;
    width: auto;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.1);
    }
}

.action-btn.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.action-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: bold;
    color: #0d0d1a;
    background: #f472b6;
    border: 4px solid #f472b6;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 6px 6px 0 #bef264;
}

.action-btn:hover {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 #bef264;
}

.action-btn.secondary {
    background: #bef264;
    border-color: #bef264;
    box-shadow: 6px 6px 0 #f472b6;
}

.action-btn.secondary:hover {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 #f472b6;
}

/* ============ GAME CONTROLS - BRUTALIST ============ */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: #0d0d1a;
    border-top: 4px solid #f472b6;
}

.control-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: bold;
    color: white;
    background: transparent;
    border: 2px solid white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: white;
    color: #0d0d1a;
}

.game-info {
    display: flex;
    gap: 2rem;
    color: white;
    font-size: 0.9rem;
}

.game-info span {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
}

.level-display {
    background: #bef264;
    color: #0d0d1a;
    padding: 0.3rem 0.8rem;
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.level-display::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #0d0d1a;
    border-radius: 50%;
    animation: pulse 1s ease infinite;
}

/* ============ FLOATING LIXI ============ */
#lixi-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200;
}

.floating-lixi {
    position: absolute;
    width: 50px;
    height: 50px;
    animation: float-lixi 2s ease-in-out forwards;
    pointer-events: auto;
    cursor: pointer;
}

.floating-lixi img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.8));
}

@keyframes float-lixi {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.5);
    }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .game-container {
        flex-direction: column;
    }

    .plant-toolbar {
        width: 100%;
        flex-direction: row;
    }

    .plant-cards {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .plant-card {
        width: 100px;
    }

    #game-canvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 600px) {
    .game-header {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.8rem;
    }

    .game-header h1 {
        font-size: 1.3rem;
    }

    .header-stats {
        font-size: 1rem;
    }

    .plant-card img {
        width: 45px;
        height: 45px;
    }

    .overlay-content h2 {
        font-size: 1.8rem;
    }

    .action-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}