@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Rubik:wght@400;500;700&display=swap');

:root {
    --sky-top: #69A8FF;
    --sky-bottom: #A8D4FF;
    --grass-top: #5D9C33;
    --dirt-brown: #79553A;
    --overworld-bg: #3B7D2C;
    --cave-stone: #2B2D30;
    --cave-deep: #18191C;
    --diamond: #4EE2EC;
    --gold-ingot: #FCEE4B;
    --emerald: #17DD62;
    --redstone: #FF3333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #1A1C1E;
    color: #FFFFFF;
    font-family: 'Rubik', sans-serif;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.mobile-viewport {
    width: 100%;
    max-width: 440px;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow-x: hidden;
}

.pixel-font {
    font-family: 'Press Start 2P', monospace;
    line-height: 1.45;
}

/* =========================================================
   PANTALLA INICIAL: COFRE DE MINECRAFT INTERACTIVO
   ========================================================= */
.chest-screen {
    position: fixed;
    inset: 0;
    max-width: 440px;
    margin: 0 auto;
    background: radial-gradient(circle at center, #3A3F47 0%, #16181B 100%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.chest-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mc-chest {
    width: 170px;
    height: 150px;
    position: relative;
    cursor: pointer;
    margin: 2rem 0;
    transition: transform 0.2s;
}

.mc-chest:active {
    transform: scale(0.95);
}

/* Tapa del cofre */
.chest-lid {
    width: 100%;
    height: 52px;
    background: linear-gradient(to bottom, #B67B35 0%, #9A6324 100%);
    border: 5px solid #2A1B0A;
    border-bottom: 4px solid #1E1306;
    border-radius: 4px 4px 0 0;
    position: relative;
    transform-origin: top center;
    transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
}

.mc-chest.open .chest-lid {
    transform: translateY(-22px) rotateX(45deg);
}

/* Resplandor interior al abrir */
.chest-glow {
    position: absolute;
    top: 42px;
    left: 10px;
    right: 10px;
    height: 20px;
    background: #FFF59D;
    box-shadow: 0 0 30px 15px rgba(252, 238, 75, 0.85);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.mc-chest.open .chest-glow {
    opacity: 1;
}

/* Base del cofre */
.chest-base {
    width: 100%;
    height: 98px;
    background: repeating-linear-gradient(
        to bottom,
        #9E6627 0px,
        #9E6627 22px,
        #7B4C18 22px,
        #7B4C18 26px
    );
    border: 5px solid #2A1B0A;
    border-top: none;
    border-radius: 0 0 4px 4px;
    position: relative;
    z-index: 1;
}

/* Broche metálico del cofre */
.chest-latch {
    width: 24px;
    height: 32px;
    background: #D0D5DD;
    border: 4px solid #2A1B0A;
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: inset -3px -3px 0 #8E959E;
}

/* Botón Música */
.music-toggle {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 90;
    width: 48px;
    height: 48px;
    background: #3B7D2C;
    border: 4px solid #1B3B13;
    box-shadow: inset -3px -3px 0 #26541B, 0 4px 10px rgba(0,0,0,0.4);
    color: #FFF;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   SECCIÓN 1: BIOMA CIELO DE MINECRAFT (PORTADA)
   ========================================================= */
.biome-sky {
    background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-bottom) 100%);
    padding: 3rem 1.4rem 3.5rem 1.4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Nubes cuadradas animadas */
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 0 rgba(200, 222, 245, 0.8);
    animation: floatClouds 28s linear infinite;
}
.cloud-1 { width: 110px; height: 28px; top: 30px; left: -120px; }
.cloud-2 { width: 140px; height: 32px; top: 95px; left: -160px; animation-delay: -12s; }
.cloud-3 { width: 85px; height: 24px; top: 165px; left: -100px; animation-delay: -20s; }

@keyframes floatClouds {
    0% { transform: translateX(0); }
    100% { transform: translateX(620px); }
}

.mc-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.55);
    border: 3px solid #FFF;
    padding: 0.55rem 0.9rem;
    font-size: 0.65rem;
    color: var(--gold-ingot);
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 2;
}

.matias-title {
    font-size: 2.1rem;
    color: #FFFFFF;
    text-shadow: 4px 4px 0 #1E3A5F;
    margin: 0.5rem 0;
    position: relative;
    z-index: 2;
}

.level-up-pill {
    display: inline-block;
    background: var(--emerald);
    color: #0B3D1B;
    border: 3px solid #0B3D1B;
    padding: 0.5rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 0.8rem;
    box-shadow: inset -3px -3px 0 #0EA648;
    position: relative;
    z-index: 2;
}

/* Barra de experiencia */
.xp-bar-container {
    width: 85%;
    height: 14px;
    background: #1B2A1E;
    border: 3px solid #000;
    margin: 1.5rem auto 0 auto;
    position: relative;
    z-index: 2;
}
.xp-bar-fill {
    width: 70%;
    height: 100%;
    background: repeating-linear-gradient(90deg, #7CFC00 0px, #7CFC00 14px, #55B800 14px, #55B800 16px);
}

/* Borde de transición: Bloque de Césped */
.grass-divider {
    height: 28px;
    background: repeating-linear-gradient(
        90deg,
        #5D9C33 0px, #5D9C33 24px,
        #4F882A 24px, #4F882A 48px
    );
    border-top: 4px solid #74BD42;
    border-bottom: 6px solid #4A3321;
}

/* =========================================================
   SECCIÓN 2: BIOMA OVERWORLD (AVENTURA Y ATRACCIONES)
   ========================================================= */
.biome-overworld {
    background: linear-gradient(to bottom, #4C8C34 0%, #386B25 100%);
    padding: 2.8rem 1.4rem 3.5rem 1.4rem;
    text-align: center;
}

.mc-panel {
    background: #C6C6C6;
    color: #222222;
    border: 4px solid #000000;
    box-shadow: inset 4px 4px 0 #FFFFFF, inset -4px -4px 0 #555555;
    padding: 1.5rem 1.1rem;
    margin-bottom: 1.6rem;
}

.section-heading {
    font-size: 1rem;
    color: #FFF;
    text-shadow: 3px 3px 0 #1C3812;
    margin-bottom: 1.2rem;
}

/* Contador estilo Redstone / Diamante */
.countdown-mc {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
    margin-top: 1rem;
}

.slot-box {
    background: #8B8B8B;
    border: 3px solid #373737;
    box-shadow: inset 3px 3px 0 #555555, inset -2px -2px 0 #FFF;
    padding: 0.7rem 0.2rem;
    color: #FFF;
}

.slot-num {
    display: block;
    font-size: 1.05rem;
    color: var(--gold-ingot);
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 0.35rem;
}

.slot-lbl {
    font-size: 0.55rem;
    text-transform: uppercase;
}

/* Inventario de Atracciones (Pizza, Payasos, Pastel, Trampolín) */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.inv-slot {
    background: #8B8B8B;
    border: 3px solid #373737;
    box-shadow: inset 3px 3px 0 #555, inset -2px -2px 0 #DDD;
    padding: 1rem 0.6rem;
    color: #FFF;
    text-align: center;
}

.inv-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.45rem;
    filter: drop-shadow(2px 2px 0 #000);
}

.inv-title {
    font-size: 0.68rem;
    color: var(--gold-ingot);
    text-shadow: 1.5px 1.5px 0 #000;
    margin-bottom: 0.3rem;
}

.inv-desc {
    font-size: 0.75rem;
    color: #F2F2F2;
    line-height: 1.3;
}

.btn-mc {
    display: inline-block;
    background: #5D9C33;
    color: #FFF;
    text-decoration: none;
    padding: 0.85rem 1.2rem;
    border: 3px solid #000;
    box-shadow: inset 3px 3px 0 #7EC84B, inset -3px -3px 0 #39661C;
    font-size: 0.68rem;
    text-shadow: 2px 2px 0 #1E380E;
    margin-top: 0.9rem;
    cursor: pointer;
}

.btn-mc:active {
    box-shadow: inset 3px 3px 0 #39661C;
    transform: translateY(2px);
}

/* Transición Tierra -> Piedra de Cueva */
.stone-divider {
    height: 24px;
    background: repeating-linear-gradient(
        90deg,
        #6E6E6E 0px, #6E6E6E 20px,
        #585858 20px, #585858 40px
    );
    border-top: 4px solid #888888;
    border-bottom: 4px solid #222222;
}

/* =========================================================
   SECCIÓN 3: BIOMA DE CUEVAS (CONFIRMACIÓN RSVP)
   ========================================================= */
.biome-caves {
    background: radial-gradient(circle at top right, #36393F 0%, var(--cave-deep) 100%);
    padding: 3rem 1.4rem 3.5rem 1.4rem;
    text-align: center;
    position: relative;
}

/* Cristales de Diamante y Redstone decorativos */
.ore-badge {
    display: inline-block;
    background: #111214;
    border: 3px solid var(--diamond);
    color: var(--diamond);
    padding: 0.45rem 0.9rem;
    font-size: 0.62rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(78, 226, 236, 0.3);
}

.rsvp-mc-box {
    background: #232529;
    border: 4px solid #000;
    box-shadow: inset 3px 3px 0 #3D4148, inset -3px -3px 0 #121315;
    padding: 1.6rem 1.2rem;
    text-align: left;
}

.field {
    margin-bottom: 1.1rem;
}

.field label {
    display: block;
    font-size: 0.65rem;
    color: #CCCCCC;
    margin-bottom: 0.45rem;
}

.input-mc {
    width: 100%;
    padding: 0.85rem;
    background: #0F1012;
    border: 3px solid #555;
    color: #FFF;
    font-family: 'Rubik', sans-serif;
    font-size: 0.92rem;
}

.input-mc:focus {
    outline: none;
    border-color: var(--diamond);
}

.btn-diamond {
    width: 100%;
    padding: 1rem;
    background: #2CC5D0;
    color: #072A2E;
    border: 3px solid #000;
    box-shadow: inset 3px 3px 0 #7BF3FC, inset -3px -3px 0 #19868E;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.4rem;
}

.btn-diamond:active {
    transform: translateY(2px);
}

.feedback-mc {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: #122918;
    border: 3px solid var(--emerald);
    color: #A8FFBE;
    font-size: 0.82rem;
    line-height: 1.5;
}

footer {
    background: #0D0E10;
    padding: 1.8rem 1rem;
    text-align: center;
    font-size: 0.65rem;
    color: #888;
    border-top: 4px solid #000;
}