/* Chime Garden: night garden, glass tubes, brass caps. */
.cg-root{position:relative;min-height:520px;color:#e8f0e6;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.cg-hud{display:flex;justify-content:space-between;align-items:baseline;gap:.5rem;padding:.25rem .15rem;font-size:.85rem;color:#b9cdc4}
.cg-hud b{color:#efd77c;font-size:1rem}
#cg-status{min-height:2.6em;font-size:.88rem;line-height:1.3;color:#cfe0d6;padding:.15rem .15rem .4rem}
#cg-status[data-tone="good"]{color:#a8e08a}#cg-status[data-tone="bad"]{color:#ee8f88}#cg-status[data-tone="warn"]{color:#f2ab6c}
.cg-field{text-align:center;padding:2px 0}
#cg-canvas{display:block;margin:0 auto;touch-action:none;border-radius:14px;outline:none;max-width:100%}
.cg-tray{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:.6rem 0 .4rem;min-height:52px}
.cg-piece{display:flex;align-items:center;gap:6px;min-width:64px;min-height:48px;padding:6px 10px;border-radius:12px;border:2px solid #34504a;background:#13211f;color:#e8f0e6;font:600 .85rem system-ui,sans-serif;cursor:pointer}
.cg-piece.sel{border-color:#efd77c;background:#21302a;box-shadow:0 0 0 2px rgba(239,215,124,.25)}
.cg-piece.empty{opacity:.4}
.cg-bar{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:.4rem}
.cg-btn{min-height:46px;padding:8px 10px;border-radius:12px;border:2px solid #34504a;background:#13211f;color:#e8f0e6;font:600 .85rem system-ui,sans-serif;cursor:pointer;touch-action:manipulation}
.cg-btn.primary{background:#c9a45a;border-color:#c9a45a;color:#17120a}
.cg-btn:focus-visible,.cg-piece:focus-visible,.cg-lv:focus-visible{outline:3px solid #fff;outline-offset:2px}
.cg-btn[hidden]{display:none}
.cg-compose{display:flex;gap:6px;margin-top:.5rem}
.cg-compose[hidden]{display:none}
.cg-compose input{flex:1;min-width:0;min-height:46px;border-radius:12px;border:2px solid #34504a;background:#0c1716;color:#e8f0e6;padding:0 10px;font:.85rem ui-monospace,monospace;-webkit-user-select:text;user-select:text}
.cg-overlay{position:absolute;inset:0;z-index:5;display:flex;align-items:flex-start;justify-content:center;padding:8px 0;background:rgba(7,14,15,.9);border-radius:14px;overflow-y:auto;animation:cgIn .25s ease-out}
.cg-overlay[hidden]{display:none}
.cg-card{width:100%;display:flex;flex-direction:column;gap:10px;padding:18px 14px;text-align:center}
.cg-big{font-size:1.9rem;line-height:1.1;color:#efd77c;margin:6px 0 0}
.cg-sub{color:#c6d8cd;font-size:.95rem;line-height:1.4;margin:0 0 6px}
.cg-meta{color:#8fa79d;font-size:.8rem;margin:6px 0 0}
.cg-stars{display:inline-flex;gap:6px;justify-content:center}
.cg-stars i{width:14px;height:14px;border-radius:50%;background:#2a3b37;display:inline-block}
.cg-stars i.on{background:#efd77c;box-shadow:0 0 8px rgba(239,215,124,.6)}
.cg-card>.cg-stars i{width:26px;height:26px}
.cg-levels{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.cg-lv{min-height:56px;border-radius:10px;border:2px solid #34504a;background:#13211f;color:#e8f0e6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;font:600 .95rem system-ui,sans-serif}
.cg-lv .cg-stars{gap:3px}.cg-lv .cg-stars i{width:7px;height:7px}
.cg-lv.locked{opacity:.35;cursor:default}
@keyframes cgIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.cg-overlay{animation:none}}
.cg-btn:disabled{opacity:.4;cursor:default}
.cg-btn:active:not(:disabled),.cg-piece:active{transform:scale(.97)}
.cg-root{padding-bottom:env(safe-area-inset-bottom,0)}
#cg-canvas{box-shadow:0 6px 24px rgba(0,0,0,.45),inset 0 0 0 1px rgba(201,164,90,.25)}
.cg-piece.sel{transform:translateY(-2px)}
.cg-chap{display:flex;justify-content:space-between;align-items:baseline;color:#b9cdc4;font-size:.85rem;margin-top:6px;padding:0 2px}
.cg-chap b{color:#efd77c;font-size:.95rem}
.cg-rank{display:flex;justify-content:space-between;gap:8px;align-items:baseline;padding:8px 12px;border-radius:12px;background:#13211f;border:1px solid #34504a;font-size:.85rem;color:#b9cdc4}
.cg-rank-name{color:#efd77c;font-weight:700}
.cg-rankup{color:#a8e08a;font-weight:700;margin:0 0 6px}
#cg-overlay[hidden],#cg-compose[hidden],#cg-listen[hidden],#cg-hint[hidden]{display:none}
@media (prefers-reduced-motion:reduce){.cg-btn:active,.cg-piece:active,.cg-piece.sel{transform:none}}
/* Full screen: the stage is a flex column; the board takes what is left, controls stay on screen. */
html.pip-immersive .game-wrap,.game-wrap:fullscreen,.game-wrap:-webkit-full-screen{display:flex;flex-direction:column;overflow:hidden;background:#0c1516}
html.pip-immersive .game-wrap>.game-title,html.pip-immersive .game-wrap>.pip-actions,.game-wrap:fullscreen>.game-title,.game-wrap:fullscreen>.pip-actions{display:none}
html.pip-immersive .cg-root,.game-wrap:fullscreen .cg-root{flex:1 1 0;min-height:0;display:flex;flex-direction:column;padding:0 8px calc(env(safe-area-inset-bottom,0px) + 4px)}
html.pip-immersive .cg-hud,.game-wrap:fullscreen .cg-hud{flex:none}
html.pip-immersive #cg-status,.game-wrap:fullscreen #cg-status{flex:none;min-height:1.3em;padding-bottom:.2rem}
html.pip-immersive .cg-field,.game-wrap:fullscreen .cg-field{flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
html.pip-immersive .cg-tray,.game-wrap:fullscreen .cg-tray{flex:none;margin:.3rem 0}
html.pip-immersive .cg-bar,.game-wrap:fullscreen .cg-bar{flex:none;margin-top:.2rem}
html.pip-immersive .cg-btn,.game-wrap:fullscreen .cg-btn{min-height:44px}
html.pip-immersive .cg-overlay,.game-wrap:fullscreen .cg-overlay{inset:0 8px}
@media (orientation:landscape) and (max-height:520px){
  html.pip-immersive .cg-root,.game-wrap:fullscreen .cg-root{display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,320px);grid-template-rows:auto auto 1fr auto auto;column-gap:10px}
  html.pip-immersive .cg-field,.game-wrap:fullscreen .cg-field{grid-column:1;grid-row:1/-1}
  html.pip-immersive .cg-hud,html.pip-immersive #cg-status,html.pip-immersive .cg-tray,html.pip-immersive .cg-bar,html.pip-immersive .cg-compose,
  .game-wrap:fullscreen .cg-hud,.game-wrap:fullscreen #cg-status,.game-wrap:fullscreen .cg-tray,.game-wrap:fullscreen .cg-bar,.game-wrap:fullscreen .cg-compose{grid-column:2}
  html.pip-immersive .cg-bar,.game-wrap:fullscreen .cg-bar{grid-template-columns:repeat(2,1fr)}
}
