:root {
  --cat: #f4a261;
  --cat-hot: #e76f51;
  --dog: #4cc9f0;
  --dog-deep: #4895ef;
  --ink: #fff8ef;
  --muted: #c9b8a4;
  --panel: rgba(12, 10, 16, 0.72);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  background: #140f12;
}

body {
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.war-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(90deg, #3b1d12 0%, #140f12 46%, #140f12 54%, #10233d 100%);
  z-index: 0;
}

.top,
.tug,
.lead,
.arena,
.combo,
.hint,
.board {
  position: relative;
  z-index: 1;
}

.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "mark end"
    "title title";
  align-items: center;
  padding: 0.9rem 1.2rem 0.55rem;
  gap: 0.45rem 0.5rem;
}

.mark {
  grid-area: mark;
  justify-self: start;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  min-width: 6.2rem;
  text-align: center;
  border: 1px solid #5a4636;
  padding: 0.35rem 0.6rem;
  display: inline-block;
}

.top h1 {
  grid-area: title;
  font-family: Syne, sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: clamp(0.92rem, 4.2vw, 1.8rem);
  text-align: center;
  white-space: nowrap;
  line-height: 1;
}

.top h1 span {
  color: #ffd166;
  margin: 0 0.2rem;
}

.sound {
  grid-area: end;
  justify-self: end;
  appearance: none;
  border: 1px solid #5a4636;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  min-width: 6.2rem;
  text-align: center;
}

.tug {
  height: 10px;
  margin: 0 1.2rem;
  background: var(--dog-deep);
  overflow: hidden;
  border-radius: 99px;
}

.tug-cats {
  height: 100%;
  width: 50%;
  background: var(--cat-hot);
  transition: width 180ms ease-out;
}

.lead {
  text-align: center;
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.arena {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 10rem);
  align-items: center;
}

.side {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.score {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(1.45rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  max-width: 46vw;
}

.cats .score {
  color: var(--cat);
  text-shadow: 0 0 28px rgba(231, 111, 81, 0.35);
}

.dogs .score {
  color: var(--dog);
  text-shadow: 0 0 28px rgba(76, 201, 240, 0.3);
}

.pet {
  appearance: none;
  border: 0;
  background: transparent;
  width: min(42vw, 300px);
  cursor: pointer;
  touch-action: manipulation;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.4));
}

.pet svg,
.pet.pixel .frame {
  width: 100%;
  display: block;
}

.pet.pixel {
  position: relative;
  filter: none;
}

.pet.pixel .frame {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pet.pixel .frame.open {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.pet.pixel.open .frame.open {
  opacity: 1;
}

.pet.pixel.open .frame.closed {
  opacity: 0;
}

.mouth.open {
  opacity: 0;
}

.pet.open .mouth.closed {
  opacity: 0;
}

.pet.open .mouth.open {
  opacity: 1;
}

.pet.open .eye.left {
  transform: translate(-3px, -5px);
}

.pet.open .eye.right {
  transform: translate(3px, -5px);
}

.pet.pop {
  animation: pop 90ms ease-out;
}

@keyframes pop {
  50% {
    transform: scale(0.9) rotate(-2deg);
  }
}

.pet.pixel.barking {
  animation: bark-lunge 280ms ease-out;
  z-index: 2;
}

.pet.pixel.hissing {
  animation: hiss-lunge 280ms ease-out;
  z-index: 2;
}

@keyframes bark-lunge {
  0% {
    transform: none;
  }
  30% {
    transform: translateX(-22%) rotate(-10deg) scale(1.08);
  }
  100% {
    transform: none;
  }
}

.pet.spooked {
  animation: cat-spook 340ms ease-out;
}

@keyframes cat-spook {
  0% {
    transform: none;
  }
  30% {
    transform: translateX(-12%) rotate(-10deg) scale(0.78);
  }
  60% {
    transform: translateX(6%) rotate(5deg) scale(0.84);
  }
  100% {
    transform: none;
  }
}

@keyframes hiss-lunge {
  0% {
    transform: none;
  }
  30% {
    transform: translateX(22%) rotate(10deg) scale(1.08);
  }
  100% {
    transform: none;
  }
}

.pet.spooked.from-right {
  animation: dog-spook 340ms ease-out;
}

@keyframes dog-spook {
  0% {
    transform: none;
  }
  30% {
    transform: translateX(12%) rotate(10deg) scale(0.78);
  }
  60% {
    transform: translateX(-6%) rotate(-5deg) scale(0.84);
  }
  100% {
    transform: none;
  }
}

.bark-bubble.hiss {
  color: #ffb085;
  transform-origin: left center;
}

@keyframes bark-fly {
  0% {
    transform: translate(0, 0) scale(0.55) rotate(-6deg);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(1.25) rotate(-20deg);
    opacity: 0;
  }
}

body[data-team="cats"] .cats .pet,
body[data-team="dogs"] .dogs .pet {
  outline: 2px solid rgba(255, 209, 102, 0.7);
  outline-offset: 8px;
  border-radius: 12px;
}

.side-label {
  margin-top: 0.35rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}

.you-line {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.you-line strong {
  color: var(--ink);
}

.combo {
  position: fixed;
  left: 50%;
  bottom: 8.6rem;
  transform: translateX(-50%);
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: #ffd166;
}

.hint {
  position: fixed;
  left: 50%;
  bottom: 6.7rem;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  width: min(90vw, 40rem);
}

.lb {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 8;
  transform: translateX(-50%);
  width: min(560px, 100%);
  font-family: system-ui, "Segoe UI", sans-serif;
  color: #222;
}

.lb-dock,
.lb-sheet {
  background: #fff;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
}

.ad-slot {
  position: relative;
  background: #fff;
  padding: 0.45rem 0.75rem 0.5rem;
}

.ad-label {
  position: absolute;
  top: 0.45rem;
  left: 1.15rem;
  transform: translateY(-50%);
  background: #fff;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  color: #8a8a8a;
  z-index: 1;
}

.ad-frame {
  width: 100%;
  min-height: 45px;
  height: 50px;
  border: 1px solid #d8d8d8;
  display: block;
  background: #fff;
}

.lb-dock {
  appearance: none;
  border: 0;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.95rem 0.85rem;
  border-radius: 14px 14px 0 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.lb-trophy {
  font-size: 1.15rem;
}

.lb-dock-lead,
.lb-dock-you {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.lb-dock-you {
  justify-content: flex-end;
}

.lb-dots {
  color: #bbb;
  letter-spacing: 0.15em;
}

.lb-caret,
.lb-close {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid #666;
  background: transparent;
  justify-self: end;
}

.lb-close {
  appearance: none;
  border-top: 8px solid #666;
  border-bottom: 0;
  cursor: pointer;
  padding: 0;
}

.lb-sheet {
  display: flex;
  flex-direction: column;
  max-height: min(58vh, 520px);
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

.lb-sheet[hidden] {
  display: none;
}

.lb-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ececec;
}

.lb-head h2 {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
}

.lb-world,
.lb-list li {
  display: grid;
  grid-template-columns: 1.8rem 1.4rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.lb-name {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.lb-name em {
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-split {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: #4cc9f0;
  overflow: hidden;
}

.lb-split i {
  display: block;
  height: 100%;
  background: #e76f51;
}

.lb-side {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 4.6rem;
  text-align: right;
}

.lb-side.cats {
  color: #e76f51;
}

.lb-side.dogs {
  color: #1d6fa5;
}

.lb-side.tie {
  color: #888;
}

.lb-world {
  font-weight: 650;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
}

.lb-list li.you {
  background: #fff8e8;
}

.flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.flag-fallback {
  font-size: 0.95rem;
}

.lb-pps {
  color: #1bbf4a;
  font-weight: 700;
  font-size: 0.82rem;
  min-width: 4.8rem;
  text-align: right;
}

.lb-score {
  font-weight: 700;
  text-align: right;
  min-width: 5.5rem;
}

.lb-medal {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
}

.lb-medal.gold {
  background: #e0b422;
}

.lb-medal.silver {
  background: #9aa3ad;
}

.lb-medal.bronze {
  background: #c47a3a;
}

.lb-rank {
  color: #888;
  font-size: 0.85rem;
  text-align: center;
}

body.lb-open .lb-dock {
  display: none;
}

@media (max-width: 820px) {
  body:not(.war):not(.hub) {
    overflow: auto;
  }

  body:not(.war) .arena {
    min-height: auto;
    padding-bottom: 1rem;
  }

  body:not(.war) .hint,
  body:not(.war) .combo {
    position: static;
    transform: none;
    display: block;
    margin: 0.4rem auto;
  }
}

body.war {
  overflow: hidden;
}

.war-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.war-frame {
  width: 1280px;
  height: 800px;
  transform-origin: top left;
  position: relative;
}

body.war .top h1 {
  font-size: 1.8rem;
}

body.war .war-frame {
  display: flex;
  flex-direction: column;
}

body.war .top,
body.war .tug,
body.war .lead {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

body.war .arena {
  flex: 1;
  min-height: 0;
  height: auto;
  place-items: center;
  overflow: hidden;
}

body.war .side {
  width: 100%;
  justify-content: center;
}

body.war .score {
  font-size: 4rem;
  max-width: none;
}

body.war .pet {
  width: 300px;
}

body.war .combo,
body.war .hint,
body.war .lb {
  position: absolute;
}

body.war .hint {
  width: 40rem;
}

body.war .lb {
  width: 560px;
}

body.hub {
  overflow-x: hidden;
  overflow-y: auto;
  user-select: text;
  -webkit-user-select: text;
}

.hub-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
}

.hub-frame {
  width: 1000px;
  transform-origin: top left;
}

.hub-top,
.hub-grid {
  position: relative;
  z-index: 1;
}

.hub-top {
  text-align: center;
  padding: 2.4rem 1.2rem 1.4rem;
}

.hub-kicker {
  color: #ffd166;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hub-top h1 {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 3.85rem;
  letter-spacing: -0.03em;
  line-height: 0.92;
  margin: 0.45rem 0 0.7rem;
}

.hub-line {
  display: block;
}

.hub-line:last-child {
  white-space: nowrap;
}

.hub-tag {
  color: var(--muted);
  font-size: 1rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: 980px;
  margin: 0 auto 3rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.15rem 1.15rem 1.2rem;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  min-height: 240px;
}

.game-card.live {
  background: linear-gradient(135deg, #3b1d12 0%, #1a1018 50%, #10233d 100%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 209, 102, 0.35);
}

.game-card.live:hover {
  border-color: #ffd166;
  transform: translateY(-3px);
}

.game-card.soon {
  background: rgba(20, 14, 18, 0.72);
  border: 1px dashed #5a4636;
  color: var(--muted);
}

.game-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.game-art img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  image-rendering: pixelated;
}

.game-art span {
  font-family: Syne, sans-serif;
  font-weight: 800;
  color: #ffd166;
}

.game-card h2 {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
}

.game-card p {
  font-size: 0.85rem;
  line-height: 1.4;
  flex: 1;
}

.play {
  align-self: flex-start;
  background: #ffd166;
  color: #2a1208;
  font-family: Syne, sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.soon-blob {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 0.4rem;
}

.soon-blob.yellow {
  background: #ffd166;
  opacity: 0.55;
}

.soon-blob.pink {
  background: #e76f51;
  opacity: 0.55;
}

.game-card.wall-card {
  background: linear-gradient(135deg, #10233d 0%, #1a1018 55%, #3b1d12 100%);
}

.wall-preview {
  height: 88px;
  border-radius: 8px;
  image-rendering: pixelated;
  background:
    linear-gradient(#e76f51 0 25%, #ffd166 25% 50%, #4cc9f0 50% 75%, #9b5de5 75% 100%),
    linear-gradient(90deg, #111 0 25%, #fff8ef 25% 50%, #2d6a4f 50% 75%, #f15bb5 75% 100%);
  background-size: 22px 22px, 22px 22px;
  background-blend-mode: multiply;
}

body.wall-page {
  overflow: auto;
  user-select: none;
  padding-bottom: 11.5rem;
}

.wall-note {
  grid-area: end;
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
}

.wall-lead {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.15rem 1rem 0.2rem;
}

.wall-price {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--ink);
  font-size: 0.85rem;
  margin: 0 1rem 0.45rem;
}

.page-fine,
.page-fine,
.rent-rules {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  max-width: 36rem;
  margin: 0.4rem auto 2rem;
  padding: 0 1rem;
}

.wall-hint {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin: -0.35rem auto 0.85rem;
}

.wall-wrap {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 1.4rem));
  margin: 0 auto;
  aspect-ratio: 5 / 4;
  max-height: min(68vh, 920px);
}

#wall {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  background: #ffffff;
  border: 2px solid #111111;
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
}

.zoom-bar {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  display: flex;
  gap: 0.28rem;
}

.zoom-bar button {
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.45rem;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  font: 700 0.95rem "IBM Plex Mono", monospace;
  cursor: pointer;
}

.palette {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  margin: 0;
  flex: 1;
}

.swatch {
  width: 28px;
  height: 28px;
  border: 2px solid #111;
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  padding: 0;
}

.swatch.on {
  border-color: #ffd166;
  transform: scale(1.12);
}

.wall-dock .swatch.pale {
  box-shadow: inset 0 0 0 1px #c8c8c8;
}

#wall-sv {
  border: 1px solid #111;
  background: #fff;
}

.wall-dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 8;
  transform: translateX(-50%);
  width: min(640px, 100%);
  background: #fff;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
  color: #222;
}

.palette-row {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem 0.45rem;
}

.wall-wheel {
  flex-shrink: 0;
}

.wall-wheel .color-label {
  color: #222;
}

.wall-dock #wall-hex {
  font-weight: 700;
  font-size: 0.78rem;
  color: #222;
}

.wall-dock .color-pop {
  top: auto;
  bottom: calc(100% + 0.4rem);
}

.wall-dock .ad-slot {
  margin: 0;
  border: 0;
  width: 100%;
}

.wall-dock .color-swatch {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid #111;
  border-radius: 0;
}

.wall-ad {
  z-index: 1;
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid #d8d8d8;
}

.game-card.adwall-card {
  background: linear-gradient(135deg, #1a1018 0%, #10233d 48%, #3b1d12 100%);
}

.adwall-preview {
  height: 88px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(#111 0 1px, transparent 1px 12px),
    repeating-linear-gradient(90deg, #111 0 1px, transparent 1px 12px),
    #fff8ef;
  border: 2px solid #111;
}

body.adwall-page {
  overflow: auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.adwall-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.4rem 0 1.2rem;
}

.adwall-stage .wall-lead {
  margin: 0 1rem 0.2rem;
  max-width: 36rem;
  text-align: center;
}

.adwall-stats {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--ink);
  font-size: 0.9rem;
  margin: 0 0 0.9rem;
}

.billboard {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 2px;
  width: min(640px, calc(100% - 1.4rem));
  margin: 0 auto;
  padding: 2px;
  background: #111;
  border: 2px solid #111;
  aspect-ratio: 1;
  overflow: visible;
  touch-action: none;
  user-select: none;
}

.billboard button {
  position: relative;
  appearance: none;
  border: 0;
  background: #fff;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  font: 700 0.45rem "IBM Plex Mono", monospace;
  color: #111;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.billboard button img.tile {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.billboard button.taken {
  color: #fff8ef;
  cursor: default;
}

.billboard button.taken:hover {
  outline: none;
  transform: none;
}

.billboard button.selected,
.billboard button.selected:hover {
  outline: 3px solid #ffd166;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 2px #111;
  z-index: 2;
  transform: scale(1.12);
}

.billboard button.blocked,
.billboard button.blocked:hover {
  outline: 3px solid #e76f51;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 2px #111;
  z-index: 2;
  cursor: not-allowed;
}

.billboard button:hover {
  outline: 2px solid #111;
  outline-offset: -2px;
  z-index: 1;
}

.billboard button.logo {
  color: transparent !important;
}

.logo-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 2px solid #111;
  background: #fff;
}

.rent-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 6, 10, 0.72);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.rent-overlay[hidden] {
  display: none;
}

.rent-sheet {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  margin: 0;
  padding: 1rem;
  background: #fff8ef;
  color: #140f12;
  border: 2px solid #111;
  display: grid;
  gap: 0.55rem;
}

.rent-cell {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
}

.info-line {
  font-size: 0.85rem;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.info-title {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: default;
}

.info-title.clickable {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.info-zoom {
  width: min(72vw, 360px);
  height: min(72vw, 360px);
  object-fit: contain;
  image-rendering: auto;
  border: 2px solid #111;
  background: #fff;
  justify-self: center;
}

.info-zoom.clickable {
  cursor: pointer;
}

.info-zoom-color {
  padding: 0;
}

.rent-sheet label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
}

.rent-sheet input {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 2px solid #111;
  background: #fff;
}

.color-pick {
  position: relative;
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
}

.color-label {
  display: block;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.color-swatch {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid #111;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
}

.color-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 5;
  display: grid;
  gap: 0.4rem;
  padding: 0.5rem;
  background: #fff;
  border: 2px solid #111;
  width: 236px;
}

.color-pop[hidden] {
  display: none;
}

#color-sv {
  width: 220px;
  height: 140px;
  display: block;
  cursor: crosshair;
  border: 1px solid #111;
}

.hue-slider {
  width: 100%;
  height: 14px;
  margin: 0.15rem 0 0;
  appearance: none;
  border: 1px solid #111;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    #ff0000,
    #ffff00,
    #00ff00,
    #00ffff,
    #0000ff,
    #ff00ff,
    #ff0000
  );
}

.hue-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #111;
  background: var(--thumb, #ff0000);
  box-shadow: 0 0 0 1px #fff;
  cursor: pointer;
}

.hue-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #111;
  background: var(--thumb, #ff0000);
  box-shadow: 0 0 0 1px #fff;
  cursor: pointer;
}

.hue-slider::-moz-range-track {
  background: transparent;
  border: 0;
}

#color-hex {
  font-weight: 700;
}

.rent-row {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.rent-row button {
  appearance: none;
  border: 2px solid #111;
  background: #fff;
  font: 700 0.82rem "IBM Plex Mono", monospace;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.rent-go {
  background: #ffd166 !important;
}

.rent-err {
  color: #7b2c3b;
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .hub-shell {
    overflow: visible;
    height: auto !important;
  }

  .hub-frame {
    width: 100%;
    transform: none !important;
  }

  .hub-top {
    padding: 1.4rem 1rem 1rem;
  }

  .hub-top h1 {
    font-size: clamp(1.5rem, 7.6vw, 2.8rem);
    letter-spacing: -0.045em;
    padding: 0 0.15rem;
  }

  .hub-line:last-child {
    white-space: nowrap;
    display: block;
    max-width: 100%;
  }

  .hub-grid {
    width: auto;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 0 1rem 2.2rem;
  }

  .game-card {
    min-height: 0;
    padding: 1rem 1rem 1.05rem;
  }

  .game-art img {
    width: 110px;
    height: 110px;
  }

  .play {
    min-height: 2.6rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.95rem;
  }

  .war-shell {
    height: 100svh !important;
    overflow: hidden;
  }

  .war-frame {
    width: 100%;
    height: 100svh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    transform: none !important;
  }

  body.war .arena {
    flex: 1;
    height: auto;
    min-height: 0;
    overflow: hidden;
    padding: 0.35rem 0.4rem 4.4rem;
    place-items: center;
  }

  body.war .score {
    font-size: clamp(1.55rem, 8vw, 2.35rem);
  }

  body.war .pet {
    width: min(42vw, 26svh);
  }

  body.war .top,
  body.wall-page .top,
  body.adwall-page .top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "mark end"
      "title title";
    padding: max(0.7rem, env(safe-area-inset-top, 0px)) 0.85rem 0.4rem;
    gap: 0.45rem 0.5rem;
  }

  body.war .top .mark,
  body.wall-page .top .mark,
  body.adwall-page .top .mark {
    grid-area: mark;
  }

  body.war .top .sound,
  body.wall-page .top .wall-note,
  body.adwall-page .top .wall-note {
    grid-area: end;
  }

  body.war .top h1,
  body.wall-page .top h1,
  body.adwall-page .top h1 {
    grid-area: title;
    font-size: clamp(1.05rem, 6.2vw, 1.55rem);
  }

  body.war .combo,
  body.war .hint {
    position: fixed;
    left: 0.9rem;
    right: 0.9rem;
    width: auto;
    transform: none;
    text-align: center;
  }

  body.war .hint {
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
  }

  body.war .combo {
    bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px));
  }

  body.war .lb {
    position: fixed;
    left: 0;
    width: 100%;
    transform: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  body.wall-page {
    min-height: 100svh;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
  }

  .wall-wrap {
    width: calc(100% - 0.8rem);
    max-height: none;
    flex: 1 1 auto;
    aspect-ratio: auto;
    min-height: 0;
    margin-bottom: 0.45rem;
  }

  .zoom-bar button {
    min-width: 2.75rem;
    height: 2.75rem;
  }

  .swatch {
    width: 34px;
    height: 34px;
  }

  .wall-dock {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .palette-row {
    flex-wrap: wrap;
    align-items: center;
  }

  .palette {
    flex: 1 1 100%;
  }

  .billboard {
    width: calc(100% - 0.9rem);
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .hub-shell {
    overflow: visible;
    height: auto !important;
  }

  .hub-frame {
    width: 100%;
    transform: none !important;
  }

  .hub-top {
    padding: 0.5rem 1rem 0.4rem;
  }

  .hub-top h1 {
    font-size: clamp(1.05rem, 5.2vw, 1.7rem);
    line-height: 1;
    margin: 0.2rem 0 0.3rem;
  }

  .hub-line {
    display: block;
  }

  .hub-line:last-child {
    white-space: nowrap;
  }

  .hub-line + .hub-line::before {
    content: " ";
  }

  .hub-tag {
    font-size: 0.78rem;
  }

  .hub-grid {
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 0 0.85rem 1.1rem;
  }

  .game-card {
    min-height: 0;
    padding: 0.75rem 0.85rem 0.8rem;
  }

  .game-art img {
    width: 64px;
    height: 64px;
  }
}
