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

:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --border-color: #ffffff;
    --input-bg: #000000;
    --input-text: #ffffff;
    --input-placeholder: #888888;
    --button-bg: #000000;
    --button-text: #ffffff;
    --button-hover-bg: #ffffff;
    --button-hover-text: #000000;
    --button-active-bg: #888888;
    --button-active-text: #ffffff;
    --cloud-fill-bg: #000000;
    --tree-fill-bg: #000000;
    
    /* Window dimensions - can be overridden in media queries */
    --window-width: 600px;
    --window-height: 400px;
    --window-aspect-ratio: 3 / 2;
    
    /* Spacing constants */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    
    /* Scene layout defaults */
    --horizon-offset-px: 25px;
    --scene-horizon-offset-percent: 9%;
    --scene-sky-cutoff-percent: var(--scene-horizon-offset-percent);
    --particle-start-offset: 50px;
    --tree-gap: 0px;
    --floor-margin: 30px;
}

body.light-mode {
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #000000;
    --input-bg: #ffffff;
    --input-text: #000000;
    --input-placeholder: #666666;
    --button-bg: #ffffff;
    --button-text: #000000;
    --button-hover-bg: #000000;
    --button-hover-text: #ffffff;
    --button-active-bg: #666666;
    --button-active-text: #ffffff;
    --cloud-fill-bg: #ffffff;
    --tree-fill-bg: #ffffff;
}

body {
    font-family: 'Courier New', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.ascii-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.frame-top,
.frame-bottom {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1;
    margin: 0;
    white-space: pre;
    font-family: 'Courier New', monospace;
}

.window-content {
    display: flex;
    align-items: stretch;
}

.frame-left,
.frame-right {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.2;
    margin: 0;
    white-space: pre;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0;
}

.weather-window {
    width: var(--window-width);
    height: var(--window-height);
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
    border: none;
}

.weather-display {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre;
    background-color: transparent;
    pointer-events: none;
    max-width: 70%;
    max-height: 40%;
    transition: top 0.5s ease, left 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
}

/* Center loading and error messages (when not sun or moon) */
.weather-display:not(.sun):not(.moon) {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    text-align: center;
}

.ground-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--scene-horizon-offset-percent) + var(--spacing-sm));
    background-color: var(--bg-color);
    z-index: 1;
    pointer-events: none;
}

.horizon-line {
    position: absolute;
    bottom: var(--scene-horizon-offset-percent);
    z-index: 2;
    pointer-events: none;
    color: var(--text-color);
    opacity: 0.7;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1;
    white-space: pre;
    overflow: visible;
    background-color: transparent;
}

.horizon-line-left {
    left: 0;
    width: calc(50% - var(--tree-gap));
    text-align: left;
}

.horizon-line-right {
    right: 0;
    width: calc(50% - var(--tree-gap));
    text-align: right;
}

.tree-background {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    line-height: 1;
    white-space: pre;
    white-space: pre-wrap;
    opacity: 0.9 !important;
    z-index: 1 !important;
    text-align: center;
    pointer-events: none;
    visibility: visible !important;
    display: block !important;
    width: 100%;
    height: auto;
}

.tree-background pre {
    margin: 0;
    padding: 0;
    text-align: center;
    white-space: pre;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
}

.weather-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-color: transparent !important;
}

.info-panel {
    text-align: center;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.location,
.weather-info {
    margin: 0;
    white-space: pre;
    font-family: 'Courier New', monospace;
}

.location {
    margin-bottom: 0.5rem;
}

.weather-info {
    opacity: 0.8;
}

.location-input-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.input-label {
    margin: 0;
    white-space: pre;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    opacity: 0.9;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.location-input {
    background-color: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    outline: none;
    min-width: 200px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.location-input::placeholder {
    color: var(--input-placeholder);
}

.location-input:focus {
    border-color: var(--border-color);
    box-shadow: 0 0 0 1px var(--border-color);
}

.submit-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.submit-button:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.submit-button:active {
    background-color: var(--button-active-bg);
    color: var(--button-active-text);
}

.change-location-btn {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    margin-top: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.change-location-btn:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.change-location-btn:active {
    background-color: var(--button-active-bg);
    color: var(--button-active-text);
}

.toggles-row {
    display: flex;
    justify-content: space-between;
    align-items: center; /* vertically align both toggles with each other */
    width: 600px;
    margin-top: 0.25rem; /* small gap above the window */
    margin-bottom: 0;
}

.temperature-toggle-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    padding: 0;
}

.theme-toggle-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0;
    padding: 0;
}

.temperature-toggle,
.theme-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s ease;
    height: 2.5rem;
    align-items: stretch;
}

.temperature-option,
.theme-option {
    padding: 0.5rem 1rem;
    background-color: var(--button-bg);
    color: var(--button-text);
    transition: all 0.3s ease;
    user-select: none;
    flex: 1;
    text-align: center;
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
}

.temperature-option:last-child,
.theme-option:last-child {
    border-right: none;
}

.temperature-option.active,
.theme-option.active {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.temperature-option:hover:not(.active),
.theme-option:hover:not(.active) {
    opacity: 0.7;
}

.weather-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.weather-btn {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    min-width: 70px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.weather-btn:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.weather-btn:active {
    background-color: var(--button-active-bg);
    color: var(--button-active-text);
}

.weather-btn.active {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.moon-phase-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.moon-phase-btn {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    min-width: 70px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.moon-phase-btn:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.moon-phase-btn:active {
    background-color: var(--button-active-bg);
    color: var(--button-active-text);
}

.moon-phase-btn.active {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

/* Dev toggle button - normal flow positioning */
.dev-toggle-btn {
    display: block;
    margin: 1rem auto 0;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.6rem;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    cursor: pointer;
    outline: none;
    opacity: 0.6;
    transition: opacity 0.2s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.dev-toggle-btn:hover {
    opacity: 1;
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.dev-toggle-btn.active {
    opacity: 1;
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

/* Hide buttons when dev mode is off */
.dev-mode-off .weather-buttons,
.dev-mode-off .moon-phase-buttons,
.dev-mode-off .dev-tools-container {
    display: none;
}

/* Dev tools container */
.dev-tools-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.dev-tools-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.dev-label {
    margin: 0;
    white-space: pre;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    opacity: 0.9;
    color: var(--text-color);
}

.dev-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dev-input {
    background-color: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    outline: none;
    min-width: 100px;
    width: 80px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.dev-input::placeholder {
    color: var(--input-placeholder);
}

.dev-input:focus {
    border-color: var(--border-color);
    box-shadow: 0 0 0 1px var(--border-color);
}

.dev-submit-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.dev-submit-button:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.dev-submit-button:active {
    background-color: var(--button-active-bg);
    color: var(--button-active-text);
}

/* Rain animation */
.rain-drop {
    position: absolute;
    color: var(--text-color);
    font-size: 0.65rem;
    animation: fall linear;
}

@keyframes fall {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(var(--end-y, 500px));
        opacity: 1;
    }
}

@keyframes splash {
    0% {
        transform: translateY(var(--end-y, 500px)) scale(0.3);
        opacity: 0.6;
    }
    30% {
        transform: translateY(var(--end-y, 500px)) scale(1);
        opacity: 1;
    }
    60% {
        transform: translateY(var(--end-y, 500px)) scale(0.8);
        opacity: 0.9;
    }
    100% {
        transform: translateY(var(--end-y, 500px)) scale(0.5);
        opacity: 0;
    }
}

.rain-splash {
    font-size: 0.65rem;
}

/* Drizzle - smaller, lighter drops */
.rain-drop.drizzle-drop {
    font-size: 0.5rem; /* Smaller than regular rain */
    opacity: 0.7; /* Lighter appearance */
}

/* Freezing drizzle - small dot with subtle glow */
.rain-drop.freezing-drizzle-drop {
    font-size: 0.5rem; /* Smaller than freezing rain */
    opacity: 0.8;
    color: var(--text-color);
    text-shadow: 
        0 0 1px rgba(255, 255, 255, 0.4), 
        0 0 2px rgba(255, 255, 255, 0.2);
}

/* Freezing rain - white diamond with subtle glow */
.rain-drop.freezing-drop {
    color: var(--text-color); /* Use default text color */
    text-shadow: 
        0 0 2px rgba(255, 255, 255, 0.5), 
        0 0 4px rgba(255, 255, 255, 0.3);
    font-weight: bold;
    opacity: 0.95;
}

/* Ice impact effects - sparkles and glaze marks */
.ice-impact {
    color: var(--text-color); /* Use default text color */
    text-shadow: 
        0 0 2px rgba(255, 255, 255, 0.4), 
        0 0 4px rgba(255, 255, 255, 0.2);
    font-weight: bold;
    /* Sparkles and glaze marks share base styling, individual characters will vary naturally */
}

/* Hail animation */
.hail-stone {
    position: absolute;
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: bold;
    animation: hailFall linear;
    z-index: 10; /* Above rain */
}

@keyframes hailFall {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(var(--stop-y, 500px));
        opacity: 0.8;
    }
}

/* Freezing rain effect - subtle visual indicator */
/* Could add subtle overlay or particle effects here in the future */
/* For now, the distinction is mainly in the description */
/* .freezing-rain { } */

/* Snow animation */
.snowflake {
    position: absolute;
    color: var(--text-color);
    font-size: 0.65rem;
    animation: snowfall linear;
}

.snow-grain {
    font-size: 0.45rem;
    opacity: 0.82;
}

@keyframes snowfall {
    from {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
    to {
        transform: translateY(var(--end-y, 500px)) translateX(var(--end-x, 50px));
        opacity: 0.9; /* Keep more visible when stopped */
    }
}

/* Cloud animation */
.cloud {
    position: absolute;
    color: var(--text-color);
    font-size: 0.65rem;
    font-family: 'Courier New', monospace;
    white-space: pre;
    line-height: 1.2;
    animation: drift linear;
    background-color: transparent;
}

/* Fog animation */
.fog-wisp {
    position: absolute;
    color: var(--text-color);
    font-size: 0.65rem;
    font-family: 'Courier New', monospace;
    white-space: pre;
    line-height: 1.1;
    animation: drift linear;
    background-color: transparent;
}

.rime-mark {
    position: absolute;
    color: var(--text-color);
    font-size: 0.42rem;
    line-height: 1;
    white-space: pre;
    pointer-events: none;
    animation: rimeShimmer 6s ease-in-out forwards;
    z-index: 2;
}

.cloud-fill {
    background-color: var(--cloud-fill-bg);
    color: var(--cloud-fill-bg);
}

.tree-fill {
    background-color: var(--tree-fill-bg);
    color: var(--tree-fill-bg);
}

@keyframes drift {
    from {
        transform: translateX(-200px);
    }
    to {
        transform: translateX(800px);
    }
}

@keyframes rimeShimmer {
    0% {
        opacity: 0;
    }
    25% {
        opacity: 0.28;
    }
    100% {
        opacity: 0;
    }
}

/* Sun animation */
.sun {
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Moon styling */
.moon {
    opacity: 0.9;
}

/* Move moon behind tree */
.weather-display.moon,
.moon-display {
    z-index: 0;
}

/* Move sun behind tree */
.weather-display.sun {
    z-index: 0;
}

/* Wind effect */
.wind-particle {
    position: absolute;
    color: var(--text-color);
    font-size: 0.65rem;
    animation: blow linear;
    left: var(--start-x, 0px);
    top: var(--start-y, 0px);
}

/* Mobile responsive dimension overrides */
@media screen and (max-width: 768px) {
    :root {
        --window-width: min(100vw - 2rem, 600px);
        --window-height: auto;
        --horizon-offset-px: 15px;
        --particle-start-offset: 30px;
        --tree-gap: 0px;
        --floor-margin: 20px;
    }
    
    .weather-window {
        aspect-ratio: var(--window-aspect-ratio);
    }
}

@media screen and (max-width: 480px) {
    :root {
        --horizon-offset-px: 12px;
        --particle-start-offset: 25px;
        --tree-gap: 0px;
        --floor-margin: 15px;
    }
}

/* Refactor v2 layout and scene layers */
:root {
    --stage-width: min(100vw - 2rem, 980px);
    --shell-padding: clamp(0.9rem, 1.6vw, 1.25rem);
    --frame-thickness: 2px;
    --scene-shadow: 0 0 0 1px var(--border-color), 0 0 0 6px color-mix(in srgb, var(--bg-color) 65%, transparent);
    --window-width: min(100%, 640px);
    --window-height: min(64vw, 430px);
}

body {
    padding: 1.25rem 0;
    align-items: flex-start;
}

.app-shell {
    width: var(--stage-width);
    max-width: var(--stage-width);
    gap: 1.25rem;
    padding-bottom: 2rem;
}

.toggles-row {
    width: 100%;
    max-width: 720px;
}

.scene-stage {
    position: relative;
    width: 100%;
    min-height: 38rem;
    display: grid;
    place-items: center;
    padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 7vw, 7rem);
}

.window-shell {
    position: relative;
    z-index: 2;
    width: min(100%, 720px);
    padding: var(--shell-padding);
    border: var(--frame-thickness) solid var(--border-color);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        var(--bg-color);
    box-shadow: var(--scene-shadow);
}

.window-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.65rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 65%, transparent);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.window-label {
    opacity: 0.8;
}

.window-sill {
    height: 0.85rem;
    margin-top: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
    background:
        linear-gradient(90deg, transparent, color-mix(in srgb, var(--border-color) 12%, transparent), transparent);
}

.weather-window {
    width: 100%;
    height: auto;
    min-height: 360px;
    aspect-ratio: 3 / 2;
    background:
        radial-gradient(circle at 50% 85%, rgba(255, 255, 255, 0.04), transparent 40%),
        var(--bg-color);
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent);
    --scene-tree-bottom: 5px;
    --scene-tree-scale: 1;
    --scene-horizon-font-size: 1rem;
    --scene-mask-width: clamp(2.25rem, 5vw, 2.75rem);
    --scene-mask-height: clamp(6.75rem, 18vw, 8.5rem);
}

.scene-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sky-layer[data-sky-mode="clear"] {
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.07), transparent 35%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 45%);
}

.sky-layer[data-sky-mode="overcast"] {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01) 45%, transparent 70%);
}

.sky-layer[data-sky-mode="storm"] {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02) 38%, transparent 78%);
}

.sky-layer[data-sky-mode="night"] {
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.03), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.01), transparent 38%);
}

.scene-text-layer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    white-space: pre;
    font-size: 0.7rem;
    line-height: 1;
    text-align: center;
}

.distant-layer {
    top: auto;
    bottom: 20%;
    height: 40%;
    opacity: 0.78;
    z-index: 1;
}

.foreground-layer {
    top: auto;
    bottom: 0;
    height: 34%;
    z-index: 5;
    opacity: 0.96;
}

.foreground-layer pre,
.distant-layer pre {
    margin: 0;
    white-space: pre;
}

.ground-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 18%;
    background:
        linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02)),
        var(--bg-color);
    z-index: 0;
}

.horizon-line {
    position: absolute;
    bottom: 16%;
    z-index: 2;
    pointer-events: none;
    color: var(--text-color);
    opacity: 0.65;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1;
    white-space: pre;
    overflow: hidden;
}

.horizon-line-left {
    left: 0;
    width: 49%;
    text-align: left;
}

.horizon-line-right {
    right: 0;
    width: 49%;
    text-align: right;
}

.weather-display {
    position: absolute;
    z-index: 4;
    text-align: center;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.15;
    white-space: pre;
    background-color: transparent;
    pointer-events: none;
    transition: top 0.5s ease, left 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
}

.weather-display pre {
    margin: 0;
    white-space: pre;
}

.moon-display {
    z-index: 3;
}

.surroundings-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.surroundings-piece {
    position: absolute;
    margin: 0;
    color: var(--text-color);
    opacity: 0.75;
    white-space: pre;
    font-size: 0.8rem;
    line-height: 1.05;
}

.surroundings-top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.surroundings-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.surroundings-left {
    left: 0;
    top: 52%;
    transform: translateY(-50%);
    text-align: left;
}

.surroundings-right {
    right: 0;
    top: 52%;
    transform: translateY(-50%);
    text-align: right;
}

.profile-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.profile-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
    font-size: 0.8rem;
}

.profile-select {
    background-color: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.7rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.info-panel {
    width: min(100%, 720px);
}

.atmosphere-layer,
.precipitation-layer,
.wildlife-layer,
.celestial-layer {
    z-index: 3;
}

.lightning-flash {
    animation: lightningPulse 0.18s linear;
}

@keyframes lightningPulse {
    0% {
        background-color: rgba(255, 255, 255, 0);
    }
    20% {
        background-color: rgba(255, 255, 255, 0.18);
    }
    100% {
        background-color: rgba(255, 255, 255, 0);
    }
}

.bird-pass {
    position: absolute;
    top: 25%;
    left: -12%;
    color: var(--text-color);
    font-size: 0.8rem;
    animation: drift linear;
    opacity: 0.7;
}

@keyframes blow {
    from {
        transform: translateX(0);
        opacity: 0;
    }
    15% {
        opacity: 0.8;
    }
    to {
        transform: translateX(calc(var(--window-width) + 160px));
        opacity: 0;
    }
}

.dev-mode-off .weather-buttons,
.dev-mode-off .moon-phase-buttons,
.dev-mode-off .dev-tools-container {
    display: none;
}

@media screen and (max-width: 900px) {
    .scene-stage {
        min-height: 34rem;
        padding-inline: clamp(1rem, 4vw, 2rem);
    }

    .surroundings-piece {
        font-size: 0.72rem;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --window-height: min(72vw, 360px);
    }

    .scene-stage {
        min-height: 28rem;
        padding: 1.5rem 0.75rem 2.5rem;
    }

    .window-shell {
        width: 100%;
    }

    .weather-window {
        min-height: 280px;
    }

    .profile-controls {
        grid-template-columns: 1fr;
    }

    .toggles-row {
        max-width: none;
    }
}

@media screen and (max-width: 560px) {
    .surroundings-left,
    .surroundings-right {
        display: none;
    }

    .surroundings-top,
    .surroundings-bottom {
        font-size: 0.68rem;
        max-width: 100%;
        overflow: hidden;
    }

    .window-header {
        font-size: 0.68rem;
        letter-spacing: 0.08em;
    }
}

@media screen and (max-width: 480px) {
    .input-wrapper,
    .dev-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .location-input,
    .submit-button,
    .dev-input,
    .dev-submit-button,
    .profile-select {
        width: 100%;
    }

    .temperature-option,
    .theme-option {
        min-width: 2.5rem;
        padding-inline: 0.8rem;
    }

    .weather-window {
        min-height: 240px;
    }

    .scene-text-layer {
        font-size: 0.56rem;
    }
}

/* Incremental renderer reset: keep the simple single-tree scene and hide future-facing UI */
body {
    padding: 1.25rem 0 2rem;
    align-items: flex-start;
}

.app-shell {
    width: min(100vw - 2rem, 720px);
    max-width: 720px;
    gap: 1.25rem;
}

.toggles-row {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
}

.scene-stage {
    width: 100%;
    min-height: auto;
    padding: 0;
    display: flex;
    justify-content: center;
}

.simple-window-frame {
    width: 100%;
    max-width: 640px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    box-shadow: none;
}

.frame-left,
.frame-right,
.window-header,
.window-sill,
.surroundings-layer,
.profile-controls {
    display: none !important;
}

.weather-window {
    width: 100%;
    min-height: 360px;
    height: auto;
    aspect-ratio: 3 / 2;
    border: none;
    background: var(--bg-color);
}

.legacy-architecture-layer {
    display: none;
}

.sky-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(var(--scene-sky-cutoff-percent) + var(--spacing-sm));
    overflow: hidden;
    display: block;
    z-index: 0;
    pointer-events: none;
}

.distant-layer,
.midground-layer {
    display: none;
}

.ground-fill {
    height: calc(var(--scene-horizon-offset-percent) + var(--spacing-sm));
    background: var(--bg-color);
}

.horizon-line {
    bottom: var(--scene-horizon-offset-percent);
    font-size: var(--scene-horizon-font-size);
    opacity: 0.7;
    overflow: visible;
}

.horizon-line-left {
    width: calc(50% - var(--tree-gap));
}

.horizon-line-right {
    width: calc(50% - var(--tree-gap));
}

.tree-base-mask {
    position: absolute;
    left: 50%;
    bottom: calc(var(--scene-horizon-offset-percent) - 0.35rem);
    width: var(--scene-mask-width);
    height: var(--scene-mask-height);
    transform: translateX(-50%);
    background: var(--bg-color);
    z-index: 3;
    pointer-events: none;
}

.tree-background {
    z-index: 4 !important;
    bottom: var(--scene-tree-bottom);
    font-size: 0.65rem;
    opacity: 0.9 !important;
    transform: translateX(-50%) scale(var(--scene-tree-scale));
    transform-origin: center bottom;
}

.weather-display {
    z-index: 5;
    max-width: 70%;
    max-height: 40%;
    line-height: 1.4;
}

.celestial-display {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre;
    background-color: transparent;
    pointer-events: none;
    max-width: 70%;
    max-height: 40%;
    z-index: 1;
    transition: top 0.5s ease, left 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
}

.sun-display,
.moon-display {
    display: none;
}

.weather-animation {
    z-index: 3;
}

.info-panel {
    width: 100%;
    max-width: 640px;
}

@media screen and (min-width: 769px) {
    .tree-base-mask {
        bottom: calc(var(--scene-horizon-offset-percent) - 0.1rem);
    }
}

@media screen and (max-width: 768px) {
    .app-shell {
        width: min(100vw - 1.5rem, 720px);
    }

    .scene-stage {
        padding: 0;
    }

    .simple-window-frame {
        max-width: none;
    }

    .weather-window {
        min-height: 280px;
    }
}

@media screen and (max-width: 480px) {
    .weather-window {
        min-height: 240px;
    }
}
