/**
 * Gem Quest - Style Sheet
 * Bright, warm temple theme for kid-friendly gem collecting
 */

/* ==================== BASE ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1a1a2e; }

.lg-game-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a1a0a 0%, #1a1a2e 100%);
}

#game-canvas {
    display: block;
    image-rendering: pixelated;
    cursor: none;
    border-radius: 0;
    box-shadow: none;
}

/* ==================== MENU OVERLAY ==================== */
.gq-menu {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(180,130,60,0.95), rgba(100,70,30,0.98));
    z-index: 100;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
}

.gq-menu h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffe060;
    text-shadow: 0 3px 10px rgba(0,0,0,0.5), 0 0 40px rgba(255,224,96,0.3);
    margin-bottom: 8px;
    letter-spacing: 3px;
}

.gq-menu .gq-subtitle {
    font-size: 1rem;
    color: #f0d0a0;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

/* Menu Buttons */
.gq-btn {
    display: block;
    width: 260px;
    margin: 8px auto;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, #b89530, #d4a840);
    border: 2px solid #ffe060;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.gq-btn:hover {
    background: linear-gradient(135deg, #d4a840, #ffe060);
    color: #3a2a10;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,224,96,0.4);
}

.gq-btn:active {
    transform: translateY(0);
}

.gq-btn-ruby {
    background: linear-gradient(135deg, #cc2233, #ff3344);
    border-color: #ff6677;
}

.gq-btn-ruby:hover {
    background: linear-gradient(135deg, #ff3344, #ff6677);
    color: #fff;
}

.gq-btn-sapphire {
    background: linear-gradient(135deg, #2266cc, #3388ff);
    border-color: #66aaff;
}

.gq-btn-sapphire:hover {
    background: linear-gradient(135deg, #3388ff, #66aaff);
    color: #fff;
}

.gq-btn-emerald {
    background: linear-gradient(135deg, #22aa44, #33cc55);
    border-color: #66ee77;
}

.gq-btn-emerald:hover {
    background: linear-gradient(135deg, #33cc55, #66ee77);
    color: #fff;
}

.gq-btn-small {
    width: 180px;
    padding: 10px 20px;
    font-size: 0.85rem;
    border-width: 1px;
}

/* Difficulty select */
.gq-diff-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.gq-diff-btn {
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    color: #f0d0a0;
    background: rgba(0,0,0,0.3);
    border: 2px solid rgba(255,224,96,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gq-diff-btn:hover {
    border-color: #ffe060;
    background: rgba(255,224,96,0.15);
}

.gq-diff-btn.selected {
    background: linear-gradient(135deg, #b89530, #d4a840);
    border-color: #ffe060;
    color: #fff;
}

/* Section labels */
.gq-section-label {
    color: #c0a070;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 20px;
    margin-bottom: 8px;
}

/* ==================== HUD ==================== */
.gq-hud {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 50;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.gq-hud-top {
    position: absolute;
    top: 10px; left: 10px; right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.gq-hud-item {
    padding: 8px 16px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,224,96,0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.gq-timer {
    font-size: 1.3rem;
    min-width: 80px;
    text-align: center;
}

.gq-timer.warning {
    color: #ff3344;
    animation: gq-pulse 0.5s ease-in-out infinite alternate;
    border-color: #ff3344;
}

@keyframes gq-pulse {
    from { opacity: 0.7; transform: scale(1); }
    to { opacity: 1; transform: scale(1.05); }
}

.gq-gems {
    color: #ffe060;
}

.gq-score-area {
    text-align: right;
}

.gq-score {
    color: #fff;
    font-size: 1.1rem;
}

.gq-streak {
    display: none;
    color: #ffcc00;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 4px;
    animation: gq-streak-pop 0.3s ease-out;
}

.gq-streak.active {
    display: block;
}

@keyframes gq-streak-pop {
    0% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Sprint bar */
.gq-hud-bottom {
    position: absolute;
    bottom: 10px; left: 10px; right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.gq-sprint-bar {
    width: 150px;
    height: 12px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,224,96,0.3);
    border-radius: 6px;
    overflow: hidden;
}

.gq-sprint-fill {
    height: 100%;
    background: linear-gradient(90deg, #33cc55, #66ee77);
    border-radius: 6px;
    transition: width 0.1s linear;
}

.gq-sprint-label {
    color: rgba(255,255,255,0.6);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.gq-powerup-status {
    padding: 6px 14px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,224,96,0.5);
    border-radius: 8px;
    color: #ffe060;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    display: none;
}

.gq-powerup-status.active {
    display: block;
    animation: gq-powerup-glow 1s ease-in-out infinite alternate;
}

@keyframes gq-powerup-glow {
    from { box-shadow: 0 0 8px rgba(255,224,96,0.3); }
    to { box-shadow: 0 0 16px rgba(255,224,96,0.6); }
}

/* Minimap */
.gq-minimap {
    position: absolute;
    bottom: 10px; right: 10px;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255,224,96,0.4);
    border-radius: 8px;
    background: rgba(0,0,0,0.5);
}

/* Click prompt */
.gq-click-prompt {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,224,96,0.4);
    border-radius: 10px;
    color: #ffe060;
    font-size: 0.9rem;
    font-weight: 600;
    animation: gq-fade-pulse 2s ease-in-out infinite;
}

@keyframes gq-fade-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ==================== BRIEFING OVERLAY ==================== */
.gq-briefing {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    z-index: 90;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
    color: #fff;
}

.gq-briefing h2 {
    font-size: 2.5rem;
    color: #ffe060;
    text-shadow: 0 2px 10px rgba(255,224,96,0.4);
    margin-bottom: 12px;
}

.gq-briefing p {
    font-size: 1.1rem;
    color: #f0d0a0;
    margin-bottom: 8px;
}

.gq-briefing .gq-briefing-stats {
    display: flex;
    gap: 30px;
    margin: 20px 0;
}

.gq-briefing-stat {
    text-align: center;
}

.gq-briefing-stat .value {
    font-size: 2rem;
    font-weight: 800;
    color: #ffe060;
}

.gq-briefing-stat .label {
    font-size: 0.75rem;
    color: #c0a070;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==================== GAME OVER OVERLAY ==================== */
.gq-gameover {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
    color: #fff;
}

.gq-gameover h2 {
    font-size: 2.8rem;
    color: #ffe060;
    text-shadow: 0 3px 15px rgba(255,224,96,0.4);
    margin-bottom: 10px;
}

.gq-gameover .gq-final-score {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(255,255,255,0.3);
    margin: 10px 0;
}

.gq-gameover .gq-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.gq-stat-item {
    text-align: center;
}

.gq-stat-item .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffe060;
}

.gq-stat-item .label {
    font-size: 0.7rem;
    color: #c0a070;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Level complete */
.gq-level-complete {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    z-index: 95;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
    color: #fff;
}

.gq-level-complete h2 {
    font-size: 2.5rem;
    color: #33cc55;
    text-shadow: 0 2px 15px rgba(51,204,85,0.4);
    margin-bottom: 10px;
}

/* ==================== INVINCIBILITY FLASH ==================== */
.gq-invincible-flash {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 40;
    border: 4px solid rgba(255,204,0,0.6);
    border-radius: 0;
    animation: gq-invincible-blink 0.2s ease-in-out infinite alternate;
}

@keyframes gq-invincible-blink {
    from { opacity: 0; }
    to { opacity: 0.4; }
}

/* ==================== TOUCH CONTROLS ==================== */
.gq-touch-controls {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 60;
    display: none;
}

.gq-touch-controls.visible {
    display: block;
}

.gq-joystick-area {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40%;
    height: 50%;
    pointer-events: auto;
}

.gq-look-area {
    position: absolute;
    right: 0;
    top: 0;
    width: 60%;
    height: 100%;
    pointer-events: auto;
}

.gq-joystick-ring {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 3px solid rgba(255,224,96,0.4);
    border-radius: 50%;
    display: none;
}

.gq-joystick-ring.active {
    display: block;
}

.gq-joystick-knob {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(255,224,96,0.5);
    border: 2px solid rgba(255,224,96,0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.gq-sprint-touch {
    position: absolute;
    bottom: 140px;
    left: 20px;
    width: 70px;
    height: 70px;
    background: rgba(51,204,85,0.3);
    border: 2px solid rgba(51,204,85,0.6);
    border-radius: 50%;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
    .gq-menu h1 { font-size: 2.2rem; }
    .gq-btn { width: 200px; padding: 10px 20px; font-size: 0.9rem; }
    .gq-hud-item { padding: 5px 10px; font-size: 0.8rem; }
    .gq-timer { font-size: 1rem; }
    .gq-minimap { width: 80px; height: 80px; }
}
