/* Tiny Planet Weeds - storybook twilight theme (teal night blue + peach/gold accents), on top of lib/common.css */
:root {
  --cz-bg: rgba(14, 40, 58, 0.78);
  --cz-fg: #fff6ea;
  --cz-accent: #ffb86a;
  --cz-accent2: #8fe8b8;
  --cz-danger: #ff7a6a;
}
body { background: #0e2a3c; }
#stage { position: fixed; inset: 0; }
#stage canvas { width: 100%; height: 100%; }
.hidden { display: none !important; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-size: 13px; transition: opacity .3s; }
.intro #hud { opacity: 0; }
#hud .cz-panel, #hud button { pointer-events: auto; }
.cz-panel { border: 2px solid rgba(255, 200, 150, .28); }

#hud-left { position: absolute; left: 12px; top: 12px; width: 280px; display: flex; flex-direction: column; gap: 7px; }
#coin-row { display: flex; align-items: center; gap: 9px; font-size: 30px; font-weight: 800; letter-spacing: .5px; color: #ffe08a; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
#coin-row.bump { animation: bump .28s ease-out; }
#coins-sub { font-size: 12px; font-weight: 600; color: #bfe0e8; margin-left: auto; text-shadow: none; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.2); } 100% { transform: scale(1); } }
.coin-ico { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1a8, #f2b929 55%, #b57a10); border: 2px solid #8a5a08; box-shadow: inset 0 0 0 3px rgba(255, 240, 160, .5); flex: none; position: relative; }
.coin-ico::after { content: '\2605'; position: absolute; inset: 0; text-align: center; line-height: 22px; font-size: 14px; color: #9a6218; font-weight: 900; }
.bar-row { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 8px; font-weight: 700; font-size: 12px; }
.cz-bar { height: 18px; border: 1px solid rgba(255, 255, 255, .15); }
.cz-bar > span { line-height: 18px; font-weight: 700; font-size: 11.5px; }
#carry-bar > i { background: linear-gradient(90deg, #6aa83a, #c8f08a); transition: width .08s linear; }
#carry-bar.full > i { background: linear-gradient(90deg, #ffb86a, #ffe08a); animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.35); } }
#tool-line { font-size: 12px; opacity: .95; }
#tool-line b { color: var(--cz-accent); }
#clock-line { font-size: 11.5px; opacity: .85; display: flex; gap: 6px; align-items: center; }
#clock-ico { width: 14px; height: 14px; border-radius: 50%; display: inline-block; background: #ffd25a; box-shadow: 0 0 6px #ffd25a; }
#clock-ico.night { background: #cfd8ff; box-shadow: inset -4px -2px 0 0 #1b2a4a, 0 0 6px #8aa0ff; }

#bloom-panel { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: min(460px, 42vw); padding: 7px 14px 9px; }
.bloom-title { display: flex; justify-content: space-between; font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.cz-bar.big { height: 20px; border-radius: 10px; }
.cz-bar.big > i { background: linear-gradient(90deg, #5a8a4a, #8ad060 40%, #ff9ac0 72%, #ffe08a); }
.cz-bar.big > span { line-height: 20px; font-size: 12px; font-weight: 700; }
#planet-pips { display: flex; gap: 6px; margin-top: 6px; }
.ppip { flex: 1; font-size: 10.5px; text-align: center; padding: 2px 0 0; border-radius: 6px; background: rgba(0, 0, 0, .3); opacity: .85; overflow: hidden; position: relative; cursor: pointer; }
.ppip i { display: block; height: 3px; background: #ff9ac0; width: 0; margin-top: 2px; }
.ppip.locked { opacity: .5; }
.ppip.here { background: rgba(255, 184, 106, .38); opacity: 1; outline: 1px solid rgba(255, 220, 170, .7); }
.ppip.done { background: rgba(255, 154, 192, .4); opacity: 1; }

#hud-right { position: absolute; right: 12px; top: 12px; width: 262px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; max-height: calc(100% - 175px); }
#btn-row { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.cz-btn.small { font-size: 12px; padding: 3px 8px; background: rgba(14, 40, 58, .82); }
#shop-panel { padding: 6px 8px; width: 244px; overflow-y: auto; }
#shop-panel.hidden, #shop-panel.empty { display: none; }
#shop.cz-shop { width: 100%; gap: 3px; }
#shop .cz-shop-title { font-size: 13px; }
#shop .cz-item { padding: 3px 8px; }
#shop .cz-item-name { font-size: 12px; } #shop .cz-item-desc { font-size: 10.5px; }
#shop .cz-item.afford { border-color: #8fe8b8; background: rgba(120, 220, 190, .22); }
#shop .cz-item.maxed { display: none; }

#compass { position: absolute; right: 12px; bottom: 12px; padding: 7px 12px; display: flex; align-items: center; gap: 10px; }
#compass-arrow { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 200, 110, .18); border: 2px solid rgba(255, 200, 110, .6); position: relative; transition: transform .1s linear; }
#compass-arrow::after { content: ''; position: absolute; left: 50%; top: 3px; margin-left: -7px; border: 7px solid transparent; border-bottom: 18px solid #ffc84a; border-top: 0; }
#compass.near #compass-arrow { background: rgba(120, 232, 160, .35); border-color: #8fe8b8; }
#compass.near #compass-arrow::after { border-bottom-color: #8fe8b8; }
#compass-text { display: flex; flex-direction: column; font-size: 12px; line-height: 1.25; }
#compass-text b { color: var(--cz-accent); }
#journal-mini { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; cursor: pointer; }
.jm-title { font-weight: 800; font-size: 12px; color: var(--cz-accent); }
#jm-text { font-size: 12px; }
#prompt { position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%); font-weight: 800; font-size: 16px; background: rgba(14, 40, 58, .88); padding: 6px 16px; border-radius: 18px; border: 2px solid rgba(255, 184, 106, .55); max-width: 70vw; text-align: center; color: #fff4dc; }
#prompt:empty { display: none; }
#hint { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); font-weight: 800; font-size: 16px; color: #fff; text-shadow: 0 2px 5px rgba(0, 0, 0, .8); text-align: center; transition: opacity .2s; white-space: nowrap; }
#keys-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 11.5px; opacity: .72; text-shadow: 0 1px 3px #000; white-space: nowrap; }

#popups { position: fixed; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; }
.popup { position: absolute; left: 0; top: 0; font-weight: 800; font-size: 20px; color: #fff7d8; text-shadow: 0 2px 0 #1a4a5a, 0 0 6px rgba(0, 0, 0, .6); white-space: nowrap; display: none; will-change: transform; }
.popup.coin { color: #ffe27a; font-size: 26px; text-shadow: 0 2px 0 #7a4a08, 0 0 8px rgba(0, 0, 0, .6); }
.popup.fibre { color: #d8ffa0; font-size: 18px; }
.popup.find { color: #ffe8a0; font-size: 22px; }
.popup.water { color: #bfeaff; font-size: 18px; }
.popup.bad { color: #ff8a7a; }
#pullring { position: fixed; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none; z-index: 11; display: none; }
#pullring circle { fill: none; stroke-width: 4; }
#pullring .bg { stroke: rgba(0, 0, 0, .35); }
#pullring .fg { stroke: #ffe27a; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 22px 22px; filter: drop-shadow(0 0 3px rgba(255, 220, 120, .9)); }
#fade { position: fixed; inset: 0; background: radial-gradient(circle at center, #fff2d0, #ffb070 60%, #3a2a6a); opacity: 0; pointer-events: none; z-index: 45; transition: opacity .45s ease; }
#fade.on { opacity: 1; }

#hub, #journal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, 94vw); max-height: 88vh; overflow-y: auto; z-index: 30; padding: 12px 16px; pointer-events: auto; border: 3px solid #d8a070; background: rgba(12, 34, 52, .94); }
.panel-head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
.panel-sub { font-size: 12px; opacity: .85; margin: 4px 0 10px; }
#hub-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hcard { display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(255, 255, 255, .08); border: 2px solid transparent; border-radius: 12px; padding: 8px 6px; cursor: pointer; font: inherit; color: inherit; }
.hcard:hover:not(.locked) { background: rgba(255, 255, 255, .16); border-color: var(--cz-accent); }
.hcard.here { border-color: #8fe8b8; }
.hcard.done { background: rgba(255, 154, 192, .16); }
.hcard canvas { width: 96px; height: 96px; }
.hcard .nm { font-weight: 800; font-size: 13px; }
.hcard .st { font-size: 11px; opacity: .9; text-align: center; min-height: 28px; }
.hcard .fare { font-weight: 800; color: var(--cz-accent); font-size: 12px; }
.hcard.locked { opacity: .75; }
.journal-sec { font-weight: 800; margin: 10px 0 6px; color: var(--cz-accent); }
#finds-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.find { display: flex; flex-direction: column; gap: 2px; background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 6px 10px; border: 2px solid transparent; font-size: 12px; }
.find.got { border-color: #ffb86a; background: rgba(255, 184, 106, .14); }
.find .fn { font-weight: 800; font-size: 13px; }
.find .ft { opacity: .85; font-size: 11px; line-height: 1.3; }
.find.got .fn::before { content: '\2605  '; color: #ffd25a; }
#flower-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.fslotc { display: flex; flex-direction: column; align-items: center; background: rgba(255, 255, 255, .07); border-radius: 8px; padding: 3px 0 2px; font-size: 9px; text-align: center; line-height: 1.1; min-height: 52px; }
.fslotc canvas { width: 32px; height: 32px; }
.fslotc.locked canvas { opacity: .25; filter: grayscale(1) brightness(.6); }
.fslotc.rare { border: 1px solid rgba(255, 224, 138, .7); }
.fslotc.new { animation: pulse .5s ease-in-out 3 alternate; }

.cz-overlay .sub { font-size: 18px; opacity: .95; color: #ffd9a8; }
.cz-overlay { z-index: 60; overflow-y: auto; justify-content: safe center; background: radial-gradient(ellipse at center, rgba(10, 40, 56, .45), rgba(6, 18, 36, .93)); }
.cz-overlay h1 { color: #fff1d8; }
.cz-overlay .cz-keys { background: rgba(0, 0, 0, .28); padding: 10px 16px; border-radius: 12px; }
#continue-note { font-size: 12px; opacity: .85; min-height: 16px; }
#finale-stats { background: rgba(0, 0, 0, .3); padding: 10px 20px; border-radius: 12px; font-size: 15px; line-height: 1.6; text-align: left; columns: 2; column-gap: 28px; }
#finale-stats b { color: var(--cz-accent); }
.finale-btns { display: flex; gap: 12px; }
#finale { justify-content: flex-end; padding-bottom: 5vh; background: linear-gradient(to bottom, rgba(10, 30, 50, .05) 0%, rgba(10, 30, 50, .55) 45%, rgba(10, 30, 50, .9) 100%); }
#finale h1 { font-size: clamp(30px, 5vw, 54px); color: #ffe6a0; }
#cz-toasts { width: min(92vw, 760px); top: 17%; } .cz-toast { text-align: center; width: max-content; max-width: 100%; box-sizing: border-box; font-size: 15px; }
@media (max-height: 640px) { .cz-overlay { gap: 8px; padding: 10px; } .cz-overlay h1 { font-size: 34px; } .cz-overlay p { font-size: 13px; line-height: 1.35; } .cz-overlay .cz-keys { font-size: 12px; gap: 2px 10px; padding: 6px 12px; } .cz-overlay .sub { font-size: 14px; } .cz-btn.primary { padding: 7px 22px; } #finale-stats { font-size: 13px; line-height: 1.4; } #keys-hint { display: none; } }
@media (max-width: 1000px) { #hud-left { width: 240px; } #hud-right { width: 232px; } #shop-panel { width: 220px; } #coin-row { font-size: 24px; } #keys-hint { display: none; } #bloom-panel { width: min(330px, 34vw); } }

/* ---------- Co-op Lobby & HUD ---------- */
.coop-lobby { background: rgba(10, 26, 40, .65); border: 1px solid rgba(143, 232, 184, .35); border-radius: 14px; padding: 12px 16px; width: min(92vw, 480px); display: flex; flex-direction: column; gap: 8px; }
.coop-lobby-title { font-size: 13px; font-weight: 700; color: #8fe8b8; letter-spacing: .3px; }
.coop-lobby-row { display: flex; gap: 8px; }
.coop-lobby-row input { flex: 1; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; color: #fff; padding: 7px 10px; font-size: 13px; }
.coop-chk { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; cursor: pointer; text-align: left; }
.coop-err { background: rgba(210, 56, 56, .25); border: 1px solid rgba(255, 110, 110, .6); color: #ffd4d4; padding: 6px 10px; border-radius: 8px; font-size: 12px; }

#coop-banner { position: fixed; top: 86px; left: 50%; transform: translateX(-50%); background: rgba(180, 95, 20, .92); color: #fff8e8; padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; z-index: 45; pointer-events: none; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
#coop-panel { position: fixed; left: 12px; top: 158px; width: 262px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; z-index: 30; font-size: 12px; pointer-events: auto; }
.coop-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.coop-pill { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.coop-pill.connected { background: rgba(82, 196, 110, .25); color: #9cf0b4; border: 1px solid rgba(82, 196, 110, .6); }
.coop-pill.reconnecting, .coop-pill.connecting { background: rgba(240, 178, 56, .25); color: #ffe09a; border: 1px solid rgba(240, 178, 56, .6); }
.coop-pill.offline { background: rgba(220, 76, 76, .25); color: #ffb4b4; border: 1px solid rgba(220, 76, 76, .6); }
#coop-code-val { font-size: 11px; opacity: .85; font-weight: 600; }
.coop-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.cz-btn.tiny { padding: 3px 7px; font-size: 11px; border-radius: 7px; }
#coop-players { display: flex; flex-direction: column; gap: 4px; max-height: 140px; overflow-y: auto; }
.cp-row { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .06); border-radius: 8px; padding: 4px 6px; }
.cp-row.off { opacity: .55; }
.cp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.cp-info b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-info span { font-size: 10px; opacity: .8; }
.cp-role { background: rgba(0, 0, 0, .4); color: #fff; border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; font-size: 10px; padding: 2px 4px; }
#coop-chat-log { max-height: 68px; overflow-y: auto; font-size: 11px; line-height: 1.3; display: flex; flex-direction: column; gap: 2px; }
.chat-row { word-break: break-word; }
#coop-chat-in { background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .18); border-radius: 7px; color: #fff; padding: 4px 7px; font-size: 11px; }
#stamina-bar i { background: linear-gradient(90deg, #3ac8a0, #7af0c8); }
#stamina-bar.low i { background: linear-gradient(90deg, #e06040, #f4a460); }
#coop-panel { top: 184px; }

