/* ==========================================================================
   Cobblemon Spawn Optimizer & Poké Snack Calculator - Master Stylesheet
   ========================================================================== */

:root {
    --bg-main: #0a0e17;
    --bg-card: rgba(18, 26, 43, 0.75);
    --bg-card-hover: rgba(26, 37, 60, 0.85);
    --bg-input: #131c2e;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 242, 254, 0.3);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --accent-gold: #fbbf24;
    --accent-emerald: #10b981;
    --accent-purple: #a855f7;
    --accent-rose: #f43f5e;
    
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-card: 0 12px 32px 0 rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 30px rgba(0, 242, 254, 0.2);
}

/* Pokemon Type Colors */
.type-normal { background: #a8a878; color: #111; }
.type-fire { background: linear-gradient(135deg, #ff6b4a, #e63946); color: #fff; }
.type-water { background: linear-gradient(135deg, #4dabf7, #1971c2); color: #fff; }
.type-grass { background: linear-gradient(135deg, #51cf66, #2b8a3e); color: #fff; }
.type-electric { background: linear-gradient(135deg, #ffd43b, #f59f00); color: #111; }
.type-ice { background: linear-gradient(135deg, #66d9e8, #1098ad); color: #111; }
.type-fighting { background: linear-gradient(135deg, #e03131, #9b111e); color: #fff; }
.type-poison { background: linear-gradient(135deg, #cc5de8, #862e9c); color: #fff; }
.type-ground { background: linear-gradient(135deg, #e9a658, #b06b24); color: #fff; }
.type-flying { background: linear-gradient(135deg, #9775fa, #5f3dc4); color: #fff; }
.type-psychic { background: linear-gradient(135deg, #ff6b8b, #c2255c); color: #fff; }
.type-bug { background: linear-gradient(135deg, #94d82d, #5c940d); color: #fff; }
.type-rock { background: linear-gradient(135deg, #be9c6e, #86643b); color: #fff; }
.type-ghost { background: linear-gradient(135deg, #7048e8, #4924a1); color: #fff; }
.type-dragon { background: linear-gradient(135deg, #7950f2, #3b1fb0); color: #fff; }
.type-dark { background: linear-gradient(135deg, #495057, #212529); color: #fff; }
.type-steel { background: linear-gradient(135deg, #868e96, #495057); color: #fff; }
.type-fairy { background: linear-gradient(135deg, #f783ac, #c2255c); color: #fff; }

/* Bucket Badges */
.bucket-common { background: rgba(156, 163, 175, 0.15); color: #9ca3af; border: 1px solid rgba(156, 163, 175, 0.3); }
.bucket-uncommon { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.bucket-rare { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.bucket-ultra-rare { background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(168, 85, 247, 0.2)); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.4); text-shadow: 0 0 10px rgba(236, 72, 153, 0.5); }

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* Atmospheric Background Glows */
.background-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}
.glow-1 {
    top: -200px;
    left: -100px;
    background: radial-gradient(circle, #00f2fe, #4facfe);
}
.glow-2 {
    bottom: -200px;
    right: -100px;
    background: radial-gradient(circle, #7928ca, #ff0080);
}

/* ==========================================================================
   Header & Navigation (100% RESPONSIVE NO-OVERFLOW)
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 23, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.pokeball-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    position: relative;
    border: 3px solid #111;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
    animation: rotateBall 20s linear infinite;
    flex-shrink: 0;
}

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

.pokeball-top {
    position: absolute;
    top: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
}

.pokeball-bottom {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50%;
    background: #f8f9fa;
}

.pokeball-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border: 3px solid #111;
    border-radius: 50%;
    z-index: 2;
}

.brand-text h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    line-height: 1.2;
}

.brand-text h1 span {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(0, 242, 254, 0.2);
    display: inline-block;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    max-width: 100%;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.25s ease;
    text-align: center;
}

.nav-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.2));
    border: 1px solid rgba(0, 242, 254, 0.4);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.app-main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 28px 20px;
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.35s ease;
    width: 100%;
    min-width: 0;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Common Card */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.3s ease;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.card-header h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ==========================================================================
   Search & Quick Picks
   ========================================================================== */
.search-section {
    position: relative;
    z-index: 1000;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 242, 254, 0.25);
    overflow: visible;
}

.search-bar-wrapper {
    position: relative;
    width: 100%;
    z-index: 1001;
}

.search-bar-wrapper input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
}

.search-bar-wrapper input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 24px rgba(0, 242, 254, 0.25);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-muted);
}

.clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
}

/* Search suggestions with SOLID background and HIGH z-index */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    margin-top: 0;
    background: #111a2e;
    border: 1.5px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    max-height: 380px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 25px rgba(0, 242, 254, 0.35);
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(0, 242, 254, 0.15);
}

.sugg-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sugg-sprite {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.sugg-name {
    font-weight: 700;
    font-size: 1.02rem;
    color: #fff;
}

.sugg-id {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-cyan);
}

.quick-picks {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.quick-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-tag:hover {
    color: #fff;
    background: rgba(0, 242, 254, 0.15);
    border-color: rgba(0, 242, 254, 0.4);
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 242, 254, 0.1);
    border-top: 4px solid var(--accent-cyan);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Hero Pokémon Card
   ========================================================================== */
.pokemon-hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(22, 33, 56, 0.8), rgba(14, 21, 37, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.12);
    gap: 20px;
    flex-wrap: wrap;
}

.hero-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pokemon-sprite-box {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.2), transparent 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.poke-sprite {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

.id-bucket-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.dex-badge {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.bucket-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
}

.poke-basic-info h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 6px;
}

.types-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.type-pill {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.hero-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    min-width: 240px;
    flex: 1 1 auto;
}

.info-group {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    gap: 12px;
}

.info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.info-val {
    color: #fff;
    font-weight: 600;
    text-align: right;
}

/* ==========================================================================
   Combos Grid (Ultimate vs Budget)
   ========================================================================== */
.combos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    min-width: 0;
}

.combo-card {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: hidden;
    min-width: 0;
}

.ultimate-card {
    background: linear-gradient(145deg, rgba(27, 38, 64, 0.9), rgba(15, 23, 42, 0.9));
    border: 1.5px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.12);
}

.budget-card {
    background: linear-gradient(145deg, rgba(20, 38, 32, 0.9), rgba(11, 23, 20, 0.9));
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.12);
}

.combo-badge-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 5px 12px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.combo-badge-top.gold {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    color: #000;
}

.combo-badge-top.emerald {
    background: linear-gradient(90deg, #059669, #10b981);
    color: #fff;
}

.combo-main-rate {
    margin-top: 10px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.rate-val {
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #fff, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.budget-card .rate-val {
    background: linear-gradient(135deg, #fff, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rate-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 6px;
}

.intra-rate-box {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

.intra-val {
    font-weight: 700;
    color: var(--accent-cyan);
}

.budget-tag {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-emerald);
}

.recipe-box h4, .environment-box h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.recipe-slots-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    min-width: 0;
}

.item-slot-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.slot-icon {
    font-size: 1.6rem;
}

.slot-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    word-break: break-word;
}

.slot-bonus {
    font-size: 0.72rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

.tier-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.tier-factor {
    color: var(--text-muted);
}

.env-tags {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-width: 0;
}

.env-tag {
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.env-tag span {
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   Details Grid: Biomes & Competition
   ========================================================================== */
.details-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    min-width: 0;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 14px;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 480px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: #fff;
}

.data-table strong {
    color: #fff;
}

.rate-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-cyan);
}

/* Competition List */
.competition-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    max-height: 420px;
    overflow-y: auto;
}

.comp-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    gap: 10px;
}

.comp-item.target {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.08);
}

.comp-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.comp-sprite {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.comp-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comp-right {
    text-align: right;
    flex-shrink: 0;
}

.comp-share {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.comp-global {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Simulator / Sandbox Layout (100% RESPONSIVE & NO OVERFLOW)
   ========================================================================== */
.simulator-layout {
    display: grid;
    grid-template-columns: minmax(320px, 440px) 1fr;
    gap: 20px;
    min-width: 0;
    width: 100%;
}

.sim-controls-card {
    min-width: 0;
    width: 100%;
}

.sim-results-card {
    min-width: 0;
    width: 100%;
}

.sim-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    min-width: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0; /* Prevents flex/grid overflow */
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.custom-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px 28px 10px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300f2fe' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.custom-select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.custom-select option {
    background: #111a2e;
    color: #fff;
}

.slots-interactive-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    min-width: 0;
}

.slots-interactive-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.interactive-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    min-width: 0;
}

.seasoning-slot {
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 6px;
    min-height: 95px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

.seasoning-slot:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.05);
}

.slot-plus {
    font-size: 1.4rem;
    color: var(--text-muted);
}

.slot-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.slot-content.filled {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
    overflow: hidden;
}

.slot-item-icon {
    font-size: 1.6rem;
}

.slot-item-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.slot-remove-btn {
    font-size: 0.7rem;
    color: var(--accent-rose);
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 2px;
}

.slots-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #000;
    flex: 1 1 auto;
    min-width: 140px;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    flex: 0 1 auto;
}

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

.bucket-odds-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sim-table-box {
    max-height: 520px;
    overflow-y: auto;
}

/* ==========================================================================
   Modal / Picker (RESPONSIVE & SCROLL PROTECTED)
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(12px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.modal-content {
    width: 100%;
    max-width: 780px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: #111a2e;
    border: 1.5px solid var(--accent-cyan);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(0, 242, 254, 0.25);
    position: relative;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: #fff;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.close-btn:hover {
    background: var(--accent-rose);
    border-color: var(--accent-rose);
    transform: scale(1.1);
}

.modal-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 12px 0;
    flex-shrink: 0;
}

.seasoning-cat-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seasoning-cat-btn.active, .seasoning-cat-btn:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--accent-cyan);
    color: #fff;
}

.seasonings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding: 4px 6px 20px 2px;
    flex: 1;
    min-height: 0;
}

.seasoning-pick-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seasoning-pick-card:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.1);
    transform: translateY(-2px);
}

.pick-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.pick-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.pick-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   Guide & Math Styling (CLEAN & BEAUTIFUL TYPOGRAPHY)
   ========================================================================== */
.guide-card h2 {
    font-size: 1.7rem;
    margin-bottom: 20px;
    color: #fff;
}

.guide-section {
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.guide-section:last-child {
    border-bottom: none;
}

.guide-section h3 {
    font-size: 1.25rem;
    color: var(--accent-cyan);
    margin-bottom: 12px;
}

.guide-section p, .guide-section li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.step-card {
    display: flex;
    gap: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin: 12px 0;
}

.step-num {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #000;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 3px 10px;
    border-radius: 20px;
    height: fit-content;
    white-space: nowrap;
}

.step-body {
    flex: 1;
    min-width: 0;
}

.step-body strong {
    color: #fff;
    font-size: 1rem;
    display: block;
    margin-bottom: 4px;
}

.bucket-stats-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.formula-box {
    background: #080d16;
    border-left: 4px solid var(--accent-cyan);
    padding: 14px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 12px 0;
    font-family: var(--font-mono);
    color: #e2e8f0;
    font-size: 1rem;
    overflow-x: auto;
}

.highlight-callout {
    display: flex;
    gap: 14px;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin: 14px 0;
}

.callout-icon {
    font-size: 1.6rem;
}

.highlight-callout strong {
    color: var(--accent-cyan);
    font-size: 0.95rem;
    display: block;
    margin-bottom: 4px;
}

.berries-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.guide-berry-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.gb-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.gb-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.gb-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 50px;
}

.footer-sub {
    font-size: 0.72rem;
    margin-top: 4px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1080px) {
    .combos-grid {
        grid-template-columns: 1fr;
    }
    .details-grid {
        grid-template-columns: 1fr;
    }
    .simulator-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    .main-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    .nav-btn {
        padding: 8px 4px;
        font-size: 0.82rem;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .main-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .nav-btn {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    .pokemon-hero-card {
        flex-direction: column;
        align-items: stretch;
    }
    .sim-form-grid {
        grid-template-columns: 1fr;
    }
    .interactive-slots {
        grid-template-columns: 1fr;
    }
    .seasoning-slot {
        min-height: 75px;
    }
    .app-main {
        padding: 16px 12px;
    }
    .card {
        padding: 16px 12px;
    }
    .recipe-slots-container {
        grid-template-columns: 1fr;
    }
    .env-tags {
        grid-template-columns: 1fr;
    }
    .modal {
        padding: 10px;
    }
    .modal-content {
        padding: 14px 12px;
    }
    .seasonings-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 6px;
    }
}
