/* ==========================================================================
   1. VARIABLES & THEMES
   ========================================================================== */

   :root {
    /* MOJAVE AMBER (Default) */
    --color-bg: #050505;
    --color-terminal-bg: rgba(16, 16, 16, 0.95);
    
    --color-primary: #FFB000;       
    --color-primary-dim: rgba(255, 176, 0, 0.1);
    --color-secondary: #c88900;     
    --color-border: rgba(255,176,0,0.3);
    
    --color-highlight: #fff;     
    --color-alert: #ef4444;         
    
    --font-main: 'Share Tech Mono', 'Courier New', monospace;
    --radius: 4px;
    --border-width: 1px;
    --shadow-glow: 0 0 10px rgba(255, 176, 0, 0.25);
}

/* ==========================================================================
   2. GLOBAL RESET
   ========================================================================== */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   3. LAYOUT CONTAINERS
   ========================================================================== */

.terminal-wrapper {
    width: 100%;
    max-width: 100%; /* Let it fill the site-main */
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 1;
}

.terminal-container {
    border: 1px solid var(--color-border);
    padding: 30px;
    background: var(--color-terminal-bg);
    box-shadow: 0 0 15px var(--color-primary-dim);
    position: relative;
    border-radius: var(--radius);
}

/* ==========================================================================
   4. UTILITY BAR
   ========================================================================== */

.utility-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.4);
    padding: 15px;
    border: 1px solid var(--color-primary-dim);
}

.tips-btn {
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--color-border);
    color: var(--color-secondary);
    padding: 10px 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem; /* Increased */
    font-weight: bold;
    transition: all 0.2s;
    text-transform: uppercase;
}

.tips-btn:hover {
    background: var(--color-primary-dim);
    color: var(--color-highlight);
    box-shadow: 0 0 8px var(--color-secondary);
}

/* ==========================================================================
   5. HEADER & MISSION
   ========================================================================== */

.bigbloom-wrapper .bigbloom-header {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bigbloom-wrapper h1 {
    font-size: clamp(2rem, 5vw, 3rem); /* Increased */
    margin-bottom: 5px;
    text-shadow: var(--shadow-glow);
    letter-spacing: 2px;
}

.bigbloom-wrapper h2 {
    font-size: 1.1rem; /* Increased */
    color: var(--color-secondary);
    letter-spacing: 4px;
    opacity: 0.8;
}

.status-panel {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 15px;
    font-size: 1rem; /* Increased */
    border-top: 1px dashed var(--color-primary-dim);
    padding-top: 10px;
}

.blink { animation: blinker 1.5s infinite; color: var(--color-highlight); }
@keyframes blinker { 50% { opacity: 0; } }

/* MISSION BOX */
.mission-section {
    border: 2px solid var(--color-border);
    background: rgba(0,0,0,0.3);
    margin-bottom: 40px;
    position: relative;
    padding: 2px;
}

.mission-header-block {
    background: var(--color-primary-dim);
    padding: 15px;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.section-header-large {
    font-size: 1.2rem;
    color: var(--color-highlight);
    font-weight: bold;
    letter-spacing: 2px;
}
.mission-subtext {
    font-size: 0.8rem;
    color: var(--color-secondary);
    letter-spacing: 1px;
}

.mission-content {
    padding: 20px;
    font-size: 1.15rem; /* Increased from 1rem for visibility */
    color: #ffffff; /* pure white for contrast */
    line-height: 1.6;
}

/* PLACEHOLDER GRAPHIC */
.visual-placeholder {
    border: 2px dashed var(--color-secondary);
    background: rgba(0,0,0,0.4);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 5px var(--color-primary));
}

.placeholder-label {
    color: var(--color-highlight);
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.ai-prompt-box {
    background: #000;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 12px;
    font-family: var(--font-main);
    font-size: 0.8rem;
    max-width: 90%;
    word-wrap: break-word;
    user-select: all; /* Easy copy */
    border-radius: 4px;
}

.gamma-tea-box {
    margin-top: 20px;
    border: 1px solid var(--color-highlight);
    background: linear-gradient(135deg, var(--color-primary-dim), transparent);
    padding: 15px;
}

.gamma-title {
    color: var(--color-highlight);
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    text-decoration: underline;
}

.gamma-stats {
    list-style: none;
    margin-bottom: 10px;
    font-weight: bold;
}
.gamma-stats li { margin-bottom: 5px; color: var(--color-primary); }

/* ==========================================================================
   6. REVERSE CALCULATOR (PLANNING)
   ========================================================================== */

.reverse-section {
    border: 2px solid var(--color-secondary);
    background: rgba(0,0,0,0.5);
    margin-bottom: 40px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.reverse-header {
    text-align: center;
    font-weight: bold;
    color: var(--color-highlight);
    margin-bottom: 20px;
    font-size: 1.1rem;
}
.reverse-header span { background: #000; padding: 0 10px; }

.reverse-instr {
    text-align: center;
    margin-bottom: 15px;
    color: var(--color-secondary);
}

.reverse-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-group-large {
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}
.input-group-large input {
    font-size: 1.5rem;
    text-align: center;
    padding: 15px;
}

.btn-reverse {
    flex: 1;
    min-width: 200px;
    padding: 18px;
    background: var(--color-secondary);
    color: #000;
    border: none;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    height: 60px;
}
.btn-reverse:hover {
    background: var(--color-highlight);
    box-shadow: 0 0 15px var(--color-primary);
}

.req-results {
    margin-top: 20px;
    border-top: 1px dashed var(--color-secondary);
    padding-top: 20px;
    animation: slideDown 0.3s ease;
}

.req-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.req-item {
    background: var(--color-primary-dim);
    border: 1px solid var(--color-border);
    padding: 10px;
    text-align: center;
}
.req-val { font-size: 1.5rem; font-weight: bold; color: var(--color-highlight); display: block;}
.req-name { font-size: 0.8rem; color: var(--color-secondary); }

/* ==========================================================================
   7. INPUTS (FORWARD CALC)
   ========================================================================== */
.section-divider {
    text-align: center;
    margin: 40px 0 20px 0;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--color-secondary);
}

.storage-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-storage {
    flex: 1;
    background: transparent;
    border: 1px solid var(--color-secondary);
    color: var(--color-secondary);
    padding: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
}
.btn-storage:hover { background: var(--color-primary-dim); color: var(--color-highlight); }

.tier-box {
    margin-bottom: 25px;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px;
    background: rgba(0,0,0,0.2);
}

.tier-header {
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--color-secondary);
    padding-bottom: 5px;
    font-weight: bold;
    color: var(--color-highlight);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.bigbloom-wrapper label {
    font-size: 0.8rem;
    margin-bottom: 5px;
    color: var(--color-secondary);
    font-weight: bold;
    /* Wrap long names instead of hiding them with ellipsis */
    white-space: normal; 
    line-height: 1.2;
    word-wrap: break-word;
    /* Flex alignment ensures the inputs stay lined up even if label heights differ */
    display: flex;
    align-items: flex-end; 
    min-height: 32px; 
}

.bigbloom-wrapper input[type="number"] {
    background: #000;
    border: 1px solid var(--color-secondary);
    color: var(--color-highlight);
    padding: 12px;
    font-family: inherit;
    font-size: 1.1rem;
    width: 100%;
    transition: 0.3s;
}

.bigbloom-wrapper input[type="number"]:focus {
    outline: 2px solid var(--color-primary);
    border-color: var(--color-highlight);
    box-shadow: 0 0 15px var(--color-primary-dim);
}

.controls {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

button.btn-primary, button.btn-secondary {
    flex: 1;
    min-width: 200px;
    padding: 18px;
    font-family: inherit;
    font-weight: bold;
    font-size: 1.1rem;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--color-primary);
    color: #000;
    border: none;
    box-shadow: 0 0 20px var(--color-primary-dim);
}
.btn-primary:hover {
    background: var(--color-highlight);
    box-shadow: 0 0 30px var(--color-secondary);
}
.btn-secondary {
    background: transparent;
    border: 2px solid var(--color-secondary);
    color: var(--color-secondary);
}
.btn-secondary:hover {
    background: var(--color-secondary);
    color: #000;
}

/* ==========================================================================
   8. RESULTS & TIPS
   ========================================================================== */

.hidden { display: none; }

.results-section {
    margin-top: 40px;
    border-top: 4px double var(--color-border);
    padding-top: 30px;
    animation: slideDown 0.5s ease;
}

.report-card {
    background: var(--color-primary-dim);
    border: 2px solid var(--color-secondary);
    padding: 20px;
    text-align: center;
    margin-bottom: 30px;
}

.report-header {
    background: var(--color-secondary);
    color: #000;
    display: inline-block;
    padding: 5px 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.yield-number {
    font-size: 4rem;
    font-weight: bold;
    color: var(--color-highlight);
    text-shadow: 0 0 20px var(--color-secondary);
}

.step-block {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--color-secondary);
    border-left: 5px solid var(--color-secondary);
    margin-bottom: 15px;
    padding: 15px;
}

.step-block.cooking {
    border-color: var(--color-alert);
    background: rgba(50, 0, 0, 0.2);
}

.step-title {
    display: block;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: var(--color-highlight);
}

.craft-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.craft-amount {
    color: #000;
    background: var(--color-secondary);
    padding: 2px 8px;
    font-weight: bold;
}

/* TIPS */
.tips-section { display: none; margin-bottom: 20px; }
.tips-section.visible { display: block; animation: slideDown 0.3s; }

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}
.tip-card {
    border: 1px solid var(--color-secondary);
    padding: 15px;
    background: rgba(0,0,0,0.8);
}
.tip-card.combo { border-color: var(--color-highlight); }
.tip-title { color: var(--color-highlight); display: block; margin-bottom: 5px; font-weight: bold; }


@media (max-width: 880px) {
    .terminal-container { padding: 10px; }
    h1 { font-size: 1.8rem; }
    .yield-number { font-size: 3rem; }
    .controls { flex-direction: column; }
    .reverse-controls { flex-direction: column; align-items: stretch; }
    
    /* Ensure grids don't force 2 columns on very small screens, let auto-fit work */
    .input-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}