/* Picture Puzzle UI - Master Corrected (v4.7.5) 
   COMPLETE UNIFIED STYLES: [LOGIN] + [PUZZLE] + [FRAMES] + [OVERLAYS] */

:root {
    --accent-blue: #22d3ee;
    --accent-cool: #06b6d4;
    --accent-pink: #06b6d4; /* Changed to Blue for Eyecool theme */
    --bg-dark: #020617;
    --phone-width: 375px;
    --phone-height: 812px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body,
html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
    touch-action: none;
    font-family: 'Outfit', 'Jua', sans-serif;
}

#game-container {
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
    position: relative;
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: none !important;
}

/* ✨ Background Decorations */
#bg-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-particle {
    position: absolute;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.15;
    filter: blur(1px);
    animation: floatParticle 20s infinite linear;
}

@keyframes floatParticle {
    0% { transform: translateY(110vh) rotate(0deg); }
    100% { transform: translateY(-20vh) rotate(360deg); }
}

@media (min-width: 701px) {
    #game-container {
        width: var(--phone-width);
        height: var(--phone-height);
        max-height: 95vh;
        border-radius: 40px;
        border: 12px solid #1e293b;
        box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
        margin: auto;
    }
}

.mode-section {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.mode-section.active {
    display: flex !important;
}

/* 🔑 --- RESTORED PREMIUM LOGIN SCREEN --- */
.premium-login-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 40%, #1e293b 0%, #020617 100%);
}

.login-card-fixed {
    width: 90%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 36px;
    padding: 40px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.start-logo-long {
    width: 220px;
    margin-bottom: 30px;
}

.unified-nickname-input {
    width: 100%;
    padding: 15px;
    border-radius: 14px;
    border: 1px solid #334155;
    background: #000;
    color: white;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.start-btn-primary-3d {
    width: 100%;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    color: white;
    font-weight: 1000;
    border: none;
    font-size: 1.4rem;
    box-shadow: 0 8px 0 #0e7490;
    margin-bottom: 20px;
    cursor: pointer;
}

.login-button-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.login-btn-3d {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    background: #1e293b;
    color: white;
    border: none;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 0 #0f172a;
    cursor: pointer;
}

/* 🧩 --- ONE-ROW HEADER --- */
.puzzle-header-modern {
    height: clamp(70px, 10vh, 90px);
    padding: 0 12px;
    background: #0f172a;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    flex-shrink: 0;
}

.hud-left,
.hud-right {
    display: flex;
    gap: 6px;
    align-items: center;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.puzzle-header-modern img {
    height: 35px !important;
    width: auto !important;
    object-fit: contain !important;
}

#stage-display {
    color: #22d3ee;
    font-size: 0.9rem;
    font-weight: 1000;
}

.icon-btn-tetris {
    width: 44px;
    height: 44px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.icon-btn-tetris:active {
    transform: scale(0.9);
}

.header-ico-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 🔑 --- OVERLAYS & CARDS --- */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000000 !important;
}

.overlay.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1000000 !important;
}

.card.glass {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 32px;
    padding: 30px;
    width: 85%;
    max-width: 320px;
    text-align: center;
}

.card-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 20px;
}

/* 🖼️ --- FRAMES --- */
#board-wrapper {
    position: relative;
    padding: 10px;
    border-radius: 20px;
    z-index: 10;
}

.frame-gold {
    background: linear-gradient(135deg, #fbbf24, #d97706);
}

.frame-glass {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.frame-wood {
    background: #78350f;
    border: 4px solid #451a03;
}

.frame-neon {
    border: 2px solid #22d3ee;
    box-shadow: 0 0 15px #22d3ee;
}

.frame-classic {
    background: #1e293b;
    border: 2px solid #334155;
}

/* Board & Pieces */
#puzzle-board-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

#puzzle-board {
    position: relative;
    background: #000;
    border-radius: 6px;
    touch-action: none !important;
}

.puzzle-piece {
    position: absolute;
    z-index: 100;
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.puzzle-piece.matched {
    z-index: 1;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.puzzle-slot {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Settings List */
.settings-list {
    width: 100%;
    margin-bottom: 30px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-btn {
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    background: var(--accent-pink);
    color: white;
    border: none;
    font-weight: 800;
    cursor: pointer;
}

/* 🏆 Sticker Dashboard */
#sticker-dashboard {
    height: 140px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    flex-shrink: 0;
}

.dashboard-title {
    color: #22d3ee;
    font-size: 0.8rem;
    font-weight: 1000;
    letter-spacing: 2px;
    text-align: center;
}

#dashboard-sticker-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 5px;
    height: 80px;
    align-items: center;
}

#dashboard-sticker-list::-webkit-scrollbar {
    display: none;
}

.dashboard-sticker-item {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.dashboard-sticker-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.dashboard-sticker-item:active {
    transform: scale(0.9);
}

.hidden {
    display: none !important;
}