.jelly-game { max-width:560px; margin:20px auto 0; color:var(--ink); }
.jelly-game [hidden] { display:none !important; }
.jelly-level-title { margin:0 0 8px; font-size:20px; line-height:1.5; text-align:left; }
.jelly-help { margin:0 0 20px; color:var(--control-ink); font-size:14px; line-height:1.6; text-align:left; }
.jelly-island { width:min(100%,360px); margin:auto; padding:8px; border-radius:18px; background:var(--accent-soft); }
.jelly-board { display:grid; grid-template-columns:repeat(var(--jelly-columns),minmax(44px,1fr)); grid-template-rows:repeat(var(--jelly-rows),minmax(44px,1fr)); aspect-ratio:var(--jelly-columns) / var(--jelly-rows); touch-action:none; user-select:none; border-radius:10px; background:var(--surface); cursor:grab; }
.jelly-board:focus-visible { outline:3px solid var(--purple); outline-offset:4px; }
.jelly-cell { position:relative; display:grid; place-items:center; min-width:44px; min-height:44px; border:1px solid var(--line); }
.jelly-cell.is-rock { background:var(--surface-soft); }
.jelly-cell.is-rock::before { position:absolute; inset:7px; border-radius:10px 7px 12px 8px; background:var(--control-ink); opacity:.78; content:""; }
.jelly-cell.is-rock::after { position:absolute; top:25%; left:25%; width:23%; height:7%; border-radius:4px; background:var(--surface); transform:rotate(-24deg); content:""; }
.jelly-home, .jelly-friend { --jelly-color:#f1acbb; }
:is(.jelly-home,.jelly-friend)[data-jelly="2"] { --jelly-color:#f1cc75; }
:is(.jelly-home,.jelly-friend)[data-jelly="3"] { --jelly-color:#a2cedd; }
.jelly-home { position:absolute; inset:5%; display:grid; place-items:center; border:3px dashed var(--control-ink); border-radius:50%; background:color-mix(in srgb,var(--jelly-color) 35%,var(--surface)); color:var(--ink); font-size:0; font-weight:750; }
.jelly-home::after { position:absolute; right:-4px; bottom:-4px; min-width:20px; height:20px; padding:0 2px; border:1px solid var(--control-ink); border-radius:5px; background:var(--surface); color:var(--ink); font-size:14px; line-height:20px; content:attr(data-jelly); z-index:3; }
.jelly-friend { position:relative; display:block; width:74%; height:80%; min-height:34px; border:2px solid color-mix(in srgb,var(--jelly-color) 70%,#30253d); border-radius:44% 44% 27% 27%; background:var(--jelly-color); color:#30253d; pointer-events:none; z-index:1; }
.jelly-number { position:absolute; top:0; left:0; right:0; font-size:clamp(12px,2vw,17px); line-height:1.2; font-weight:850; }
.jelly-eyes { position:absolute; display:flex; justify-content:center; gap:7px; left:0; right:0; top:37%; }
.jelly-eyes i { display:block; width:8px; height:11px; border-radius:50%; background:#30253d; border:2px solid #fff; }
.jelly-mouth { position:absolute; width:11px; height:5px; top:69%; left:50%; transform:translateX(-50%); border:2px solid #30253d; border-top:0; border-radius:0 0 9px 9px; }
.is-home-done .jelly-home { border-style:solid; }
.is-home-done .jelly-friend { border-radius:35% 35% 27% 27%; }
.jelly-board[data-completed="true"] .jelly-friend { transform:translateY(-3px); }
.jelly-count { margin:16px 0 8px; font-size:14px; font-variant-numeric:tabular-nums; color:var(--control-ink); }
.jelly-status { min-height:24px; margin:8px 0 14px; font-size:15px; font-weight:600; line-height:1.6; color:var(--control-ink); }
.jelly-directions { display:grid; grid-template-columns:repeat(3,48px); grid-template-rows:repeat(2,48px); justify-content:center; gap:6px; margin:0 auto 18px; }
.jelly-directions .game-button { min-width:48px; min-height:48px; padding:0; font-size:27px; line-height:1; }
.jelly-directions svg { width:24px; height:24px; }
#jelly-up { grid-column:2; grid-row:1; }
#jelly-left { grid-column:1; grid-row:2; }
#jelly-down { grid-column:2; grid-row:2; }
#jelly-right { grid-column:3; grid-row:2; }
.jelly-controls { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.jelly-controls .game-button { min-width:44px; }
@media (max-width:480px) {
  .jelly-level-title { font-size:18px; }
  .jelly-help { font-size:13px; }
  .jelly-home { border-width:2px; }
  .jelly-eyes { gap:4px; }
  .jelly-eyes i { width:7px; height:9px; }
  .jelly-controls .game-button { padding:10px 12px; }
}
