@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

:root {
    --bg-main: #f1f5f9;
    --sidebar-bg: #14354a;
    --sidebar-text: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --topbar-bg: #ffffff;
    --text-primary: #3c4b64;
    --text-secondary: #768192;
    --terminal-bg: #ffffff;
    --terminal-text: #333333;

    /* CoreUI Colors */
    --c-blue: #321fdb;
    --c-light-blue: #39f;
    --c-yellow: #f9b115;
    --c-red: #e55353;
    --c-green: #2eb85c;
    --c-dark-blue: #3399ff;
    --border-color: #d8dbe0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


#layout {
    display: flex;
    width: 100%;
    flex-grow: 1;
    overflow: hidden;
}

#right-panel {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    box-shadow: -10px 0 25px rgba(0,0,0,0.1);
    z-index: 10;
}

/* Sidebar - Modern Glassmorphism */
#sidebar {
    width: 256px;
    min-width: 256px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0 0 20px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

#sidebar img {
    border-radius: 50%;
    margin-top: 10px;
}

#sidebar h2 {
    color: #ffffff;
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

.menu-section {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-top: 20px;
    margin-bottom: 10px;
    padding: 0 20px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item,
.nav-group-toggle {
    padding: 12px 20px;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: background 0.2s;
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
}

.nav-item:hover,
.nav-group-toggle:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.icon {
    margin-right: 15px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.chevron {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 1.2rem;
}

.nav-group-items {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.1);
}

.nav-group-items .nav-item {
    padding-left: 55px;
    font-size: 0.85rem;
}

.nav-group-items .nav-item::before,
.nav-group-items .nav-group-toggle::before {
    content: "\2022";
    margin-right: 10px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
}

.nav-group.show>.nav-group-items {
    max-height: 2000px;
    /* large enough for content to animate, even when deeply nested */
}

.nav-group.show>.nav-group-toggle .chevron {
    transform: rotate(90deg);
}

/* Sidebar Promo Box */
.sidebar-promo-box {
    margin: 30px 15px;
    padding: 25px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.promo-text {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    font-family: 'Fredoka', sans-serif;
    z-index: 2;
    position: relative;
}

.promo-star {
    font-size: 3.5rem;
    position: absolute;
    right: -5px;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%) rotate(15deg);
    opacity: 0.9;
}

/* Main Content Area */
#main-content {
    flex-grow: 1;
    position: relative;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

/* The "App" Container - Sleek Terminal Card */
#app {
    width: 100%;
    flex: 1;
    margin: 0 auto;
    position: relative;
    padding: 2rem;
    display: flex;
    /* Hide by default or overridden by JS */
    flex-direction: column;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 1.1rem;
    line-height: 1.6;
    white-space: normal;
    color: var(--terminal-text);
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Fix for flexbox scroll cutoff */
#app::after {
    content: '';
    display: block;
    min-height: 20px;
    flex-shrink: 0;
}

/* Custom Scrollbar for modern look */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#terminal {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-top: -20px;
}

#input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
    padding-bottom: 40px;
    color: #000000;
    /* Black prompt text */
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: #ffffff;
    animation: blink 1s step-end infinite;
    vertical-align: bottom;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.correct {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.incorrect {
    color: #f87171;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

/* Unique Welcome Screen */
.welcome-container {
    background: linear-gradient(135deg, #3264c8 0%, #204db5 100%);
    border-radius: 16px;
    padding: 60px 40px;
    white-space: normal;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(32, 77, 181, 0.2);
}

.welcome-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.welcome-title {
    font-size: 3.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.welcome-title .highlight {
    background: linear-gradient(135deg, #ffffff 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: #dbeafe;
    font-family: 'Inter', sans-serif;
    margin-bottom: 2.5rem;
    font-weight: 400;
    opacity: 0.9;
}

.welcome-features {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #ffffff;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feature-badge:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Calendar UI */
.input-card {
    background: transparent;
    border: none;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    margin: 40px auto;
    max-width: 680px;
    width: calc(100% - 40px);
    animation: fadeIn 0.5s ease-out;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
}

.input-card *,
.input-card div,
.input-card span,
.input-card p,
.input-card h2 {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: inherit;
}

.input-card h2 {
    font-family: 'Inter', sans-serif;
    color: #000000;
    margin-bottom: 10px;
    font-size: 1.8rem;
    white-space: normal;
}

.input-card p {
    color: #333333;
    font-family: 'Inter', sans-serif;
    white-space: normal;
}

.calendar-year-container {
    width: 100%;
    animation: fadeIn 0.5s ease-out;
    padding: 20px 0;
    margin-bottom: 60px;
    white-space: normal;
}

.calendar-year-title {
    text-align: center;
    font-family: 'Inter', sans-serif;
    color: #000000;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    width: 100%;
}

.calendar-month {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.month-name {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #321fdb;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
}

.day,
.empty-day {
    padding: 3px 0;
    font-size: 0.8rem;
    font-family: 'Fira Code', monospace;
    border-radius: 4px;
    color: #000000;
}

.day:hover {
    background: rgba(50, 31, 219, 0.1);
    cursor: default;
}

/* Yes / No Prompt */
.yes-no-prompt {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.03);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 60px;
}

.yes-no-prompt span {
    color: #333333;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
}

.yes-no-prompt button {
    background: rgba(50, 31, 219, 0.1);
    border: 1px solid rgba(50, 31, 219, 0.3);
    color: #321fdb;
    padding: 6px 16px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.yes-no-prompt button:hover {
    background: rgba(50, 31, 219, 0.2);
}

transform: translateY(-2px);
}

/* CoreUI Dashboard Styles */
#dashboard-cards {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumb {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    border-radius: 6px;
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card.blue {
    background-color: var(--c-blue);
}

.stat-card.light-blue {
    background-color: var(--c-light-blue);
}

.stat-card.yellow {
    background-color: var(--c-yellow);
}

.stat-card.red {
    background-color: var(--c-red);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.stat-value .trend {
    font-size: 0.85rem;
    font-weight: 400;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.dummy-chart-line,
.dummy-chart-bar {
    height: 40px;
    margin-top: 20px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.dummy-chart-line svg {
    width: 100%;
    height: 100%;
}

.dummy-chart-bar .bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px 2px 0 0;
}

.traffic-chart-container {
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.chart-header .date-range {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 5px;
}

.chart-actions {
    display: flex;
    gap: 15px;
}

.button-group {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.button-group button {
    background: white;
    border: none;
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    border-right: 1px solid var(--border-color);
}

.button-group button:last-child {
    border-right: none;
}

.button-group button.active {
    background: var(--text-secondary);
    color: white;
}

.download-btn {
    background: var(--c-blue);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
}

.chart-body {
    padding: 20px;
    background: #f8f9fa;
}

.chart-footer {
    display: flex;
    padding: 20px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    flex: 1;
    text-align: center;
    border-right: 1px solid var(--border-color);
    padding: 0 10px;
}

.stat-item:last-child {
    border-right: none;
}

.stat-item .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.stat-item .value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
}

.progress-bar .fill.green {
    background: var(--c-green);
}

.progress-bar .fill.blue {
    background: var(--c-light-blue);
}

.progress-bar .fill.yellow {
    background: var(--c-yellow);
}

.progress-bar .fill.red {
    background: var(--c-red);
}

.progress-bar .fill.dark-blue {
    background: var(--c-blue);
}

.social-cards {
    display: flex;
    gap: 20px;
}

.social-card {
    flex: 1;
    height: 100px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.social-card.facebook {
    background-color: #3b5998;
}

.social-card.twitter {
    background-color: #00aced;
}

.social-card.linkedin {
    background-color: #4875b4;
}

/* Monster Brand Styles */
.monster-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 64px;
    min-height: 64px;
    flex-shrink: 0;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.15);
    /* Match the previous darker background from CoreUI */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.monster-logo {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    letter-spacing: -1px;
}

.logo-word {
    display: inline-block;
    white-space: nowrap;
}

.monster-logo .letter {
    display: inline-block;
    text-shadow:
        -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff,
        -3px 0 0 #fff, 3px 0 0 #fff, 0 -3px 0 #fff, 0 3px 0 #fff,
        0px 6px 0px rgba(0, 0, 0, 0.3);
}

@supports (-webkit-text-stroke: 4px white) {
    .monster-logo .letter {
        -webkit-text-stroke: 4px white;
        paint-order: stroke fill;
        text-shadow: 0px 4px 0px rgba(0, 0, 0, 0.3);
    }
}

.monster-logo .c-red {
    color: #f24b59;
}

.monster-logo .c-pink {
    color: #f98db8;
}

.monster-logo .c-orange {
    color: #f28c2c;
}

.monster-logo .c-yellow {
    color: #f9c23c;
}

.monster-logo .c-purple {
    color: #a163cc;
}

.monster-logo .c-blue {
    color: #35a7ed;
}

.monster-logo .c-cyan {
    color: #2cc9e5;
}

.monster-logo .c-green {
    color: #6dbf3f;
}

.monster-logo .bounce-1 {
    transform: rotate(-6deg) translateY(-2px);
}

.monster-logo .bounce-2 {
    transform: rotate(4deg) translateY(3px);
}

.monster-logo .bounce-3 {
    transform: rotate(-4deg) translateY(1px);
}

.monster-logo .bounce-4 {
    transform: rotate(6deg) translateY(-3px);
}

.monster-letter {
    position: relative;
}

.monster-eye {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    border: 2px solid #333;
    z-index: 2;
}

.monster-eye::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: black;
    border-radius: 50%;
}

.monster-horns {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 10px;
    border-top: 3px solid #333;
    border-radius: 50%;
    z-index: 1;
}

.monster-horns::before,
.monster-horns::after {
    content: '';
    position: absolute;
    top: -4px;
    width: 4px;
    height: 8px;
    background: #333;
    border-radius: 50%;
}

.monster-horns::before {
    left: -2px;
    transform: rotate(-30deg);
}

.monster-horns::after {
    right: -2px;
    transform: rotate(30deg);
}

/* CoreUI Header Styles */
.coreui-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: #ffffff;
    border-bottom: none;
    height: 64px;
    box-sizing: border-box;
    color: #4f5d73;
    width: 100%;
    flex-shrink: 0;
    z-index: 20;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
}

.header-left {
    gap: 20px;
}

.header-toggler {
    background: transparent;
    border: none;
    color: #4f5d73;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
}

.header-nav {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    font-weight: 500;
    font-size: 0.95rem;
}

.header-nav .nav-item {
    cursor: pointer;
    padding: 5px 0;
}

.header-nav .nav-item:hover {
    color: #321fdb;
}

.header-right {
    gap: 15px;
}

.header-icon {
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    color: #4f5d73;
    transition: color 0.2s;
}

.header-icon:hover {
    color: #321fdb;
}

.header-avatar {
    cursor: pointer;
    margin-left: 10px;
}

.header-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Premium Game UI */
.premium-game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 40px;
    animation: fadeIn 0.6s ease-out;
    font-family: 'Inter', sans-serif;
}

.premium-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #321fdb, #5856d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    letter-spacing: -0.5px;
}

.premium-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 40px;
    text-align: center;
    font-weight: 400;
}

.premium-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* App Header Bar */
.app-header-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background-color: #f8f9fa; /* Light container background */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

#app-breadcrumbs {
    flex: 1 1 100%;
    min-width: 0;
}

.app-header-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.home-btn {
    background: #3c4b64 !important;
}

/* Tile Menu Styles */
.tiles-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 16px;
    background-color: #f8f9fa; /* Light container background */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    gap: 10px;
    margin-bottom: 20px;
}

.centered-title {
    text-align: center;
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-btn {
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.icon-btn:hover {
    background: #e2e8f0;
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn.home-btn {
    background: #4caf50;
    color: white;
}

.icon-btn.home-btn:hover {
    background: #43a047;
}

.back-action-btn {
    background: transparent !important;
    box-shadow: none !important;
    color: #475569;
    padding: 0;
}

#app.fibo-active #input-line {
    display: none !important;
}

.back-action-btn:hover {
    color: #0f172a;
    background: transparent !important;
}

.back-btn {
    padding: 8px 16px;
    background-color: #37475a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background-color: #2c3a4a;
}

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding: 40px;
    overflow-y: auto;
}

.tile-card {
    border-radius: 24px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: #111;
    position: relative;
    border: none;
}

/* Match mobile-tile pastel colors */
.tile-card.color-1 { background: #ffd4cc; }
.tile-card.color-2 { background: #ffccda; }
.tile-card.color-3 { background: #ffe4cc; }
.tile-card.color-4 { background: #ccefff; }
.tile-card.color-5 { background: #dfccff; }
.tile-card.color-6 { background: #ccffdb; }
.tile-card.color-7 { background: #fffaad; }
.tile-card.color-8 { background: #ccfffa; }
.tile-card.color-9 { background: #cfccff; }
.tile-card.color-10 { background: #e8cfbb; }
.tile-card.color-11 { background: #ccf7ff; }

.tile-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}

.tile-icon {
    font-size: 2.8rem;
    margin: 0 auto 20px auto;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1), inset 0 2px 5px rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile-card:hover .tile-icon {
    transform: scale(1.15) rotate(5deg);
}

.tile-label {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

width: 100%;
max-width: 500px;
margin: 0 auto;
}

.premium-input-wrapper.active {
    border-color: #321fdb;
    box-shadow: 0 10px 30px rgba(50, 31, 219, 0.15);
    transform: translateY(-2px);
}

.premium-result-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    margin: 20px auto;
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

.premium-result-text {
    font-family: 'Fredoka', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid #10b981;
    margin-top: 15px;
    text-align: center;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-btn-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    animation: slideUp 0.6s ease-out;
}

.premium-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
}

.premium-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.premium-btn.primary {
    color: #ffffff;
    background: #321fdb;
    border-color: #321fdb;
    box-shadow: 0 4px 15px rgba(50, 31, 219, 0.2);
}

.premium-btn.primary:hover {
    background: #2a1ab9;
    border-color: #2a1ab9;
    box-shadow: 0 8px 25px rgba(50, 31, 219, 0.3);
}

/* ==========================================================================
   Mobile Responsiveness (Media Queries)
   ========================================================================== */

@media (max-width: 768px) {

    /* Layout & Sidebar */
    #layout {
        position: relative;
    }

    #sidebar {
        position: fixed;
        left: -260px;
        /* Hide off-screen by default */
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
    }

    /* When .collapsed is toggled via header button, slide sidebar IN */
    #sidebar.collapsed {
        left: 0;
    }

    #main-content {
        padding: 10px 10px 80px 10px;
        background: #e2efff;
    }

    /* Header */
    #top-bar {
        padding: 10px;
    }

    .header-center {
        display: none !important;
        /* Hide long company name on small screens */
    }

    .header-right {
        font-size: 0.8rem;
    }

    .header-right img {
        width: 30px;
        height: 30px;
    }

    /* Welcome Banner overrides (using !important because of inline HTML styles) */
    .welcome-banner {
        padding: 30px 15px !important;
    }

    .welcome-banner>div:first-child {
        width: 150px !important;
        height: 150px !important;
        margin-bottom: 20px !important;
    }

    .welcome-banner img {
        width: 100% !important;
        height: 100% !important;
    }

    .welcome-banner h1 {
        font-size: 2.2rem !important;
    }

    .welcome-banner p {
        font-size: 1rem !important;
    }

    /* Tiles Grid */
    .tiles-grid {
        padding: 0 5px 5px;
        gap: 15px;
        grid-template-columns: repeat(2, 1fr);
        /* 2 tiles per row on mobile */
    }

    .tile-card {
        border-radius: 14px;
        padding: 25px 10px;
        min-height: 140px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    }

    .tile-icon {
        font-size: 2.8rem;
        width: auto;
        height: auto;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        border: none;
        margin: 0 auto 12px auto;
        display: block;
    }

    .tile-label {
        font-size: 0.75rem;
        font-weight: 700;
        margin-bottom: 2px;
        line-height: 1.1;
        letter-spacing: normal;
        text-shadow: none;
    }

    .fibo-content-wrapper {
        padding: 0px 15px;
        gap: 20px;
    }

    .tiles-header {
        padding: 12px;
        gap: 8px;
    }

    .centered-title {
        font-size: 1.05rem;
    }

    .back-btn {
        font-size: 0.9rem;
        padding: 6px 12px;
        white-space: nowrap;
    }

    /* Terminal App */
    #app {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    .app-header-bar {
        padding: 12px;
        margin-bottom: 6px;
    }

    #app-breadcrumbs {
        font-size: 0.8rem;
    }

    .app-header-btns .back-btn {
        font-size: 0.75rem;
        padding: 5px 10px !important;
    }

    /* Premium Game UI */
    .premium-title {
        font-size: 1.5rem;
    }

    .premium-subtitle {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    .premium-game-container {
        margin-top: 20px;
        padding: 0 10px;
    }

    .premium-input-wrapper {
        flex-direction: column;
        padding: 15px;
        gap: 10px;
    }

    .premium-result-box {
        padding: 20px 15px;
    }

    .premium-result-text {
        font-size: 1rem;
        padding: 15px;
    }
}

/* Mobile Dashboard Styles */
.mobile-dashboard {
    display: none;
    flex-direction: column;
    padding: 5px;
    padding-bottom: 80px;
    background: #e2efff;
    flex: 1;
    overflow-y: auto;
}

.mobile-header-container {
    display: none;
    background: #ffffff;
    border-radius: 0;
    padding: 12px 16px;
    margin: -10px -10px 10px -10px;
    border-bottom: 3px solid #666;
}

.mobile-header-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    margin-bottom: 5px;
}

.mobile-header-text h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #555;
    margin: 0;
}

.mobile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-search-container {
    position: relative;
    margin-bottom: 15px;
}

.mobile-search-container input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    background: #f9f9f9;
    font-size: 0.9rem;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    width: 16px;
    height: 16px;
}

.mobile-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mobile-tile {
    border-radius: 16px;
    padding: 15px 10px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    background: #fafaf9;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s;
    gap: 10px;
}

.mobile-tile:active {
    transform: scale(0.96);
}

.mobile-tile.color-1 { background: #fdf2f8; border-color: #fce7f3; }
.mobile-tile.color-2 { background: #fff1f2; border-color: #ffe4e6; }
.mobile-tile.color-3 { background: #fff7ed; border-color: #ffedd5; }
.mobile-tile.color-4 { background: #eff6ff; border-color: #dbeafe; }
.mobile-tile.color-5 { background: #f5f3ff; border-color: #ede9fe; }
.mobile-tile.color-6 { background: #f0fdf4; border-color: #dcfce7; }
.mobile-tile.color-7 { background: #fefce8; border-color: #fef08a; }
.mobile-tile.color-8 { background: #f0fdfa; border-color: #ccfbf1; }
.mobile-tile.color-9 { background: #eef2ff; border-color: #e0e7ff; }
.mobile-tile.color-10 { background: #fef2f2; border-color: #fee2e2; }
.mobile-tile.color-11 { background: #ecfeff; border-color: #cffafe; }

.mobile-tile-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.mobile-tile-title {
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin: 0;
    line-height: 1.2;
    font-family: 'Fira Code', monospace;
    word-break: break-word;
}

.mobile-tile.color-1 .mobile-tile-title, .tile-card.color-1 .tile-label { color: #be185d; }
.mobile-tile.color-2 .mobile-tile-title, .tile-card.color-2 .tile-label { color: #e11d48; }
.mobile-tile.color-3 .mobile-tile-title, .tile-card.color-3 .tile-label { color: #c2410c; }
.mobile-tile.color-4 .mobile-tile-title, .tile-card.color-4 .tile-label { color: #1d4ed8; }
.mobile-tile.color-5 .mobile-tile-title, .tile-card.color-5 .tile-label { color: #6d28d9; }
.mobile-tile.color-6 .mobile-tile-title, .tile-card.color-6 .tile-label { color: #15803d; }
.mobile-tile.color-7 .mobile-tile-title, .tile-card.color-7 .tile-label { color: #a16207; }
.mobile-tile.color-8 .mobile-tile-title, .tile-card.color-8 .tile-label { color: #0f766e; }
.mobile-tile.color-9 .mobile-tile-title, .tile-card.color-9 .tile-label { color: #4338ca; }
.mobile-tile.color-10 .mobile-tile-title, .tile-card.color-10 .tile-label { color: #b91c1c; }
.mobile-tile.color-11 .mobile-tile-title, .tile-card.color-11 .tile-label { color: #0369a1; }

.mobile-tile-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    line-height: 1.2;
    font-family: 'Fira Code', monospace;
}

@media (max-width: 768px) {
    .mobile-header-container {
        display: block;
    }

    .mobile-close-sidebar {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-dashboard {
        display: flex;
        flex: 1;
        overflow-y: auto;
    }

    /* Ensure it fits one screen without scroll if possible */
    #top-bar {
        display: none !important;
    }
}

/* Game UI Overrides for Playful Aesthetic */
.input-card, .premium-game-container {
    background: transparent !important;
    border: none !important;
    border-radius: 24px !important;
    padding: 20px 25px !important;
    max-width: 600px !important;
    margin: 15px auto !important;
    transition: transform 0.1s ease, border-bottom-width 0.1s ease;
    cursor: pointer;
}

.input-card:active, .premium-game-container:active {
    transform: translateY(4px) !important;
    border-bottom-width: 4px !important;
}

/* Icon Container */
.input-card > div:first-child {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 90px !important;
    height: 90px !important;
    background: linear-gradient(135deg, #fde047, #f59e0b) !important;
    border: 4px solid #334155 !important;
    border-bottom: 6px solid #334155 !important;
    border-radius: 28px !important;
    font-size: 3rem !important;
    margin: 0 auto 20px auto !important;
    animation: bounceIcon 2s infinite ease-in-out !important;
}

@keyframes bounceIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Titles */
.input-card h2, .premium-title {
    font-family: 'Fredoka', 'Nunito', sans-serif !important;
    color: #4338ca !important;
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    margin-bottom: 12px !important;
    text-shadow: 2px 2px 0px #c7d2fe !important;
    white-space: normal !important;
}

/* Subtitles / Descriptions */
.input-card p, .premium-subtitle {
    font-family: 'Fredoka', sans-serif !important;
    color: #475569 !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    margin-bottom: 25px !important;
}

/* Simulated Input Field (usually the last div in input-card) */
.input-card > div:last-child {
    background: #ffffff !important;
    border: 3px solid #10b981 !important;
    border-bottom: 5px solid #10b981 !important;
    border-radius: 16px !important;
    padding: 18px 24px !important;
    font-family: 'Fredoka', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    color: #1e293b !important;
    display: block !important;
    text-align: center !important;
}

/* Premium input wrapper and result box */
.premium-input-wrapper.active {
    background: #ffffff !important;
    border: 3px solid #10b981 !important;
    border-bottom: 5px solid #10b981 !important;
    border-radius: 16px !important;
    padding: 18px 24px !important;
    font-family: 'Fredoka', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    color: #1e293b !important;
}

.premium-result-box {
    background: #ffffff !important;
    border: 3px solid #10b981 !important;
    border-bottom: 5px solid #10b981 !important;
    border-radius: 16px !important;
    padding: 18px 24px !important;
    font-family: 'Fredoka', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    color: #1e293b !important;
}

/* Mobile specific overrides for Game UI */
@media (max-width: 768px) {
    .input-card, .premium-game-container {
        padding: 24px 15px !important;
        margin: 20px auto !important;
        border-radius: 20px !important;
        border: none !important;
        width: 92% !important;
    }
    
    .input-card > div:first-child {
        width: 70px !important;
        height: 70px !important;
        font-size: 2.2rem !important;
        border-radius: 20px !important;
        margin-bottom: 16px !important;
        border-width: 3px !important;
        border-bottom-width: 5px !important;
    }

    .input-card h2, .premium-title {
        font-size: 1.6rem !important;
    }

    .input-card p, .premium-subtitle {
        font-size: 1.05rem !important;
        margin-bottom: 20px !important;
    }
    
    .input-card > div:last-child, .premium-input-wrapper.active, .premium-result-box {
        padding: 14px 18px !important;
        font-size: 1.1rem !important;
    }
}

.action-btn {
    background-color: var(--sidebar-bg);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.action-btn:hover {
    opacity: 0.9;
}

/* Bottom Submenu Navigation Styles */
.app-submenu-container {
    margin-top: 25px;
    padding: 20px;
    border-radius: 16px;
    display: none;
    animation: fadeInUp 0.4s ease;
}

.app-submenu-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    text-align: center;
}

.app-submenu-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.app-submenu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 8px;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid currentColor;
    user-select: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
    min-height: 105px;
}

.app-submenu-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.app-submenu-item:active {
    transform: translateY(0);
}

.app-submenu-item-icon {
    font-size: 2rem;
    margin-bottom: 6px;
    display: block;
}

.app-submenu-item-label {
    white-space: normal;
    line-height: 1.2;
    display: block;
    word-break: break-word;
}

/* Color schemes for app submenu cards */
.app-submenu-item.color-1 { background: #ffd4cc; color: #d93025; }
.app-submenu-item.color-2 { background: #ffccda; color: #c2185b; }
.app-submenu-item.color-3 { background: #ffe4cc; color: #e65100; }
.app-submenu-item.color-4 { background: #ccefff; color: #0b57d0; }
.app-submenu-item.color-5 { background: #dfccff; color: #681da8; }
.app-submenu-item.color-6 { background: #ccffdb; color: #0d652d; }
.app-submenu-item.color-7 { background: #fffaad; color: #b07d00; }
.app-submenu-item.color-8 { background: #ccfffa; color: #00796b; }
.app-submenu-item.color-9 { background: #cfccff; color: #3f51b5; }
.app-submenu-item.color-10 { background: #e8cfbb; color: #5d4037; }
.app-submenu-item.color-11 { background: #ccf7ff; color: #00838f; }

/* Active sibling highlight */
.app-submenu-item.active {
    border-color: currentColor;
    transform: scale(1.03);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes celebrationPop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        transform: scale(1.03) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Fibonacci UI Overrides */
#app.fibo-active {
    background: linear-gradient(to bottom, #dbeafe 0%, #e0e7ff 50%, #ffffff 100%);
    border: none;
    box-shadow: none;
    padding: 0;
}

#app.fibo-active .app-header-bar {
    background: transparent !important;
    border-bottom: none;
    padding: 20px 30px;
    z-index: 10;
}

#app.fibo-active .app-header-bar .back-action-btn, 
#app.fibo-active .app-header-bar .home-btn {
    background: #ffffff !important;
    color: #4f46e5 !important;
    border-radius: 20px;
    padding: 8px 20px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#app.fibo-active .app-header-bar .centered-title {
    color: #4338ca;
    font-size: 2.2rem;
    text-shadow: 2px 2px 0px #ffffff;
    letter-spacing: -0.5px;
}

.fibo-hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 280px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23c7d2fe" fill-opacity="1" d="M0,256L80,240C160,224,320,192,480,186.7C640,181,800,203,960,213.3C1120,224,1280,224,1360,224L1440,224L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z"></path></svg>') no-repeat bottom center;
    background-size: cover;
    z-index: 1;
}

.fibo-monster-decorator {
    display: none;
}

.fibo-content-wrapper {
    position: relative;
    z-index: 5;
    padding: 0px 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.fibo-main-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    border: 2px solid #f1f5f9;
}

.fibo-left-illustration {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    align-self: flex-start;
}

.fibo-left-illustration img {
    max-width: 250px;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.1));
}

.fibo-right-form {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    margin-top: -10px;
    min-width: 300px;
}

.fibo-right-form h2 {
    font-family: 'Fredoka', sans-serif;
    color: #1e3a8a;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
    white-space: nowrap;
}

.fibo-right-form h2 span {
    color: #6366f1;
}

.fibo-input-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.fibo-input-row input {
    flex: 1;
    padding: 15px 20px;
}

.fibo-related-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.fibo-related-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin: 0;
}

.fibo-related-card p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

.fibo-related-card.card-1 h4 { color: #be185d; }
.fibo-related-card.card-2 h4 { color: #b45309; }
    margin-bottom: 6px;
    display: block;
}

.app-submenu-item-label {
    white-space: normal;
    line-height: 1.2;
    display: block;
    word-break: break-word;
}

/* Color schemes for app submenu cards */
.app-submenu-item.color-1 { background: #ffd4cc; color: #d93025; }
.app-submenu-item.color-2 { background: #ffccda; color: #c2185b; }
.app-submenu-item.color-3 { background: #ffe4cc; color: #e65100; }
.app-submenu-item.color-4 { background: #ccefff; color: #0b57d0; }
.app-submenu-item.color-5 { background: #dfccff; color: #681da8; }
.app-submenu-item.color-6 { background: #ccffdb; color: #0d652d; }
.app-submenu-item.color-7 { background: #fffaad; color: #b07d00; }
.app-submenu-item.color-8 { background: #ccfffa; color: #00796b; }
.app-submenu-item.color-9 { background: #cfccff; color: #3f51b5; }
.app-submenu-item.color-10 { background: #e8cfbb; color: #5d4037; }
.app-submenu-item.color-11 { background: #ccf7ff; color: #00838f; }

/* Active sibling highlight */
.app-submenu-item.active {
    border-color: currentColor;
    transform: scale(1.03);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes celebrationPop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        transform: scale(1.03) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Fibonacci UI Overrides */
#app.fibo-active {
    background: linear-gradient(to bottom, #dbeafe 0%, #e0e7ff 50%, #ffffff 100%);
    border: none;
    box-shadow: none;
    padding: 0;
}

#app.fibo-active .app-header-bar {
    background: transparent !important;
    border-bottom: none;
    padding: 20px 30px;
    z-index: 10;
}

#app.fibo-active .app-header-bar .back-action-btn, 
#app.fibo-active .app-header-bar .home-btn {
    background: #ffffff !important;
    color: #4f46e5 !important;
    border-radius: 20px;
    padding: 8px 20px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#app.fibo-active .app-header-bar .centered-title {
    color: #4338ca;
    font-size: 2.2rem;
    text-shadow: 2px 2px 0px #ffffff;
    letter-spacing: -0.5px;
}

.fibo-hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 280px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23c7d2fe" fill-opacity="1" d="M0,256L80,240C160,224,320,192,480,186.7C640,181,800,203,960,213.3C1120,224,1280,224,1360,224L1440,224L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z"></path></svg>') no-repeat bottom center;
    background-size: cover;
    z-index: 1;
}

.fibo-monster-decorator {
    position: absolute;
    top: 60px;
    left: 20%;
    font-size: 4rem;
    z-index: 2;
    animation: float 4s ease-in-out infinite;
}

.fibo-content-wrapper {
    position: relative;
    z-index: 5;
    padding: 0px 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: 100%;
    overflow-y: auto;
}

.fibo-main-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    border: 2px solid #f1f5f9;
}

.fibo-left-illustration {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.fibo-left-illustration img {
    max-width: 250px;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.1));
    mix-blend-mode: multiply;
}

.fibo-right-illustration {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.fibo-right-illustration img {
    max-width: 300px;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.1));
    transform: scale(1.1);
    mix-blend-mode: multiply;
}

.fibo-boy-illustration {
    align-self: flex-end;
    margin-right: -20px;
    margin-bottom: 0px;
    width: 200px;
}



.fibo-input-row input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s;
}

.fibo-input-row input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.fibo-play-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(99,102,241,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.fibo-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(99,102,241,0.4);
}

.fibo-tip {
    background: #fef3c7;
    color: #b45309;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.fibo-boy-illustration {
    width: 240px;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: -40px;
    margin-right: -20px;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.1));
    mix-blend-mode: multiply;
}

.fibo-related-apps {
    background: #ffffff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
    border: 2px solid #f1f5f9;
}

.fibo-related-title {
    text-align: center;
    font-family: 'Fredoka', sans-serif;
    color: #1e293b;
    font-size: 1.4rem;
    margin-bottom: 25px;
}

.fibo-related-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .fibo-related-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 900px) {
    .fibo-related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 600px) {
    .fibo-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.fibo-related-card {
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #fafaf9;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s;
    cursor: pointer;
}

.fibo-related-card:hover {
    transform: translateY(-5px);
}

.fibo-related-card.card-1 { background: #fdf2f8; border-color: #fce7f3; }
.fibo-related-card.card-2 { background: #fffbeb; border-color: #fef3c7; }
.fibo-related-card.card-3 { background: #fff7ed; border-color: #ffedd5; }
.fibo-related-card.card-4 { background: #f0fdf4; border-color: #dcfce7; }
.fibo-related-card.card-5 { background: #f5f3ff; border-color: #ede9fe; }

.fibo-related-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.fibo-related-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin: 0;
}

.fibo-related-card p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

.fibo-related-card.card-1 h4 { color: #be185d; }
.fibo-related-card.card-2 h4 { color: #b45309; }
.fibo-related-card.card-3 h4 { color: #c2410c; }
.fibo-related-card.card-4 h4 { color: #15803d; }
.fibo-related-card.card-5 h4 { color: #6d28d9; }

#sidebar .nav-item.active {
    background: #ffffff !important;
    color: #1e3a8a !important;
    font-weight: bold !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
}

/* ASCII Table Premium UI */
.ascii-grid-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}

/* Custom Scrollbar for ASCII Container */
.ascii-grid-container::-webkit-scrollbar {
    width: 8px;
}
.ascii-grid-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}
.ascii-grid-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}
.ascii-grid-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.ascii-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    width: 100%;
}

.ascii-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.ascii-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.ascii-char {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Fira Code', monospace;
    color: #1e293b;
    margin-bottom: 8px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ascii-meta {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    font-family: 'Fira Code', monospace;
    color: #64748b;
}

.ascii-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

/* ASCII Categorized Colors */
.ascii-printable {
    background: #ffffff;
}
.ascii-printable .ascii-char {
    color: #3b82f6;
}
.ascii-printable .ascii-badge {
    background: #eff6ff;
    color: #2563eb;
}

.ascii-control {
    background: #fff5f5;
    border-color: #fed7d7;
}
.ascii-control .ascii-char {
    color: #e53e3e;
    font-size: 1.1rem;
}
.ascii-control .ascii-badge {
    background: #fee2e2;
    color: #dc2626;
}

.ascii-space {
    background: #faf5ff;
    border-color: #e9d5ff;
}
.ascii-space .ascii-char {
    color: #7c3aed;
    font-size: 1.1rem;
}
.ascii-space .ascii-badge {
    background: #f3e8ff;
    color: #9333ea;
}

/* Fibonacci & Game UI Mobile Fixes */
@media (max-width: 768px) {
    .fibo-content-wrapper {
        padding: 0 10px;
    }
    .fibo-main-card {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }
    .fibo-left-illustration {
        width: 100%;
        justify-content: center;
        margin-top: -25px;
        margin-bottom: 0px;
    }
    .fibo-left-illustration img {
        max-width: 120px;
    }
    .fibo-right-illustration {
        display: none; /* Hide to prevent overflow and save space */
    }
    .fibo-right-form {
        width: 100%;
        min-width: 100%;
        margin-top: 0;
    }
    .fibo-right-form h2 {
        font-size: 1.6rem;
        white-space: normal;
    }
    .fibo-input-row {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    .fibo-input-row input, .fibo-input-row textarea, .fibo-play-btn {
        width: 100%;
        box-sizing: border-box;
        flex: none !important;
    }
    .fibo-input-row input {
        padding: 10px 15px !important;
        font-size: 0.95rem !important;
        height: auto !important;
    }
    .fibo-input-row textarea {
        height: 80px !important;
        padding: 10px !important;
        font-size: 0.9rem !important;
    }
    .fibo-play-btn {
        padding: 10px 20px !important;
        font-size: 0.95rem !important;
        justify-content: center;
    }
    .fibo-boy-illustration {
        display: none;
    }
    #app.fibo-active .app-header-bar {
        padding: 10px;
        gap: 5px;
    }
    #app-breadcrumbs.centered-title, #app.fibo-active .app-header-bar .centered-title {
        font-size: 1.25rem !important;
        white-space: normal !important;
        text-align: center;
        line-height: 1.2 !important;
    }
    .action-btn, #app.fibo-active .app-header-bar .back-action-btn, #app.fibo-active .app-header-bar .home-btn {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
    }
    .fibo-related-title {
        white-space: nowrap;
        font-size: 0.9rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .app-submenu-container {
        margin-top: 20px !important;
        padding: 0 10px !important;
    }
}

@media (max-width: 480px) {
    .fibo-related-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide number input arrows */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}
