/* ==========================================================================
   STACK MASTER - Global Core Stylesheet (style.css)
   ========================================================================== */

:root {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --accent-gold: #fbbf24;
    --bg-gradient-top: #ea580c;
    --bg-gradient-mid: #f97316;
    --bg-gradient-bot: #fef08a;
    --text-light: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #94a3b8;
    --modal-bg: rgba(26, 16, 8, 0.88);
    --card-bg: rgba(255, 255, 255, 0.15);
    --card-border: rgba(255, 255, 255, 0.28);
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #ea580c;
    font-family: var(--font-family);
    color: var(--text-light);
    touch-action: manipulation;
}

#appRoot {
    position: relative;
    width: 100%;
    height: 100%;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-gradient-top) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-bot) 100%);
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Screen Transitions */
.fade-out {
    opacity: 0 !important;
    transition: opacity 0.4s ease-out;
}

/* Interactive Common Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.45);
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-accent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Keyframes */
@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 0 25px rgba(251, 191, 36, 0.7);
    }
}

@keyframes floatAnim {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Universal Toast Notification Banner */
.app-toast {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(26, 16, 8, 0.94);
    border: 1.5px solid rgba(251, 191, 36, 0.65);
    color: #ffffff;
    font-size: clamp(13px, 3.5vw, 15px);
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 9999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
}

.app-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.fade-out {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.4s ease-out;
}
