.swords-page {
  --swords-action: var(--portal-action);
  --swords-action-hover: var(--portal-action-hover);
  --swords-action-text: var(--portal-action-text);
  --swords-track: var(--play-track);
}

.swords-page #site-main {
  color: var(--text);
}


.swords-page #swords-game {
  box-shadow: 0 16px 36px rgba(18, 38, 24, .06);
}

.swords-page .game-launch-header {
  margin: clamp(1.4rem, 4vw, 2.6rem) 0 1rem;
  text-align: left;
}

.swords-page .game-launch-header h1 {
  color: var(--text);
  font-size: clamp(1.95rem, 5vw, 3.1rem);
}

.swords-page .game-launch-subtitle {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: .4rem 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.swords-page #swords-game,
.swords-board {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.swords-page #main-frame-error.interstitial-wrapper {
  min-height: 225px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 13px 13px 0 0;
  background: linear-gradient(180deg, rgba(249,250,247,.98), rgba(243,246,242,.98));
  box-shadow: none;
  margin: 0;
  touch-action: none;
}

.swords-page #main-frame-error:focus { outline: none; }
.swords-page #main-frame-error:focus-visible { outline: 2px solid var(--swords-action); outline-offset: -3px; }
.swords-page .controller { pointer-events: none; background: transparent; }
.swords-page .start-hint[hidden] { display: none; }

html[data-theme="dark"] .swords-page .runner-canvas { filter: brightness(2.1); }

.swords-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem 1rem;
  padding: .95rem 1rem 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,248,.98));
}

.swords-game-state {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem 1.3rem;
  min-width: 0;
}

.swords-stat {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
  line-height: 1.3;
}

.swords-stat > span { font-size: .75rem; color: var(--muted); }
.swords-stat strong { color: var(--text); font-size: .95rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.swords-shield, .swords-game-state [data-combo]:not([hidden]) {
  padding: .15rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
}

.swords-shield.is-active, .swords-game-state [data-combo]:not([hidden]) {
  color: var(--swords-action);
  font-weight: 650;
}

.swords-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 28rem;
  gap: .5rem;
}

.swords-options { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }

.swords-page :is(.swords-actions, .swords-options, .swords-board-header, .swords-board-pages) :is(button, select) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  min-width: 0;
  padding: .42rem .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.swords-page :is(.swords-actions, .swords-options, .swords-board-header, .swords-board-pages) button:not(:disabled):hover {
  background: var(--surface-soft);
  border-color: var(--swords-action);
}

.swords-page :is(.swords-actions, .swords-options, .swords-board-header, .swords-board-pages) button:disabled {
  opacity: .48;
  cursor: default;
}

.swords-page :is(.swords-actions, .swords-options, .swords-board-header, .swords-board-pages) :is(button, select):focus-visible,
.swords-board-table:focus-visible {
  outline: 2px solid var(--swords-action);
  outline-offset: 2px;
}

.swords-page .swords-actions [data-attack]:not(:disabled) {
  background: var(--swords-action);
  color: var(--swords-action-text);
  border-color: var(--swords-action);
}

.swords-page .swords-actions [data-attack]:not(:disabled):hover { background: var(--swords-action-hover); }
.swords-actions [data-attack].is-recharging { opacity: .62; }
.swords-actions :is([data-jump], [data-duck]) { touch-action: none; }
.swords-actions button { -webkit-tap-highlight-color: transparent; }
.swords-actions kbd {
  padding: .11rem .3rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-size: .75rem;
}

.swords-status { margin: 0 1rem .9rem; color: var(--muted); }
.swords-status:empty { display: none; }
.swords-save { max-width: 32rem; margin: .8rem 1rem 1rem; }
.swords-save label { display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: 600; }
.swords-save div { display: flex; flex-wrap: wrap; gap: .5rem; }
.swords-save input {
  flex: 1 1 180px;
  min-width: 0;
  min-height: 44px;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}

.swords-board { margin: 1.3rem auto; }
.swords-board-header,
.swords-board-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem 1rem;
  padding: .85rem 1rem;
}

.swords-board-header > div { flex: 1 1 12rem; min-width: 0; }
.swords-board h2, .swords-guide h2 { margin: 0; color: var(--text); font-size: 1.14rem; line-height: 1.35; }
.swords-board-header h2 { font-size: 1.28rem; }
.swords-board-header p, .swords-board-footer p {
  margin: .22rem 0 0;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.45;
}

.swords-board-table {
  /* The leaderboard already uses server-side pagination. Allow each page of
     results to expand naturally instead of creating a second scroll area. */
  height: auto;
  max-height: none;
  overflow: visible;
  border-block: 1px solid var(--border);
}

.swords-board .article-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  table-layout: fixed;
}

.swords-board thead { position: sticky; top: 0; z-index: 1; }
.swords-board .article-table :is(th, td) { padding: .55rem .65rem; border-bottom: 1px solid var(--border); }
.swords-board thead th { background: var(--surface-soft); color: var(--muted); }
.swords-board th:first-child { width: 4.4rem; }
.swords-board th:last-child { width: 6.2rem; }
.swords-board :is(td, th):first-child { padding-left: 1rem; }
.swords-board :is(td, th):last-child { padding-right: 1rem; text-align: right; white-space: nowrap; }
.swords-board td:nth-child(2) { overflow-wrap: anywhere; }
.swords-board td:last-child { font-variant-numeric: tabular-nums; font-weight: 650; }
.swords-board tbody tr:nth-child(even) { background: var(--surface-soft); }
.swords-board tbody tr:last-child td { border-bottom: 0; }
.swords-board .country-flag { width: 20px; height: 15px; box-shadow: none; }
.swords-rank { font-variant-numeric: tabular-nums; }
.swords-board [data-podium] .swords-rank {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 5px;
  font-weight: 700;
}
.swords-board [data-podium="1"] .swords-rank { background: #f8eac0; color: #674703; }
.swords-board [data-podium="2"] .swords-rank { background: #e3eaef; color: #344c5e; }
.swords-board [data-podium="3"] .swords-rank { background: #f1dfce; color: #653e22; }

.swords-board-footer p { margin: 0; font-variant-numeric: tabular-nums; }
.swords-board-pages:not([hidden]), .swords-board-page-choice, .swords-board-pages label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.swords-page .swords-board-pages button { min-width: 44px; font-size: 1.1rem; }
.swords-page .swords-board-pages select { padding-inline: .5rem; }
.swords-board-page-choice { font-size: .84rem; color: var(--muted); }

.swords-guide {
  gap: .8rem;
  margin-block: 1.2rem;
}
.swords-guide .tip-card {
  padding: 1rem;
  border-radius: 12px;
}
.swords-guide p, .swords-about p { margin: .45rem 0 0; color: var(--muted); font-size: .94rem; }
.swords-about { margin: 1.2rem 0; }
.swords-about summary { font-weight: 650; }

.swords-weapon-guide { padding: clamp(.8rem, 2.5vw, 1.2rem); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.swords-weapon-guide h2 { margin: 0 0 .65rem; }
.swords-weapon-guide .article-table { min-width: 0; }
.swords-weapon-guide .article-table thead th { background: var(--surface-soft); }
.swords-weapon-guide .article-table th[scope="row"] { width: 23%; color: var(--text); font-size: inherit; text-transform: none; letter-spacing: normal; overflow-wrap: anywhere; }
.swords-weapon-guide p { margin: .7rem 0 0; color: var(--muted); font-size: .9rem; }

@media (max-width: 680px) {
  .swords-page #main-frame-error.interstitial-wrapper { min-height: clamp(195px, 53vw, 250px); }
  .swords-controls { grid-template-columns: minmax(0, 1fr); gap: .65rem; padding: .75rem; }
  .swords-game-state { gap: .45rem .7rem; }
  .swords-options { justify-content: flex-start; }
  .swords-actions { max-width: none; }
  .swords-actions kbd { display: none; }
  .swords-page .swords-actions button { padding-inline: .35rem; font-size: .82rem; }
  .swords-page .swords-options button { min-height: 36px; font-size: .8rem; }
  .swords-board-header, .swords-board-footer { padding: .75rem; }
  .swords-board-header > div { flex-basis: 0; }
  .swords-board-header h2 { font-size: 1.1rem; }
  .swords-board .article-table :is(th, td) { padding-inline: .45rem; }
  .swords-board :is(td, th):first-child { padding-left: .75rem; }
  .swords-board :is(td, th):last-child { padding-right: .75rem; }
  .swords-board th:first-child { width: 3.9rem; }
  .swords-board th:last-child { width: 5.35rem; }
  .swords-board-footer { justify-content: center; text-align: center; }
  .swords-board-footer p { flex-basis: 100%; }
  .swords-guide { grid-template-columns: minmax(0, 1fr); }
}

/* Original collectible inventory rebuilt as a cleaner armory panel. */
.swords-page #swords-game {
  overflow: hidden;
}
.swords-page #main-frame-error.interstitial-wrapper {
  width: 100%;
}
.swords-armory {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .8rem;
  padding: 1rem 1rem .9rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(246,248,245,.92));
  min-width: 0;
}
.swords-armory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  margin-bottom: 0;
}
.swords-armory-heading strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.swords-armory-heading span {
  font-size: .8rem;
  color: var(--muted);
}
.swords-inventory {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .7rem;
  width: 100%;
  max-width: none;
}
.swords-item-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: .25rem;
  min-width: 0;
  min-height: 96px;
  padding: .55rem .5rem .5rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(242,246,243,.98));
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 6px 18px rgba(15, 23, 42, .05);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.swords-item-card:hover:not(:disabled),
.swords-item-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(21, 148, 71, .45);
  box-shadow: 0 10px 22px rgba(21,148,71,.10);
}
.swords-item-card:focus-visible { outline: 2px solid var(--swords-action); outline-offset: 2px; }
.swords-item-card:disabled { opacity: .78; cursor: default; }
.swords-item-card.is-equipped {
  border-color: rgba(21,148,71,.55);
  background: linear-gradient(180deg, rgba(236,248,239,.98), rgba(248,252,248,.98));
  box-shadow: 0 10px 24px rgba(21,148,71,.12);
}
.swords-item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: .35rem;
}
.swords-item-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  min-height: 1.55rem;
  padding: 0 .32rem;
  border-radius: 999px;
  background: #163c26;
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.swords-item-card kbd {
  position: static;
  margin-left: auto;
  padding: .12rem .34rem;
  border: 1px solid rgba(148,163,184,.36);
  border-radius: 6px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.1;
  opacity: 1;
  font-family: inherit;
}
.swords-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(236,241,237,.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}
.swords-item-icon svg {
  width: 30px;
  height: 30px;
  flex: none;
}
.swords-item-label {
  display: block;
  max-width: 100%;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--text);
  overflow-wrap: anywhere;
}
.swords-item-card[data-item="spear"] .swords-item-icon { background: linear-gradient(180deg, #fef3e2, #f9e6cd); }
.swords-item-card[data-item="hammer"] .swords-item-icon { background: linear-gradient(180deg, #eef2f7, #dde4ec); }
.swords-item-card[data-item="bow"] .swords-item-icon { background: linear-gradient(180deg, #fcebdd, #f7dbc7); }
.swords-item-card[data-item="axe"] .swords-item-icon { background: linear-gradient(180deg, #edf0f3, #dde4ea); }
.swords-item-card[data-item="shield"] .swords-item-icon { background: linear-gradient(180deg, #e7f0f6, #d6e4ef); }
.swords-item-card[data-item="spear"] .swords-item-count { background: #6f4e2f; }
.swords-item-card[data-item="hammer"] .swords-item-count { background: #44515d; }
.swords-item-card[data-item="bow"] .swords-item-count { background: #965136; }
.swords-item-card[data-item="axe"] .swords-item-count { background: #46515c; }
.swords-item-card[data-item="shield"] .swords-item-count { background: #46657b; }
.swords-armory-notice {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  min-height: 1.2em;
}
.swords-armory-notice:empty { display: none; }

@media (max-width: 860px) {
  .swords-inventory {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .swords-armory {
    padding: .85rem .75rem .8rem;
  }
  .swords-inventory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
  }
  .swords-item-card {
    min-height: 86px;
    padding: .45rem .42rem;
  }
  .swords-item-icon {
    width: 38px;
    height: 38px;
  }
  .swords-item-icon svg {
    width: 27px;
    height: 27px;
  }
  .swords-item-label { font-size: .72rem; }
}

@media (max-width: 380px) {
  .swords-inventory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .swords-item-card {
    min-height: 82px;
  }
}



/* v18: Dino Swords track fills the inside edges, never the shared 900px cap. */
.swords-page #main-frame-error.interstitial-wrapper {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
}
.swords-page #main-frame-error .runner-container,
.swords-page #main-frame-error .runner-canvas {
  max-width: none;
  margin: 0;
  left: 0;
  box-sizing: border-box;
}
.swords-page #main-frame-error .runner-canvas { display: block; }

/* v18: inventory is instantly legible by color, not just a number. */
.swords-page .swords-inventory .swords-item-card {
  --item-top: #fafbfa;
  --item-bottom: #edf1ed;
  --item-border: #d6ded8;
  --item-ink: var(--text);
  border-color: var(--item-border);
  background: linear-gradient(160deg, var(--item-top), var(--item-bottom));
  opacity: .66;
  filter: saturate(.5);
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease,
    box-shadow .16s ease, transform .16s ease, opacity .16s ease;
}
.swords-page .swords-inventory .swords-item-card.has-item {
  opacity: 1;
  filter: none;
  border-color: var(--item-border);
  background: linear-gradient(155deg, var(--item-top), var(--item-bottom));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.52), 0 6px 18px rgba(27,43,31,.12);
}
.swords-page .swords-inventory .swords-item-card.has-item .swords-item-label {
  color: var(--item-ink);
  font-weight: 850;
}
.swords-page .swords-inventory .swords-item-card.has-item .swords-item-icon {
  background: rgba(255,255,255,.50);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.swords-page .swords-inventory .swords-item-card[data-item="spear"].has-item {
  --item-top: #fff1d9; --item-bottom: #f9d99f; --item-border: #dca44e; --item-ink: #704017;
}
.swords-page .swords-inventory .swords-item-card[data-item="hammer"].has-item {
  --item-top: #e8eff8; --item-bottom: #adc2dc; --item-border: #7698bf; --item-ink: #263f62;
}
.swords-page .swords-inventory .swords-item-card[data-item="bow"].has-item {
  --item-top: #fbe7f9; --item-bottom: #e7b4df; --item-border: #ba78b2; --item-ink: #6d3067;
}
.swords-page .swords-inventory .swords-item-card[data-item="axe"].has-item {
  --item-top: #ffe5dc; --item-bottom: #f2b39e; --item-border: #d98564; --item-ink: #803b24;
}
.swords-page .swords-inventory .swords-item-card[data-item="shield"].has-item {
  --item-top: #e2f6ed; --item-bottom: #9fdec2; --item-border: #58b189; --item-ink: #185b42;
}
.swords-page .swords-inventory .swords-item-card.is-equipped {
  outline: 2px solid var(--swords-action);
  outline-offset: -3px;
}
.swords-page .swords-inventory .swords-item-card.just-collected {
  animation: swordsPickupHighlight .42s ease-out;
}
@keyframes swordsPickupHighlight {
  0% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(22,148,71,.45); }
  48% { transform: scale(1.03); box-shadow: 0 0 0 5px rgba(22,148,71,.14); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(22,148,71,0); }
}
@media (prefers-reduced-motion: reduce) {
  .swords-page .swords-inventory .swords-item-card { transition: none; }
  .swords-page .swords-inventory .swords-item-card.just-collected { animation: none; }
}

/* One natural page scroll only: no nested horizontal/vertical leaderboard scroller. */
.swords-page .leaderboard-scroll.swords-board-table {
  height: auto;
  max-height: none;
  overflow-x: visible;
  overflow-y: visible;
}
.swords-page .swords-board-pages:not([hidden]) { flex-wrap: wrap; }
@media (max-width: 480px) {
  .swords-page .swords-board-pages:not([hidden]) { justify-content: center; width: 100%; }
  .swords-page .swords-board-page-choice { min-width: 0; }
}


/* v20: Fullscreen toggle sits BELOW the track, never over the score. */
.swords-page .swords-fullscreen-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 44px;
  padding: .35rem .65rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.swords-page .swords-fullscreen-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 36px;
  padding: .42rem .7rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: .79rem;
  font-weight: 750;
  line-height: 1.1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.swords-page .swords-fullscreen-toggle:hover { border-color: var(--swords-action); }
.swords-page .swords-fullscreen-toggle:focus-visible {
  outline: 2px solid var(--swords-action);
  outline-offset: 2px;
}
.swords-page .swords-fullscreen-toggle svg { flex: none; }

/* Native Fullscreen API, with a viewport fallback for browsers such as iOS Safari. */
.swords-page #swords-game:fullscreen,
.swords-page #swords-game.swords-is-fullscreen {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface, #f6f8f5);
  box-shadow: none;
}
.swords-page #swords-game.swords-is-fullscreen:not(:fullscreen) {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
}
body.swords-fullscreen-fallback { overflow: hidden !important; }

.swords-page #swords-game.swords-is-fullscreen #main-frame-error.interstitial-wrapper {
  flex: 1 1 0;
  min-height: 150px;
  max-height: none;
  height: auto;
  border-radius: 0;
  overflow: hidden;
}
/* Preserve the pixel-art proportions. Center the 150px scene in taller screens. */
.swords-page #swords-game.swords-is-fullscreen #main-frame-error .runner-container {
  top: 50%;
  transform: translateY(-50%);
  max-width: none;
  left: 0;
  right: auto;
  margin: 0;
}
.swords-page #swords-game.swords-is-fullscreen .swords-fullscreen-bar {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 2px 8px;
}
.swords-page #swords-game.swords-is-fullscreen .swords-armory,
.swords-page #swords-game.swords-is-fullscreen .swords-controls {
  flex: 0 0 auto;
}
.swords-page #swords-game.swords-is-fullscreen .swords-save:not([hidden]) {
  flex: 0 0 auto;
  margin-block: .35rem;
}
.swords-page #swords-game.swords-is-fullscreen .swords-status:empty { display: none; }
.swords-page #swords-game.swords-is-fullscreen .swords-status:not(:empty) {
  padding: 0 .7rem;
  margin: .3rem 0;
  font-size: .74rem;
}

/* Short landscape screens: one row of touch controls and compact inventory. */
@media (orientation: landscape) and (max-height: 510px) {
  .swords-page #swords-game.swords-is-fullscreen .swords-armory {
    gap: .2rem;
    padding: .3rem .55rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-armory-heading { display: none; }
  .swords-page #swords-game.swords-is-fullscreen .swords-armory-notice { display: none; }
  .swords-page #swords-game.swords-is-fullscreen .swords-inventory {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .35rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-card {
    min-height: 53px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 1fr auto;
    padding: 2px 7px;
    gap: 1px 5px;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-topline {
    grid-column: 2;
    grid-row: 1 / 3;
    flex-direction: column-reverse;
    justify-content: center;
    gap: 2px;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-icon {
    grid-column: 1;
    grid-row: 1;
    width: 27px;
    height: 27px;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-icon svg {
    width: 24px;
    height: 24px;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-label {
    grid-column: 1;
    grid-row: 2;
    font-size: .65rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-count {
    min-width: 18px;
    min-height: 18px;
    font-size: .7rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-controls {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(160px, 1.35fr) auto;
    align-items: center;
    gap: .35rem;
    padding: .3rem .55rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-game-state {
    grid-column: 1;
    gap: .25rem .55rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-stat > span { font-size: .63rem; }
  .swords-page #swords-game.swords-is-fullscreen .swords-stat strong { font-size: .75rem; }
  .swords-page #swords-game.swords-is-fullscreen .swords-shield { font-size: .65rem; }
  .swords-page #swords-game.swords-is-fullscreen .swords-actions {
    grid-column: 2;
    gap: .25rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-options {
    grid-column: 3;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: .25rem;
  }
  .swords-page #swords-game.swords-is-fullscreen :is(.swords-actions, .swords-options) button {
    min-height: 38px;
    padding: .32rem .4rem;
    font-size: .7rem;
  }
}

@media (orientation: portrait) and (max-width: 680px) {
  .swords-page #swords-game.swords-is-fullscreen .swords-armory {
    gap: .3rem;
    padding: .4rem .4rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-armory-heading span { display: none; }
  .swords-page #swords-game.swords-is-fullscreen .swords-inventory {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .3rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-card {
    min-height: 67px;
    padding: .25rem .14rem;
    gap: 1px;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-icon { width: 27px; height: 27px; }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-icon svg { width: 25px; height: 25px; }
  .swords-page #swords-game.swords-is-fullscreen .swords-item-label { font-size: .6rem; }
  .swords-page #swords-game.swords-is-fullscreen .swords-controls {
    gap: .35rem;
    padding: .4rem;
  }
  .swords-page #swords-game.swords-is-fullscreen .swords-options { justify-content: flex-end; }
  .swords-page #swords-game.swords-is-fullscreen .swords-fullscreen-bar { padding: 1px 5px; }
}

@media (max-height: 320px) and (orientation: landscape) {
  .swords-page #swords-game.swords-is-fullscreen { overflow-y: auto; }
  .swords-page #swords-game.swords-is-fullscreen #main-frame-error.interstitial-wrapper { flex: 1 0 140px; }
}

/* v21 — Center the Play / Resume overlay within the Dino Swords stage.
   It is visible only before the run or when paused / game over; the existing
   is-hidden class hides it immediately when the game resumes. */
.swords-page #main-frame-error #messageBox.sendmessage {
  top: 50%;
  bottom: auto;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 24px);
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .7rem .85rem;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(32, 67, 44, .1);
  border-radius: 14px;
  background: rgba(249, 252, 248, .87);
  box-shadow: 0 12px 28px rgba(22, 44, 30, .1);
  text-align: center;
}
.swords-page #main-frame-error #messageBox.sendmessage.is-hidden {
  transform: translate(-50%, calc(-50% + 6px));
}
.swords-page #messageBox .start-game-button {
  min-height: 44px;
  margin: 0;
  white-space: normal;
  text-align: center;
}
.swords-page #messageBox .start-hint:not([hidden]) {
  display: block;
  max-width: min(100%, 320px);
  padding: 0;
  border: 0;
  background: transparent;
  color: #43574b;
  font-size: .75rem;
  font-weight: 550;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
:root[data-theme="dark"] .swords-page #main-frame-error #messageBox.sendmessage {
  border-color: rgba(168, 207, 176, .22);
  background: rgba(22, 37, 27, .9);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .22);
}
:root[data-theme="dark"] .swords-page #messageBox .start-hint:not([hidden]) {
  color: #cfddd3;
}
@media (max-height: 360px) and (orientation: landscape) {
  .swords-page #main-frame-error #messageBox.sendmessage {
    gap: .15rem;
    padding: .4rem .55rem;
  }
  .swords-page #messageBox .start-game-button { min-height: 38px; }
  .swords-page #messageBox .start-hint:not([hidden]) { font-size: .68rem; }
}
