.bop-match-page {
  width: min(100%, 26rem);
  margin: 0 auto;
  padding: 0.85rem 1rem calc(7.5rem + env(safe-area-inset-bottom, 0px));
}
.bop-match-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bop-match-scene video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bop-match-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(18, 16, 14, 0.12), rgba(18, 16, 14, 0.58) 74%);
}
.bop-match-page > :not(.bop-match-scene) { position: relative; z-index: 1; }
.bop-match-title,
.bop-match-page h1 {
  margin: 0 0 0.65rem;
  font: 800 1.45rem/1 var(--display, Archivo, sans-serif);
  letter-spacing: 0.04em;
}
.bop-match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
}
.bop-match-top h1,
.bop-match-top .bop-match-title { margin: 0; min-width: 0; }
.bop-match-top .bop-match-rooms { margin: 0; }
.bop-handset-screen .bop-match-status {
  margin: 0 0 0.25rem;
  color: #6e5829;
  font: 700 0.68rem/1.25 var(--display, Archivo, sans-serif);
}
body:has([data-bop-match]) .studio-dock__hint {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.bop-handset {
  --fx: #c5a45d;
  background: linear-gradient(180deg, #32343a 0%, #141518 42%, #0e0f12 100%);
  border: 1px solid rgba(197, 164, 93, 0.5);
  border-radius: 28px;
  padding: 0.75rem 0.75rem 0.85rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.bop-handset-speaker {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 0.55rem;
}
.bop-handset-speaker span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2a2418;
  box-shadow: inset 0 0 0 1px rgba(197, 164, 93, 0.35);
}
.bop-handset-screen {
  position: relative;
  background:
    radial-gradient(circle at 16% 0%, rgba(240, 160, 32, 0.22), transparent 42%),
    radial-gradient(circle at 92% 100%, rgba(224, 107, 138, 0.18), transparent 46%),
    radial-gradient(circle at 70% 8%, rgba(62, 180, 228, 0.16), transparent 40%),
    #f4ecdc;
  border-radius: 14px;
  padding: 0.45rem;
  box-shadow: inset 0 0 0 2px rgba(197, 164, 93, 0.55);
  overflow: hidden;
}
.bop-handset-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, var(--fx), transparent 68%);
  opacity: 0;
}
.bop-match-hud {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  min-height: 1.1rem;
  margin-bottom: 0.3rem;
  color: #6e5829;
  font: 700 0.68rem/1 var(--display, Archivo, sans-serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bop-match-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 7), minmax(0, 1fr));
  gap: 4px;
  aspect-ratio: var(--cols, 6) / var(--rows, 7);
  touch-action: none;
}
.bop-tile {
  --tile: #f3d7a2;
  --tile-hi: #fff6e4;
  --tile-lip: #c4924e;
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  border-radius: 4px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.55), transparent 34%),
    linear-gradient(180deg, var(--tile-hi) 0%, var(--tile) 46%, var(--tile-lip) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -3px 0 var(--tile-lip), 0 3px 0 rgba(42, 32, 22, 0.28);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  cursor: pointer;
}
.bop-tile[data-kind="shades"] { --tile: #2fafa6; --tile-hi: #8ee0d8; --tile-lip: #1d756f; }
.bop-tile[data-kind="popcorn"] { --tile: #f0a020; --tile-hi: #ffd36a; --tile-lip: #b56d10; }
.bop-tile[data-kind="book"] { --tile: #e06b8a; --tile-hi: #f7b3c4; --tile-lip: #a84464; }
.bop-tile[data-kind="phone"] { --tile: #6d93e8; --tile-hi: #b9cffc; --tile-lip: #3e64b8; }
.bop-tile[data-kind="umbrella"] { --tile: #3eb4e4; --tile-hi: #9ad9f4; --tile-lip: #1f7eaa; }
.bop-tile[data-kind="newspaper"] { --tile: #e2b34a; --tile-hi: #f6d98a; --tile-lip: #a67a22; }
.bop-tile.is-cursor { box-shadow: inset 0 0 0 2px #31578c, inset 0 -3px 0 var(--tile-lip), 0 3px 0 rgba(42, 32, 22, 0.28); }
.bop-tile.is-armed {
  box-shadow: inset 0 0 0 2px #c5a45d, 0 0 0 3px rgba(197, 164, 93, 0.45), inset 0 -3px 0 var(--tile-lip);
  animation: bop-arm 0.8s ease infinite;
}
.bop-tile.is-reject { animation: bop-reject 0.42s ease; z-index: 2; }
.bop-tile.is-clearing { animation: bop-pop 0.26s ease forwards; z-index: 2; }
.bop-tile.is-fresh { animation: bop-fresh 0.24s ease; }
.bop-tile.is-drop { animation: bop-drop 0.22s ease; }
.bop-tile-art {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: 78% !important;
  height: 78% !important;
  filter: drop-shadow(0 2px 1px rgba(48, 36, 22, 0.28)) !important;
  pointer-events: none;
}
.bop-tile .paw-prop-hand,
.bop-tile .paw-prop-bubble { display: none !important; }
.bop-tile .paw-blob-prop,
.bop-tile .paw-blob-prop * { animation: none !important; }
.bop-spark {
  position: absolute;
  z-index: 4;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 1px;
  background: var(--fx, #fff6df);
  box-shadow: 2px 0 0 var(--fx, #fff6df);
  pointer-events: none;
  animation: bop-spark 0.42s steps(4, end) forwards;
}
.bop-spark[data-shape="chain"] { width: 8px; height: 8px; }
.bop-points {
  position: absolute;
  z-index: 6;
  margin: 0;
  transform: translate(-50%, -70%);
  pointer-events: none;
  color: #fff6df;
  font: 800 0.95rem/1 ui-monospace, "Courier New", monospace;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 #191a1c, 0 0 8px var(--fx, #c5a45d);
  animation: bop-points 0.7s steps(5, end) forwards;
}
.bop-combo {
  min-width: 2.2rem;
  padding: 0.12rem 0.28rem;
  border-radius: 2px;
  background: #191a1c;
  color: #f3d7a2;
  font: 800 0.68rem/1 ui-monospace, "Courier New", monospace;
  letter-spacing: 0.08em;
  box-shadow: 2px 2px 0 #c5a45d;
}
.bop-combo.is-on { animation: bop-score 0.42s steps(3, end); }
.bop-match-banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 42%;
  z-index: 5;
  margin: 0;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  color: var(--fx, #6e5829);
  text-shadow: 0 1px 0 #fff6df;
  font: 800 1.15rem/1 var(--display, Archivo, sans-serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bop-match-banner.is-on { animation: bop-banner 0.72s ease; }
.bop-match-hud [data-match-score] {
  display: inline-block;
  min-width: 1.2em;
  text-align: right;
  transform-origin: 100% 60%;
}
.bop-match-hud [data-match-score].is-pop { animation: bop-score 0.45s ease; }
.bop-handset[data-fx="match"] .bop-handset-screen::after,
.bop-handset[data-fx="chain"] .bop-handset-screen::after,
.bop-handset[data-fx="line"] .bop-handset-screen::after,
.bop-handset[data-fx="cross"] .bop-handset-screen::after,
.bop-handset[data-fx="fresh"] .bop-handset-screen::after,
.bop-handset[data-fx="miss"] .bop-handset-screen::after { animation: bop-wash 0.62s ease; }
.bop-handset[data-fx="match"] .bop-handset-screen,
.bop-handset[data-fx="line"] .bop-handset-screen,
.bop-handset[data-fx="fresh"] .bop-handset-screen {
  box-shadow: inset 0 0 0 2px var(--fx), 0 0 18px color-mix(in srgb, var(--fx) 50%, transparent);
}
.bop-handset[data-fx="chain"] .bop-handset-screen,
.bop-handset[data-fx="cross"] .bop-handset-screen {
  animation: bop-shake 0.42s ease;
  box-shadow: inset 0 0 0 2px var(--fx), 0 0 22px color-mix(in srgb, var(--fx) 62%, transparent);
}
.bop-handset[data-fx="miss"] .bop-handset-screen { animation: bop-shake 0.42s ease; }
.bop-handset[data-fx] .bop-handset-speaker span {
  background: var(--fx);
  box-shadow: 0 0 6px var(--fx);
}
.bop-handset-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.35rem 0.1rem;
}
.bop-pad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-areas: ". up ." "left . right" ". down .";
  gap: 4px;
}
.bop-pad [data-pad="up"] { grid-area: up; }
.bop-pad [data-pad="down"] { grid-area: down; }
.bop-pad [data-pad="left"] { grid-area: left; }
.bop-pad [data-pad="right"] { grid-area: right; }
.bop-pad button,
.bop-actions button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 4px;
  border: 1px solid rgba(197, 164, 93, 0.45);
  background: #232427;
  color: #f7f5ed;
  font: 800 0.95rem/1 var(--display, Archivo, sans-serif);
}
.bop-pad button:active,
.bop-actions button:active { transform: translateY(1px) scale(0.96); }
.bop-actions { display: flex; align-items: center; gap: 0.55rem; }
.bop-actions [data-pad="arm"] {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #c5a45d;
  color: #191a1c;
}
.bop-actions [data-pad="new"] {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #8d3d46;
}
.bop-match-note,
.bop-match-status {
  margin: 0.75rem 0 0;
  color: var(--ink-soft, #b9b5a8);
  font-size: 0.92rem;
}
.bop-match-rooms {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.bop-match-rooms a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 164, 93, 0.35);
  text-decoration: none;
  font: 700 0.72rem/1 var(--display, Archivo, sans-serif);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.bop-match-rooms a[aria-current="page"] {
  background: #c5a45d;
  color: #191a1c;
  border-color: #c5a45d;
}
.bop-handset[data-orientation="landscape"] {
  width: min(100%, 46rem);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "speaker speaker" "screen controls";
  column-gap: 0.85rem;
  align-items: center;
}
.bop-handset[data-orientation="landscape"] .bop-handset-speaker { grid-area: speaker; }
.bop-handset[data-orientation="landscape"] .bop-handset-screen { grid-area: screen; }
.bop-handset[data-orientation="landscape"] .bop-handset-controls {
  grid-area: controls;
  flex-direction: column;
  padding-top: 0;
}
.bop-match-page:has([data-orientation="landscape"]) { width: min(100%, 48rem); }

.bop-handset.has-shell {
  width: 100%;
  margin: 0 auto;
  aspect-ratio: 617 / 975;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: url("/games-assets/pocket-portrait.png") center / 100% 100% no-repeat;
  box-shadow: none;
}
.bop-handset.has-shell .bop-handset-speaker { display: none; }
.bop-handset.has-shell .bop-handset-screen {
  position: absolute;
  left: 14%;
  top: 13.5%;
  width: 72%;
  height: 36%;
  display: flex;
  flex-direction: column;
  padding: 0.35rem;
  border-radius: 8px;
  background:
    linear-gradient(rgba(25, 26, 28, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 26, 28, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 16% 0%, rgba(240, 160, 32, 0.22), transparent 42%),
    #f4ecdc;
  background-size: 4px 4px, 4px 4px, auto, auto;
  box-shadow: inset 0 0 0 2px rgba(25, 26, 28, 0.35);
}
.bop-handset.has-shell .bop-match-board {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  aspect-ratio: auto;
}
.bop-handset.has-shell .bop-handset-controls {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 56%;
  bottom: 10%;
  padding: 0;
}
.bop-handset.has-shell[data-orientation="landscape"] {
  width: min(100%, 40rem);
  aspect-ratio: 975 / 625;
  background-image: url("/games-assets/pocket-landscape.png");
  grid-template-columns: none;
}
.bop-handset.has-shell[data-orientation="landscape"] .bop-handset-screen {
  left: 10%;
  top: 20%;
  width: 47%;
  height: 60%;
}
.bop-handset.has-shell[data-orientation="landscape"] .bop-handset-controls {
  left: 60%;
  right: 8%;
  top: 24%;
  bottom: 16%;
  flex-direction: column;
  justify-content: center;
}
html[data-global-blob=true] body:has([data-player-scene="games"]:not([hidden])) .paw-companion-roam-toy {
  bottom: 176px;
}

@keyframes bop-pop {
  30% { transform: scale(1.34) rotate(-8deg); filter: brightness(1.45); }
  100% { transform: scale(0.12) rotate(10deg); opacity: 0; }
}
@keyframes bop-fresh {
  from { transform: translateY(-70%); opacity: 0; }
}
@keyframes bop-drop {
  from { transform: translateY(calc(var(--drop, 1) * -100%)); }
}
@keyframes bop-reject {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-7px) rotate(-6deg); }
  55% { transform: translateX(7px) rotate(6deg); }
  80% { transform: translateX(-3px) rotate(-2deg); }
}
@keyframes bop-banner {
  0% { opacity: 0; transform: translateY(8px) scale(0.92); }
  18%, 75% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-10px); }
}
@keyframes bop-wash {
  0% { opacity: 0; }
  28% { opacity: 0.62; }
  100% { opacity: 0; }
}
@keyframes bop-spark {
  to { transform: translate(var(--dx, 12px), var(--dy, -18px)) scale(0.2); opacity: 0; }
}
@keyframes bop-score {
  40% { transform: scale(1.4); color: var(--fx, #c45b2d); }
}
@keyframes bop-points {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.6); }
  30% { opacity: 1; transform: translate(-50%, -80%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -130%) scale(1); }
}
@keyframes bop-shake {
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes bop-arm {
  50% { transform: translateY(-3px) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .bop-tile,
  .bop-spark,
  .bop-points,
  .bop-combo,
  .bop-match-banner,
  .bop-handset-screen,
  .bop-handset-screen::after,
  .bop-match-hud [data-match-score] { animation: none !important; }
}

@media (max-width: 820px) {
  .bop-match-page {
    padding: 0.35rem 0.7rem calc(5.4rem + env(safe-area-inset-bottom, 0px));
  }
  .bop-match-title,
  .bop-match-page h1 { margin: 0 0 0.3rem; font-size: 1.2rem; }
  .bop-match-top h1,
  .bop-match-top .bop-match-title { margin: 0; }
  .bop-handset { padding: 0.35rem 0.45rem 0.3rem; border-radius: 22px; }
  .bop-handset-speaker { margin-bottom: 0.15rem; }
  .bop-handset-screen { padding: 0.3rem; }
  .bop-match-hud { min-height: 0.9rem; margin-bottom: 0.15rem; }
  .bop-handset-controls { padding: 0.3rem 0.1rem 0; }
  .bop-pad { grid-template-columns: repeat(3, 38px); gap: 3px; }
  .bop-pad button,
  .bop-actions button { min-width: 38px; min-height: 38px; }
  .bop-actions [data-pad="arm"] { width: 46px; height: 46px; }
  .bop-actions [data-pad="new"] { width: 40px; height: 40px; }
  .bop-match-note { margin-top: 0.45rem; }
}
