/*
 * Flappy Dragon - Stylesheet
 * Custom vanilla CSS for an apocalyptic, premium glassmorphic UI.
 */

:root {
    --bg-dark: #070303;
    --panel-bg: rgba(20, 10, 10, 0.92);
    --panel-border: rgba(255, 78, 17, 0.2);
    --color-orange: #ff4e11;
    --color-gold: #ffb000;
    --color-text: #f0e6e6;
    
    /* Skin specific neon glows */
    --glow-inferno: 0 0 15px #ff4e11;
    --glow-shadow: 0 0 15px #a020f0;
    --glow-acid: 0 0 15px #39ff14;
    --glow-frostbite: 0 0 15px #00f3ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--color-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: radial-gradient(circle at center, #1b0a0a 0%, #050202 100%);
}

/* Background volcanic haze decoration */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at bottom, rgba(255, 78, 17, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Game Wrapper Container */
.game-container {
    position: relative;
    width: 480px;
    height: 800px;
    max-width: 100vw;
    max-height: 100vh;
    aspect-ratio: 9/15;
    background-color: #0d0606;
    border: 3px solid rgba(255, 78, 17, 0.35);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Screen Shake Effect */
.shake {
    animation: shakeEffect 0.4s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shakeEffect {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* The Canvas itself */
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #0b0505;
}

/* Base style for all glass overlays */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.overlay-screen.active {
    opacity: 1;
    visibility: visible;
}

/* Epic Headings */
h1 {
    font-family: 'Georgia', serif;
    font-size: 2.6rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    letter-spacing: 2px;
    margin-bottom: 25px;
    line-height: 1.1;
}

h2 {
    font-family: 'Georgia', serif;
    font-size: 1.8rem;
    color: var(--color-gold);
    margin-bottom: 20px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    color: #d8c2c2;
}

/* Premium Navigation & Action Buttons */
.btn {
    background: linear-gradient(135deg, rgba(255, 78, 17, 0.85) 0%, rgba(255, 30, 0, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    margin: 8px 0;
    width: 230px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

.btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.45);
}

.btn:active {
    transform: translateY(-1px) scale(0.99);
}

.btn-secondary {
    background: rgba(40, 20, 20, 0.8);
    border: 1px solid rgba(255, 78, 17, 0.35);
    color: #e5b0a3;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-secondary:hover {
    background: rgba(60, 25, 25, 0.95);
    border-color: var(--color-orange);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Home Screen Elements */
.menu-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.high-score-tag {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-gold);
    border: 1px solid rgba(255, 176, 0, 0.3);
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255, 176, 0, 0.05);
    margin-top: 25px;
    letter-spacing: 0.5px;
}

/* HUD Overlay during gameplay */
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.hud-item {
    background: rgba(18, 9, 9, 0.92);
    border: 1px solid rgba(255, 78, 17, 0.15);
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.hud-item i {
    font-style: normal;
}

.score-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Georgia', serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    background: none;
    border: none;
    box-shadow: none;
}

.hud-orbs {
    color: var(--color-gold);
    border-color: rgba(255, 176, 0, 0.2);
}

.hud-fireball {
    color: #ff3c00;
}

.hud-tornado {
    color: #a020f0;
    border-color: rgba(160, 32, 240, 0.18);
}

.tornado-count {
    display: flex;
    gap: 3px;
}

.tornado-gem {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #ff00ff, #a020f0);
    border-radius: 50%;
    border: 1px solid #fff;
    display: inline-block;
    transition: transform 0.2s;
}

.tornado-gem.empty {
    background: #23122c;
    border-color: #401850;
}

.fireball-count {
    display: flex;
    gap: 3px;
}

.fireball-gem {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #ffcc00, #ff3c00);
    transform: rotate(45deg);
    border: 1px solid #fff;
    display: inline-block;
    transition: transform 0.2s;
}

.fireball-gem.empty {
    background: #331a15;
    border-color: #55332c;
    box-shadow: none;
}

/* Control Config (Modo Canhoto) */
.control-config {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.config-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c2b0b0;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    background: rgba(255, 78, 17, 0.05);
    border: 1px solid rgba(255, 78, 17, 0.15);
    padding: 8px 18px;
    border-radius: 20px;
    transition: border-color 0.2s, background-color 0.2s;
}

.config-label:hover {
    border-color: rgba(255, 78, 17, 0.45);
    background: rgba(255, 78, 17, 0.12);
    color: #fff;
}

.config-label input[type="checkbox"] {
    accent-color: var(--color-orange);
    cursor: pointer;
    width: 15px;
    height: 15px;
}

/* Mobile Play Controls */
.mobile-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 0 25px;
    z-index: 6;
    pointer-events: none;
}

.mobile-controls.canhoto {
    justify-content: flex-end;
}

/* Stacks power buttons vertically */
.power-controls-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-btn {
    pointer-events: auto;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(20, 10, 10, 0.92);
    border: 2px solid rgba(255, 78, 17, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.15s, background-color 0.15s;
}

.control-btn:active {
    transform: scale(0.9);
    background: rgba(255, 78, 17, 0.2);
}

.btn-shoot-fire {
    border-color: #ff3c00;
}

.btn-shoot-fire::after {
    content: '🔥';
    font-size: 1.8rem;
}

.btn-shoot-tornado {
    border-color: #a020f0;
}

.btn-shoot-tornado::after {
    content: '🌀';
    font-size: 1.8rem;
}

.btn-flap-wings {
    border-color: var(--color-gold);
}

.btn-flap-wings::after {
    content: '🦅';
    font-size: 1.8rem;
}

/* Shop Layout (Loja de Dragões) */
.shop-title {
    margin-bottom: 10px;
}

.shop-balance {
    color: var(--color-gold);
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.shop-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 25px;
}

/* Custom Scrollbar for Shop */
.shop-grid::-webkit-scrollbar {
    width: 6px;
}
.shop-grid::-webkit-scrollbar-track {
    background: rgba(255, 78, 17, 0.05);
    border-radius: 4px;
}
.shop-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 78, 17, 0.3);
    border-radius: 4px;
}

.shop-item {
    background: rgba(30, 15, 15, 0.85);
    border: 1px solid rgba(255, 78, 17, 0.15);
    border-radius: 14px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
    cursor: pointer;
}

.shop-item:hover {
    border-color: rgba(255, 78, 17, 0.4);
    background: rgba(45, 20, 20, 0.95);
    transform: translateY(-2px);
}

.shop-item.selected {
    border-color: var(--color-orange);
    box-shadow: inset 0 0 6px rgba(255, 78, 17, 0.3);
    background: rgba(50, 15, 15, 0.95);
}

.skin-preview-box {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: rgba(10, 5, 5, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Colorful glowing circles behind skin icons */
.skin-preview-box::before {
    content: '';
    position: absolute;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    opacity: 0.5;
    filter: blur(3px);
}

.shop-item[data-skin="inferno"] .skin-preview-box::before { background-color: #ff4e11; }
.shop-item[data-skin="shadow"] .skin-preview-box::before { background-color: #a020f0; }
.shop-item[data-skin="acid"] .skin-preview-box::before { background-color: #39ff14; }
.shop-item[data-skin="frostbite"] .skin-preview-box::before { background-color: #00f3ff; }

.skin-preview-svg {
    width: 42px;
    height: 42px;
    z-index: 2;
}

.skin-name {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #fff;
}

.skin-status-btn {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    text-align: center;
}

.status-buy {
    background: linear-gradient(135deg, var(--color-gold) 0%, #ff8800 100%);
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}
.status-buy::after {
    content: '🟡';
    font-size: 0.65rem;
}

.status-equip {
    background: rgba(255, 255, 255, 0.1);
    color: #b0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.status-equip:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.status-equipped {
    background: rgba(255, 78, 17, 0.2);
    color: var(--color-orange);
    border: 1px solid rgba(255, 78, 17, 0.4);
    cursor: default;
}

/* Instructions Overlay */
.instructions-box {
    background: rgba(15, 7, 7, 0.85);
    border: 1px solid rgba(255, 78, 17, 0.25);
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    text-align: left;
    margin-bottom: 25px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

.instruction-item {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.instruction-item:last-child {
    margin-bottom: 0;
}

.instruction-icon {
    font-size: 1.4rem;
    min-width: 28px;
    text-align: center;
}

.instruction-text h4 {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 800;
    margin-bottom: 3px;
}

.instruction-text p {
    font-size: 0.8rem;
    color: #aaa4a4;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Sound and Options Toggle Panel */
.sound-toggle-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 12;
}

.sound-toggle-btn {
    background: rgba(20, 10, 10, 0.92);
    border: 1px solid rgba(255, 78, 17, 0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: border-color 0.2s, background-color 0.2s;
}

.sound-toggle-btn:hover {
    border-color: var(--color-orange);
    background: rgba(35, 15, 15, 0.85);
}

.sound-toggle-btn::after {
    content: '🔊';
    font-size: 1.2rem;
}

.sound-toggle-btn.muted::after {
    content: '🔇';
}

/* Game Over Screen Specs */
.game-over-stats {
    background: rgba(20, 10, 10, 0.8);
    border: 1px solid rgba(255, 78, 17, 0.25);
    border-radius: 14px;
    padding: 20px;
    width: 100%;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #c2b0b0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.stat-val-highlight {
    color: var(--color-gold);
}

.new-record-badge {
    background: #ff3c00;
    color: #fff;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 6px;
    text-transform: uppercase;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* Scroll adjustments on small desktop screens */
@media (max-height: 820px) and (min-width: 480px) {
    .game-container {
        height: 96vh;
    }
}

/* Live Pulse Dot for real-time achievements updates */
.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #39ff14;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #39ff14;
    animation: livePulse 1.6s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px #39ff14; }
    100% { transform: scale(0.9); opacity: 0.6; }
}
