@font-face {
  font-family: Inter;
  src: url('/inter.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: Archivo Black;
  src: url('/archivo-black.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f6f2e8;
  --cream: #fffaf0;
  --ink: #172638;
  --muted: #4d5965;
  --outline: #263446;
  --gold: #ffd34c;
  --orange: #d4482e;
  --line: #ded9cd;
  --display: "Archivo Black",Impact,sans-serif;
  --body: Inter,system-ui,sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none!important;
}

body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
}

button,input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  opacity: .55;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid #1961b1;
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  clip: rect(0,0,0,0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.wrap {
  width: min(1250px,calc(100% - 96px));
  margin-inline: auto;
}

.masthead {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-family: var(--display);
  font-size: clamp(18px,2.35vw,24px);
  letter-spacing: -.07em;
}

.brand-mark {
  width: 35px;
  height: 35px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  position: relative;
  display: inline-block;
  background: var(--gold);
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-6deg);
}

.brand-mark::before {
  content: "";
  display: block;
  width: 2px;
  height: 17px;
  background: var(--ink);
  position: absolute;
  top: 6px;
  left: 9px;
  border-radius: 4px;
}

.brand-mark span {
  display: block;
  width: 12px;
  height: 11px;
  position: absolute;
  top: 7px;
  left: 11px;
  background: var(--ink);
  clip-path: polygon(0 0,100% 18%,74% 56%,100% 100%,0 82%);
}

.brand-period {
  color: var(--orange);
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.button {
  min-height: 52px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-weight: 850;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
  transition: background-color .16s,transform .16s,box-shadow .16s;
}

.button:active:not(:disabled) {
  transform: translate(2px,2px);
  box-shadow: 0 0 0 var(--ink);
}

.button-primary {
  background: var(--gold);
  box-shadow: 3px 3px 0 var(--ink);
}

.button-primary:hover:not(:disabled) {
  background: #ffe073;
}

.button-outline {
  background: transparent;
}

.button-outline:hover:not(:disabled) {
  background: #ece6da;
}

.button-small {
  min-height: 40px;
  padding-inline: 13px;
  font-size: 13px;
}

.masthead .button-small {
  gap: 8px;
}

.masthead .button-small span {
  border: 1.6px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  font-size: 11px;
}

.text-button {
  padding: 6px 0;
  background: none;
  border: 0;
  color: var(--ink);
  font-weight: 800;
  text-underline-offset: 4px;
}

.text-button:hover {
  text-decoration: underline;
}

.hero {
  display: grid;
  grid-template-columns: minmax(340px,39fr) minmax(0,61fr);
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 5px 6px 0 var(--ink);
}

.hero-copy {
  padding: clamp(28px,4vw,57px) clamp(21px,3.35vw,47px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  position: relative;
  min-width: 0;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(66px,8.05vw,118px);
  line-height: .79;
  letter-spacing: -.105em;
  margin: 0 0 25px;
  isolation: isolate;
}

.hero h1>span {
  display: block;
}

.hero h1>span:nth-child(2) {
  color: var(--orange);
  margin-top: 10px;
}

.hero-period {
  color: var(--ink);
}

.hero-copy>p {
  max-width: 330px;
  margin: 0 0 25px;
  font-size: clamp(17px,1.6vw,22px);
  font-weight: 690;
  line-height: 1.45;
  letter-spacing: -.035em;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions .button {
  white-space: nowrap;
}

.practice-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 19px;
  font-size: 13px;
}

.play-triangle {
  display: inline-block;
  width: 8px;
  height: 10px;
  background: var(--orange);
  clip-path: polygon(0 0,100% 50%,0 100%);
}

.hero-art {
  border-left: 2px solid var(--ink);
  position: relative;
  overflow: hidden;
  min-height: 490px;
  background: #123866;
}

.hero-art img {
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: 50% 52%;
}

.art-meta {
  position: absolute;
  right: 17px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.art-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  color: var(--cream);
  font-size: 12px;
  font-weight: 750;
  background: #172638ef;
  border: 1px solid #f5efd8;
  border-radius: 7px;
}

.how-cards {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 13px;
  margin: 23px 0 36px;
}

.how-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 15px;
  background: #fffaf09c;
  border: 1px solid #d7cfc1;
  border-radius: 13px;
  min-height: 91px;
}

.how-icon {
  display: grid;
  place-items: center;
  flex: 0 0 49px;
  height: 49px;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  font-size: 24px;
  line-height: 1;
  background: #ffdfa1;
}

.how-push {
  background: #fbd3c9;
}

.how-boat {
  background: #c9e9e3;
}

.how-card h2 {
  margin: 0 0 3px;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.how-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
  line-height: 1.45;
}

.paper-panel {
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
}

.lobby-layout {
  display: grid;
  grid-template-columns: minmax(270px,.92fr) minmax(325px,1.08fr);
  gap: 20px;
  margin-bottom: 32px;
  align-items: start;
}

.room-panel {
  overflow: hidden;
}

.room-illustration {
  height: clamp(120px,17vw,217px);
  background: #153662 url('/island.webp') 50% 54% / cover;
  border-bottom: 2px solid var(--ink);
}

.room-content,.players-panel {
  padding: clamp(18px,3vw,34px);
}

.section-title,.dialog-content h2 {
  font: 400 clamp(28px,5vw,51px)/1.01 var(--display);
  letter-spacing: -.075em;
  margin: 8px 0 16px;
}

.eyebrow,.room-caption,.hud-item>span {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 880;
  letter-spacing: .1em;
  color: var(--muted);
}

.room-caption {
  margin: 14px 0 7px;
}

.room-code {
  display: block;
  font: 400 clamp(30px,6vw,62px)/1 var(--display);
  letter-spacing: .1em;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.inline-note {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
  min-height: 1.5em;
}

#practice-caption {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-top h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.055em;
}

.number-chip {
  padding: 5px 8px;
  background: #ffebbc;
  border: 1px solid #edd39a;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.roster,.score-list {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.roster {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 7px;
}

.player-entry,.score-entry {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #f1ebdf;
  min-height: 42px;
  font-size: 13px;
  font-weight: 750;
}

.player-entry>strong,.score-entry>strong {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.player-entry small,.score-entry small {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.player-entry.is-self,.score-entry.is-self {
  background: #ffebbc;
}

.avatar-dot {
  width: 15px;
  height: 15px;
  flex: none;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  background: var(--player-color,#b9b6ac);
}

.avatar-dot.avatar-offline {
  opacity: .4;
}

.players-panel #start-game {
  margin-right: 11px;
}

.back-link {
  color: var(--muted);
  font-size: 12px;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #7d411a;
  font-size: 12px;
  font-weight: 750;
}

.connection>span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ea832b;
}

.game-layout {
  display: grid;
  --score-width: 215px;
  --arena-space: 170px;
  grid-template-columns: minmax(0,1fr) var(--score-width);
  gap: 16px;
  align-items: start;
  width: min(100%, calc((100svh - var(--arena-space)) * 19 / 15 + var(--score-width) + 16px));
  margin: 0 auto 28px;
}

.game-main {
  min-width: 0;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.hud-item {
  padding: 9px 12px;
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.hud-item>strong {
  font: 400 clamp(17px,2.45vw,26px)/1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
}

#timer.timer-low,.carry-number {
  color: #b53d28;
}

.arena {
  position: relative;
  isolation: isolate;
  border: 2px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  background: #1e6f9c;
  box-shadow: 3px 3px 0 var(--ink);
}

#board {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 19/15;
}

.event-banner {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 15px);
  pointer-events: none;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: #fff1ca;
  color: var(--ink);
  padding: 6px 10px;
  box-shadow: 2px 2px 0 #172638ba;
}

.event-symbol {
  font-size: 22px;
  line-height: 1;
}

.event-banner strong,.event-banner div>span {
  display: block;
}

.event-banner strong {
  font-size: 13px;
}

.event-banner div>span {
  font-size: 11px;
  margin-top: 1px;
}

.game-notice {
  pointer-events: none;
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: #172638ec;
  border: 1px solid #fff0c7;
  color: #fffaf0;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.keyboard-tip,.touch-tip {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.game-footer .keyboard-tip {
  margin: 0;
}

.game-footer .back-link {
  white-space: nowrap;
}

kbd {
  background: #fffaf0;
  border: 1px solid #c9c0ad;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 4px;
  font: inherit;
  color: var(--ink);
  white-space: nowrap;
  margin-right: 2px;
}

.score-panel {
  padding: 13px 11px 5px;
}

.score-gold {
  font-size: 19px;
}

.score-list {
  display: grid;
  gap: 5px;
}

.score-entry {
  gap: 6px;
  min-height: 36px;
  padding: 5px 7px;
}

.score-entry .score-rank {
  width: 15px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  flex: none;
}

.score-entry .score-value {
  margin-left: auto;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.side-note {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
  padding: 12px 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.side-note strong {
  color: var(--ink);
}

.touch-controls,.touch-tip {
  display: none;
}

.results-wrap {
  margin: 8px auto 35px;
  padding: clamp(18px,4vw,39px);
  width: min(100%,535px);
  text-align: center;
}

.result-trophy {
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  width: 63px;
  height: 63px;
  margin: 0 auto 17px;
  background: var(--gold);
  border-radius: 17px;
  font-size: 36px;
  transform: rotate(-7deg);
}

.result-header p {
  font-weight: 680;
  color: var(--muted);
}

.result-scores {
  margin: 20px auto;
  max-width: 360px;
  text-align: left;
}

.result-scores .score-entry {
  min-height: 40px;
  padding-inline: 10px;
}

.result-actions,.dialog-actions {
  display: flex;
  gap: 9px;
  justify-content: center;
  flex-wrap: wrap;
}

.site-message {
  margin: 24px 0;
  padding: 12px 14px;
  background: #fcdcd4;
  border: 1px solid #a94332;
  border-radius: 8px;
  color: #812e22;
  font-weight: 700;
}

dialog {
  padding: 0;
  width: min(440px,calc(100% - 30px));
  max-height: calc(100% - 22px);
  border: 2px solid var(--ink);
  border-radius: 17px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}

dialog::backdrop {
  background: #0b1b36a8;
}

.dialog-content {
  padding: 25px;
  position: relative;
}

.dialog-content h2 {
  font-size: 32px;
  margin: 6px 34px 10px 0;
}

.dialog-content>p,.help-list {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 35px;
  height: 35px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.dialog-close:hover {
  background: #ece6da;
}

.sound-controls {
  display: grid;
  gap: 13px;
  margin: 19px 0 22px;
}

.sound-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 45px;
  align-items: center;
  column-gap: 10px;
}

.sound-control label {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 800;
}

.sound-control input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  accent-color: var(--orange);
  cursor: pointer;
}

.sound-control output {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

#room-form {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

#room-form label {
  display: block;
  margin: 0 0 1px;
  font-size: 13px;
  font-weight: 850;
}

#room-form input {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #fffcf6;
  padding: 9px;
  color: var(--ink);
}

#room-form .button {
  margin-top: 6px;
}

#code-field {
  margin-top: 7px;
}

#code-field label {
  margin-bottom: 6px;
}

#room-input {
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 800;
}

.form-message {
  margin: 4px 0 0;
  font-size: 13px;
  color: #a23523;
  font-weight: 750;
}

.help-list {
  padding-left: 20px;
}

.help-list li+li {
  margin-top: 7px;
}

.dialog-actions {
  justify-content: flex-start;
  margin-top: 15px;
}

@media (max-width:1020px) {

  .wrap {
    width: calc(100% - 62px);
  }

  .hero-copy {
    padding: 29px 24px;
  }

  .hero h1 {
    font-size: clamp(66px,9.15vw,98px);
  }

  .hero-art {
    min-height: 428px;
  }

  .hero-actions .button {
    padding-inline: 10px;
    gap: 5px;
    font-size: 13px;
  }

  .game-layout {
    --score-width: 167px;
  }

  .hud-item>span {
    font-size: 10px;
  }
}

@media (max-width:760px) {

  .wrap {
    width: calc(100% - 34px);
  }

  .masthead {
    min-height: 65px;
  }

  .hero {
    grid-template-columns: 1fr;
    border-radius: 17px;
    box-shadow: 3px 4px 0 var(--ink);
  }

  .hero-copy {
    padding: 22px 21px 17px;
  }

  .hero h1 {
    font-size: clamp(49px,11.8vw,84px);
    line-height: .87;
    letter-spacing: -.093em;
    margin-bottom: 11px;
  }

  .hero h1>span {
    display: inline;
  }

  .hero h1>span:nth-child(2) {
    margin-top: 0;
  }

  .hero-copy>p {
    font-size: 16px;
    margin-bottom: 13px;
    max-width: 335px;
  }

  .hero-art {
    border-left: 0;
    border-top: 2px solid var(--ink);
    min-height: 0;
    aspect-ratio: 1.62;
  }

  .hero-actions .button {
    min-height: 43px;
  }

  .practice-link {
    margin-top: 8px;
  }

  .art-meta {
    right: 7px;
    bottom: 7px;
    gap: 4px;
  }

  .art-meta span {
    min-height: 24px;
    font-size: 9px;
    padding: 0 5px;
  }

  .how-cards {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 15px;
  }

  .how-card {
    min-height: 60px;
    gap: 10px;
    padding: 7px 10px;
  }

  .how-icon {
    flex-basis: 36px;
    height: 36px;
    font-size: 19px;
    border-radius: 8px;
  }

  .how-card h2 {
    font-size: 14px;
  }

  .lobby-layout {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .room-illustration {
    height: 100px;
  }

  .game-layout {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 12px;
  }

  .game-side {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .side-note {
    display: none;
  }

  .score-panel {
    padding: 9px 10px 0;
  }

  .game-side .score-list {
    grid-template-columns: repeat(2,minmax(0,1fr));
    margin: 8px 0;
  }

  .panel-top h2 {
    font-size: 17px;
  }

  .masthead-actions {
    gap: 8px;
  }

  .connection {
    font-size: 0;
  }

  .hud-item {
    padding: 7px 5px;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
  }

  .hud-item>span {
    font-size: 8px;
    letter-spacing: .03em;
  }

  .game-hud {
    gap: 5px;
    margin-bottom: 6px;
  }

  .game-footer {
    margin-top: 6px;
  }

  .game-footer .keyboard-tip {
    font-size: 10px;
  }

  .event-banner div>span {
    font-size: 10px;
  }
}

@media (max-width:370px) {

  .wrap {
    width: calc(100% - 24px);
  }

  .hero-copy {
    padding-inline: 15px;
  }

  .roster {
    grid-template-columns: 1fr;
  }

  .masthead .button-small {
    font-size: 11px;
    padding-inline: 7px;
    white-space: nowrap;
  }

  .masthead .button-small span {
    display: none;
  }

  .game-footer .keyboard-tip {
    font-size: 9px;
  }
}

@media (pointer: coarse), (max-width: 580px) {
  .game-layout {
    --arena-space: 245px;
  }

  .game-footer .keyboard-tip,#help-dialog .keyboard-tip {
    display: none;
  }

  .game-footer {
    justify-content: flex-end;
  }

  .touch-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 10px 4px;
  }

  .touch-tip {
    display: block;
  }

  .move-stick {
    position: relative;
    flex: none;
    width: 116px;
    aspect-ratio: 1;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: #e9e3d6;
    box-shadow: 2px 3px 0 var(--ink), inset 0 0 0 5px var(--cream);
    color: var(--ink);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    cursor: grab;
  }

  .move-stick.is-held {
    background: #ffedbb;
    cursor: grabbing;
  }

  .stick-arrows {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 1px solid #b3a994;
    background: linear-gradient(#b3a994, #b3a994) center / 1px 100% no-repeat,
      linear-gradient(#b3a994, #b3a994) center / 100% 1px no-repeat;
    pointer-events: none;
  }

  .stick-thumb {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 39%;
    aspect-ratio: 1;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 1px 3px 0 var(--ink), inset 0 0 0 3px #ffeb9b;
    transform: translate(-50%, -50%) translate(var(--stick-x, 0px), var(--stick-y, 0px));
    pointer-events: none;
    z-index: 1;
  }

  .stick-label {
    position: absolute;
    bottom: 9%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 4px;
    border-radius: 3px;
    background: #e9e3d6;
    font-size: 10px;
    font-weight: 850;
    pointer-events: none;
  }

  .touch-shove {
    min-height: 60px;
    min-width: 99px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  .touch-shove.is-cooling {
    opacity: .55;
  }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  body:has(#playing:not([hidden])) .masthead {
    min-height: 49px;
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .game-main {
    --landscape-board-width: max(155px, calc((100svh - 122px) * 19 / 15));
    display: grid;
    grid-template-columns: minmax(74px, 1fr) minmax(0, var(--landscape-board-width)) minmax(74px, 1fr);
    column-gap: clamp(6px, 2vw, 15px);
  }

  .game-hud, .arena, .game-footer {
    grid-column: 2;
  }

  .game-hud {
    grid-row: 1;
  }

  .arena {
    grid-row: 2;
  }

  .game-footer {
    grid-row: 3;
  }

  .touch-controls {
    display: contents;
  }

  .move-stick, .touch-shove {
    grid-row: 2;
    place-self: end center;
    margin-bottom: 9px;
  }

  .move-stick {
    grid-column: 1;
    width: clamp(76px, 14vw, 116px);
  }

  .touch-shove {
    grid-column: 3;
    min-width: 74px;
    padding-inline: 9px;
  }
}

@media (prefers-reduced-motion:reduce) {

  .button {
    transition: none;
  }
}
