/* =========================================
   Chess Engine v2.1 — Stylesheet
   ========================================= */

/* --- RESET & BASICS --- */
html {
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #060a14;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    position: relative;
    background-image:
        radial-gradient(ellipse 700px 700px at 10% 40%, rgba(99, 102, 241, 0.25), transparent),
        radial-gradient(ellipse 600px 600px at 90% 25%, rgba(56, 189, 248, 0.22), transparent),
        radial-gradient(ellipse 500px 500px at 50% 80%, rgba(168, 85, 247, 0.18), transparent),
        radial-gradient(ellipse 300px 300px at 70% 60%, rgba(236, 72, 153, 0.10), transparent);
    background-attachment: fixed;
}

/* Animated floating orbs for depth — brighter for visible glass tint */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(90px);
    animation: float-orb 14s ease-in-out infinite alternate;
}

body::before {
    width: 420px;
    height: 420px;
    background: rgba(56, 189, 248, 0.16);
    top: 8%;
    left: 3%;
}

body::after {
    width: 380px;
    height: 380px;
    background: rgba(139, 92, 246, 0.14);
    bottom: 12%;
    right: 6%;
    animation-delay: -7s;
}

@keyframes float-orb {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-50px) scale(1.15);
        opacity: 1;
    }
}

/* Glass light-sweep animation */
@keyframes glass-shimmer {
    0% {
        transform: translateX(-100%) rotate(25deg);
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        transform: translateX(200%) rotate(25deg);
        opacity: 0;
    }
}

@keyframes border-glow-pulse {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.10);
    }
    50% {
        border-color: rgba(129, 140, 248, 0.22);
    }
}

h1 {
    margin: 30px 0 20px 0;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-size: 32px;
    text-transform: uppercase;
    font-weight: 900;
    text-align: center;
    letter-spacing: 1px;
    filter: drop-shadow(0px 4px 12px rgba(56, 189, 248, 0.3));
    z-index: 10;
}

/* --- ENGINE MOVE ANIMATION --- */
@keyframes moveGlow {
    0% { box-shadow: inset 0 0 0 3px rgba(34, 197, 94, 0), inset 0 0 0 rgba(34, 197, 94, 0); }
    30% { box-shadow: inset 0 0 0 3px rgba(34, 197, 94, 0.7), inset 0 0 25px rgba(34, 197, 94, 0.2); }
    100% { box-shadow: inset 0 0 0 3px rgba(56, 189, 248, 0.5), inset 0 0 20px rgba(56, 189, 248, 0.15); }
}

@keyframes movePieceScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.engine-move-from {
    animation: moveGlow 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}

.engine-move-to {
    animation: moveGlow 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards !important;
}

.engine-move-to img {
    animation: movePieceScale 0.4s ease-out 0.2s both !important;
}

/* Smooth piece transition override for engine moves */
.board-b72b1d .piece-417db {
    transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* --- PIECE VISIBILITY (ENHANCED) --- */
#myBoard img,
.board-b72b1d img {
    image-rendering: auto;
    transition: filter 0.15s ease, transform 0.15s ease;
}

/* Black pieces: strong white glow for dark square contrast */
img[src*="bP.png"],
img[src*="bR.png"],
img[src*="bN.png"],
img[src*="bB.png"],
img[src*="bQ.png"],
img[src*="bK.png"] {
    filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 1)) drop-shadow(0 0 4px rgba(255, 255, 255, 0.6)) drop-shadow(0 2px 6px rgba(255, 255, 255, 0.3)) !important;
}

/* White pieces: strong dark shadow for visibility */
img[src*="wP.png"],
img[src*="wR.png"],
img[src*="wN.png"],
img[src*="wB.png"],
img[src*="wQ.png"],
img[src*="wK.png"] {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 3px rgba(0, 0, 0, 0.5)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35)) !important;
}

/* Pawns: extra visibility with scaling */
img[src*="bP.png"],
img[src*="wP.png"] {
    transform: scale(1.12);
}

/* --- SPARE PIECE TRAY (drag pieces) --- */
.spare-pieces-7492f img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 8px rgba(56, 189, 248, 0.3)) !important;
    transition: transform 0.2s ease, filter 0.2s ease;
    cursor: grab;
}

.spare-pieces-7492f img:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 14px rgba(56, 189, 248, 0.6)) !important;
}

/* --- DRAGGED PIECE --- */
.piece-417db {
    z-index: 9999 !important;
}

.piece-417db img {
    transform: scale(1.2) !important;
    filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.7)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)) !important;
    transition: none !important;
}

/* --- BOARD SQUARES: hover & highlight --- */
.square-55d63 {
    transition: box-shadow 0.15s ease;
    position: relative;
}

.square-55d63:hover {
    box-shadow: inset 0 0 18px rgba(56, 189, 248, 0.25);
}

/* Last move highlight */
.highlight-last-move {
    box-shadow: inset 0 0 0 3px rgba(56, 189, 248, 0.5),
        inset 0 0 20px rgba(56, 189, 248, 0.15) !important;
}

/* --- PAGE ENTRANCE ANIMATIONS --- */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

h1 {
    animation: fadeSlideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.board-area {
    animation: fadeScale 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.controls {
    animation: fadeSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.control-group:nth-child(1) {
    animation: fadeSlideUp 0.5s ease 0.4s both;
}

.control-group:nth-child(2) {
    animation: fadeSlideUp 0.5s ease 0.5s both;
}

.control-group:nth-child(3) {
    animation: fadeSlideUp 0.5s ease 0.6s both;
}

.control-group:nth-child(4) {
    animation: fadeSlideUp 0.5s ease 0.7s both;
}

.control-group:nth-child(5) {
    animation: fadeSlideUp 0.5s ease 0.8s both;
}

/* --- EVAL BAR GLOW PULSE --- */
@keyframes evalGlow {
    0%,
    100% {
        box-shadow: 0 0 18px rgba(255, 255, 255, 0.4), 0 -2px 8px rgba(255, 255, 255, 0.15);
    }
    50% {
        box-shadow: 0 0 24px rgba(255, 255, 255, 0.6), 0 -2px 12px rgba(255, 255, 255, 0.3);
    }
}

.eval-bar-fill {
    animation: evalGlow 3s ease-in-out infinite;
}

/* --- BUTTON HOVER MICRO-ANIMATIONS --- */
.btn-main,
.btn-danger,
.btn-flip,
.btn-nav,
.btn-white,
.btn-black {
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.btn-main:hover,
.btn-danger:hover {
    transform: translateY(-2px);
}

.btn-nav:hover,
.btn-flip:hover {
    transform: translateY(-1px);
}

/* Ripple shimmer on buttons */
.btn-main::after,
.btn-danger::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-main:hover::after,
.btn-danger:hover::after {
    left: 100%;
}

/* --- FOOTER ENTRANCE --- */
footer {
    animation: fadeSlideUp 0.6s ease 1s both;
}

/* --- MAIN LAYOUT --- */
.main-container {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 25px;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    z-index: 1;
}

/* --- BOARD AREA + BAR --- */
.board-area {
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
}

/* --- EVAL BAR (GLASSMORPHISM ENHANCED) --- */
.eval-bar-container {
    width: 30px;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-radius: 14px;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    transition: height 0.3s ease, border-color 0.6s ease;
    animation: border-glow-pulse 4s ease-in-out infinite;
}

/* Glass shine overlay */
.eval-bar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 60%, transparent 100%);
    border-radius: 14px 14px 0 0;
    z-index: 1;
    pointer-events: none;
}

.eval-bar-fill {
    width: 100%;
    height: 50%;
    background: linear-gradient(0deg, #e2e8f0, #ffffff);
    transition: height 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.eval-bar-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.7), rgba(239, 68, 68, 1), rgba(239, 68, 68, 0.7));
    z-index: 2;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.7), 0 0 2px rgba(239, 68, 68, 0.9);
}

.eval-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 800;
    color: #f8fafc;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.6);
    z-index: 10;
    pointer-events: none;
    letter-spacing: -0.5px;
}

.eval-bar-container.flipped {
    background-color: rgba(248, 250, 252, 0.65);
}

.eval-bar-container.flipped .eval-bar-fill {
    background: linear-gradient(0deg, #0f172a, #1e293b);
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
}

.eval-bar-container.flipped .eval-text {
    color: #1e293b;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 0 8px rgba(255, 255, 255, 0.6);
}

/* --- BOARD (GLASSMORPHISM PREMIUM ENHANCED) --- */
#board-wrapper {
    background: rgba(30, 41, 59, 0.28);
    padding: 12px;
    border-radius: 18px;
    backdrop-filter: blur(32px) saturate(220%);
    -webkit-backdrop-filter: blur(32px) saturate(220%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

#board-wrapper:hover {
    border-color: rgba(129, 140, 248, 0.25);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.25),
        0 0 30px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Glass highlight on board wrapper */
#board-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 50%, transparent 100%);
    border-radius: 18px 18px 0 0;
    pointer-events: none;
    z-index: 0;
}

/* Light sweep on board wrapper */
#board-wrapper::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 40px;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    transform: rotate(25deg);
    pointer-events: none;
    z-index: 0;
    animation: glass-shimmer 8s ease-in-out infinite;
    animation-delay: 2s;
}

#myBoard {
    width: 520px;
    border: 0;
    border-radius: 8px;
    touch-action: none;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* --- CONTROLS (GLASSMORPHISM PREMIUM ENHANCED) --- */
.controls {
    background: rgba(30, 41, 59, 0.30);
    backdrop-filter: blur(36px) saturate(220%);
    -webkit-backdrop-filter: blur(36px) saturate(220%);
    padding: 24px;
    border-radius: 22px;
    width: 420px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    margin-top: 0;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.controls:hover {
    border-color: rgba(56, 189, 248, 0.20);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 0 25px rgba(56, 189, 248, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

/* Glass shine for controls — brighter & more visible */
.controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 40%, transparent 100%);
    border-radius: 22px 22px 0 0;
    pointer-events: none;
    z-index: 0;
}

/* Light sweep on controls panel */
.controls::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 30px;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: rotate(25deg);
    pointer-events: none;
    z-index: 0;
    animation: glass-shimmer 10s ease-in-out infinite;
    animation-delay: 4s;
}

.controls>* {
    position: relative;
    z-index: 1;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.lbl {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

/* --- SELECT STYLES (GLASSMORPHISM ENHANCED) --- */
select {
    background: rgba(10, 15, 30, 0.45);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    outline: none;
    cursor: pointer;
    flex: 1;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#engineSelect {
    border-left: 4px solid #00BCD4;
}

#depthSelect {
    border-left: 4px solid #38bdf8;
}

/* --- FEN WRAPPER (GLASSMORPHISM ENHANCED) --- */
.fen-wrapper {
    display: flex;
    background: rgba(10, 15, 30, 0.38);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.fen-wrapper:focus-within {
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.25), 0 0 4px rgba(56, 189, 248, 0.15);
}

#fenInput {
    background: transparent;
    color: #cbd5e1;
    border: none;
    padding: 12px 14px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    width: 100%;
    outline: none;
    cursor: text;
}

.btn-fen-action {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: none;
    padding: 0 16px;
    cursor: pointer;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.2s all;
}

.btn-fen-action:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-fen-action:active {
    background: #38bdf8;
    color: #0f172a;
}

/* --- SMALL PHONE: hide eval bar --- */
@media (max-width: 600px) {
    .eval-bar-container {
        display: none !important;
    }
}

/* --- MOBILE LAYOUT --- */
@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 15px;
    }

    .board-area {
        width: 100%;
        justify-content: center;
    }

    #board-wrapper {
        width: 85vw;
        max-width: 420px;
    }

    #myBoard {
        width: 100%;
    }

    .controls {
        width: 100%;
        max-width: 450px;
    }

    h1 {
        font-size: 24px;
        margin: 20px 0;
    }

    #section-suggestion {
        order: 1;
        margin-bottom: 5px;
    }

    #section-calc {
        order: 2;
    }

    #section-status {
        order: 3;
    }

    #section-manage {
        order: 4;
        margin-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 20px;
    }

    #section-fen {
        order: 5;
        margin-top: 10px;
    }

    #section-history {
        order: 6;
        margin-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 15px;
    }

    .move-history-container {
        max-height: 120px;
    }
}

/* --- BUTTONS --- */
button {
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 14px;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

button:active {
    transform: scale(0.95);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(100%);
    transform: none !important;
}

.btn-main {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-main:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    filter: brightness(115%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
    filter: brightness(115%);
}

.btn-flip {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-flip:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-nav {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-white {
    background: rgba(248, 250, 252, 0.9);
    color: #0f172a;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.btn-white:hover {
    background: #fff;
    transform: translateY(-2px);
}

.btn-black {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 -3px 0 #000;
}

.btn-black:hover {
    background: #334155;
    transform: translateY(-2px);
}

.btn-move-suggestion {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    width: 100%;
    font-size: 18px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    animation: pulse-green 2s infinite;
    text-transform: none;
    border-radius: 12px;
}

.btn-move-suggestion:hover {
    filter: brightness(110%);
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* --- ENGINE STATUS BOX (GLASSMORPHISM ENHANCED) --- */
#engineStatus {
    background: rgba(10, 15, 30, 0.40);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    color: #4ade80;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    min-height: 110px;
    padding: 14px;
    white-space: pre-wrap;
    border-left: 4px solid #38bdf8;
    border-radius: 12px;
    overflow-y: auto;
    line-height: 1.6;
    position: relative;
    box-shadow:
        inset 0 2px 12px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 16px rgba(0, 0, 0, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.score-highlight {
    color: #fbbf24;
    font-weight: bold;
    font-size: 14px;
}

.knps-tag {
    position: absolute;
    top: 10px;
    right: 12px;
    color: #94a3b8;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

.mate-alert {
    color: #ef4444;
    font-weight: 900;
    font-size: 15px;
    animation: blink-red 1s infinite;
    display: block;
    margin-top: 6px;
}

@keyframes blink-red {
    50% {
        opacity: 0.4;
    }
}

/* --- ANALYSIS PROGRESS BAR --- */
.analysis-progress {
    height: 3px;
    background: linear-gradient(90deg, transparent, #38bdf8, #6366f1, #c084fc, transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: 2px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.analysis-progress.active {
    opacity: 1;
}

/* --- MODALS (GLASSMORPHISM PREMIUM ENHANCED) --- */
#warningModal,
#promotionModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 10, 20, 0.70);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.modal-content {
    background: rgba(30, 41, 59, 0.35);
    padding: 35px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    max-width: 420px;
    text-align: center;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 8px 30px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(36px) saturate(220%);
    -webkit-backdrop-filter: blur(36px) saturate(220%);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
    border-radius: 26px 26px 0 0;
    pointer-events: none;
}

.modal-content h2 {
    margin-top: 0;
    color: #38bdf8;
    font-size: 24px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.modal-content p {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.btn-accept {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}

.btn-accept:hover {
    filter: brightness(115%);
}

/* PROMOTION GRID */
.promotion-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.promo-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.promo-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #38bdf8;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.promo-btn img {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.6));
}

/* --- FOOTER LINKS --- */
.footer-links {
    margin-top: 10px;
    font-weight: 600;
}

.footer-link {
    color: #94a3b8;
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.2s;
    border-bottom: 1px solid transparent;
}

.footer-link:hover {
    color: #38bdf8;
    border-bottom: 1px solid #38bdf8;
}

.footer-sep {
    color: rgba(255, 255, 255, 0.2);
}

/* --- MOVE HISTORY PANEL --- */
#section-history {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.move-history-container {
    background: rgba(10, 15, 30, 0.38);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid #818cf8;
    flex: 0 1 auto;
    min-height: 40px;
    max-height: 140px;
    overflow-y: auto;
    padding: 10px 14px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.move-history-container::-webkit-scrollbar {
    width: 4px;
}

.move-history-container::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.4);
    border-radius: 4px;
}

.move-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.move-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 2px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.move-num {
    color: #64748b;
    font-weight: 700;
    min-width: 28px;
}

.move-entry {
    color: #cbd5e1;
    padding: 1px 5px;
    border-radius: 4px;
    cursor: default;
    transition: background 0.15s;
    min-width: 42px;
}

.move-entry:hover {
    background: rgba(255, 255, 255, 0.08);
}

.move-entry.white-move {
    color: #f8fafc;
}

.move-entry.black-move {
    color: #94a3b8;
}

.move-entry.engine-move {
    color: #4ade80;
    font-weight: 700;
}

.move-history-empty {
    color: #475569;
    font-size: 11px;
    font-style: italic;
}

/* --- POLICY MODAL (GLASSMORPHISM ENHANCED) --- */
#policyModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 10, 20, 0.75);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    padding: 20px;
}

#policyModal.active {
    display: flex;
}

.policy-modal-content {
    background: rgba(30, 41, 59, 0.32);
    backdrop-filter: blur(40px) saturate(220%);
    -webkit-backdrop-filter: blur(40px) saturate(220%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 8px 30px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    max-width: 780px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: policyModalIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes policyModalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Glass highlight on modal — enhanced shine */
.policy-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
    z-index: 0;
}

.policy-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px 16px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.policy-modal-header h2 {
    margin: 0;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.3px;
}

.policy-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.policy-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: scale(1.05);
}

.policy-modal-body {
    padding: 24px 30px 30px 30px;
    overflow-y: auto;
    flex: 1;
    position: relative;
    z-index: 1;
}

.policy-modal-body::-webkit-scrollbar {
    width: 5px;
}

.policy-modal-body::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.3);
    border-radius: 4px;
}

.policy-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

/* Policy content styles inside modal */
.policy-content .last-update {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 20px;
}

.policy-content .section-card {
    background: rgba(10, 15, 30, 0.30);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px 22px;
    margin-top: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.policy-content .section-card:hover {
    border-color: rgba(129, 140, 248, 0.18);
    background: rgba(15, 20, 40, 0.35);
}

.policy-content .section-card h3 {
    color: #38bdf8;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.policy-content .section-card h3 .material-icons-round {
    font-size: 20px;
    color: #818cf8;
}

.policy-content p,
.policy-content li {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.8;
}

.policy-content ul {
    padding-left: 20px;
}

.policy-content li {
    margin-bottom: 6px;
}

.policy-content li::marker {
    color: #38bdf8;
}

.policy-content a {
    color: #38bdf8;
    text-decoration: none;
    transition: color 0.2s;
}

.policy-content a:hover {
    color: #818cf8;
    text-decoration: underline;
}

.policy-content strong {
    color: #e2e8f0;
}

.policy-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: 6px;
    color: #4ade80;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.policy-content .section-card p:last-child,
.policy-content .section-card ul:last-child {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .policy-modal-content {
        max-height: 92vh;
        border-radius: 18px;
    }

    .policy-modal-header {
        padding: 18px 20px 14px 20px;
    }

    .policy-modal-header h2 {
        font-size: 18px;
    }

    .policy-modal-body {
        padding: 18px 20px 24px 20px;
    }
}

/* --- HAMBURGER MENU BUTTON (GLASS ENHANCED) --- */
.hamburger-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: rgba(30, 41, 59, 0.35);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.hamburger-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.2);
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #cbd5e1;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- SIDEBAR OVERLAY --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 13, 26, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* --- SIDEBAR MENU (GLASSMORPHISM ENHANCED) --- */
.sidebar-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background: rgba(12, 18, 35, 0.55);
    backdrop-filter: blur(40px) saturate(220%);
    -webkit-backdrop-filter: blur(40px) saturate(220%);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        8px 0 50px rgba(0, 0, 0, 0.55),
        inset -1px 0 0 rgba(255, 255, 255, 0.06);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-menu.active {
    transform: translateX(0);
}

/* Glass shine on sidebar — brighter gradient */
.sidebar-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 40%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.sidebar-header {
    padding: 76px 24px 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.sidebar-header h3 {
    margin: 0;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.sidebar-header p {
    margin: 6px 0 0 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.sidebar-nav {
    padding: 12px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.sidebar-nav-item:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.15);
    color: #f8fafc;
}

.sidebar-nav-item:active {
    transform: scale(0.98);
}

.sidebar-nav-item i {
    font-size: 22px;
    color: #818cf8;
    width: 28px;
    text-align: center;
}

.sidebar-nav-item .item-desc {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
    margin-top: 2px;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 8px 16px;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.sidebar-footer p {
    margin: 0;
    color: #475569;
    font-size: 11px;
    font-weight: 500;
}

/* --- CONTACT FORM MODAL (GLASS ENHANCED) --- */
#contactModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 10, 20, 0.75);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    padding: 20px;
}

#contactModal.active {
    display: flex;
}

.contact-modal-content {
    background: rgba(30, 41, 59, 0.32);
    backdrop-filter: blur(40px) saturate(220%);
    -webkit-backdrop-filter: blur(40px) saturate(220%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 8px 30px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    max-width: 480px;
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: policyModalIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.contact-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
    z-index: 0;
}

.contact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.contact-header h2 {
    margin: 0;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-size: 20px;
    font-weight: 900;
}

.contact-body {
    padding: 24px 28px 28px 28px;
    position: relative;
    z-index: 1;
}

.contact-body p {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    margin-left: 4px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(10, 15, 30, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.10);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #475569;
}

.form-group textarea {
    min-height: 120px;
}

.contact-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.contact-type-btn {
    flex: 1;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.contact-type-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.contact-type-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.contact-type-btn i {
    font-size: 16px;
}

.btn-send {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.6);
    filter: brightness(110%);
}

@media (max-width: 600px) {
    .sidebar-menu {
        width: 280px;
    }

    .hamburger-btn {
        top: 14px;
        left: 14px;
        width: 40px;
        height: 40px;
    }

    .hamburger-btn span {
        width: 18px;
    }

    .contact-modal-content {
        border-radius: 18px;
    }

    .contact-header {
        padding: 20px 22px 14px 22px;
    }

    .contact-body {
        padding: 20px 22px 24px 22px;
    }
}

/* --- LOCAL INFO MODAL (GLASS ENHANCED) --- */
#localInfoModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 10, 20, 0.80);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.local-info-card {
    background: rgba(30, 41, 59, 0.35);
    padding: 35px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    max-width: 90%;
    width: 380px;
    text-align: center;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(36px) saturate(220%);
    -webkit-backdrop-filter: blur(36px) saturate(220%);
    position: relative;
    overflow: hidden;
}

/* Glass shine on local info card */
.local-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 50%, transparent 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.local-info-card > * {
    position: relative;
    z-index: 1;
}

.local-info-icon {
    margin-bottom: 20px;
    background: rgba(56, 189, 248, 0.15);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

.local-info-icon i {
    font-size: 36px;
    color: #38bdf8;
}

.local-info-card h3 {
    margin: 0 0 15px 0;
    color: #f8fafc;
    font-size: 22px;
    font-weight: 800;
}

.local-info-card p {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.local-info-check {
    color: #4ade80;
    font-weight: 600;
}

.local-info-check i {
    font-size: 16px;
    vertical-align: middle;
}

/* --- TOAST NOTIFICATIONS (GLASS ENHANCED) --- */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    color: #f8fafc;
    padding: 14px 24px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    pointer-events: auto;
    white-space: nowrap;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error i {
    color: #ef4444;
}

.toast-success {
    border-left: 4px solid #22c55e;
}

.toast-success i {
    color: #22c55e;
}

.toast-info {
    border-left: 4px solid #38bdf8;
}

.toast-info i {
    color: #38bdf8;
}

/* --- UTILITY CLASSES --- */
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.flex-06 { flex: 0.6; }
.mb-5 { margin-bottom: 5px; }

.section-divider {
    width: 100%;
    border-color: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
    border-width: 1px 0 0 0;
}

.h1-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.version-tag {
    font-size: 0.5em;
    opacity: 0.85;
    font-weight: 600;
    -webkit-text-fill-color: #a5b4fc;
    color: #a5b4fc;
}

/* History action buttons row */
.history-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-history-action {
    background: none;
    border: none;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 10px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.btn-history-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 25px;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    width: 100%;
}

/* --- KEYBOARD SHORTCUT HINT — HIDDEN --- */
.shortcut-hint {
    display: none !important;
}
