/* Presentation only: keep the existing stage/score/input owners and world ratio. */
.angry-page .angry-hud {
  position:relative;
  inset:auto;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:0 0 10px;
  pointer-events:none;
}
.angry-page .angry-hud span {
  min-width:0;
  min-height:52px;
  padding:6px 10px;
  border:0;
  border-bottom:2px solid var(--line);
  background:transparent;
}
.angry-page .angry-hud small { font-size:14px; line-height:1.25; letter-spacing:0; }
.angry-page .angry-hud b { font-size:18px; line-height:1.25; overflow-wrap:anywhere; }
.angry-card:has(.stage-panel:not([hidden])) > .angry-hud { display:none; }

/* Stage selection owns real page height rather than being clipped by the canvas. */
.angry-game-wrap:has(.stage-panel:not([hidden])) { aspect-ratio:auto; }
.angry-game-wrap:has(.stage-panel:not([hidden])) #gameCanvas { display:none; }
.angry-page .stage-panel { position:relative; inset:auto; padding:20px; }
.angry-page .stage-panel-head > button { flex:0 0 46px; height:46px; }
.angry-page .stage-count { font-size:14px; letter-spacing:0; }
.angry-page .world-tabs { margin:18px 0 14px; gap:8px; padding:3px; }
.angry-page .world-tabs button { min-height:44px; }
.angry-page .stage-map { min-height:240px; }
.angry-page .stage-grid {
  grid-template-columns:repeat(5,minmax(56px,1fr));
  grid-template-rows:repeat(2,1fr);
  padding:28px 6%;
  row-gap:24px;
  column-gap:16px;
}
.angry-page .stage-button { width:56px; min-width:56px; height:56px; min-height:56px; padding:3px; }
.angry-page .stage-button strong { font-size:15px; line-height:1.2; }
.angry-page .stage-button span { font-size:12px; line-height:1.1; letter-spacing:0; }
.angry-page .stage-map::before { top:28%; box-shadow:0 100px 0 var(--ink); }
.angry-page .stage-map::after { top:28%; height:100px; }

.angry-page :is(.rank-button,.angry-controls button,.stage-button,.world-tabs button,.result-actions button,.angry-record-form button,.ability-button) {
  transition:box-shadow 100ms ease;
}
.angry-page :is(.rank-button,.angry-controls button,.stage-button,.world-tabs button,.result-actions button,.angry-record-form button,.ability-button):active {
  transform:none;
  box-shadow:inset 0 2px 0 rgba(0,0,0,.2);
}
.angry-page :is(button,input):focus-visible { outline:3px solid var(--ink); outline-offset:3px; }
.angry-page button:disabled { cursor:not-allowed; }
.angry-page .angry-controls { flex-wrap:wrap; }
.angry-page .angry-controls button { flex:1 1 90px; padding-inline:8px; }
.angry-page .teacher-game-ad--fallback :is(.coupang-partners-disclosure,.coupang-partners-frame,iframe) {
  width:100% !important;
  max-width:100%;
}

@media(max-width:720px) {
  .angry-page .stage-panel { padding:14px; }
  .angry-page .stage-map { min-height:148px; overflow-x:auto; overflow-y:hidden; }
  .angry-page .stage-grid {
    position:relative;
    inset:auto;
    grid-template-columns:repeat(10,56px);
    grid-template-rows:1fr;
    width:max-content;
    min-width:100%;
    height:148px;
    padding:0 18px;
    gap:16px;
  }
  .angry-page .stage-map::before { top:50%; left:18px; width:calc(100% - 36px); box-shadow:none; }
  .angry-page .stage-map::after { display:none; }
  .angry-page .angry-hud { gap:6px; }
  .angry-page .angry-hud span { padding-inline:4px; }
}
@media(prefers-reduced-motion:reduce) {
  .angry-page :is(.rank-button,.angry-controls button,.stage-button,.world-tabs button,.result-actions button,.angry-record-form button,.ability-button) { transition:none; }
}
