/* Dijital Orman Sayfası — sıcak gün batımı ormanı
   Palet: claude.md §4 (accent yalnızca CTA butonlarında) */
:root {
    --bg: #F7FBF7; --text: #1B4332; --primary: #2D6A4F; --secondary: #74C69D; --accent: #FFB347;
    --header-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.orman-page { font-family: 'Nunito', sans-serif; color: var(--text); background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
.serif { font-family: 'Playfair Display', serif; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ── Üst çubuk ── */
#orman-header { height: var(--header-h); flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: rgba(247,251,247,.94); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(116,198,157,.35); z-index: 50; }
#orman-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--primary); text-decoration: none; }
#orman-header .brand small { font-family: 'Nunito', sans-serif; font-weight: 600; color: rgba(27,67,50,.6); font-size: 13px; }
.hdr-actions { display: flex; align-items: center; gap: 8px; }
.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 800; font-size: 14px; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #245a42; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid rgba(116,198,157,.6); }
.btn-ghost:hover { background: #eef8f1; }
.btn-cta { background: var(--accent); color: var(--text); box-shadow: 0 4px 14px rgba(255,179,71,.4); } /* accent = aksiyon */
.btn-cta:hover { transform: translateY(-1px); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
#profile-menu { display: flex; align-items: center; gap: 8px; }
#profile-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--secondary); }
#profile-name { font-weight: 800; font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-pill { font-weight: 800; font-size: 13px; background: #fff; border: 1px solid rgba(116,198,157,.5); border-radius: 999px; padding: 8px 14px; white-space: nowrap; }

/* ── Sahne ── */
#forest-viewport { position: relative; flex: 1 1 auto; overflow: auto hidden; -webkit-overflow-scrolling: touch; cursor: grab; touch-action: pan-x; /* pinch'i biz yönetiyoruz */ }
#forest-viewport.dragging { cursor: grabbing; scroll-behavior: auto; user-select: none; }
#forest-scene { position: relative; height: 100%; min-height: 520px; background: linear-gradient(180deg, #FFE3B3 0%, #FFF1D2 30%, #F5F3D8 48%, #CFEBC8 58%, #A9DDB0 100%); overflow: hidden; }
.sun { position: absolute; top: 9%; right: 12%; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #FFE9A8 35%, rgba(255,214,120,.45) 60%, rgba(255,214,120,0) 72%); pointer-events: none; }
.sky-deco { position: absolute; inset: 0 0 45% 0; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; height: 26px; width: 90px; border-radius: 40px; background: rgba(255,255,255,.75); filter: blur(1px); animation: drift 90s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: inherit; border-radius: 50%; }
.cloud::before { width: 40px; height: 40px; top: -18px; left: 12px; }
.cloud::after { width: 30px; height: 30px; top: -12px; left: 46px; }
@keyframes drift { from { transform: translateX(-160px); } to { transform: translateX(110vw); } }
.hill { position: absolute; left: -10%; width: 120%; border-radius: 50% 50% 0 0 / 100% 100% 0 0; pointer-events: none; }
.hill.h1 { bottom: 38%; height: 22%; background: #B5DDB0; opacity: .8; }
.hill.h2 { bottom: 30%; height: 24%; background: #98D1A0; opacity: .85; }
.hill.h3 { bottom: 0; height: 52%; background: linear-gradient(180deg, #82C98F, #5DB37B); border-radius: 40% 40% 0 0 / 14% 14% 0 0; }
#forest { position: absolute; inset: 0; }

/* ── Ağaçlar ── */
.forest-tree { position: absolute; border: 0; padding: 0; background: none; transform: translateX(-50%); transform-origin: 50% 100%; transition: transform .25s cubic-bezier(.3,1.4,.5,1), filter .25s; -webkit-tap-highlight-color: transparent; }
.forest-tree .tree-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.forest-tree:hover, .forest-tree:focus-visible, .forest-tree.is-active { transform: translateX(-50%) scale(1.14); filter: drop-shadow(0 6px 10px rgba(27,67,50,.35)); z-index: 5000 !important; }
.forest-tree.is-mine::after { content: ''; position: absolute; left: 50%; bottom: -2px; width: 74%; height: 12px; transform: translateX(-50%); border-radius: 50%; border: 2.5px solid var(--accent); opacity: .95; }
.forest-tree .tree-sway { transform-origin: 50px 118px; animation: sway 5s ease-in-out infinite; }
.forest-tree:nth-child(3n) .tree-sway { animation-duration: 6.5s; animation-delay: -2s; }
.forest-tree:nth-child(3n+1) .tree-sway { animation-duration: 4.4s; animation-delay: -1s; }
@keyframes sway { 0%,100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } }
.ta-bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2px); } }
.ta-flutter { animation: flutter 3.2s ease-in-out infinite; }
@keyframes flutter { 0%,100% { transform: translate(0,0); } 30% { transform: translate(-6px,-5px); } 60% { transform: translate(-2px,4px); } }
.ta-sway { transform-box: fill-box; transform-origin: 50% 0; animation: pendulum 3s ease-in-out infinite; }
@keyframes pendulum { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.tree-placeholder { width: 100%; height: 100%; }

/* ── Bilgi kartı (hover / dokunma) ── */
#tree-tooltip { position: fixed; z-index: 9000; max-width: 260px; background: #fff; border: 1px solid rgba(116,198,157,.5); border-radius: 18px; padding: 14px 16px; box-shadow: 0 12px 30px rgba(27,67,50,.22); pointer-events: none; opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; }
#tree-tooltip.show { opacity: 1; transform: none; }
.tt-name { font-family: 'Playfair Display', serif; font-weight: 800; font-size: 18px; margin: 0 0 4px; }
.tt-msg { margin: 0 0 8px; font-size: 14px; line-height: 1.45; color: rgba(27,67,50,.8); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.tt-msg.empty { font-style: italic; color: rgba(27,67,50,.5); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #E9F6EE; color: var(--primary); border-radius: 999px; padding: 3px 9px; }

/* Mobil alt kart */
#tree-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9100; background: #fff; border-radius: 28px 28px 0 0; padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(27,67,50,.25); transform: translateY(110%); transition: transform .25s; }
#tree-sheet.show { transform: none; }
#tree-sheet .sheet-actions { display: flex; gap: 8px; margin-top: 12px; }
#tree-sheet .btn { flex: 1; }

/* ── Modal ── */
#tree-modal { position: fixed; inset: 0; z-index: 9500; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(27,67,50,.55); }
#tree-modal.open { display: flex; }
.modal-card { background: var(--bg); border-radius: 32px; width: 100%; max-width: 760px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.35); position: relative; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; font-size: 22px; line-height: 1; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.12); z-index: 2; }
.modal-grid { display: grid; grid-template-columns: 260px 1fr; }
.modal-art { background: linear-gradient(180deg, #FFE9BE, #CFEBC8 70%, #A9DDB0); display: flex; align-items: flex-end; justify-content: center; padding: 28px 16px 20px; border-radius: 32px 0 0 32px; min-height: 280px; position: sticky; top: 0; align-self: start; height: min(100%, 440px); }
.modal-grid { min-height: 100%; }
.modal-art .tree-svg { width: 100%; max-width: 220px; overflow: visible; }
.modal-art .tree-sway { transform-origin: 50px 118px; animation: sway 5s ease-in-out infinite; }
.modal-body { padding: 28px 28px 24px; min-width: 0; }
.modal-body h2 { font-family: 'Playfair Display', serif; font-weight: 800; font-size: 28px; margin: 0 40px 6px 0; word-break: break-word; }
.owner-badge { display: inline-block; margin-bottom: 8px; }
.tree-message { font-size: 16px; line-height: 1.6; margin: 10px 0 18px; white-space: pre-wrap; word-break: break-word; }
.tree-message.empty { font-style: italic; color: rgba(27,67,50,.5); }
.info-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; font-size: 14px; }
.info-list li { display: flex; gap: 10px; align-items: baseline; }
.info-list b { min-width: 104px; color: rgba(27,67,50,.6); font-weight: 700; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Düzenleme alanı */
.field { margin-bottom: 14px; }
.field label, .field .lbl { display: block; font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.field input[type=text], .field textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid rgba(116,198,157,.7); border-radius: 14px; background: #fff; color: var(--text); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,106,79,.18); }
.counter { text-align: right; font-size: 12px; color: rgba(27,67,50,.55); margin-top: 2px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 2px solid transparent; background: #fff; border-radius: 14px; padding: 6px 12px; font-weight: 700; font-size: 13px; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.opt[aria-checked=true] { border-color: var(--primary); background: #E9F6EE; }
.opt.species { width: 64px; height: 76px; padding: 4px; display: flex; flex-direction: column; align-items: center; font-size: 11px; }
.opt.species svg { width: 42px; height: 50px; }
.opt.swatch { width: 40px; height: 40px; border-radius: 50%; padding: 0; background: linear-gradient(135deg, var(--c1) 50%, var(--c2) 50%); }
.edit-msg { min-height: 20px; font-size: 14px; font-weight: 700; margin: 6px 0 0; }
.edit-msg.err { color: #c0392b; }
.edit-msg.ok { color: var(--primary); }

/* ── Ağaçlarım çekmecesi ── */
#my-drawer { position: fixed; top: var(--header-h); right: 0; bottom: 0; width: 360px; max-width: 100%; background: var(--bg); z-index: 9200; box-shadow: -10px 0 30px rgba(27,67,50,.2); transform: translateX(105%); transition: transform .28s; display: flex; flex-direction: column; }
#my-drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid rgba(116,198,157,.4); }
.drawer-head h2 { margin: 0; font-family: 'Playfair Display', serif; font-size: 22px; }
#my-list { overflow: auto; padding: 14px 16px 24px; display: grid; gap: 10px; align-content: start; }
.my-item { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid rgba(116,198,157,.4); border-radius: 20px; padding: 10px 12px; color: var(--text); }
.my-item:hover { box-shadow: 0 4px 14px rgba(45,106,79,.15); }
.my-item .thumb { width: 54px; height: 64px; flex: 0 0 auto; }
.my-item .thumb svg { width: 100%; height: 100%; }
.my-item strong { display: block; font-size: 15px; }
.my-item small { color: rgba(27,67,50,.6); font-size: 12px; }
.status-pending { background: #FFF3DA; color: #8a5a00; }
.status-rejected { background: #FDE8E6; color: #a1281c; }

/* ── Durum ekranları / bildirim ── */
.state-box { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; z-index: 20; }
.state-box .card { background: rgba(255,255,255,.92); border-radius: 28px; padding: 28px 26px; max-width: 360px; box-shadow: 0 12px 30px rgba(27,67,50,.15); }
.state-box h2 { font-family: 'Playfair Display', serif; margin: 0 0 8px; font-size: 22px; }
.state-box p { margin: 0 0 14px; line-height: 1.5; color: rgba(27,67,50,.75); }
.spinner { width: 38px; height: 38px; border: 4px solid rgba(116,198,157,.35); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 10000; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.scroll-hint { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 40; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.9); border-radius: 999px; padding: 7px 14px; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 12px rgba(27,67,50,.12); }

/* ── Zoom düğmeleri ── */
#zoom-controls { position: fixed; right: 16px; bottom: 30px; z-index: 40; display: flex; flex-direction: column; align-items: center; background: rgba(255,255,255,.94); border: 1px solid rgba(116,198,157,.5); border-radius: 22px; box-shadow: 0 6px 18px rgba(27,67,50,.15); overflow: hidden; }
#zoom-controls button { width: 44px; height: 44px; border: 0; background: none; color: var(--text); font-size: 16px; }
#zoom-controls button:hover:not([disabled]) { background: #E9F6EE; }
#zoom-controls button[disabled] { opacity: .35; cursor: default; }
#zoom-level { font-size: 11px; font-weight: 800; color: rgba(27,67,50,.65); padding: 0 0 2px; }
#zoom-level:hover { color: var(--primary); }

/* ── Mobil ── */
@media (max-width: 720px) {
    #orman-header .brand small, #profile-name, .stat-pill .long, .btn-label { display: none; }
    #orman-header { padding: 0 10px; gap: 6px; }
    #orman-header .brand { font-size: 17px; white-space: nowrap; gap: 6px; }
    .hdr-actions { gap: 6px; }
    .hdr-actions .btn { padding: 9px 12px; }
    .stat-pill { padding: 7px 10px; }
    .modal-grid { grid-template-columns: 1fr; }
    .modal-art { border-radius: 32px 32px 0 0; min-height: 200px; padding-top: 20px; position: static; height: auto; }
    .modal-art .tree-svg { max-width: 160px; }
    .modal-body { padding: 20px 18px 20px; }
    .modal-body h2 { font-size: 24px; }
    #tree-modal { padding: 0; align-items: flex-end; }
    .modal-card { border-radius: 28px 28px 0 0; max-height: 92vh; }
    .info-list b { min-width: 90px; }
}
@media (hover: none) { #tree-tooltip { display: none; } }
@media (hover: hover) { #tree-sheet { display: none; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── v1.2: profil kartları (hava, su) ── */
.profile-cards { display: grid; gap: 10px; margin: 0 0 18px; }
.mini-card { background: #fff; border: 1px solid rgba(116,198,157,.4); border-radius: 20px; padding: 12px 14px; font-size: 14px; }
.mini-head { display: flex; gap: 12px; align-items: center; }
.mini-head > i { font-size: 26px; color: var(--primary); width: 30px; text-align: center; }
.mini-head strong { display: block; font-size: 15px; }
.muted-sm { display: block; font-size: 12px; color: rgba(27,67,50,.6); line-height: 1.45; margin: 4px 0 0; }
.wx-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 4px; }
.wx-day { background: #F2FAF4; border-radius: 14px; padding: 8px 4px; text-align: center; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.wx-day i { font-size: 16px; color: var(--primary); }
.wx-day b { font-size: 12px; }
.wx-day small { color: rgba(27,67,50,.55); }
.attribution a { color: inherit; }
.bank-mini { height: 10px; border-radius: 999px; background: #EAF4F8; overflow: hidden; margin: 10px 0 2px; }
.bank-mini div { height: 100%; background: linear-gradient(90deg, #8ECAE6, #219EBC); border-radius: 999px; }

/* ── v1.2: ormanda gerçek hava atmosferi ── */
#forest-scene.wx-cloud, #forest-scene.wx-rain, #forest-scene.wx-storm { filter: saturate(.8) brightness(.94); }
#forest-scene.wx-fog { filter: saturate(.7) brightness(1.02) contrast(.85); }
#forest-scene.wx-snow { filter: saturate(.75) brightness(1.04); }
#forest-scene.wx-rain .sun, #forest-scene.wx-storm .sun, #forest-scene.wx-snow .sun, #forest-scene.wx-cloud .sun, #forest-scene.wx-fog .sun { opacity: .25; }
.weather-fx { position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.weather-fx .drop { position: absolute; top: -20px; width: 2px; height: 18px; border-radius: 2px; background: linear-gradient(transparent, rgba(80,120,160,.55)); animation: rainfall linear infinite; }
.weather-fx .flake { position: absolute; top: -12px; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 0 4px rgba(255,255,255,.8); animation: snowfall linear infinite; }
@keyframes rainfall { to { transform: translate(-30px, 110vh); } }
@keyframes snowfall { 0% { transform: translate(0, 0); } 50% { transform: translate(18px, 55vh); } 100% { transform: translate(-6px, 110vh); } }
.scene-weather { position: fixed; left: 16px; top: calc(var(--header-h) + 12px); z-index: 40; background: rgba(255,255,255,.9); border: 1px solid rgba(116,198,157,.5); border-radius: 18px; padding: 8px 14px; font-weight: 800; font-size: 13px; box-shadow: 0 4px 12px rgba(27,67,50,.1); }
.scene-weather i { color: var(--primary); margin-right: 4px; }
.scene-weather .muted-sm { margin: 0; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .weather-fx { display: none; } }

/* ── v1.3: büyüme ve evcil hayvan ── */
.forest-tree { overflow: visible; }
.tree-pet { position: absolute; bottom: -2px; pointer-events: none; z-index: 1; }
.tree-pet .pet-svg { width: 100%; height: auto; display: block; overflow: visible; }
.pet-svg .pet-body { transform-origin: 50% 100%; animation: petbob 2.8s ease-in-out infinite; }
.pet-svg.pet-sleepy .pet-body { animation: petbreathe 4s ease-in-out infinite; }
.pet-zzz { animation: zzz 2.6s ease-in-out infinite; }
@keyframes petbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes petbreathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.96); } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(4px, -4px); } }

.modal-art { position: relative; flex-direction: column; justify-content: flex-end; gap: 6px; }
.art-stack { width: calc(100% * var(--g, 1)); max-width: calc(220px * var(--g, 1)); min-width: 90px; display: flex; justify-content: center; }
.art-stack .tree-svg { width: 100%; max-width: none; }
.art-pet { position: absolute; right: 10%; bottom: 34px; width: 74px; }
.art-pet .pet-svg { width: 100%; height: auto; display: block; }
.art-caption { font-size: 12px; font-weight: 800; background: rgba(255,255,255,.85); border-radius: 999px; padding: 4px 12px; color: var(--primary); }

.pet-head > .pet-svg { width: 54px; height: auto; flex: 0 0 auto; }
.muted-inline { font-weight: 600; color: rgba(27,67,50,.55); font-size: 12px; }
.meter { position: relative; height: 18px; border-radius: 999px; background: #F3EEE4; overflow: hidden; margin: 10px 0 2px; }
.meter div { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #FFD08A, #F4A259); border-radius: 999px; transition: width .6s; }
.meter span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 800; line-height: 18px; color: #6B4510; }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.pet-opt { border: 2px solid transparent; background: #fff; border-radius: 16px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 800; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pet-opt .pet-svg { width: 52px; height: auto; }
.pet-opt[aria-checked=true] { border-color: var(--primary); background: #E9F6EE; }
