.action-game{--ag-ink:#425b4e;display:flex;flex-direction:column;gap:10px;min-width:0;color:var(--ag-ink);width:100%}.action-hud{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #dce6d7;background:#f9fbf2;border-radius:16px;padding:11px 15px;font-size:14px;font-weight:650;min-height:46px}.action-hud-main{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.action-hud-time{font-variant-numeric:tabular-nums;background:#fff;border-radius:9px;padding:5px 9px;white-space:nowrap;color:#657655}.action-stage{position:relative;width:100%;height:clamp(280px,53vh,570px);overflow:hidden;border-radius:20px;border:1px solid #d7e2d4;background:#e9efd9;isolation:isolate}.action-canvas{display:block;width:100%;height:100%;touch-action:none;outline:none;cursor:crosshair}.action-canvas:focus-visible{outline:3px solid #bd784d;outline-offset:-4px}.action-pause-screen{position:absolute;inset:0;display:grid;place-content:center;gap:8px;text-align:center;background:#faf9efd9;backdrop-filter:blur(5px);font-size:21px;font-weight:750;pointer-events:none}.action-pause-screen small{font-size:13px;font-weight:450}.action-pause-screen[hidden]{display:none}.action-bottom{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:52px}.action-hint{font-size:12px;line-height:1.65;color:#79816c;margin:0}.action-controls{display:flex;align-items:center;gap:12px;flex-shrink:0}.action-dpad{display:grid;grid-template-columns:34px 34px 34px;grid-template-rows:28px 28px;gap:3px;touch-action:none}.action-dpad button{border:1px solid #cdd9c6;background:#f4f8e9;color:#56714e;border-radius:8px;font:700 17px/1 system-ui;cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none}.action-dpad button[data-dir=up]{grid-column:2}.action-dpad button[data-dir=left]{grid-column:1;grid-row:2}.action-dpad button[data-dir=down]{grid-column:2;grid-row:2}.action-dpad button[data-dir=right]{grid-column:3;grid-row:2}.action-dpad button:active,.action-dpad button.is-held{background:#dcecc9}.action-button{min-width:91px;min-height:46px;padding:9px 17px;border:0;border-radius:14px;background:#d4e4be;color:#3a5735;font-family:inherit;font-size:14px;font-weight:700;line-height:1.4;box-shadow:0 3px 0 #afc597;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none}.action-button:active{transform:translateY(2px);box-shadow:0 1px 0 #afc597}.action-button:disabled{opacity:.5;cursor:wait}.action-mode-label{font-size:11px;letter-spacing:.04em;color:#72806a}.action-touch-tip{display:none}@media(max-width:760px),(max-width:1100px) and (pointer:coarse){.action-game{gap:8px}.action-hud{gap:8px;padding:9px 11px;font-size:12px;min-height:42px}.action-hud-main{gap:7px}.action-hud-time{padding:4px 6px}.action-stage{height:clamp(290px,46vh,460px);border-radius:15px}.action-bottom{align-items:center;gap:8px}.action-hint{font-size:11px;max-width:185px}.action-controls{gap:7px}.action-dpad{grid-template-columns:32px 32px 32px;grid-template-rows:30px 30px}.action-button{min-width:71px;min-height:48px;padding:8px 10px;font-size:12px}.action-touch-tip{display:inline}.action-mode-label{font-size:10px}}@media(prefers-reduced-motion:reduce){.action-button:active{transform:none}}
/* Playland v2: a complete game panel, with readable goals and deliberate feedback. */
.action-game{gap:9px}.action-statusline{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px;line-height:1.5;color:#8b927c;padding:0 3px}.action-difficulty{white-space:nowrap;letter-spacing:.04em}.action-objective{text-align:right;color:#758665}.action-hud{border-radius:15px;border-color:#d9e2cb;background:linear-gradient(115deg,#f7faee,#fffaf0);box-shadow:0 3px 10px #52633d06;padding:11px 15px}.action-hud-main{font-size:13px;line-height:1.65;letter-spacing:.015em}.action-hud-time{background:#edf2e1;color:#6a7f52;padding:6px 11px;min-width:60px;text-align:center;border:1px solid #dce7cb}.action-progress{height:5px;margin:0 4px 2px;border-radius:5px;overflow:hidden;background:#e6ebdc}.action-progress>span{display:block;height:100%;width:0;background:linear-gradient(90deg,#a3bd84,#d8bd74);border-radius:5px;transition:width .18s ease}.action-stage{box-shadow:inset 0 0 0 1px #f8fbe755,0 8px 22px #5361430b;border:1px solid #cedcc1;background:#e5edda}.action-bottom{flex-wrap:wrap}.action-hint{flex:1 1 200px;max-width:650px}.action-controls{margin-left:auto}.action-dpad{grid-template-columns:42px 42px 42px;grid-template-rows:39px 39px;gap:4px}.action-dpad button{background:linear-gradient(#fbfdf4,#eaf2dc);border-color:#d1ddc2;box-shadow:0 2px 0 #d5dfc9;border-radius:10px;min-width:42px;min-height:39px}.action-button{background:linear-gradient(145deg,#d4e4bd,#c3d7a8);border:1px solid #b4c99b;min-width:106px;min-height:48px;box-shadow:0 3px 0 #9fb886,0 5px 10px #64794d14;color:#4f6c3d;font-size:13px;transition:filter .12s,transform .12s}.action-button:hover:not(:disabled){filter:brightness(1.04)}.action-pause-screen{z-index:10}.action-upgrade{position:absolute;inset:0;z-index:8;background:linear-gradient(145deg,#fbf9eff7,#f0f5e7f5);backdrop-filter:blur(9px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:25px;overflow-y:auto;color:#5a6e4c;text-align:center}.action-upgrade[hidden]{display:none}.upgrade-eyebrow{font-size:10px;letter-spacing:.24em;color:#a99568;margin-bottom:8px}.action-upgrade h3{font-family:inherit;font-size:25px;font-weight:800;margin:3px 0 7px;letter-spacing:.015em}.action-upgrade>p{font-size:12px;color:#9b9d89;margin:0 0 23px}.upgrade-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;width:min(690px,100%)}.upgrade-options button{display:flex;flex-direction:column;align-items:center;gap:11px;border:1px solid #dddcc3;border-radius:19px;background:linear-gradient(150deg,#fffefa,#f6f6e8);box-shadow:0 5px 0 #e4e4d1,0 8px 18px #7b78500a;padding:19px 15px;color:#687a51;cursor:pointer;font-family:inherit;transition:transform .16s,border-color .16s}.upgrade-options button:hover,.upgrade-options button:focus-visible{transform:translateY(-4px);border-color:#aabc86;outline:none;box-shadow:0 7px 0 #d9e1c5,0 9px 18px #70815118}.upgrade-symbol{display:grid;place-items:center;width:53px;height:53px;border-radius:50%;background:#eaf0d9;color:#9aae6e;font-size:34px;font-weight:500}.upgrade-options button:nth-child(2) .upgrade-symbol{background:#e2efea;color:#87aaa3}.upgrade-options button:nth-child(3) .upgrade-symbol{background:#f4ead0;color:#b39d64}.upgrade-options b{font-size:16px;letter-spacing:.04em}.upgrade-options small{font-size:11px;line-height:1.8;color:#979b83;min-height:40px}.upgrade-options em{font-size:11px;color:#9eaa83;font-style:normal;border-top:1px solid #e4e6d5;padding-top:10px;width:100%}@media(max-width:760px),(max-width:1100px) and (pointer:coarse){.action-statusline{align-items:flex-start;font-size:10px;gap:8px}.action-objective{max-width:195px;line-height:1.6}.action-hud{padding:9px 10px}.action-hud-main{font-size:11px;line-height:1.7}.action-hud-time{font-size:11px;min-width:48px;padding:5px 6px}.action-hint{flex-basis:100%;font-size:11px;max-width:none;line-height:1.7}.action-controls{width:100%;justify-content:space-between}.action-dpad{grid-template-columns:44px 44px 44px;grid-template-rows:40px 40px;gap:3px}.action-dpad button{min-width:44px;min-height:40px}.action-button{min-width:105px;min-height:49px}.action-stage{height:clamp(300px,47vh,485px)}.action-upgrade{justify-content:flex-start;padding:22px 16px}.action-upgrade h3{font-size:21px}.action-upgrade>p{margin-bottom:15px}.upgrade-options{grid-template-columns:1fr;gap:10px;width:100%}.upgrade-options button{display:grid;grid-template-columns:47px 1fr;grid-template-rows:auto auto;gap:3px 12px;text-align:left;padding:13px 16px;border-radius:15px}.upgrade-symbol{grid-row:1/3;width:43px;height:43px;font-size:29px}.upgrade-options b{font-size:14px}.upgrade-options small{font-size:11px;min-height:0;line-height:1.6}.upgrade-options em{display:none}}@media(prefers-reduced-motion:reduce){.action-progress>span,.action-button,.upgrade-options button{transition:none}.upgrade-options button:hover,.upgrade-options button:focus-visible{transform:none}}
/* Action-game readability: screen-sized labels, one clear goal and a compact status. */
.action-game{font-family:"PingFang TC","Noto Sans TC","Microsoft JhengHei",system-ui,sans-serif;color:#314632}
.action-statusline{font-size:14px;line-height:1.65;color:#526148}
.action-objective{font-size:16px;font-weight:700;color:#2d452e}
.action-hud-main{font-size:16px;line-height:1.7;color:#304731}
.action-hud-time{font-size:17px;font-weight:750;color:#344b2d}
.action-hint{font-size:16px;line-height:1.8;white-space:pre-line;color:#344a35}
.action-button{font-size:16px;color:#294320;min-height:48px}
.action-button:disabled{opacity:1;color:#536047;background:#e5eadc;border-color:#c4d0b6;box-shadow:none}
.action-dpad{grid-template-columns:44px 44px 44px;grid-template-rows:44px 44px}
.action-dpad button{min-width:44px;min-height:44px;font-size:20px;color:#34502d}
.action-mode-label{font-size:14px;color:#526148}
.action-pause-screen small{font-size:14px;color:#4c6046}
.action-announcement{position:absolute;z-index:3;top:12px;left:50%;transform:translateX(-50%);width:min(620px,calc(100% - 28px));display:flex;flex-direction:column;gap:5px;padding:13px 18px;border:1px solid #d3d7bd;border-radius:16px;background:#fffdf4f5;box-shadow:0 4px 16px #40513b12;color:#314b32;text-align:center;pointer-events:none;overflow-wrap:anywhere;box-sizing:border-box}
.action-announcement-title{font-size:18px;line-height:1.55;font-weight:750}
.action-announcement-copy{font-size:14px;line-height:1.7;color:#4b5e41}
.action-announcement-copy:empty{display:none}
.action-announcement[hidden],.action-alert[hidden]{display:none}
.action-alert{position:absolute;z-index:2;bottom:12px;left:12px;right:12px;display:block;padding:10px 12px;border:1px solid #b6a8c0;border-radius:12px;background:#fffaf4f5;color:#563c62;font-size:16px;font-weight:700;line-height:1.6;text-align:center;pointer-events:none;overflow-wrap:anywhere}
.action-legend{display:flex;flex:1 0 100%;align-items:center;flex-wrap:wrap;gap:6px 16px;font-size:14px;line-height:1.7;color:#3d513a}
.action-team-green::before,.action-team-orange::before{content:"";display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;background:#3f6542;box-shadow:0 0 0 2px #d4e3c9}
.action-team-orange::before{background:#965735;box-shadow:0 0 0 2px #edd3bd}
.upgrade-eyebrow{font-size:14px;letter-spacing:.1em;color:#766039}
.action-upgrade>p{font-size:16px;line-height:1.7;color:#485e40}
.upgrade-options button{color:#344e2d;min-height:145px}
.upgrade-options b{font-size:18px;line-height:1.6}
.upgrade-options small{font-size:14px;line-height:1.8;color:#4b5f41}
.upgrade-options em{font-size:14px;color:#4c653a}
@media(max-width:760px),(max-width:1100px) and (pointer:coarse){
  .action-game{gap:10px}
  .action-statusline{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:0 2px;font-size:14px}
  .action-difficulty{white-space:normal;font-size:14px;color:#526148}
  .action-objective{max-width:none;text-align:left;font-size:16px;line-height:1.65;color:#2d452e}
  .action-hud{display:flex;align-items:flex-start;gap:8px;padding:11px 12px;min-height:0}
  .action-hud-main{display:block;flex:1;min-width:0;white-space:pre-line;overflow-wrap:anywhere;font-size:16px;line-height:1.75;letter-spacing:0;color:#304731}
  .action-hud-time{flex:0 0 auto;min-width:58px;box-sizing:border-box;padding:5px 8px;font-size:18px;line-height:1.5;white-space:nowrap;color:#30462a}
  .action-bottom{display:flex;flex-direction:row;align-items:center;gap:12px}
  .action-hint{flex:1 0 100%;max-width:none;font-size:16px;line-height:1.8;color:#344a35}
  .action-controls{width:100%;justify-content:space-between;gap:12px}
  .action-dpad{grid-template-columns:44px 44px 44px;grid-template-rows:44px 44px;gap:4px}
  .action-dpad button{min-width:44px;min-height:44px;font-size:22px}
  .action-button{min-width:108px;min-height:48px;padding:10px 12px;font-size:16px;line-height:1.6}
  .action-announcement{top:10px;left:10px;right:10px;width:auto;transform:none;padding:11px 12px;gap:4px;border-radius:12px;text-align:left}
  .action-announcement-title{font-size:16px;line-height:1.6}
  .action-announcement-copy{font-size:14px;line-height:1.7}
  .action-alert{font-size:16px;line-height:1.6;padding:9px 10px}
  .action-legend{font-size:14px;line-height:1.7;gap:5px 12px}
  .action-upgrade{padding:21px 15px;text-align:left;align-items:stretch}
  .upgrade-eyebrow{font-size:14px;line-height:1.6;letter-spacing:.06em}
  .action-upgrade h3{font-size:22px;line-height:1.5;color:#2f482e}
  .action-upgrade>p{font-size:16px;line-height:1.7;color:#485e40;margin-bottom:16px}
  .upgrade-options{gap:13px}
  .upgrade-options button{grid-template-columns:43px minmax(0,1fr);gap:5px 11px;padding:15px 13px;min-height:116px;align-items:center}
  .upgrade-options b{font-size:16px;line-height:1.6;letter-spacing:0}
  .upgrade-options small{font-size:14px;line-height:1.8;color:#4b5f41}
  .upgrade-symbol{font-size:29px}
}
.action-help{flex:1 1 200px;min-width:0;max-width:650px;color:#344a35}
.action-help>summary{min-height:44px;box-sizing:border-box;padding:9px 0;font-size:16px;font-weight:650;line-height:1.6;color:#344a35;cursor:pointer;list-style-position:inside;touch-action:manipulation}
.action-help[open]>summary{margin-bottom:3px}
.action-stage>.action-controls{position:absolute;z-index:4;left:8px;right:8px;bottom:8px;width:auto;margin:0;display:flex;justify-content:space-between;align-items:flex-end;gap:8px;pointer-events:none}
.action-stage>.action-controls:empty{display:none}
.action-stage>.action-controls .action-dpad,.action-stage>.action-controls>.action-button{pointer-events:auto}
.action-stage>.action-controls .action-dpad{background:#fffdf0c9;border-radius:11px}
.action-stage>.action-controls .action-button{min-width:90px;min-height:48px;padding:8px;font-size:16px}
.action-stage>.action-controls .action-dpad button{background:#f8fbefed;color:#284624;box-shadow:0 2px 0 #b4c49c}
.action-stage:has(>.action-controls:not(:empty)) .action-alert{bottom:110px}
@media(max-width:760px),(max-width:1100px) and (pointer:coarse){
  .action-help{flex:1 0 100%;max-width:none;order:3}
  .action-help>summary{font-size:16px;min-height:44px;border-bottom:1px solid #dce3d0}
  .action-help .action-hint{padding-top:8px}
  .action-legend{order:2;gap:5px 9px;font-size:14px}
  .action-hud-main{display:block;white-space:pre-line}
}
@media(max-width:760px) and (max-height:650px),(max-width:1100px) and (max-height:650px) and (pointer:coarse){
  .action-stage{height:clamp(240px,42svh,290px);min-height:240px}
  .action-difficulty{display:none}
  .action-game{gap:8px}
}
@media(min-width:1101px) and (pointer:fine){.action-help[open]>summary{display:none}}
/* Active play uses the space assigned by the fullscreen dialog, never a page-height game. */
#game-dialog[data-phase="playing"] .action-game{position:relative;display:flex;flex:1 1 0;flex-direction:column;width:100%;height:100%;min-height:0;max-height:100%;overflow:hidden;gap:6px;box-sizing:border-box}
#game-dialog[data-phase="playing"] .action-statusline{flex:0 0 auto;min-height:0;gap:0;padding:0 4px}
#game-dialog[data-phase="playing"] .action-difficulty{display:none}
#game-dialog[data-phase="playing"] .action-objective{max-width:none;text-align:left;font-size:16px;line-height:1.5;overflow-wrap:anywhere}
#game-dialog[data-phase="playing"] .action-hud{flex:0 0 auto;min-height:0;margin:0;padding:7px 10px;align-items:flex-start;gap:8px}
#game-dialog[data-phase="playing"] .action-hud-main{font-size:16px;line-height:1.5;white-space:pre-line;min-width:0;display:block}
#game-dialog[data-phase="playing"] .action-hud-time{font-size:17px;line-height:1.5;padding:4px 7px;min-width:58px}
#game-dialog[data-phase="playing"] .action-progress{flex:0 0 4px;height:4px;margin:0 2px}
#game-dialog[data-phase="playing"] .action-stage{position:relative;flex:1 1 0;width:100%;height:auto!important;min-height:0!important;max-height:none;aspect-ratio:auto;overflow:hidden;box-sizing:border-box;border-radius:15px}
#game-dialog[data-phase="playing"] .action-canvas{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:100%;max-height:100%;touch-action:none}
#game-dialog[data-phase="playing"] .action-bottom{position:absolute;z-index:6;right:8px;bottom:112px;display:block;width:auto;min-height:0;height:auto;padding:0;margin:0}
#game-dialog[data-phase="playing"] .action-help{flex:none;max-width:none;width:74px;border-radius:12px;background:#fffdf0ef;box-shadow:0 2px 10px #30462518}
#game-dialog[data-phase="playing"] .action-help>summary{display:block;min-height:44px;margin:0;padding:10px 6px;font-size:14px;line-height:1.6;text-align:center;list-style:none;border:1px solid #c9d7ba;border-radius:12px;color:#34502c}
#game-dialog[data-phase="playing"] .action-help>summary::-webkit-details-marker{display:none}
#game-dialog[data-phase="playing"] .action-help[open]{width:min(330px,calc(100vw - 40px));max-height:calc(100dvh - 180px);overflow-y:auto;overscroll-behavior:contain;padding:10px;box-sizing:border-box}
#game-dialog[data-phase="playing"] .action-help[open]>summary{display:block;position:sticky;top:0;background:#fffdf0;font-size:16px}
#game-dialog[data-phase="playing"] .action-help .action-hint{font-size:16px;line-height:1.7;padding:8px 2px;margin:0}
#game-dialog[data-phase="playing"] .action-legend{display:none}
#game-dialog[data-phase="playing"] .action-stage>.action-controls{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-width:100%;align-items:flex-end;pointer-events:none}
#game-dialog[data-phase="playing"] .action-stage>.action-controls button{touch-action:none;min-height:44px}
#game-dialog[data-phase="playing"] .action-announcement{top:8px;max-height:38%;overflow:hidden;pointer-events:none;padding:9px 11px}
#game-dialog[data-phase="playing"] .action-announcement-title{font-size:16px;line-height:1.5}
#game-dialog[data-phase="playing"] .action-announcement-copy{font-size:14px;line-height:1.55}
#game-dialog[data-phase="playing"] .action-upgrade{justify-content:flex-start;padding:15px;min-height:0;overscroll-behavior:contain}
#game-dialog[data-phase="playing"] .action-upgrade h3{font-size:20px;line-height:1.4;margin:0 0 5px}
#game-dialog[data-phase="playing"] .action-upgrade>p{font-size:14px;line-height:1.5;margin:0 0 10px}
#game-dialog[data-phase="playing"] .upgrade-eyebrow{display:none}
#game-dialog[data-phase="playing"] .upgrade-options{gap:10px}
#game-dialog[data-phase="playing"] .upgrade-options button{min-height:96px;padding:12px;gap:4px 10px}
.action-run-context{font-size:14px;line-height:1.5;color:#3d5633;background:#fffdf0ee;padding:7px 10px;border-radius:10px;border:1px solid #d1dabc;pointer-events:none}
.action-stage>.action-run-context{position:absolute;z-index:2;left:10px;right:10px;top:8px;max-width:calc(100% - 20px);box-sizing:border-box}
.action-stage:has(.action-announcement:not([hidden]))>.action-run-context{opacity:0}
.action-secondary{font:650 14px/1.4 inherit;min-width:76px;min-height:44px;padding:8px;border:1px solid #bccca6;border-radius:12px;background:#fffdf0ed;color:#34502c;pointer-events:auto;cursor:pointer}
@media(max-height:440px){#game-dialog[data-phase="playing"] .action-hud-main{white-space:normal;font-size:16px}#game-dialog[data-phase="playing"] .action-objective{font-size:14px;line-height:1.4}#game-dialog[data-phase="playing"] .action-statusline{padding:0 4px}#game-dialog[data-phase="playing"] .action-announcement-copy{display:none}#game-dialog[data-phase="playing"] .action-hud{padding:4px 8px}#game-dialog[data-phase="playing"] .action-bottom{bottom:60px}}
/* Keep both arena actions within a 320px playfield. */
.action-stage>.action-controls .action-secondary{position:absolute;right:0;bottom:58px;width:110px;min-width:0;min-height:44px;box-sizing:border-box;font-family:inherit;font-size:14px;line-height:1.4}
.action-stage>.action-controls:not(:has(.action-dpad)){justify-content:flex-end}
.action-game:has(.action-upgrade:not([hidden]))>.action-statusline,.action-game:has(.action-upgrade:not([hidden]))>.action-hud,.action-game:has(.action-upgrade:not([hidden]))>.action-progress{display:none!important}
.action-game:has(.action-upgrade:not([hidden])) .action-controls,.action-game:has(.action-upgrade:not([hidden])) .action-bottom{visibility:hidden}
@media(max-height:440px){#game-dialog[data-phase="playing"] .action-dpad{display:flex;gap:4px}#game-dialog[data-phase="playing"] .upgrade-options{grid-template-columns:repeat(3,minmax(0,1fr))}#game-dialog[data-phase="playing"] .upgrade-options button{display:flex;flex-direction:column;align-items:flex-start;min-height:0;padding:10px;gap:4px}#game-dialog[data-phase="playing"] .upgrade-options .upgrade-symbol{display:none}#game-dialog[data-phase="playing"] .upgrade-options b{font-size:16px}#game-dialog[data-phase="playing"] .upgrade-options small{font-size:14px;line-height:1.5}#game-dialog[data-phase="playing"] .action-upgrade{padding:10px}#game-dialog[data-phase="playing"] .action-upgrade>p{display:none}}
/* Help stays above the two right-hand arena actions; wide short screens use the middle gap. */
#game-dialog[data-phase="playing"] .action-game[data-mode="arena"] .action-bottom{bottom:122px}
@media(min-width:500px) and (max-height:440px){#game-dialog[data-phase="playing"] .action-game[data-mode="arena"] .action-bottom{right:calc(50% - 37px);bottom:8px}}
