:root {
  --bg: #FBF4E6;
  --card: #FFFDF8;
  --line: #EADCC4;
  --ink: #4A3A2E;
  --muted: #8A7663;
  --green: #5DA552;
  --green-dark: #3F7F37;
  --green-soft: #DCEFD2;
  --water: #5BB4E0;
  --water-soft: #DDF0FA;
  --pink: #F26D8F;
  --danger: #C8452E;
  --radius: 20px;
  --tabbar-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
#app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}
h1 { font-size: 24px; margin: 0; font-weight: 700; }
h2 { font-size: 20px; margin: 0; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 10px; font-weight: 700; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
button { font: inherit; color: inherit; }

.top { margin: 4px 2px 14px; }
.eyebrow { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.card {
  display: block;
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  text-align: left;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.card-head h3 { margin: 0; }

/* Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); font-weight: 600; cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--green); border-color: var(--green-dark); color: #fff; }
.btn.danger { background: var(--danger); border-color: #8E2F1E; color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger.ghost { background: transparent; color: var(--danger); border-color: #E9B8AD; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.big { width: 100%; min-height: 52px; font-size: 17px; margin-top: 10px; }
.icon-btn {
  border: none; background: transparent; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 22px; line-height: 1; color: var(--muted);
}
.icon-btn:active { background: var(--line); }
.icon-btn.round { border: 1.5px solid var(--line); background: var(--card); font-size: 26px; width: 42px; height: 42px; }
.icon-btn:disabled { opacity: 0.3; }

/* Bitki kartı */
.plant-card { text-align: center; padding-top: 6px; }
.plant-card .btn { margin-top: 10px; }
.plant-stage { max-width: 210px; margin: 0 auto; cursor: pointer; }
.plant-stage.wiggle .lf-plant { animation: wiggle 0.6s ease-in-out; transform-origin: 50% 90%; }
.plant-stage.drink .lf-plant { animation: drink 0.7s ease-out; transform-origin: 50% 95%; }
@keyframes wiggle { 25% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } 75% { transform: rotate(-1.5deg); } }
@keyframes drink { 30% { transform: scale(1.05, 0.95); } 60% { transform: scale(0.98, 1.03); } }
.plant-title { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.health-0 { background: var(--green-soft); color: var(--green-dark); }
.health-1 { background: #F6EBC8; color: #86691E; }
.health-2 { background: #F5DDBF; color: #8C5420; }
.health-3 { background: #F8D2C8; color: #9A321E; }
.grow-row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin: 12px 2px 4px; }

.bar { position: relative; height: 12px; border-radius: 999px; background: #EFE6D6; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.bar.grow .bar-fill { background: var(--green); }
.bar.water { height: 16px; }
.bar.water .bar-fill { background: var(--water); }
.bar-mark { position: absolute; top: 0; bottom: 0; left: 80%; width: 2px; background: rgba(74, 58, 46, 0.35); }

/* Su kartı */
.seg { display: inline-flex; background: #F2E9D9; border-radius: 999px; padding: 3px; margin-bottom: 10px; }
.seg button { border: none; background: transparent; padding: 6px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(74, 58, 46, 0.15); }
.seg.small button { padding: 4px 12px; font-size: 13px; }
.seg.small { margin: 0; }
.water-total { display: flex; align-items: baseline; gap: 4px; margin-bottom: 8px; }
.water-total .big { font-size: 30px; font-weight: 700; }
.water-total .pct { margin-left: auto; font-weight: 700; color: var(--water); }
.note { background: var(--water-soft); color: #2D6C8E; border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.containers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.cbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 6px; border-radius: 16px; border: 1.5px solid #CFE6F3;
  background: var(--water-soft); color: #2D6C8E; cursor: pointer;
}
.cbtn:active { transform: scale(0.95); background: #C9E7F7; }
.cbtn svg { width: 28px; height: 28px; }
.cbtn span { font-size: 13px; font-weight: 600; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbtn b { font-size: 13px; }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #F1E7D6; }
.entries li:first-child { border-top: none; }
.entries .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; width: 44px; }
.entries .what { flex: 1; font-size: 15px; }
.entries .what em { color: var(--muted); font-size: 12px; font-style: normal; }
.entries .ml { font-weight: 600; font-size: 15px; }
.nag { background: #FFF4D6; border-color: #F1D88A; color: #7A5D12; font-weight: 600; cursor: pointer; }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--green-soft); color: var(--green-dark);
  border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-size: 15px;
}

/* Bahçe */
.garden-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; text-align: center; }
.garden-wrap { border-radius: var(--radius); overflow: hidden; border: 1.5px solid var(--line); margin-bottom: 10px; }
.garden-svg { display: block; width: 100%; height: auto; }
.g-plant, .g-slot { cursor: pointer; }
.g-slot ellipse { animation: slot-pulse 1.6s ease-in-out infinite; }
.g-selected { animation: selected 1s ease-in-out infinite alternate; }
.g-cloud { animation: cloud 60s linear infinite; }
.g-particle { animation: particle 12s linear infinite; }
.g-firefly { animation: firefly 3.5s ease-in-out infinite; }
@keyframes slot-pulse { 50% { fill-opacity: 0.85; } }
@keyframes selected { to { opacity: 0.55; } }
@keyframes cloud { from { transform: translateX(-60px); } to { transform: translateX(420px); } }
@keyframes particle {
  0% { transform: translate(0, -20px) rotate(0deg); }
  50% { transform: translate(18px, 260px) rotate(180deg); }
  100% { transform: translate(-6px, 540px) rotate(360deg); }
}
@keyframes firefly { 0%, 100% { opacity: 0.1; } 50% { opacity: 1; } }

/* Tohumlar */
.section-title { margin: 18px 4px 10px; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; }
.seed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.seed-card {
  position: relative; border: 1.5px solid var(--line); background: var(--card);
  border-radius: 18px; padding: 8px 6px 10px; text-align: center; cursor: pointer;
}
.seed-card:active { transform: scale(0.97); }
.seed-art { width: 100%; }
.seed-name { font-weight: 700; font-size: 14px; margin-top: 2px; }
.seed-meta { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.locked .seed-art svg, .sheet-art.locked svg { filter: brightness(0); opacity: 0.14; }
.rarity { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.r-uncommon { background: #DCEFD2; color: #3F7F37; }
.r-rare { background: #DDEBFA; color: #2F5E99; }
.r-legendary { background: #EEE3FB; color: #6B3FA6; }
.count { position: absolute; top: 6px; right: 8px; font-size: 12px; font-weight: 700; color: var(--green-dark); }

/* İstatistik */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tiles.inner { margin: 12px 0 0; }
.tiles.inner:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 10px; }
.tiles.inner .tile { background: #FBF6EC; border: none; }
.tile-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 20px; font-weight: 700; }
.tile-sub { font-size: 12px; color: var(--muted); }
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart .b-met { fill: var(--green); }
.chart .b-miss { fill: #C9DDBC; }
.chart .b-today { stroke: var(--green-dark); stroke-width: 1.5; }
.chart .c-lab { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.chart .c-val { font-size: 9px; fill: var(--ink); text-anchor: middle; font-weight: 600; }
.chart .c-goal { stroke: var(--water); stroke-width: 1.2; stroke-dasharray: 4 3; }
.chart .c-goal-lab { font-size: 9px; fill: var(--water); text-anchor: end; font-weight: 600; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .dot.met { background: var(--green); }
.legend .dot.miss { background: #C9DDBC; margin-left: 8px; }

/* Ayarlar ve formlar */
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #F1E7D6; }
.field:first-of-type { border-top: none; }
.field span { font-size: 15px; }
.field input, .field select, .crow input {
  font: inherit; font-size: 16px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  padding: 8px 10px; min-height: 40px; width: 130px; text-align: right;
}
.field select { text-align: left; }
.field-error { color: var(--danger); font-size: 14px; min-height: 0; margin: 4px 0; }
.field-error:empty { display: none; }
.goal-box { background: var(--water-soft); color: #2D6C8E; border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--green); }
.clist { list-style: none; padding: 0; margin: 0 0 10px; }
.crow { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.crow .cicon { color: #2D6C8E; display: flex; }
.crow input[data-field="c-name"] { flex: 1; width: auto; min-width: 0; text-align: left; }
.crow input[data-field="c-ml"] { width: 80px; }
.crow .unit { font-size: 14px; color: var(--muted); }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.icon-picks { display: flex; gap: 8px; margin: 10px 0; }
.icon-pick { display: flex; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); color: #2D6C8E; cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick:has(input:checked) { background: var(--water-soft); border-color: var(--water); }

/* İlk açılış */
.onb { text-align: center; padding-top: 10px; }
.onb-art { max-width: 220px; margin: 0 auto 6px; }
.onb .field { text-align: left; }
.onb-goal { font-size: 40px; font-weight: 800; color: var(--water); margin: 6px 0; }

/* Alt menü */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: rgba(255, 253, 248, 0.96);
  border-top: 1.5px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar[hidden] { display: none; }
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: none; color: var(--muted); font-size: 11px; font-weight: 600;
  padding: 4px 0; cursor: pointer;
}
.tabbar button[aria-current="page"] { color: var(--green-dark); }

/* Alttan açılan pencere */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(60, 42, 30, 0.35); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto;
  max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 0.25s ease;
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-title { margin: 4px 0 6px; }
.sheet-text { margin: 6px 0; }
.sheet-art { max-width: 200px; margin: 0 auto; }
.sheet-art.small { max-width: 110px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip-btn { border: 1.5px solid #CFE6F3; background: var(--water-soft); color: #2D6C8E; border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.unlock-list { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; text-align: center; }

/* Bildirim */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 12px;
  background: #3E3027; color: #FFF8EC; border-radius: 999px;
  padding: 10px 18px; font-size: 15px; font-weight: 600; max-width: calc(100vw - 32px);
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { border: none; background: none; color: #9FD98F; font-weight: 700; cursor: pointer; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  .g-cloud, .g-particle, .g-firefly, .g-slot ellipse, .g-selected { animation: none; }
  .g-particle { display: none; }
}
