/* Google Fonts import is handled in HTML */

:root {
    --brand-cream: #FFF9EE;
    --brand-brick: #E0483E;
    --brand-brick-dark: #A62921;
    --brand-gold: #F59E0B;
    --brand-gold-dark: #B45309;
    --brand-sky: #0EA5E9;
    --brand-sky-dark: #0369A1;
    --brand-mint: #10B981;
    --brand-mint-dark: #047857;
    --brand-ink: #1E293B;
}

body {
    font-family: 'Kanit', sans-serif;
    color: var(--brand-ink);
    overflow-x: hidden;
    caret-color: var(--brand-brick);
}

::selection {
    background: #FDE68A;
    color: #9A3412;
}

:focus-visible {
    outline: 3px solid var(--brand-gold);
    outline-offset: 2px;
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #FEF3C7;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #EE5A4F 0%, #C83B32 100%);
    border-radius: 999px;
    border: 2px solid #FEF3C7;
}
::-webkit-scrollbar-thumb:hover {
    background: #B91C1C;
}

/* 3D Game Panels & Surfaces */
.game-panel-3d {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 249, 238, 0.96) 100%);
    border: 3px solid #FFFFFF;
    border-radius: 28px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.95),
        0 8px 0 #CBD5E1,
        0 20px 40px -10px rgba(15, 23, 42, 0.3);
}

.game-card-3d {
    background: #FFFFFF;
    border: 3px solid #FFFFFF;
    border-radius: 22px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        0 7px 0 #CBD5E1,
        0 14px 28px -8px rgba(15, 23, 42, 0.22);
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-card-3d:hover {
    transform: translateY(-4px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.95),
        0 11px 0 #F59E0B,
        0 20px 34px -8px rgba(15, 23, 42, 0.28);
}

.game-card-3d:active {
    transform: translateY(3px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        0 4px 0 #D97706,
        0 8px 16px -4px rgba(15, 23, 42, 0.2);
}

.hud-pill-3d {
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF7ED 100%);
    border: 2px solid #FFFFFF;
    border-radius: 20px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.95),
        0 6px 0 #CBD5E1,
        0 12px 24px -6px rgba(15, 23, 42, 0.2);
}

.puzzle-tray-3d {
    background: linear-gradient(145deg, #FEF3C7 0%, #FDE68A 100%);
    border: 4px solid #FFFFFF;
    border-radius: 26px;
    box-shadow:
        inset 0 4px 12px rgba(180, 83, 9, 0.16),
        0 8px 0 #D97706,
        0 22px 44px -10px rgba(15, 23, 42, 0.32);
}

/* 3D Recessed Inputs */
.game-input-3d {
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: inset 0 3px 6px rgba(15, 23, 42, 0.08);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.game-input-3d:focus {
    background: #FFFFFF;
    border-color: var(--brand-brick);
    box-shadow:
        inset 0 2px 4px rgba(15, 23, 42, 0.05),
        0 0 0 4px rgba(224, 72, 62, 0.18);
    outline: none;
}

/* 3D Tactile Push Buttons */
.game-btn-3d {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.12s cubic-bezier(0.22, 1, 0.36, 1), filter 0.12s ease;
}

.game-btn-3d:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

.game-btn-3d:active {
    transform: translateY(4px);
}

.btn-brick {
    background: linear-gradient(180deg, #F25C52 0%, #D93B31 100%);
    color: #FFFFFF;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        0 6px 0 var(--brand-brick-dark),
        0 12px 22px -4px rgba(166, 41, 33, 0.45);
}
.btn-brick:active {
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        0 2px 0 var(--brand-brick-dark),
        0 5px 10px -2px rgba(166, 41, 33, 0.35);
}

.btn-gold {
    background: linear-gradient(180deg, #FBBF24 0%, #D97706 100%);
    color: #451A03;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.55),
        0 6px 0 var(--brand-gold-dark),
        0 12px 22px -4px rgba(180, 83, 9, 0.4);
}
.btn-gold:active {
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        0 2px 0 var(--brand-gold-dark),
        0 5px 10px -2px rgba(180, 83, 9, 0.3);
}

.btn-sky {
    background: linear-gradient(180deg, #38BDF8 0%, #0284C7 100%);
    color: #FFFFFF;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        0 6px 0 var(--brand-sky-dark),
        0 12px 22px -4px rgba(3, 105, 161, 0.4);
}
.btn-sky:active {
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        0 2px 0 var(--brand-sky-dark),
        0 5px 10px -2px rgba(3, 105, 161, 0.3);
}

.btn-mint {
    background: linear-gradient(180deg, #34D399 0%, #059669 100%);
    color: #FFFFFF;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        0 6px 0 var(--brand-mint-dark),
        0 12px 22px -4px rgba(4, 120, 87, 0.4);
}
.btn-mint:active {
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        0 2px 0 var(--brand-mint-dark),
        0 5px 10px -2px rgba(4, 120, 87, 0.3);
}

.btn-slate {
    background: linear-gradient(180deg, #F1F5F9 0%, #E2E8F0 100%);
    color: #334155;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.8),
        0 5px 0 #94A3B8,
        0 10px 18px -4px rgba(15, 23, 42, 0.18);
}
.btn-slate:active {
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        0 2px 0 #94A3B8,
        0 4px 8px -2px rgba(15, 23, 42, 0.14);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 28px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fade-in-up {
    animation-name: fadeInUp;
    animation-duration: 0.45s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in {
    animation-name: fadeIn;
    animation-duration: 0.35s;
    animation-fill-mode: both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation-name: scaleIn;
    animation-duration: 0.35s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: both;
}

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

.float-gentle {
    animation: floatGentle 3.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .float-gentle,
    .animate-fade-in-up,
    .animate-fade-in,
    .animate-scale-in {
        animation: none !important;
    }
    .game-card-3d,
    .game-btn-3d {
        transition: none !important;
    }
}

/* SweetAlert2 3D Game Theme Override */
div.swal2-popup {
    border-radius: 26px !important;
    border: 3px solid #FFFFFF !important;
    font-family: 'Kanit', sans-serif !important;
    box-shadow: 0 8px 0 #CBD5E1, 0 24px 48px -12px rgba(15, 23, 42, 0.35) !important;
}

button.swal2-confirm {
    background: linear-gradient(180deg, #F25C52 0%, #D93B31 100%) !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 4px 0 #99241D !important;
}

button.swal2-cancel {
    border-radius: 14px !important;
    font-weight: 700 !important;
}

/* Canvas Styles */
#puzzle-canvas {
    touch-action: none;
}
