/* ==========================================================================
   2048 Fibonacci Edition - Golden Ratio Mathematical Stylesheet
   ========================================================================== */

.g2048-wrapper.theme-fibonacci {
    --fibo-teal: #0d9488;
    --fibo-emerald: #059669;
    --fibo-gold: #d97706;
    --fibo-navy: #0f172a;
    max-width: 530px;
    margin: 0 auto;
}

/* Fibonacci Header Badge */
.theme-fibonacci .g2048-badge {
    background: linear-gradient(135deg, #0d9488 0%, #10b981 100%);
    color: #ffffff;
    font-weight: 800;
    border: none;
    box-shadow: 0 3px 8px rgba(13, 148, 136, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Fibonacci Sequence Helper Bar */
.fibo-sequence-bar {
    background: #f0fdfa;
    border: 1.5px solid #ccfbf1;
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #115e59;
    box-shadow: 0 2px 5px rgba(13, 148, 136, 0.08);
}

.fibo-formula {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    color: #0f766e;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #99f6e4;
}

.fibo-guide-btn {
    background: #0d9488;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.fibo-guide-btn:hover {
    background: #0f766e;
}

/* Fibonacci Board */
.theme-fibonacci .g2048-board-container {
    background: #ccfbf1 !important;
    border: 6px solid #99f6e4 !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 25px rgba(13, 148, 136, 0.15), inset 0 3px 6px rgba(0, 0, 0, 0.04);
}

.theme-fibonacci .grid-cell {
    background: rgba(255, 255, 255, 0.65) !important;
    border-radius: 14px !important;
}

/* Fibonacci Tiles Styling */
.tile-theme-fibonacci .tile-inner {
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 800;
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.fibo-rank-sub {
    font-size: clamp(0.55rem, 1.6vw, 0.68rem);
    font-weight: 700;
    opacity: 0.8;
    letter-spacing: 0.02em;
    margin-top: 1px;
}

/* Mathematical Gradient Palette for Fibonacci Values */
.tile-fibo-1 .tile-inner { background: #f8fafc; color: #334155; border: 1.5px solid #cbd5e1; }
.tile-fibo-2 .tile-inner { background: #e0f2fe; color: #0369a1; border: 1.5px solid #bae6fd; }
.tile-fibo-3 .tile-inner { background: #ccfbf1; color: #0f766e; border: 1.5px solid #99f6e4; }
.tile-fibo-5 .tile-inner { background: #dcfce7; color: #15803d; border: 1.5px solid #bbf7d0; }
.tile-fibo-8 .tile-inner { background: #fef9c3; color: #a16207; border: 1.5px solid #fef08a; }
.tile-fibo-13 .tile-inner { background: #fed7aa; color: #c2410c; border: 1.5px solid #fdba74; }
.tile-fibo-21 .tile-inner { background: #fecdd3; color: #be123c; border: 1.5px solid #fca5a5; }
.tile-fibo-34 .tile-inner { background: #fbcfe8; color: #be185d; border: 1.5px solid #f9a8d4; }
.tile-fibo-55 .tile-inner { background: #ede9fe; color: #6d28d9; border: 1.5px solid #ddd6fe; }
.tile-fibo-89 .tile-inner { background: #e0e7ff; color: #4338ca; border: 1.5px solid #c7d2fe; }
.tile-fibo-144 .tile-inner { background: #38bdf8; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.tile-fibo-233 .tile-inner { background: #2dd4bf; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.tile-fibo-377 .tile-inner { background: #34d399; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.tile-fibo-610 .tile-inner { background: #fbbf24; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.tile-fibo-987 .tile-inner { background: #f97316; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.tile-fibo-1597 .tile-inner { background: #ec4899; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* The Target Winning Tile: 2584 */
.tile-fibo-2584 .tile-inner {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6), 0 0 35px rgba(239, 68, 68, 0.4);
    animation: fiboPulse 2.5s infinite alternate;
}

@keyframes fiboPulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.03); filter: brightness(1.15); }
}

/* Fibonacci Guide Modal */
.fibo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.fibo-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.fibo-modal {
    background: #ffffff;
    border: 3px solid #ccfbf1;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: scale(0.94);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fibo-modal-overlay.is-visible .fibo-modal {
    transform: scale(1);
}

.fibo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed #99f6e4;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.fibo-modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f766e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fibo-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.88rem;
}

.fibo-table th, .fibo-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0fdfa;
    text-align: left;
}

.fibo-table th {
    background: #f0fdfa;
    color: #0f766e;
    font-weight: 800;
}

