:root {
  color-scheme: dark;
  --background: #101715;
  --panel: #18221e;
  --surface: #1d2823;
  --border: #304038;
  --text: #f4efe2;
  --muted: #a9b8ac;
  --gold: #f1bc69;
  --gold-light: #ffe1a8;
  --mint: #a3cbb0;
  --heading: Georgia, 'Times New Roman', serif;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 48% -22%, #263a30 0%, transparent 64%), var(--background);
  color: var(--text);
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
p, h1, h2 { margin: 0; }

.site-width { width: min(1320px, calc(100% - 88px)); margin-inline: auto; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.masthead { background: #111a17e6; border-bottom: 1px solid #2a382f; }
.masthead-inner, .header-actions, .brand { display: flex; align-items: center; }
.masthead-inner { min-height: 73px; justify-content: space-between; gap: 16px; }
.brand {
  gap: 12px;
  font-family: var(--heading);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.brand-emblem, .mission-emblem, .overlay-emblem {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #e4b86744;
  border-radius: 12px;
  background: linear-gradient(145deg, #4a3b23, #2a291e);
  color: var(--gold);
}

.brand-emblem .icon, .mission-emblem .icon { width: 21px; height: 21px; }
.header-actions { gap: 9px; }
.quiet-button, .gold-button, .screen-button, .download-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  font-size: .85rem;
  font-weight: 650;
  transition: background-color .16s, border-color .16s, box-shadow .16s, color .16s;
}

.quiet-button {
  padding: 0 13px;
  border: 1px solid var(--border);
  background: #202c26;
  color: #dce6dc;
}
.quiet-button:hover { border-color: #526458; background: #2a3930; }
.quiet-button .icon { width: 17px; height: 17px; }
.square-button { width: 40px; padding: 0; }

.gold-button {
  padding: 0 17px;
  border: 1px solid #ffda90;
  background: linear-gradient(180deg, #ffd689, #eeb764);
  color: #2d210f;
  box-shadow: inset 0 1px #fff2bc8c, 0 5px 18px #12100640;
  font-weight: 750;
}
.gold-button:hover { background: linear-gradient(180deg, #ffe6a8, #f4c575); box-shadow: 0 5px 24px #e4ae4a38; }
.gold-button:active { background: #eab260; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  align-items: start;
  gap: 22px;
  margin-top: 31px;
  margin-bottom: 38px;
}

.game-frame, .panel, .mission {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 9px 30px #080e0b22;
}
.game-frame { overflow: hidden; }
.screen {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #132922;
  user-select: none;
}
.screen canvas, .cover { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen canvas:focus-visible { outline-offset: -3px; }

.cover {
  display: flex;
  align-items: center;
  background: #132922 url('assets/bosque.webp') 54% center / cover no-repeat;
}
.cover::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(90deg, #070f0cec 0%, #07130fbb 26%, #091c1470 48%, transparent 74%),
              linear-gradient(0deg, #070f0ca0, transparent 35%);
  content: '';
}
.cover-avatar {
  position: absolute;
  right: 4%;
  bottom: 4.5%;
  width: 44%;
  height: 74%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(2px 16px 19px #0a120dc7) drop-shadow(0 0 40px #e1b56c23);
  pointer-events: none;
}
.cover-content {
  position: relative;
  z-index: 1;
  width: 65%;
  padding: 12px 0 12px clamp(21px, 5vw, 56px);
}
.current-chapter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #ffd595;
  font-size: clamp(.64rem, 1.18vw, .76rem);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.current-chapter span, .save-note span {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  transform: rotate(45deg);
  background: currentColor;
  box-shadow: 0 0 12px #f1bc698c;
}
.cover h1 {
  margin: 15px 0 17px;
  font-family: var(--heading);
  font-size: clamp(2.9rem, 6.35vw, 5.65rem);
  font-weight: 700;
  letter-spacing: -.064em;
  line-height: .91;
  text-shadow: 0 3px 22px #07120e9e;
}
.cover h1 em { color: var(--gold-light); font-weight: 500; }
.cover-summary {
  max-width: 310px;
  color: #e1e6d9;
  font-size: clamp(.83rem, 1.4vw, 1.02rem);
  line-height: 1.63;
  text-wrap: pretty;
}
.cover .gold-button { min-height: 48px; margin-top: 24px; padding-inline: 15px 20px; font-size: .94rem; }

.game-toolbar {
  display: flex;
  min-height: 55px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 14px;
  padding: 6px 14px 6px 17px;
  border-top: 1px solid #344139;
}
.key-hints { display: flex; align-items: center; gap: clamp(10px, 2vw, 20px); color: var(--muted); font-size: .76rem; }
.key-hints span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
kbd {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  padding: 1px 5px 2px;
  place-items: center;
  border: 1px solid #45564b;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #26342b;
  color: #e1e8dd;
  font: 650 .71rem 'Segoe UI', system-ui, sans-serif;
  line-height: 1;
}
.screen-button {
  min-height: 33px;
  padding: 0 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #b9c6bb;
  font-size: .77rem;
}
.screen-button:hover { border-color: var(--border); background: var(--surface); color: var(--text); }
.screen-button .icon { width: 16px; height: 16px; }

.mission { display: flex; align-items: center; gap: 13px; margin-top: 16px; padding: 15px 18px; }
.mission-emblem { width: 38px; height: 38px; border-radius: 10px; }
.mission h2 { font-size: .88rem; font-weight: 750; }
.mission p { margin-top: 4px; color: var(--muted); font-size: .8rem; line-height: 1.45; }

.side-panel { display: grid; gap: 16px; }
.panel { min-width: 0; padding: 18px; }
.panel h2 { font-family: var(--heading); font-size: 1.42rem; letter-spacing: -.025em; line-height: 1.1; }
.panel-description { margin-top: 5px; color: var(--muted); font-size: .83rem; }
.avatar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.avatar-tile {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #3a4a41;
  border-radius: 11px;
  background: #202c26;
  text-align: left;
  transition: border-color .16s, box-shadow .16s, background-color .16s;
}
.avatar-tile:hover { border-color: #829789; background: #28372f; }
.avatar-tile[aria-pressed='true'] { border-color: #d7ad66; background: #302c21; box-shadow: 0 0 0 1px #d7ad662a; }
.avatar-art {
  position: relative;
  display: block;
  height: 111px;
  overflow: hidden;
  border-bottom: 1px solid #e0e5c51a;
  background: radial-gradient(ellipse at 51% 65%, #537359, #293e34 79%);
}
.brasa-tile .avatar-art { background: radial-gradient(ellipse at 51% 65%, #89643f, #433a29 79%); }
.avatar-art img {
  position: absolute;
  top: 8%;
  left: 10%;
  width: 80%;
  height: 142%;
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(0 3px 5px #08110cb3);
}
.selection-mark {
  position: absolute;
  top: 7px;
  right: 7px;
  display: none;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #2e240e;
}
.avatar-tile[aria-pressed='true'] .selection-mark { display: grid; }
.selection-mark .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.avatar-caption { display: block; padding: 8px 8px 9px; }
.avatar-caption strong { display: block; font-size: .9rem; line-height: 1.15; }
.avatar-caption small { display: block; margin-top: 4px; color: #bdc8bd; font-size: .67rem; line-height: 1.3; }
.download-button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  margin-top: 11px;
  padding: 0 10px;
  border: 1px solid #3b4c40;
  background: #1e2a23;
  color: #d3dfd3;
  font-size: .76rem;
}
.download-button:hover { border-color: #7a967f; background: #293a30; }
.download-button .icon { width: 15px; height: 15px; color: var(--mint); }
.download-button small { margin-left: auto; color: #acbdad; font-size: .65rem; font-weight: 650; letter-spacing: .05em; }

.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.panel-heading > span { color: var(--muted); font-size: .73rem; }
.chapter-list { display: grid; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.chapter-button {
  display: grid;
  width: 100%;
  min-height: 59px;
  grid-template-columns: 44px minmax(0, 1fr) 17px;
  align-items: center;
  gap: 9px;
  padding: 6px 9px 6px 6px;
  border: 1px solid #324239;
  border-radius: 9px;
  background: #1d2a23;
  text-align: left;
  transition: border-color .16s, background-color .16s;
}
.chapter-button:hover:not(:disabled) { border-color: #708775; background: #27382d; }
.chapter-button[aria-current='step'] { border-color: #a28b53; background: #322e21; }
.chapter-button:disabled { background: #1b2521; color: #b8c3b8; }
.chapter-image { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.chapter-button:disabled .chapter-image { opacity: .62; }
.chapter-text { min-width: 0; }
.chapter-text small { display: block; margin-bottom: 2px; color: var(--muted); font-size: .66rem; }
.chapter-text strong { display: block; font-size: .79rem; font-weight: 650; line-height: 1.1; }
.chapter-button > .icon { width: 16px; height: 16px; color: #9eb7a5; }
.chapter-button[aria-current='step'] > .icon { color: var(--gold); }
.save-note { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: var(--muted); font-size: .7rem; }
.save-note span { width: 5px; height: 5px; border-radius: 50%; background: #a9d0b2; box-shadow: 0 0 9px #88b98f56; }

.hud { position: absolute; inset: 13px 14px auto; pointer-events: none; }
.hud-row, .hud-badges { display: flex; align-items: center; gap: 7px; }
.hud-row { justify-content: space-between; }
.hud-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid #e5e6c943;
  border-radius: 8px;
  background: #0f1b17e6;
  color: var(--text);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.1;
}
.hud-badge .icon { width: 16px; height: 16px; }
.hearts .icon { fill: #ef8d7c; stroke: #ffb7a6; }
.hearts .icon.spent { fill: none; stroke: #ad908b; opacity: .65; }
.crystals .icon { color: var(--gold-light); filter: drop-shadow(0 0 8px #f1bc695c); }
.crystals.ready { border-color: #eabd6899; color: var(--gold-light); }
.pause-button { width: 36px; justify-content: center; padding: 0; pointer-events: auto; }
.pause-button:hover { background: #2b3b31; }
.path-progress {
  display: block;
  width: min(160px, 25%);
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  appearance: none;
  background: #111a17b8;
  color: var(--gold);
}
.path-progress::-webkit-progress-bar { background: #111a17b8; }
.path-progress::-webkit-progress-value { border-radius: 4px; background: var(--gold); }
.path-progress::-moz-progress-bar { border-radius: 4px; background: var(--gold); }
.notice {
  position: absolute;
  right: 12px;
  bottom: 13px;
  left: 12px;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin-inline: auto;
  padding: 7px 13px;
  border: 1px solid #e8bb7067;
  border-radius: 8px;
  background: #15201aee;
  color: var(--gold-light);
  font-size: .79rem;
  font-weight: 650;
  text-align: center;
  pointer-events: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 9px;
  background: #08130ed1;
  backdrop-filter: blur(5px);
}
.overlay-card {
  width: min(100%, 390px);
  padding: 22px 23px;
  border: 1px solid #79754f;
  border-radius: 15px;
  background: linear-gradient(150deg, #29392e, #1c2720);
  box-shadow: 0 12px 44px #050b08ad;
  text-align: center;
}
.overlay-emblem { width: 42px; height: 42px; margin: 0 auto 10px; }
.overlay-card h2, .help-dialog h2 { font-family: var(--heading); font-size: clamp(1.52rem, 3.5vw, 2.25rem); letter-spacing: -.035em; }
.overlay-card p { margin: 7px 0 15px; color: #ccd7ca; font-size: .85rem; line-height: 1.45; }
.overlay-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }

.help-dialog {
  position: fixed;
  width: min(430px, calc(100% - 28px));
  padding: 26px;
  border: 1px solid #677a67;
  border-radius: 16px;
  background: #1e2b24;
  color: var(--text);
  box-shadow: 0 24px 65px #050a07a1;
}
.help-dialog::backdrop { background: #070f0bc4; backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.help-dialog .overlay-emblem { margin: 0 0 12px; }
.help-dialog p { margin-top: 8px; color: #ccd7ca; font-size: .86rem; line-height: 1.55; }
.help-keys { margin: 17px 0; }
.help-keys > div { display: flex; min-height: 38px; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid #39483e; }
.help-keys dt { font-weight: 650; }
.help-keys dd { margin: 0; color: var(--muted); font-size: .76rem; }
.dialog-button { width: 100%; margin-top: 16px; }

.touch-controls { display: none; justify-content: space-between; gap: 15px; padding: 8px 12px; touch-action: none; }
.touch-directions, .touch-actions { display: flex; gap: 7px; }
.touch-button { min-width: 49px; min-height: 43px; touch-action: none; font-size: 1.15rem; user-select: none; }
.touch-crouch, .touch-power { font-size: .82rem; }
.touch-jump { min-width: 92px; font-size: .9rem; }
.touch-button[data-held] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

.game-frame:is(:fullscreen, .expanded) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: #0d1712;
}
.game-frame.expanded { position: fixed; z-index: 10; inset: 0; }
body:has(.game-frame.expanded) { overflow: hidden; }
.game-frame:is(:fullscreen, .expanded) .screen { width: min(100%, calc((100dvh - 55px) * 16 / 9)); }
.game-frame:is(:fullscreen, .expanded) .game-toolbar,
.game-frame:is(:fullscreen, .expanded) .touch-controls { width: 100%; }
.no-script { margin: 20px auto; padding: 0 16px; color: var(--gold-light); text-align: center; }

@media (max-width: 1050px) {
  .site-width { width: calc(100% - 48px); }
  .layout { grid-template-columns: minmax(0, 1fr) 285px; gap: 15px; }
  .panel { padding: 14px; }
  .cover-content { padding-left: 28px; }
  .cover h1 { font-size: clamp(2.7rem, 6.2vw, 4.6rem); }
}

@media (max-width: 850px) {
  .layout { grid-template-columns: 1fr; gap: 16px; margin-top: 20px; }
  .cover-content { padding-left: clamp(21px, 6vw, 50px); }
  .cover h1 { font-size: clamp(2.9rem, 9vw, 4.75rem); }
  .side-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .panel { padding: 16px; }
}

@media (pointer: coarse), (max-width: 680px) {
  .game-frame[data-mode='playing'] .touch-controls { display: flex; }
  .game-frame:is(:fullscreen, .expanded)[data-mode='playing'] .screen { width: min(100%, calc((100dvh - 114px) * 16 / 9)); }
}

@media (max-width: 530px) {
  .site-width { width: calc(100% - 26px); }
  .masthead-inner { min-height: 59px; }
  .brand { gap: 7px; font-size: 1.05rem; }
  .brand-emblem { width: 33px; height: 33px; border-radius: 9px; }
  .header-actions { gap: 6px; }
  .header-actions .quiet-button { min-height: 35px; padding-inline: 8px; font-size: .74rem; }
  .header-actions .square-button { width: 35px; }
  .layout { margin-top: 13px; }
  .game-frame[data-mode='menu']:not(:is(:fullscreen, .expanded)) .screen { aspect-ratio: 1.2; }
  .cover { background-position: 59% center; }
  .cover::before { background: linear-gradient(90deg, #07120fe8, #07170ece 34%, #091c1470 64%, #08141126); }
  .cover-avatar { right: -3%; bottom: 7%; width: 51%; height: 66%; }
  .cover-content { width: 72%; }
  .cover h1 { margin: 12px 0; font-size: clamp(2.55rem, 10.35vw, 3.27rem); }
  .cover-summary { max-width: 215px; }
  .cover .gold-button { min-height: 42px; margin-top: 16px; }
  .game-toolbar { min-height: 45px; padding: 5px 9px; }
  .key-hints { gap: 7px; font-size: .68rem; }
  .key-hints span { gap: 3px; }
  .key-hints span:last-child, .key-hints .key-hint-crouch { display: none; }
  .screen-button { padding-inline: 4px; font-size: .72rem; }
  .mission { margin-top: 12px; padding: 12px; }
  .side-panel { grid-template-columns: 1fr; gap: 12px; }
  .avatar-art { height: 124px; }
  .hud { inset: 7px 8px auto; }
  .hud-badge { min-height: 28px; padding-inline: 6px; font-size: .72rem; }
  .hud-badge .icon { width: 13px; height: 13px; }
  .hud-chapter { display: none; }
  .pause-button { width: 31px; }
  .notice { bottom: 7px; padding: 5px 8px; font-size: .7rem; }
  .overlay-card { padding: 12px 9px; }
  .overlay-card .overlay-emblem { display: none; }
  .overlay-card p { margin: 5px 0 9px; font-size: .75rem; }
  .overlay-actions .quiet-button, .overlay-actions .gold-button { min-height: 34px; padding-inline: 9px; font-size: .74rem; }
}

@media (max-width: 380px) {
  .touch-controls { gap: 6px; padding-inline: 8px; }
  .touch-directions, .touch-actions { gap: 5px; }
  .touch-button { min-width: 43px; padding-inline: 9px; }
  .touch-jump { min-width: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.power-badge { position: relative; overflow: hidden; }
.power-badge::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--charge, 100%);
  background: var(--gold-light, #f4d98c); opacity: .85;
}
.power-badge.ready { border-color: #eabd6899; color: var(--gold-light, #f4d98c); }
@media (max-width: 560px) { .power-badge .icon { display: none; } }

.buff-badge { color: #bfe9ff; border-color: #8fd6ff88; }
.editor-cta { margin-top: 10px; margin-left: 0; }
.editor-bar { display: none; flex-direction: column; gap: 7px; padding: 9px 12px; border-top: 1px solid var(--border); background: var(--panel); }
.game-frame[data-mode='editor'] .editor-bar { display: flex; }
.game-frame[data-mode='editor'] .screen canvas { touch-action: none; cursor: crosshair; }
.editor-tools, .editor-actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.editor-tools button { min-height: 32px; padding: 4px 9px; font-size: .76rem; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); cursor: pointer; }
.editor-tools button[aria-pressed='true'] { border-color: var(--gold); background: #3a3320; color: var(--gold-light); }
.editor-actions .quiet-button, .editor-actions .gold-button { min-height: 32px; padding: 4px 10px; font-size: .76rem; }
.editor-actions select { min-height: 32px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font-size: .76rem; padding: 0 6px; }
.editor-width { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); }
.editor-width input { width: 110px; }
.editor-help { margin: 0; font-size: .76rem; color: var(--muted); min-height: 1.2em; }

/* Celular: sem zoom por toque duplo, sem menu de pressionar e botões maiores. */
html, body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.touch-controls, .touch-button, .screen canvas { -webkit-touch-callout: none; user-select: none; }
@media (pointer: coarse) {
  .touch-button { min-width: 62px; min-height: 58px; font-size: 1.3rem; }
  .touch-crouch, .touch-power { font-size: .9rem; }
  .touch-jump { min-width: 104px; }
  .editor-tools button, .editor-actions .quiet-button, .editor-actions .gold-button { min-height: 40px; }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  .masthead, .mission, .side-panel { display: none; }
  .layout { margin-top: 0; }
}

/* Controles de toque em qualquer aparelho com tela sensível (celular, tablet, iPad). */
html[data-touch='1'] .game-frame[data-mode='playing'] .touch-controls { display: flex; }
html[data-touch='1'] .game-frame[data-mode='playing'] .screen canvas { touch-action: none; }
html[data-touch='1'] .key-hints { display: none; }
.touch-controls { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.touch-directions { touch-action: none; }
.touch-directions .touch-button { min-width: 72px; }

.touch-controls.overlay-active, .game-frame.overlay-touch .touch-controls {
  position: absolute; left: 0; right: 0; bottom: 0; width: auto !important; z-index: 4;
  padding: 0 max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  align-items: flex-end; pointer-events: none; background: none;
}
.game-frame.overlay-touch .touch-controls .touch-button {
  pointer-events: auto; opacity: .72; backdrop-filter: blur(2px);
  background: #0c1512b3; border-color: #ffffff44; color: var(--text);
}
.game-frame.overlay-touch .touch-controls .touch-jump { background: #f1bc69cc; color: #1c1408; }
.game-frame.overlay-touch .touch-controls .touch-button[data-held] { opacity: 1; border-color: var(--gold); }
.game-frame.overlay-touch .touch-controls .touch-actions { align-items: flex-end; }
.game-frame.overlay-touch:is(:fullscreen, .expanded)[data-mode='playing'] .screen { width: min(100%, calc((100dvh - 55px) * 16 / 9)); }
@media (pointer: coarse) {
  .game-frame.overlay-touch .touch-controls .touch-button { min-height: 64px; min-width: 70px; }
  .game-frame.overlay-touch .touch-controls .touch-jump { min-width: 110px; min-height: 72px; }
}

.mode-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 22px; }
.mode-buttons .gold-button { margin-top: 0; }
.cover .mode-buttons .gold-button { margin-top: 0; }
.mode-button { min-height: 48px; padding-inline: 16px; font-size: .9rem; }
.cover-best { margin: 12px 0 0; color: #ffd595; font-size: .76rem; letter-spacing: .04em; }
.timer-badge { font-variant-numeric: tabular-nums; min-width: 46px; justify-content: center; }
.timer-badge.late { color: #ff9a8a; border-color: #ff9a8a66; }
.combo-badge { color: #ffb15c; border-color: #ffb15c88; font-weight: 700; }
@media (max-width: 530px) {
  .mode-buttons { gap: 6px; margin-top: 12px; }
  .mode-button, .cover .mode-buttons .gold-button { min-height: 38px; padding-inline: 10px; font-size: .74rem; }
  .cover-best { display: none; }
}
