body[data-playing=true] main:has(.ene-game) { min-height: 0; padding: max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom)); }
.ene-game { width: min(480px,100%); margin-inline: auto; color: var(--text); }
.ene-heading { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 12px; }
.ene-heading h1 { margin: 0; line-height: 1; }
.ene-heading h1 img { display: block; width: 146px; height: 62px; object-fit: contain; }
.ene-heading > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.ene-text-button { justify-self: end; border: 0; background: transparent; color: var(--text); min-height: 44px; padding: 4px; font: inherit; font-size: 14px; cursor: pointer; }
.ene-stage { position: relative; isolation: isolate; aspect-ratio: 480/680; width: min(100%,calc((100svh - 150px)*.705882)); margin-inline: auto; border-radius: 14px; overflow: hidden; background: #317c80; touch-action: pan-y; }
#ene-canvas { position: absolute; inset: 0; touch-action: none; }
#ene-canvas canvas { display: block; touch-action: none; outline-offset: -4px; }
.ene-game :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ene-stage:focus-visible, #ene-canvas canvas:focus-visible { outline-offset: -4px; }
.ene-hud { position: absolute; z-index: 3; inset: 14px 12px auto; display: flex; align-items: start; justify-content: space-between; gap: 8px; pointer-events: none; }
.ene-hud[hidden], .ene-overlay[hidden], .ene-game [hidden] { display: none; }
.ene-hud > span { display: block; color: #153a37; background: #f8faf3; padding: 7px 10px; border-radius: 9px; font-size: 14px; line-height: 1.4; }
.ene-hud-best b { font-variant-numeric: tabular-nums; }
#ene-score { display: grid; place-items: center; min-width: 64px; min-height: 62px; padding: 2px 10px; border-radius: 12px; background: #f8faf3; color: #153a37; font-size: 40px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.ene-overlay { position: absolute; inset: 0; z-index: 5; display: grid; align-items: center; background: var(--bg); padding: clamp(12px,3vw,24px); overscroll-behavior: contain; touch-action: pan-y; }
.ene-panel { width: 100%; max-width: 360px; max-height: 100%; margin-inline: auto; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--accent) var(--surface); text-align: center; }
.ene-panel h2 { margin: 0; color: var(--text); font-size: clamp(23px,5.5vw,28px); font-weight: 600; line-height: 1.2; text-wrap: balance; }
.ene-hint { margin: 8px auto 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.ene-characters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.ene-character { display: grid; grid-template-rows: auto auto auto; justify-items: center; align-content: center; gap: 3px; min-width: 0; min-height: 112px; padding: 9px 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; touch-action: manipulation; }
.ene-character[aria-checked=true] { border-color: var(--accent); background: var(--accent-soft); }
.ene-character img { width: 88px; height: clamp(48px,10svh,78px); object-fit: contain; object-position: center bottom; user-select: none; -webkit-user-drag: none; }
.ene-character strong { font-size: 18px; font-weight: 600; line-height: 1.25; }
.ene-character small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ene-primary, .ene-secondary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; border: 0; border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 600; line-height: 1.25; cursor: pointer; touch-action: manipulation; }
.ene-primary { background: var(--accent); color: var(--button-text); }
.ene-primary:hover { color: var(--button-text); }
.ene-secondary { background: transparent; color: var(--text); margin-top: 6px; font-size: 14px; font-weight: 400; text-decoration: underline; text-underline-offset: 4px; }
.ene-controls { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; width: 100%; margin: 10px 0 0; }
.ene-controls button { min-height: 44px; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 8px 3px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; line-height: 1.2; cursor: pointer; touch-action: manipulation; }
.ene-controls button:disabled { opacity: .45; cursor: default; }
.ene-controls button:not(:disabled):active, .ene-primary:active { transform: translateY(1px); }
.ene-status { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 8px 0 0; text-align: center; }
.ene-status:empty { display: none; }
.ene-result { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 14px; }
.ene-result > span { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.ene-result b { color: var(--text); font-size: 44px; line-height: 1.15; font-weight: 600; font-variant-numeric: tabular-nums; }
.ene-reaction-slot { min-height: 60px; margin: 0 0 16px; }
.ene-reaction-video { display: block; width: 100%; max-height: 130px; object-fit: contain; margin-inline: auto; background: #0c1412; border-radius: 9px; }
.ene-pause-panel .ene-primary { margin-top: 24px; }
.ene-error .ene-primary { margin-top: 20px; }
.ene-loading > img { display: block; width: 190px; height: 92px; object-fit: contain; margin: 0 auto 20px; }
.ene-loading h2 { font-size: 22px; }
.ene-loading progress { appearance: none; display: block; width: min(220px,100%); height: 5px; margin: 20px auto; overflow: hidden; border: 0; border-radius: 4px; background: var(--line); accent-color: var(--accent); }
.ene-loading progress::-webkit-progress-bar { background: var(--line); }
.ene-loading progress::-webkit-progress-value { background: var(--accent); }
.ene-game:fullscreen { display: grid; grid-template-rows: auto minmax(0,1fr) auto; width: 100%; height: 100dvh; padding: 12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); background: var(--bg); }
.ene-game:fullscreen .ene-stage { width: 100%; height: 100%; aspect-ratio: auto; }
.ene-game:fullscreen .ene-controls { max-width: 480px; justify-self: center; }
.ene-game:fullscreen .ene-status { position: absolute; bottom: 0; }
@media (hover:hover) { .ene-character:hover { border-color: var(--accent); } .ene-controls button:not(:disabled):hover { background: var(--accent-soft); } }
@media (max-width:360px) { .ene-controls button { font-size: 13px; } .ene-heading h1 img { width: 130px; height: 54px; } .ene-characters { margin: 12px 0; gap: 8px; } }
@media (orientation:landscape) and (max-height:540px) {
  .ene-game { width: min(840px,100%); }
  .ene-heading { margin-bottom: 6px; }
  .ene-heading h1 img { width: 110px; height: 42px; }
  .ene-stage { width: 100%; height: calc(100svh - 126px); aspect-ratio: auto; }
  .ene-panel { max-width: 660px; }
  .ene-overlay { padding: 12px; }
  .ene-panel h2 { font-size: 23px; }
  .ene-characters { grid-template-columns: repeat(4,minmax(0,1fr)); margin: 10px 0; }
  .ene-character { min-height: 94px; padding: 6px; }
  .ene-character img { height: 48px; width: 64px; }
  .ene-character strong { font-size: 16px; }
  .ene-hint { margin-top: 4px; font-size: 14px; }
  .ene-primary { min-height: 44px; }
  .ene-result { margin: 8px 0; }
  .ene-result b { font-size: 30px; }
  .ene-result-panel { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4px 20px; }
  .ene-result-panel h2, .ene-result-panel > .ene-hint { grid-column: 1; }
  .ene-result-panel .ene-result { grid-column: 1; grid-row: 3/5; }
  .ene-result-panel .ene-reaction-slot { grid-column: 2; grid-row: 1/3; margin: 0; }
  .ene-result-panel .ene-primary { grid-column: 2; grid-row: 3; }
  .ene-result-panel .ene-secondary { grid-column: 2; grid-row: 4; margin: 0; min-height: 36px; }
  .ene-game:fullscreen .ene-stage { height: 100%; }
}
