/* =====================================================
   game-layout.css
   Layout responsif portrait — Tema: Hijau Cerah + Pixel Font
   
   CARA PAKAI di file PHP baru:
     <link rel="stylesheet" href="assets/css/game-layout.css">

   Gunakan struktur HTML ini:
     <div id="desktop-wrapper">
       <div id="mobile-frame">
         <div id="status-bar">...</div>
         <div id="game-container"></div>
       </div>
     </div>
===================================================== */

/* ----- Google Fonts: pixel game fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Pixelify+Sans:wght@400;500;600;700&display=swap');



/* ----- Reset & No Scroll ----- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    background: #bbf7d0;
    font-family: 'Press Start 2P', monospace;
    user-select: none;
    -webkit-user-select: none;
}

/* ----- Desktop wrapper: pusatkan frame mobile ----- */
#desktop-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(34, 197, 94, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(74, 222, 128, 0.12) 0%, transparent 60%),
        #bbf7d0;
}

/* ----- Frame Mobile ----- */
#mobile-frame {
    position: relative;

    /* Mobile: full-screen */
    width: 100vw;
    height: 100vh;

    background: #f0fdf4;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Desktop: tampil seperti ponsel portrait */
@media (min-width: 600px) {
    #mobile-frame {
        width: 360px;
        height: 760px;
        border-radius: 36px;
        box-shadow:
            0 0 0 2px #86efac,
            0 0 0 6px #bbf7d0,
            0 28px 72px rgba(21, 128, 61, 0.22),
            0 0 50px rgba(34, 197, 94, 0.18);
    }

    /* Notch / pill atas */
    #mobile-frame::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 88px;
        height: 24px;
        background: #bbf7d0;
        border-radius: 16px;
        z-index: 100;
    }
}

/* ----- Game Canvas Container ----- */
#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    flex: 1;
}

#game-container canvas {
    display: block;
    border-radius: 12px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ----- Status Bar (desktop only) ----- */
#status-bar {
    display: none;
}

@media (min-width: 600px) {
    #status-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 22px 0;
        height: 40px;
        font-size: 8px;
        font-weight: normal;
        font-family: 'Press Start 2P', monospace;
        color: rgba(21, 128, 61, 0.6);
        letter-spacing: 0.5px;
        pointer-events: none;
        flex-shrink: 0;
    }
}

/* ----- Fullscreen Confirmation Modal ----- */
#fullscreen-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 78, 59, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#fullscreen-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.fullscreen-modal-card {
    background: #f0fdf4;
    border: 4px solid #15803d;
    box-shadow: 6px 6px 0px rgba(21, 128, 61, 0.25);
    border-radius: 16px;
    width: 90%;
    max-width: 320px;
    padding: 24px 20px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Pixelify Sans', monospace;
}

#fullscreen-modal-overlay.show .fullscreen-modal-card {
    transform: scale(1);
}

.fullscreen-modal-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    color: #15803d;
    margin-bottom: 16px;
    line-height: 1.5;
}

.fullscreen-modal-body {
    font-size: 14px;
    color: #166534;
    margin-bottom: 24px;
    line-height: 1.6;
    font-weight: 600;
}

.fullscreen-modal-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.fullscreen-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    border: 3px solid;
    cursor: pointer;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.08s ease;
    width: 100px;
}

.fullscreen-btn:active {
    transform: translate(2px, 2px);
}

.fullscreen-btn-yes {
    background: #22c55e;
    color: #ffffff;
    border-color: #15803d;
    box-shadow: 3px 3px 0px #15803d;
}

.fullscreen-btn-yes:active {
    box-shadow: 1px 1px 0px #15803d;
}

.fullscreen-btn-no {
    background: #ef4444;
    color: #ffffff;
    border-color: #991b1b;
    box-shadow: 3px 3px 0px #991b1b;
}

.fullscreen-btn-no:active {
    box-shadow: 1px 1px 0px #991b1b;
}