/* letflow.css — LetFlow 接水管：只有「板面」（水箱｜水管盤｜噴泉＋方向鍵）。
   木框／教練／🌼／回家的路／折線圖／統計／方向鍵全部在 garden-kit.css（class gk-），這裡不要重寫。 */

.lf-ref-goal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.lf-ref-icons { font-size: 13px; line-height: 1; letter-spacing: -1px; white-space: nowrap; }
.lf-ref-text { font-size: 10px; font-weight: 800; color: #7c5a21; line-height: 1; white-space: nowrap; }
.lf .gk-road-home { align-items: center; justify-content: center; }
.lf-home { font-size: 18px; line-height: 1; }
.lf-lvl button { padding: 0 12px; }
.lf-lvl button[disabled] { opacity: .35; cursor: default; }
.lf-lvl-label { appearance: none; background: none; border: 0; border-left: 1px solid var(--gd-bd); border-right: 1px solid var(--gd-bd); cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; padding: 0 12px; font-weight: 800; font-size: 14.5px; color: #334155; min-width: 86px; justify-content: center; }
.lf-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; width: 100%; max-height: 196px; overflow-y: auto; padding: 8px; box-sizing: border-box; background: #fff8ea; border: 2px solid #e5c58c; border-radius: 14px; }
.lf-pick { appearance: none; position: relative; height: 40px; border-radius: 10px; border: 2px solid #e5c58c; background: #fff; font: 800 15px/1 inherit; color: #475569; cursor: pointer; }
.lf-pick.is-done { background: #fef9c3; border-color: #eab308; }
.lf-pick.is-done::after { content: '⭐'; position: absolute; right: -5px; top: -7px; font-size: 12px; }
.lf-pick.is-cur { border-color: var(--gk-good); box-shadow: 0 0 0 2px var(--gk-good); }

.lf-board { position: relative; }
/* 水池：--c 一格；左右各留 1.1 格給水箱與噴泉 */
.lf-yard { --c: min(96px, calc(636px / (var(--n) + 2.2)), calc((100vw - 76px) / (var(--n) + 2.2))); position: relative; display: flex; align-items: flex-start; justify-content: center; width: calc(var(--c) * (var(--n) + 2.2) + 12px); margin: 0 auto; padding: 6px; box-sizing: border-box; border-radius: 18px; background: linear-gradient(180deg, #bae6fd, #7dd3fc); box-shadow: inset 0 -5px 0 rgba(0,0,0,.1), 0 3px 6px rgba(60,30,0,.2); }
.lf-grid { position: relative; width: calc(var(--c) * var(--n)); height: calc(var(--c) * var(--n)); border-radius: 12px; overflow: hidden; background: #e0f2fe; touch-action: manipulation; outline: none; user-select: none; -webkit-user-select: none; box-shadow: inset 0 3px 8px rgba(0,0,0,.15); flex: none; }
.lf-grid:focus-visible { box-shadow: inset 0 3px 8px rgba(0,0,0,.15), 0 0 0 3px #86efac; }
.lf-cell { position: absolute; width: var(--c); height: var(--c); left: calc(var(--x) * var(--c)); top: calc(var(--y) * var(--c)); box-sizing: border-box; background: #d9f99d; }
.lf-cell.is-alt { background: #fde68a; }
.lf-cell:nth-child(3n) { background: #fbcfe8; } .lf-cell:nth-child(3n).is-alt { background: #a5f3fc; }
.lf-cell { box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), inset 0 -3px 0 rgba(0,0,0,.08); }
.lf-tile { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lf-tile-in { position: absolute; inset: 0; transition: transform .22s cubic-bezier(.3,1.4,.6,1); }
.lf-tile-in svg { width: 100%; height: 100%; display: block; }
.lf-water { opacity: 0; transition: opacity .25s; }
.is-wet .lf-water { opacity: 1; }
.lf-face { opacity: .55; }
.is-wet .lf-face { opacity: 1; }
.lf-tile:active .lf-tile-in { transform: scale(.94) !important; }
/* 還沒接到水的水管：角落有小小的 ↻，提示「點我會轉」 */
.lf-spin { position: absolute; right: 3px; bottom: 1px; font-size: 13px; font-weight: 900; color: rgba(30,41,59,.55); pointer-events: none; }
.is-wet .lf-spin { display: none; }
.lf-tile.is-sel { outline: 3px solid #fff; outline-offset: -3px; z-index: 2; box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 0 8px 2px rgba(255,255,255,.9); }
.lf-badge { --b: min(20px, calc(var(--c) * .42)); position: absolute; left: 1px; top: 1px; width: var(--b); height: var(--b); border-radius: 50%; display: none; place-items: center; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); z-index: 1; pointer-events: none; }
.lf-badge svg { width: 60%; height: 60%; display: block; }
.lf-tile.is-good .lf-badge { display: grid; background: var(--gk-good); }
.lf-tile.is-bad .lf-badge { display: grid; background: var(--gk-bad); }
.lf-tile.is-same .lf-badge { display: grid; background: var(--gk-same); }
.lf-tile.is-good { box-shadow: inset 0 0 0 3px var(--gk-good); }
.lf-tile.gk-glow { animation: gk-glow 1s ease-in-out infinite; }
/* 水箱／噴泉：對齊 r0／r1 那一列 */
.lf-side { position: relative; width: calc(var(--c) * 1.1); height: calc(var(--c) * var(--n)); flex: none; }
.lf-flag { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--r0) * var(--c) - 24px); white-space: nowrap; font-size: 11px; font-weight: 900; color: #7c2d12; background: #fff7ed; border: 2px solid #fdba74; border-radius: 6px; padding: 1px 5px; line-height: 1.2; z-index: 2; }
.lf-fountain .lf-flag { top: calc(var(--r1) * var(--c) - 24px); }
.lf-tank-body { position: absolute; left: 6%; top: calc(var(--r0) * var(--c) + var(--c) * .08); width: 70%; height: calc(var(--c) * .84); border-radius: 22% 22% 26% 26%; background: linear-gradient(180deg, #e0f2fe 0 30%, #7dd3fc 30%); border: 3px solid #475569; box-sizing: border-box; display: grid; place-items: center; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); }
.lf-tank-face { font-size: calc(var(--c) * .4); line-height: 1; animation: lf-bob 1.6s ease-in-out infinite; }
.lf-spout { position: absolute; right: 0; top: calc(var(--r0) * var(--c) + var(--c) * .33); width: 30%; height: calc(var(--c) * .34); background: #1d4ed8; border-radius: 4px 0 0 4px; }
.lf-spout::after { content: ''; position: absolute; inset: 25% 0; background: #7dd3fc; }
.lf-spout--in { right: auto; left: 0; top: calc(var(--r1) * var(--c) + var(--c) * .33); border-radius: 0 4px 4px 0; }
.lf-fountain-body { position: absolute; left: 24%; top: calc(var(--r1) * var(--c) + var(--c) * .12); font-size: calc(var(--c) * .68); line-height: 1; filter: grayscale(.6) opacity(.7); transition: filter .3s, transform .3s; }
.lf-yard--done .lf-fountain-body { filter: none; transform: scale(1.15); animation: lf-bob .6s ease-in-out infinite; }
.lf-yard--done .lf-spout--in::after { background: #38bdf8; }
@keyframes lf-bob { 50% { transform: translateY(-8%); } }
.lf-rot-btn { width: 74px; margin-left: 8px; }
.lf-rot-btn .gk-pad-arrow { font-weight: 900; }
.lf .gk-win { position: absolute; top: auto; }
@media (prefers-reduced-motion: reduce) { .lf-tile-in, .lf-water { transition: none; } .lf-tank-face, .lf-yard--done .lf-fountain-body { animation: none; } }
