:root {
    --bg-color: #fcf9f2; /* Lighter, warmer paper */
    --text-color: #2e2307;
    --accent-color: #4a5d23; /* Default forest green */
    --accent-rgb: 74, 93, 35;
    --border-color: rgba(79, 34, 34, 0.15);
    --btn-bg: #fffbf5;
    --btn-hover: #ffffff;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
    --ground-color: rgba(79, 34, 34, 0.1);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="endemic"] { --accent-color: #1B4D16; --accent-rgb: 27, 77, 22; --bg-shift: #e8f0e5; }
[data-theme="quasi-endemic"] { --accent-color: #6D4C1D; --accent-rgb: 109, 76, 29; --bg-shift: #f9f0e0; }
[data-theme="reference"] { --accent-color: #5D5D5D; --accent-rgb: 93, 93, 93; --bg-shift: #f0f0f0; }

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

body {
    background-color: var(--bg-shift, var(--bg-color));
    color: var(--text-color);
    font-family: var(--font-body);
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    transition: background-color 1.2s cubic-bezier(0.1, 0.9, 0.2, 1);
}

/* === OVERLAYS AND TEXTURES === */
.vignette {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    /* Stronger color influence from the accent */
    background: radial-gradient(circle, transparent 0%, rgba(var(--accent-rgb), 0.08) 50%, rgba(var(--accent-rgb), 0.25) 100%);
    pointer-events: none; z-index: 10;
    transition: background 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.texture-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 11;
    mix-blend-mode: multiply;
}

.grain-overlay {
    position: fixed; inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 12;
}

.light-leak {
    position: fixed; top: -10%; left: -10%; width: 120%; height: 120%;
    background: radial-gradient(circle at 20% 30%, rgba(255, 230, 180, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(200, 255, 220, 0.1) 0%, transparent 40%);
    pointer-events: none; z-index: 13;
    animation: lightMove 20s infinite alternate linear;
}

@keyframes lightMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, -2%) rotate(2deg); }
}

.container-stripes {
    background-image: repeating-linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.02) 1px, transparent 0, transparent 40px);
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1;
}

/* === BORDER OUTLINE === */
.border-outline {
    position: fixed; top: 20px; left: 20px;
    width: calc(100% - 40px); height: calc(100% - 40px);
    border: 2px solid #000;
    pointer-events: none; z-index: 14;
    transition: all 0.3s linear;
}
.border-outline-title {
    top: 80px; left: 80px;
    width: calc(100% - 160px); height: calc(100% - 160px);
}

/* === TITLE CARD === */
.title-card {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; background: var(--bg-color);
    transition: opacity 0.5s ease-out;
    overflow: hidden;
}
.title-card::before {
    content: ''; position: absolute; inset: 0;
    background: url('../assets/home.png') no-repeat center center;
    background-size: cover; opacity: 0.1; /* Low alpha */
    z-index: 0;
}
.title-card.hidden { opacity: 0; pointer-events: none; }
.title-card-inner {
    text-align: center; z-index: 10;
    display: flex; flex-direction: column; align-items: center;
}
.title {
    font-family: var(--font-heading); font-size: clamp(36px, 5vw, 78px);
    font-weight: 700; margin-bottom: 20px; color: var(--text-color);
}
.subtitle {
    font-size: 1.2rem; font-weight: 300;
    margin-bottom: 40px; opacity: 0.8;
}

/* === INFO PANEL === */
.info-panel {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 15;
    pointer-events: none;
    opacity: 1;
    transition: all 0.5s ease;
    padding: 20px 24px;
}

@keyframes fadeInPanel {
    to { opacity: 1; }
}

.tree-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.tree-scientific {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(11px, 2vw, 13px);
    opacity: 0.6;
    color: var(--text-color);
    letter-spacing: 0.05em;
}

.tree-size, .type-tag {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(9px, 1.5vw, 11px);
    padding: 4px 10px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
}

.tree-size {
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.type-tag {
    border: 1px solid currentColor;
}

.type-tag.endemic { color: #1B4D16; border-color: rgba(27, 77, 22, 0.3); }
.type-tag.quasi-endemic { color: #4D3D16; border-color: rgba(77, 61, 22, 0.3); }

.tree-name {
    font-family: var(--font-heading);
    font-size: clamp(32px, 8vw, 64px);
    font-weight: 700;
    color: var(--text-color);
    margin: 10px 0;
    text-transform: uppercase;
    line-height: 1.0;
    letter-spacing: 0.05em;
    transition: color var(--transition-slow);
}

.tree-desc {
    max-width: 550px;
    margin-top: 20px;
    font-family: var(--font-body);
    font-size: clamp(14px, 2.2vw, 18px);
    font-weight: 400;
    line-height: 1.8;
    color: var(--text-color);
    opacity: 0.9;
    padding: 0 20px;
    letter-spacing: 0.01em;
}

.tree-header, .tree-name, .tree-desc {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.tree-header { animation-delay: 0.1s; }
.tree-name { animation-delay: 0.2s; }
.tree-desc { animation-delay: 0.3s; }

/* --- Transitions for Panel --- */
.fade-in { opacity: 1 !important; visibility: visible; }
.fade-out { opacity: 0 !important; visibility: hidden; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === BUTTONS === */
/* Premium CTA */
.btn-enter {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 40px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    padding: 18px 45px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
    letter-spacing: 0.1em;
}
.btn-enter:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.15);
}
.btn-enter:hover .arrow-icon { transform: translateX(4px); }

.arrow-icon { width: 20px; transition: transform 0.2s ease; }
.arrow-icon.inverted { transform: rotate(180deg); }

/* Infinite pulsing arrow animation (like original) */
.arrow-animated {
    animation: arrowPulse 1s ease-in-out infinite alternate;
}
@keyframes arrowPulse {
    0% { transform: translateX(0); }
    100% { transform: translateX(4px); }
}

/* === MAIN APP UI === */
.app-ui {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 1; transition: opacity 0.5s ease-in; z-index: 5;
}
.app-ui.hidden { opacity: 0; pointer-events: none; }

.logo {
    position: fixed; top: 35px; left: 35px;
    font-family: var(--font-heading); font-size: 18px;
    font-weight: 700; z-index: 15; cursor: pointer;
    opacity: 0.7; transition: opacity 0.2s;
}
.logo:hover { opacity: 1; }

/* Removed redundant info-panel definitions */

/* === INSTRUCTION CTA === */
.instruction {
    position: fixed; top: 50%; right: 40px; transform: translateY(-50%);
    font-family: var(--font-body); font-size: 15px; font-weight: 500;
    letter-spacing: 1px;
    z-index: 15; opacity: 0;
    /* Add a pulsing animation to match Size of Life CTA */
    animation: fadeIn 0.6s linear 2.5s forwards, pulseGlow 2s ease-in-out infinite alternate;
    transition: opacity 0.5s ease;
    pointer-events: none;
    color: var(--text-color);
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 10px 20px;
    border-radius: 40px;
    border: 1px solid rgba(79, 34, 34, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.instruction.hidden { 
    opacity: 0 !important; 
    animation: none; 
    transition: opacity 0.3s ease; 
}


/* === TOP RIGHT UI === */
.top-right-ui {
    position: fixed; top: 30px; right: 40px;
    display: flex; gap: 12px; z-index: 20;
}
.icon-btn {
    width: 45px; height: 45px; border-radius: 50%;
    background: var(--btn-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-body); font-size: 16px; font-weight: 600;
    color: var(--text-color); cursor: pointer;
    transition: all 0.2s ease;
}
.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.icon-btn:active { transform: scale(0.95); }

.icon-btn.active {
    background: var(--accent-color);
    color: white;
}

.hidden { display: none !important; }

/* === ARROWS === */
.arrow-nav {
    position: fixed; bottom: 40px; z-index: 20;
}
.prev-arrow { left: 40px; }
.next-arrow { right: 40px; }

.control-button {
    background: var(--btn-bg); border: none; border-radius: 50%;
    width: 50px; height: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    outline: 1px solid var(--border-color); outline-offset: -3px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.control-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.control-button:active:not(:disabled) { transform: scale(0.95); }
.control-button:disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; transform: none; }
.arrow-icon { width: 18px; filter: invert(24%) sepia(21%) saturate(541%) hue-rotate(338deg) brightness(97%) contrast(92%); }
.inverted { transform: rotate(180deg); }

/* === MODAL POPUP === */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    z-index: 100; display: flex; align-items: center; justify-content: center;
    opacity: 1; transition: opacity 0.3s ease;
}
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal-content {
    background: var(--bg-color); padding: 40px; border-radius: 20px;
    width: 90%; max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); position: relative;
    font-family: var(--font-body); color: var(--text-color);
}
.modal-close {
    position: absolute; top: 8px; right: 8px; background: none; border: none;
    font-size: 24px; cursor: pointer; color: var(--text-color); opacity: 0.5;
    transition: opacity 0.2s;
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { opacity: 1; }
.modal-content h2 { font-family: var(--font-heading); margin-bottom: 15px; }
.modal-content p { font-size: 14px; line-height: 1.6; opacity: 0.8; margin-bottom: 20px; }
.modal-links { display: flex; gap: 15px; }
.modal-links a { font-size: 14px; font-weight: 600; color: var(--accent-color); text-decoration: none; }
.modal-links a:hover { text-decoration: underline; }

/* === SCALE UI === */
.scale-ui {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 3; overflow: hidden;
}
.scale-line-ui {
    position: absolute; left: 0; width: 100%;
    border-bottom: 1px dashed rgba(79,34,34,0.12);
    transition: bottom 1s cubic-bezier(0.25,1,0.5,1), opacity 0.5s ease;
}
.scale-line-ui.major { border-bottom: 1px solid rgba(79,34,34,0.22); }
.scale-label-ui {
    position: absolute; left: 30px; bottom: 2px;
    font-family: var(--font-body); font-weight: 500; font-size: 13px;
    color: rgba(79,34,34,0.55);
    text-shadow: 1px 1px 0 var(--bg-color), -1px -1px 0 var(--bg-color),
                 1px -1px 0 var(--bg-color), -1px 1px 0 var(--bg-color);
}

/* === RENDER LAYER === */
.render-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2; transform-origin: 50% 100%;
    transition: transform 1s cubic-bezier(0.25,1,0.5,1);
}

.camera-layer {
    position: absolute; bottom: 0; left: 50%; width: 0; height: 100%;
    transition: transform 1s cubic-bezier(0.25,1,0.5,1);
}

.ground-line {
    position: absolute; bottom: 0; left: -50vw; width: 200vw; height: 30px;
    background: linear-gradient(to bottom, rgba(79,34,34,0.08) 0%, rgba(79,34,34,0.18) 100%);
    z-index: -1;
}

/* === TREE ENTITIES === */
.entity {
    position: absolute; bottom: 20px;
    transform-origin: bottom center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
    transition: opacity 0.5s ease;
}
.entity img {
    height: 100%;
    width: 100%; /* Important: now filled exactly by JS calculations */
    display: block;
    max-width: none;
    max-height: none;
    object-fit: contain;
}
.entity.active { opacity: 1; }
.entity img {
    animation: sway 5s ease-in-out infinite;
    transform-origin: bottom center;
}
/* --- Improved sway with more momentum --- */
@keyframes sway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(0.4deg); }
}

.ground-line {
    background: linear-gradient(to bottom, rgba(var(--accent-rgb), 0.1) 0%, rgba(var(--accent-rgb), 0.2) 100%);
    transition: background 1.2s ease;
}
.entity:not(.active) { opacity: 0.25; }

/* Entity labels removed per user request */


/* === HUMAN SCALE COMPANION (per-tree) === */
.human-companion {
    position: absolute;
    bottom: 20px;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    z-index: 15;
}

.human-companion img {
    height: 100%;
    width: 100%;
    object-fit: fill;
}

.human-companion.active {
    opacity: 0.25;
}

/* Atmospheric End Card */
.end-card {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 1001; background: var(--bg-color);
    background-image: radial-gradient(circle at center, transparent 0%, rgba(var(--accent-rgb), 0.05) 100%);
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}
.end-card-inner {
    text-align: center; max-width: 600px; padding: 60px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--accent-rgb), 0.1);
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    position: relative;
    display: flex; flex-direction: column; align-items: center;
}
.end-card-inner::before {
    content: ''; position: absolute; top: -10px; left: -10px; right: -10px; bottom: -10px;
    border: 1px solid rgba(var(--accent-rgb), 0.05);
    pointer-events: none;
}
.end-title {
    font-family: var(--font-heading); font-size: 3rem;
    margin-bottom: 20px; color: var(--text-color);
    letter-spacing: 0.2em;
}
.end-subtitle {
    font-family: var(--font-body); font-size: 1.1rem;
    line-height: 1.8; opacity: 0.7; margin-bottom: 50px;
    font-style: italic;
}

/* === PROGRESS COUNTER === */
.progress-counter {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 6px;
    pointer-events: none;
}
#counter-text {
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    color: var(--text-color); opacity: 0.5; letter-spacing: 0.15em;
}
.progress-bar {
    width: 80px; height: 2px;
    background: rgba(79, 34, 34, 0.1); border-radius: 2px; overflow: hidden;
}
.progress-fill {
    height: 100%; width: 7.14%;
    background: var(--accent-color); border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* === RESPONSIVE STRATEGY (Mobile-First) === */

/* Prevent iOS double-tap zoom on buttons */
.icon-btn, .control-button, .btn-enter {
    touch-action: manipulation;
}

/* Pulse animation — shadow only, no transform (avoids conflicting with positioning) */
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(255,146,44,0.4); }
    100% { box-shadow: 0 0 0 10px rgba(255,146,44,0); }
}

/* Default: Mobile (< 640px) */
.border-outline {
    top: 12px; left: 12px;
    width: calc(100% - 24px); height: calc(100% - 24px);
    border-width: 1px;
}
.border-outline-title {
    top: 12px; left: 12px;
    width: calc(100% - 24px); height: calc(100% - 24px);
}
.logo {
    top: max(25px, env(safe-area-inset-top, 0px) + 10px);
    left: max(25px, env(safe-area-inset-left, 0px) + 10px);
    font-size: 14px;
}
.top-right-ui {
    top: max(20px, env(safe-area-inset-top, 0px) + 8px);
    right: max(20px, env(safe-area-inset-right, 0px) + 8px);
    gap: 6px;
}
.icon-btn { width: 44px; height: 44px; font-size: 13px; }
.icon-btn svg { width: 18px; height: 18px; }
.info-panel {
    top: max(76px, env(safe-area-inset-top, 0px) + 70px);
    width: 92%; max-width: 100%; padding: 0 10px;
    max-height: 48vh; overflow: hidden;
}
.tree-name { font-size: clamp(24px, 7vw, 64px); }
.tree-desc {
    font-size: 14px;
    padding: 0 10px;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 10px;
}
.tree-header { gap: 6px; flex-wrap: wrap; justify-content: center; }
.tree-size, .type-tag { font-size: 9px; padding: 3px 7px; }
.tree-scientific { font-size: 11px; }
.instruction {
    top: auto;
    bottom: max(100px, env(safe-area-inset-bottom, 0px) + 90px);
    right: 50%; transform: translateX(50%);
    font-size: 11px; white-space: nowrap; padding: 8px 14px;
}
.arrow-nav {
    bottom: max(22px, env(safe-area-inset-bottom, 0px) + 12px);
}
.prev-arrow { left: max(16px, env(safe-area-inset-left, 0px) + 10px); }
.next-arrow { right: max(16px, env(safe-area-inset-right, 0px) + 10px); }
.control-button { width: 44px; height: 44px; }
.progress-counter {
    bottom: max(24px, env(safe-area-inset-bottom, 0px) + 14px);
}
#counter-text { font-size: 11px; }
.progress-bar { width: 60px; }

.title { font-size: clamp(28px, 5vw, 78px); margin-bottom: 14px; }
.subtitle { font-size: clamp(14px, 2.5vw, 1.2rem); margin-bottom: 30px; padding: 0 20px; }
.btn-enter { font-size: 15px; padding: 14px 32px; }

.end-card-inner { padding: 30px 20px; }
.end-title { font-size: clamp(1.5rem, 5vw, 3rem); letter-spacing: 0.1em; }
.end-subtitle { font-size: clamp(0.85rem, 2.5vw, 1.1rem); margin-bottom: 30px; }

/* Modal mobile */
.modal-content { padding: 25px 20px; width: 92%; }

/* Tablet (>= 640px) */
@media (min-width: 640px) {
    .border-outline { top: 20px; left: 20px; width: calc(100% - 40px); height: calc(100% - 40px); border-width: 2px; }
    .logo { top: 35px; left: 35px; font-size: 18px; }
    .top-right-ui { top: 30px; right: 40px; gap: 12px; }
    .icon-btn { width: 45px; height: 45px; font-size: 16px; }
    .icon-btn svg { width: 20px; height: 20px; }
    .info-panel { top: 10%; width: 90%; max-width: 600px; max-height: none; overflow: visible; }
    .tree-desc {
        font-size: clamp(14px, 2.2vw, 18px);
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        overflow: visible;
        max-width: 550px;
        margin-top: 20px;
    }
    .tree-header { gap: 12px; }
    .tree-size, .type-tag { font-size: clamp(9px, 1.5vw, 11px); padding: 4px 10px; }
    .instruction { top: 50%; bottom: auto; right: 40px; transform: translateY(-50%); font-size: 15px; }
    .arrow-nav { bottom: 40px; }
    .prev-arrow { left: 40px; }
    .next-arrow { right: 40px; }
    .control-button { width: 50px; height: 50px; }
    .progress-counter { bottom: 30px; }
    #counter-text { font-size: 12px; }
    .progress-bar { width: 80px; }
}

/* Desktop (>= 1024px) */
@media (min-width: 1024px) {
    .border-outline-title {
        top: 80px; left: 80px;
        width: calc(100% - 160px); height: calc(100% - 160px);
    }
}

/* Landscape Mode Adjustments for Small Screens */
@media (max-height: 500px) and (orientation: landscape) {
    .info-panel { top: 5%; max-height: 55vh; }
    .tree-name { font-size: 20px; }
    .tree-desc {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-top: 4px;
        font-size: 13px;
    }
    .instruction { bottom: 20px; font-size: 11px; }
    .logo { display: none; }
    .progress-counter { bottom: 10px; }
}

/* Very small screens (< 380px) */
@media (max-width: 380px) {
    .top-right-ui { gap: 4px; right: 14px; top: 16px; }
    .icon-btn { width: 40px; height: 40px; }
    .icon-btn svg { width: 16px; height: 16px; }
    .logo { font-size: 12px; top: 18px; left: 18px; }
    .prev-arrow { left: 10px; }
    .next-arrow { right: 10px; }
    .control-button { width: 44px; height: 44px; }
    .info-panel { top: 72px; }
    .tree-desc { padding: 0 5px; font-size: 13px; }
}

/* Accessibility: Focus Indicators */
.icon-btn:focus-visible, .control-button:focus-visible, .btn-enter:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
}
