@property --fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.online-room-player {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.45cqw;
  width: 100%;
  height: 100%;
  border: 0.5cqw solid #8fc9fc;
  border-radius: 5cqw;
  background: linear-gradient(#395cb5, #25276d);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.online-room-player[data-self] {
  border-color: #ffe69b;
}

.online-room-player img {
  width: 19cqw;
  height: 19cqw;
  object-fit: contain;
}

.online-room-player strong {
  font-size: 4.6cqw;
  line-height: 1;
}

.online-room-player span {
  font-size: 3.7cqw;
}

.online-room-status {
  display: grid;
  place-content: center;
  border-radius: 999px;
  background: #201a61df;
  color: #fff;
  font-size: 4.2cqw;
  text-align: center;
}

.screen .online-room-action {
  border: 0.4cqw solid #a9ccff;
  border-radius: 999px;
  background: #273778;
  color: #fff;
  font-size: 4.1cqw;
  font-weight: 700;
}

.screen--room button:disabled {
  opacity: 0.58;
  cursor: default;
}

.room-code-input {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #a9ccff;
  border-radius: 0.5rem;
  background: #151a50;
  color: #fff;
  font: 700 1.05rem/1.4 monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#gameplay-online-status {
  font-size: 5.1cqw;
  text-align: center;
}

.screen .play-match {
  border: 0.5cqw solid #a9caff;
  border-radius: 999px;
  background: linear-gradient(#5f83ee, #3542a4 65%, #33307d);
  box-shadow: inset 0 0.55cqw #ffffff48, 0 0.7cqw 1.1cqw #231d6770;
  color: #fff;
  font-size: 5.8cqw;
  font-weight: 800;
  text-shadow: 0 0.3cqw #262257;
}

:is(.screen--gameplay, .screen--board) {
  --green-bubble: url("./pages/gameplay/bubbles/matte-press-idle.png");
  --white-bubble: url("./pages/gameplay/bubbles/matte-white.png");
  --shallow-press-bubble: url("./pages/gameplay/bubbles/matte-press-shallow.png");
  --deep-press-bubble: url("./pages/gameplay/bubbles/matte-press-deep.png");
  --popped-bubble: url("./pages/gameplay/bubbles/matte-press-popped.png");
}

.screen--gameplay {
  --design-width: 178;
  --design-height: 366;
  --bubble-press-duration: 120ms;
  display: none;
  background-color: #162357;
  background-image:
    radial-gradient(ellipse at 55% 46%, #1ca9f569, transparent 56%),
    linear-gradient(180deg, #101234eb, #08335687 40%, #26448d5e 64%, #16143ff2 100%),
    url("./pages/Waiting_Room/background/waiting_room.png");
  background-size: 100% 100%, 100% 100%, cover;
}

.showcase[data-view="gameplay"] > :is(.screen--home, .screen--room) {
  display: none;
}

.showcase[data-view="gameplay"] > .screen--gameplay {
  display: block;
}

.screen--gameplay .screen-content {
  --gameplay-unit: calc(100cqw / 178);
  --gameplay-height: var(--safe-height, var(--screen-height));
  --gameplay-power-height: calc(22 * var(--gameplay-unit));
  --gameplay-control-gap: calc(3 * var(--gameplay-unit));
  --gameplay-control-bottom: 30px;
  --gameplay-controls-height: calc(61 * var(--gameplay-unit) + var(--gameplay-power-height) + 2 * var(--gameplay-control-gap) + var(--gameplay-control-bottom));
  font-weight: 800;
  text-shadow: 0 0.35cqw 0.45cqw #111846cf;
}

.gameplay--wrong-pop::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: radial-gradient(ellipse at center, #f81e3a0d 24%, #ff193861 100%);
  box-shadow: inset 0 0 7cqw #ff274d8c;
  opacity: 0.48;
  pointer-events: none;
  content: "";
}

@media (prefers-reduced-motion: no-preference) {
  .gameplay--wrong-pop .screen-content {
    animation: wrong-pop-shake 240ms ease-out;
  }

  .gameplay--wrong-pop::after {
    animation: wrong-pop-flash 320ms ease-out;
  }
}

@keyframes wrong-pop-shake {
  0%, 100% { transform: translate(0, 0); }
  16% { transform: translate(-1.5cqw, 0.45cqw); }
  34% { transform: translate(1.3cqw, -0.4cqw); }
  52% { transform: translate(-0.8cqw, 0.25cqw); }
  72% { transform: translate(0.55cqw, 0); }
  89% { transform: translate(-0.2cqw, 0); }
}

@keyframes wrong-pop-flash {
  from { opacity: 1; }
  to { opacity: 0.48; }
}

.gameplay-stage {
  display: grid;
  place-content: center;
  gap: 0.7cqw;
  border: 0.45cqw solid #a995ee80;
  border-radius: 5.8cqw;
  background: linear-gradient(145deg, #264782, #32247c 72%, #5137aa);
  box-shadow: inset 0 0.45cqw #e3d7ff35, 0 0.65cqw 1.7cqw #211c646e;
  text-align: center;
  line-height: 1;
}

.gameplay-stage h2 {
  font-size: 4.2cqw;
  font-weight: 900;
  white-space: nowrap;
  padding-inline: 1.8cqw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gameplay-stage h2:focus {
  outline: none;
}

.gameplay-stage p {
  color: #f2d8ff;
  font-size: 4.8cqw;
  text-transform: uppercase;
}

.gameplay-back {
  opacity: 0.85;
}

.gameplay-back:focus-visible {
  outline: 2px solid #fff5a3;
  outline-offset: 2px;
}

.gameplay-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6cqw;
  border: 0.7cqw solid #fff6af;
  border-radius: 5.7cqw;
  background: linear-gradient(#9b4b31, #75332d 50%, #a8583a);
  box-shadow: 0 0 2.6cqw #ffb6499a, inset 0 0.6cqw #ffe79151;
  color: #fff7d8;
  font-size: 5.9cqw;
  font-variant-numeric: tabular-nums;
}

.gameplay-stopwatch {
  position: relative;
  width: 6.5cqw;
  aspect-ratio: 1;
  border: 1.15cqw solid #ffe58d;
  border-radius: 50%;
  box-shadow: 0 0 1.4cqw #ffbb3c;
}

.gameplay-stopwatch::before,
.gameplay-stopwatch::after {
  position: absolute;
  left: 50%;
  border-radius: 999px;
  background: #fff2a1;
  content: "";
}

.gameplay-stopwatch::before {
  top: -2.25cqw;
  width: 2.4cqw;
  height: 1.1cqw;
  transform: translateX(-50%);
}

.gameplay-stopwatch::after {
  top: 15%;
  width: 0.7cqw;
  height: 39%;
  transform: rotate(18deg);
}

.gameplay-scores {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: minmax(0, 1.65fr);
  grid-auto-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: end;
  gap: 2.25cqw;
}

.gameplay-score {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: center;
  min-width: 0;
  height: 84%;
  padding: 0 0.65cqw 1.25cqw;
  border: 0.45cqw solid #629adc45;
  border-radius: 5.2cqw;
  background: radial-gradient(ellipse at 48% 4%, #2963ae 0%, #1b4487 27%, #142d62 65%, #132958);
  box-shadow: inset 0 0.45cqw #99cbff26, 0 0.7cqw 1.65cqw #0c1c426e;
  line-height: 1;
  text-align: center;
}

.gameplay-score--leader {
  display: block;
  isolation: isolate;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.gameplay-score--leader::before {
  position: absolute;
  z-index: -1;
  inset: -17% -7% 1%;
  background: radial-gradient(ellipse at center, #fff4a3 0%, #ffb33aba 30%, #ff733e60 53%, transparent 72%);
  content: "";
}

.gameplay-score--leader::after {
  position: absolute;
  z-index: 0;
  top: 43%;
  left: -0.2cqw;
  color: #ffed90;
  font-size: 5cqw;
  text-shadow: 26cqw -4cqw #ffca62, 0 0 1.6cqw #ff9824;
  pointer-events: none;
  content: "✦";
}

.gameplay-rank {
  position: absolute;
  z-index: 2;
  top: -2.2cqw;
  left: 50%;
  translate: -50% 0;
  padding: 0.55cqw 1.75cqw;
  border: 0.35cqw solid #8dbafe;
  border-radius: 999px;
  background: linear-gradient(#456ee5, #172b77);
  color: #fff;
  font-size: 3.7cqw;
  text-shadow: 0 0.35cqw #132554;
}

.gameplay-score--leader .gameplay-rank {
  top: -1.7cqw;
  left: 1cqw;
  translate: none;
  border-color: #ffe39c;
  background: linear-gradient(#ffbe3a, #d56b11);
  color: #fff7bd;
  font-size: 4.3cqw;
  text-shadow: 0 0.36cqw #7a350a;
}

/* Leader portraits have different head shapes and accessory positions. */
.gameplay-score[data-character="luna"] {
  --leader-crown-x: 52%;
  --leader-crown-top: -5.8cqw;
}

.gameplay-score[data-character="rex"] {
  --leader-portrait-height: 28.5cqw;
  --leader-crown-top: -6.3cqw;
}

.gameplay-score[data-character="momo"] {
  --leader-crown-x: 45%;
  --leader-crown-top: -6cqw;
}

.gameplay-score[data-character="kiko"] {
  --leader-portrait-height: 28.5cqw;
  --leader-crown-top: -4.7cqw;
  --leader-crown-width: 8.2cqw;
}

.gameplay-crown {
  position: absolute;
  z-index: 1;
  top: var(--leader-crown-top, -6cqw);
  left: var(--leader-crown-x, 50%);
  translate: -50% 0;
  width: var(--leader-crown-width, 9.4cqw);
  height: 7.4cqw;
  background: url("./pages/profile/icon-crown.png") center / contain no-repeat;
  filter: drop-shadow(0 0.4cqw 0.65cqw #b95618) drop-shadow(0 0 1cqw #ffdb70);
  pointer-events: none;
}

.gameplay-portrait {
  align-self: end;
  width: 14.6cqw;
  height: 14.6cqw;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.4cqw 0.65cqw #15264d9f);
}

.gameplay-score--leader .gameplay-portrait,
.gameplay-leader-portrait {
  display: none;
}

.gameplay-score--leader .gameplay-leader-portrait {
  position: absolute;
  inset: auto 0 2.6cqw;
  display: block;
  width: min(100%, 32cqw);
  height: var(--leader-portrait-height, 30cqw);
  max-width: none;
  margin-inline: auto;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 0 1.4cqw #ffb64fe6);
}

.gameplay-score-info {
  display: contents;
}

.gameplay-score--leader .gameplay-score-info {
  position: absolute;
  inset: auto 8% 0;
  z-index: 1;
  display: grid;
  justify-items: center;
  padding: 1.7cqw 1.4cqw 1cqw;
  border: 0.5cqw solid #ffba42;
  border-radius: 999px;
  background: linear-gradient(#51206d, #261654);
  box-shadow: 0 0 1.35cqw #ff9a4caa;
}

.gameplay-name {
  width: 100%;
  min-width: 0;
  padding: 0.42cqw 0.65cqw;
  overflow: hidden;
  border-radius: 2.25cqw;
  font-size: 3.95cqw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gameplay-score--leader .gameplay-name {
  position: absolute;
  top: 0;
  left: 50%;
  width: max-content;
  max-width: 100%;
  padding-block: 0;
  translate: -50% -53%;
  font-size: 4.55cqw;
  line-height: 1.1;
  -webkit-text-stroke: 0.9cqw #40215f;
  paint-order: stroke fill;
}

.gameplay-score-percent {
  font-size: 5.25cqw;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.gameplay-score--leader .gameplay-score-percent {
  color: #ffdf6b;
  font-size: 6.1cqw;
}

.gameplay-prompt {
  z-index: 1;
}

.gameplay-prompt > * {
  width: 100%;
  height: 100%;
}

.gameplay-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5cqw;
  border: 0.75cqw solid #63f1fa;
  border-radius: 999px;
  background: linear-gradient(#154d72, #112a51 72%);
  box-shadow: inset 0 0.6cqw #b5fbff85, 0 0 3.2cqw #4ed9f2af;
  font-size: 5.5cqw;
  padding-inline: 2.2cqw;
}

.gameplay-rule.gameplay-target-indicator {
  position: absolute;
  z-index: 1;
  top: -3.5%;
  right: 3.5%;
  min-height: 11.5cqw;
  padding: 0.65cqw 1.65cqw;
  border-color: #ffe08e;
  background: linear-gradient(#263e73, #142247);
  box-shadow: inset 0 0.45cqw #dbe4ff52, 0 0 2.2cqw #ffd06b80;
  font-size: 3.35cqw;
  pointer-events: none;
}

.gameplay-target-indicator .gameplay-rule-bubble {
  width: 8.4cqw;
  border-radius: 50%;
}

.gameplay-rule-bubble {
  width: 9.2cqw;
  aspect-ratio: 1;
  flex: none;
  background: var(--green-bubble) center / contain no-repeat;
}

.gameplay-rule strong {
  color: #8dff75;
}

.gameplay-rule[data-target-color="red"] strong { color: #ff8093; }
.gameplay-rule[data-target-color="yellow"] strong { color: #ffe65c; }
.gameplay-rule[data-target-color="blue"] strong { color: #67d6ff; }

.gameplay-lives {
  display: inline-flex;
  align-items: center;
  gap: 0.6cqw;
  margin-left: 1.2cqw;
  padding: 0.4cqw 1.6cqw;
  border-radius: 999px;
  background: #1a1142bf;
  border: 0.35cqw solid #ff8ab588;
  font-size: 4.9cqw;
  line-height: 1;
}

.gameplay-heart {
  color: #ff4f86;
  text-shadow: 0 0 1cqw #ff3b77aa;
}

.gameplay-heart--lost {
  color: #7c6ba3;
  opacity: 0.45;
  text-shadow: none;
}

.gameplay-penalty {
  border-color: #ff9fba;
  background: linear-gradient(#963453, #4e2147 72%);
  box-shadow: inset 0 0.6cqw #ffd6e166, 0 0 3.2cqw #ff5b8199;
  font-size: 5.2cqw;
}

.gameplay-rush-actions {
  display: flex;
  gap: 2cqw;
}

.gameplay-rush-status {
  flex: 1;
  gap: 1.5cqw;
  border-color: #fff2ae;
  background: linear-gradient(#5c3d15e0, #361e0aeb);
  box-shadow: inset 0 0.6cqw #fff4b866, 0 0 3.2cqw #ffc75d9a;
  font-size: 5.4cqw;
}

.gameplay-rush-status strong {
  color: #ffe36e;
}

.gameplay-rush-status small {
  color: #ffeeb3;
  font-size: 3.8cqw;
  opacity: 0.9;
}

.screen .gameplay-enable-shake {
  width: 24cqw;
  padding: 0 1cqw;
  border: 0.6cqw solid #8adcf6;
  border-radius: 999px;
  background: #194773;
  font-size: 4.4cqw;
  font-weight: 800;
  line-height: 1;
}

.gameplay-board {
  isolation: isolate;
}

/* Expand the board into spare space beside the portrait layout. */
.screen--gameplay .gameplay-board {
  --board-max-width: 105cqw;
  --scores-bottom: calc(var(--gameplay-height) * 58 / 366 + 23 * var(--gameplay-unit));
  --board-room: calc(var(--gameplay-height) - var(--scores-bottom) - var(--gameplay-controls-height) - 6px);
  --gameplay-board-size: min(var(--board-max-width), calc(var(--board-room) / 1.005));
  position: absolute;
  top: clamp(
    calc(var(--scores-bottom) + 2px + 0.535 * var(--gameplay-board-size)),
    calc(19500% / var(--design-height)),
    calc(100% - var(--gameplay-controls-height) - 4px - 0.47 * var(--gameplay-board-size))
  );
  left: 50%;
  width: var(--gameplay-board-size);
  aspect-ratio: 1;
  translate: -50% -50%;
  container-type: inline-size;
}

@media (max-width: 639px) and (orientation: portrait) {
  .screen--gameplay .gameplay-board {
    --board-max-width: min(
      120cqw,
      calc(100vw - var(--safe-left, 0px) - var(--safe-right, 0px))
    );
  }
}

.gameplay-board::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("./pages/gameplay/board-wide-grid.png") center / contain no-repeat;
  pointer-events: none;
  content: "";
}

.gameplay-bubbles {
  --bubble-diameter: 16.8cqw;
  position: absolute;
  /* Fit the blue playfield inside the rim of the board art. */
  top: 9.35%;
  left: 7.6%;
  width: 84.3%;
  height: 85.05%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border-radius: 12.8%;
  background: #176fa9;
  touch-action: none;
}

.gameplay--wrong-pop .gameplay-bubble-face {
  opacity: 0.57;
}

.screen .gameplay-bubble {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  background: linear-gradient(145deg, var(--board-tile-light, #53bdf9), var(--board-tile, #339fdf) 76%);
  box-shadow: inset -0.2cqw -0.2cqw var(--board-tile-edge, #176fa9);
}

.screen .gameplay-bubble:focus-visible {
  outline-offset: -2px;
}

.screen .gameplay-bubble:active {
  transform: none;
}

.screen .gameplay-bubble:disabled {
  cursor: default;
  filter: none;
}

.gameplay-bubble::before {
  position: absolute;
  inset: 5%;
  border-radius: 28%;
  background:
    radial-gradient(ellipse at 50% 66%, var(--board-well-shadow, #075281b0), transparent 69%),
    linear-gradient(160deg, var(--board-well-dark, #0e78c8), var(--board-well-light, #279be4) 76%);
  box-shadow:
    inset 0 0.53cqw 0.75cqw var(--board-well-shadow, #064d87d9),
    inset 0 -0.24cqw 0.42cqw var(--board-well-rim, #76d2ffab),
    0 0.13cqw 0.21cqw var(--board-well-rim, #78d6fc9a);
  pointer-events: none;
  content: "";
}

.gameplay-bubble-face {
  --raised-bubble: var(--green-bubble);
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--bubble-diameter);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  overflow: hidden;
  background: #4ec63f;
  pointer-events: none;
}

.gameplay-rule-bubble,
.gameplay-bubble:not(.gameplay-bubble--white) .gameplay-bubble-face {
  filter: saturate(1.16) brightness(0.95);
}

.gameplay-bubble--white .gameplay-bubble-face {
  --raised-bubble: var(--white-bubble);
  background: #eeedf9;
}

.gameplay-bubble--spill-on .gameplay-bubble-face {
  --raised-bubble: var(--green-bubble);
  background: #4ec63f;
  filter: saturate(1.32) brightness(1.16) drop-shadow(0 0 1.4cqw #9cff88);
  transform: scale(1.06);
}

/* Color Hunt palette variations reusing sculpted Matte Soft / Paw Pad textures */
.gameplay-bubble[data-bubble-color] .gameplay-bubble-face {
  --raised-bubble: var(--green-bubble);
}

.gameplay-bubble[data-bubble-color="green"] .gameplay-bubble-face,
.gameplay-rule-bubble[data-bubble-color="green"] {
  background-color: #4ec63f;
  filter: saturate(1.18) brightness(0.96);
}

.gameplay-bubble[data-bubble-color="red"] .gameplay-bubble-face,
.gameplay-rule-bubble[data-bubble-color="red"] {
  background-color: #e83b4c;
  filter: hue-rotate(-114deg) saturate(1.55) brightness(0.98);
}

.gameplay-bubble[data-bubble-color="yellow"] .gameplay-bubble-face,
.gameplay-rule-bubble[data-bubble-color="yellow"] {
  background-color: #f3c818;
  filter: hue-rotate(-58deg) saturate(1.6) brightness(1.14);
}

.gameplay-bubble[data-bubble-color="blue"] .gameplay-bubble-face,
.gameplay-rule-bubble[data-bubble-color="blue"] {
  background-color: #299cf6;
  filter: hue-rotate(94deg) saturate(1.35) brightness(1.02);
}

.gameplay-bubble-face::before,
.gameplay-bubble-face::after,
.gameplay-bubble-compress,
.gameplay-bubble-compress::before,
.gameplay-bubble-compress::after {
  position: absolute;
  inset: 0;
}

.gameplay-bubble-face::before,
.gameplay-bubble-face::after,
.gameplay-bubble-compress::before,
.gameplay-bubble-compress::after {
  background: var(--bubble-art) center / 107% no-repeat;
  content: "";
}

.gameplay-bubble-compress {
  pointer-events: none;
}

.gameplay-bubble-face::before {
  --bubble-art: var(--popped-bubble);
  opacity: 0;
}

.gameplay-bubble-face::after {
  --bubble-art: var(--raised-bubble);
}

.gameplay-bubble-compress::before {
  --bubble-art: var(--deep-press-bubble);
  opacity: 0;
}

.gameplay-bubble-compress::after {
  --bubble-art: var(--shallow-press-bubble);
  opacity: 0;
}

.gameplay-bubble[aria-pressed="false"] .gameplay-bubble-face::before {
  opacity: 1;
}

.gameplay-bubble[aria-pressed="false"] .gameplay-bubble-face::after {
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .gameplay-bubble[aria-pressed="false"] .gameplay-bubble-face::after {
    animation: matte-bubble-idle-out var(--bubble-press-duration) linear;
  }

  .gameplay-bubble[aria-pressed="false"] .gameplay-bubble-compress::before {
    animation: matte-bubble-press-deep var(--bubble-press-duration) linear;
  }

  .gameplay-bubble[aria-pressed="false"] .gameplay-bubble-compress::after {
    animation: matte-bubble-press-shallow var(--bubble-press-duration) linear;
  }
}

@keyframes matte-bubble-idle-out {
  0% { opacity: 1; }
  30%, 100% { opacity: 0; }
}

@keyframes matte-bubble-press-shallow {
  0%, 30% { opacity: 1; }
  61%, 100% { opacity: 0; }
}

@keyframes matte-bubble-press-deep {
  0%, 61% { opacity: 1; }
  100% { opacity: 0; }
}

.gameplay-controls {
  --controls-safe-bottom: var(--safe-bottom, 0px);
  top: auto;
  bottom: calc(-1 * var(--controls-safe-bottom));
  height: auto;
  display: grid;
  justify-items: center;
  gap: var(--gameplay-control-gap);
  padding: 0 calc(2 * var(--unit)) calc(var(--gameplay-control-bottom) + var(--controls-safe-bottom));

}

.gameplay-controls > * {
  width: min(100%, calc(174 * var(--unit)));
}

@media (max-width: 639px) and (orientation: portrait) {
  .gameplay-controls {
    left: calc(50% + (var(--safe-right) - var(--safe-left)) / 2);
    width: 100vw;
    padding-inline: calc(2 * var(--unit) + var(--safe-left)) calc(2 * var(--unit) + var(--safe-right));
    transform: translateX(-50%);
  }
}

.gameplay-power {
  height: var(--gameplay-power-height);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr 0.5fr;
  align-items: center;
  gap: 0.75cqw 2.2cqw;
  padding: 1.5cqw 3.5cqw;
  border: 0.5cqw solid #7d91db;
  border-radius: 999px;
  background: linear-gradient(#26376a, #141b45);
  box-shadow: inset 0 0.45cqw #aec9ff48, 0 0.6cqw 1.1cqw #110d3d90;
}

.gameplay-power-icon {
  grid-row: 1 / -1;
  width: 7.5cqw;
  height: 7.5cqw;
  object-fit: contain;
}

.gameplay-power-label {
  display: flex;
  justify-content: space-between;
  gap: 1.5cqw;
  color: #fff;
  font-size: 4.05cqw;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.gameplay-power-track {
  height: 100%;
  overflow: hidden;
  border: 0.35cqw solid #5b74ae;
  border-radius: 999px;
  background: #0f1b3a;
}

.gameplay-power-track span {
  display: block;
  width: var(--power, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(#c2ffb9, #49f286 55%, #14b76e);
}

.gameplay-dock {
  height: calc(34 * var(--unit));
  padding: 1.2cqw 6cqw;
  border: 0.85cqw solid #c48bff;
  border-radius: 999px;
  background: linear-gradient(#54329c, #251758 55%, #3d2383);
  box-shadow: inset 0 0 1.3cqw #d799ffaa, 0 0.65cqw 1.6cqw #120d39aa;
}

.gameplay-abilities {
  height: 100%;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
}

.gameplay-ability {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.gameplay-ability img {
  width: auto;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  pointer-events: none;
}

.gameplay-controls > .gameplay-rush-slot {
  width: min(100%, calc(127 * var(--unit)));
}

.screen .gameplay-pop-rush {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.55cqw;
  width: 100%;
  height: calc(27 * var(--unit));
  padding-inline: 2cqw;
  border: 0.85cqw solid #fff1af;
  border-radius: 999px;
  background: linear-gradient(#fff177, #ffd031 48%, #f39611);
  box-shadow: inset 0 0.7cqw 0.7cqw #fff9c8, 0 0.8cqw 2.6cqw #ffaa4166;
  color: #fff;
  font-size: 6.5cqw;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0.5cqw #702b8c;
  -webkit-text-stroke: 0.85cqw #652297;
  paint-order: stroke fill;
  background-color: #0e8eaa;

}

.screen .gameplay-pop-rush:disabled {
  background: linear-gradient(#72618a, #46315e);
  border-color: #9a7abb;
  box-shadow: none;
  color: #e2d4f4;
  cursor: default;
}

.gameplay-rush-caption {
  color: #612737;
  font-size: 3.05cqw;
  text-transform: none;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.gameplay-pop-rush:disabled .gameplay-rush-caption {
  color: #f1e7fc;
}

.gameplay-pop-rush[data-mode="results"] .gameplay-rush-caption {
  display: none;
}

.gameplay-results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.gameplay-results-actions > * {
  display: grid;
  min-height: 2.75rem;
  place-items: center;
  padding-inline: 0.9rem;
}

@property --mr-scroll {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.match-results {
  --mr-scroll: 0;
  position: fixed;
  inset: 0;
  width: min(100vw, 49dvh, 28rem);
  height: min(100dvh, 58rem);
  max-width: none;
  max-height: none;
  margin: auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  container-type: size;
  background: #614cd6 url("./pages/match_results/stage.webp") center / cover no-repeat;
  color: #fff;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
}

.match-results::backdrop {
  background: rgb(14 10 52 / 78%);
  backdrop-filter: blur(8px);
}

@media (max-width: 639px) and (orientation: portrait) {
  .match-results {
    width: 100vw;
    height: 100dvh;
  }
}

.results-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.results-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.72;
  transform: translate3d(0, calc(var(--mr-scroll) * -22px), 0);
}

.results-orb--one {
  top: -8%;
  left: -14%;
  width: 68%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgb(125 220 255 / 50%), transparent 70%);
}

.results-orb--two {
  top: 32%;
  right: -18%;
  width: 72%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgb(255 124 226 / 44%), transparent 70%);
  transform: translate3d(0, calc(var(--mr-scroll) * 26px), 0);
}

.results-orb--three {
  bottom: -10%;
  left: 14%;
  width: 74%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgb(255 218 112 / 34%), transparent 72%);
  transform: translate3d(0, calc(var(--mr-scroll) * -16px), 0);
}

.results-sheet {
  --result-u: min(1cqw, 0.45cqh);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: calc(3 * var(--result-u));
  width: 100%;
  min-height: 100%;
  margin-inline: auto;
  padding: max(calc(2.2 * var(--result-u)), env(safe-area-inset-top))
    max(calc(4.4 * var(--result-u)), env(safe-area-inset-right))
    max(calc(4 * var(--result-u)), env(safe-area-inset-bottom))
    max(calc(4.4 * var(--result-u)), env(safe-area-inset-left));
}

.results-banner {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 3;
  flex: none;
  background: url("./pages/match_results/ribbon.png") center / contain no-repeat;
  filter: drop-shadow(0 calc(1.4 * var(--result-u)) calc(2.4 * var(--result-u)) rgb(26 11 72 / 42%));
}

.results-banner h2 {
  position: absolute;
  inset: 54% 0 auto;
  transform: translateY(-50%) rotate(-3deg);
  color: #fff9f4;
  font-size: calc(10.2 * var(--result-u));
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0.75cqw 0.12cqw #a12d77, 0 0 1.5cqw #b6267f;
}

.results-podium {
  position: relative;
  z-index: 1;
  height: calc(56 * var(--result-u));
  margin: calc(-4.5 * var(--result-u)) calc(-2.2 * var(--result-u)) calc(-0.6 * var(--result-u));
  flex: none;
}

.results-podium::before {
  position: absolute;
  inset: auto 0 0;
  aspect-ratio: 3;
  background: url("./pages/match_results/podium.png") center / contain no-repeat;
  filter: drop-shadow(0 calc(2 * var(--result-u)) calc(3.2 * var(--result-u)) rgb(21 11 64 / 45%));
  content: "";
}

.results-podium::after {
  position: absolute;
  left: 50%;
  bottom: calc(16 * var(--result-u));
  width: calc(64 * var(--result-u));
  height: calc(40 * var(--result-u));
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 233 145 / 38%), rgb(255 130 232 / 18%) 48%, transparent 72%);
  pointer-events: none;
  z-index: 0;
  content: "";
}

.results-place {
  position: absolute;
  inset: 0;
}

.results-place[data-rank="1"] {
  --place-x: 50%;
  --place-size: 40;
  --place-foot: 20.5;
  --place-label: 11.5;
  --place-type: 15.5;
  z-index: 2;
}

.results-place[data-rank="2"] {
  --place-x: 18.7%;
  --place-size: 33;
  --place-foot: 16.5;
  --place-label: 8.8;
  --place-type: 11.8;
  z-index: 1;
}

.results-place[data-rank="3"] {
  --place-x: 81.5%;
  --place-size: 33;
  --place-foot: 14.2;
  --place-label: 7;
  --place-type: 10.8;
  z-index: 1;
}

.results-place img {
  position: absolute;
  left: var(--place-x);
  bottom: calc(var(--place-foot) * var(--result-u));
  width: calc(var(--place-size) * var(--result-u));
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 calc(1.1 * var(--result-u)) calc(1.8 * var(--result-u)) rgb(25 12 68 / 55%));
}

.results-place[data-rank="1"] img {
  filter: drop-shadow(0 0 calc(1.2 * var(--result-u)) #fff9f7)
    drop-shadow(0 calc(1 * var(--result-u)) calc(2.4 * var(--result-u)) #fb57e6);
}

.results-place-number {
  position: absolute;
  left: var(--place-x);
  bottom: calc(var(--place-label) * var(--result-u));
  transform: translate(-50%, 50%);
  color: #fffaef;
  font-size: calc(var(--place-type) * var(--result-u));
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0.75cqw 0.3cqw #753b24a8, 0 0 0.85cqw #fff0cd;
}

.results-place .results-winner-crown {
  position: absolute;
  left: 36%;
  bottom: calc(52 * var(--result-u));
  transform: rotate(-19deg);
}

.results-place:not([data-rank="1"]) .results-winner-crown {
  display: none;
}

.gameplay-results-list {
  --row-ink: #24174b;
  position: relative;
  display: grid;
  gap: calc(1.25 * var(--result-u));
  padding: calc(1.8 * var(--result-u));
  border: calc(0.5 * var(--result-u)) solid rgb(255 255 255 / 48%);
  border-radius: calc(6.5 * var(--result-u));
  list-style: none;
  background: linear-gradient(
    155deg,
    rgb(255 255 255 / 26%),
    rgb(172 154 255 / 20%) 52%,
    rgb(112 90 222 / 30%)
  );
  backdrop-filter: blur(14px) saturate(135%);
  box-shadow:
    0 calc(2.2 * var(--result-u)) calc(4.8 * var(--result-u)) rgb(22 10 68 / 38%),
    inset 0 1px 0 rgb(255 255 255 / 66%);
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease;
}

.gameplay-results-list::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--glare-x, 50%) var(--glare-y, 20%),
    rgb(255 255 255 / 28%),
    transparent 58%
  );
  pointer-events: none;
  content: "";
}

.gameplay-result-row {
  --rank-fill: linear-gradient(#b7c4ff, #6576d1);
  position: relative;
  display: grid;
  grid-template-columns: calc(9.2 * var(--result-u)) calc(10.2 * var(--result-u)) minmax(0, 1fr) auto;
  align-items: center;
  gap: calc(2 * var(--result-u));
  min-height: calc(11 * var(--result-u));
  padding: calc(0.5 * var(--result-u)) calc(3.2 * var(--result-u)) calc(0.5 * var(--result-u))
    calc(1.4 * var(--result-u));
  border: 1px solid rgb(255 255 255 / 68%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(255 255 255 / 88%), rgb(224 218 255 / 82%));
  box-shadow:
    0 calc(0.75 * var(--result-u)) calc(1.6 * var(--result-u)) rgb(32 18 88 / 16%),
    inset 0 1px 0 rgb(255 255 255 / 90%);
  color: var(--row-ink);
  font-size: calc(4.95 * var(--result-u));
  font-weight: 900;
}

.gameplay-result-row[data-rank="1"] {
  --rank-fill: linear-gradient(#ffed8b, #ee9d14);
  border-color: rgb(255 247 194 / 92%);
  background: linear-gradient(180deg, rgb(255 247 204 / 96%), rgb(252 223 149 / 90%));
  box-shadow:
    0 calc(0.9 * var(--result-u)) calc(2.1 * var(--result-u)) rgb(120 72 10 / 24%),
    inset 0 1px 0 #fff;
}

.gameplay-result-row[data-rank="2"] {
  --rank-fill: linear-gradient(#d6e8ff, #7b96e2);
}

.gameplay-result-row[data-rank="3"] {
  --rank-fill: linear-gradient(#ffe2b5, #ce7848);
}

.gameplay-result-row[data-you] {
  box-shadow:
    0 calc(0.9 * var(--result-u)) calc(2.2 * var(--result-u)) rgb(32 18 88 / 22%),
    inset 0 0 0 calc(0.45 * var(--result-u)) rgb(255 255 255 / 92%);
}

.results-row-rank {
  display: grid;
  place-items: center;
  width: calc(8.4 * var(--result-u));
  aspect-ratio: 1;
  border: 0.4cqw solid #fcf6ff;
  border-radius: 50%;
  background: var(--rank-fill);
  color: #fff;
  font-size: calc(4.6 * var(--result-u));
  text-shadow: 0 0.42cqw #4d3569;
  box-shadow: 0 0.35cqw 0.6cqw rgb(40 20 88 / 24%);
}

.gameplay-result-row img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.results-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.results-player-score {
  display: flex;
  align-items: center;
  gap: calc(1.1 * var(--result-u));
  font-variant-numeric: tabular-nums;
}

.results-player-score span {
  color: #6147a1;
}

.gameplay-result-row[data-rank="1"] .results-player-score span {
  color: #9a601a;
}

.results-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(1.8 * var(--result-u));
  padding: calc(1.8 * var(--result-u));
  border: calc(0.5 * var(--result-u)) solid rgb(255 255 255 / 44%);
  border-radius: calc(5.8 * var(--result-u));
  background: linear-gradient(
    155deg,
    rgb(255 255 255 / 22%),
    rgb(138 114 236 / 24%) 55%,
    rgb(86 64 188 / 34%)
  );
  backdrop-filter: blur(14px) saturate(135%);
  box-shadow:
    0 calc(2 * var(--result-u)) calc(4.2 * var(--result-u)) rgb(22 10 68 / 34%),
    inset 0 1px 0 rgb(255 255 255 / 60%);
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.results-stats::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--glare-x, 50%) var(--glare-y, 20%),
    rgb(255 255 255 / 22%),
    transparent 60%
  );
  pointer-events: none;
  content: "";
}

.results-stats li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(0.9 * var(--result-u));
  min-width: 0;
  padding: calc(2.1 * var(--result-u)) calc(1.2 * var(--result-u));
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: calc(4.2 * var(--result-u));
  background: linear-gradient(175deg, rgb(255 255 255 / 22%), rgb(74 51 154 / 46%));
  box-shadow:
    0 calc(0.8 * var(--result-u)) calc(1.8 * var(--result-u)) rgb(24 12 72 / 24%),
    inset 0 1px 0 rgb(255 255 255 / 45%);
  text-align: center;
  font-weight: 900;
}

.results-stats img,
.results-rank-symbol {
  width: calc(7.8 * var(--result-u));
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 calc(0.6 * var(--result-u)) calc(1 * var(--result-u)) rgb(18 8 56 / 34%));
}

.results-rank-symbol {
  display: grid;
  place-items: center;
  border-radius: 35% 35% 50% 50%;
  border: 0.55cqw solid #97edff;
  background: linear-gradient(#63d6ff, #287cdc 75%);
  font-size: calc(5.2 * var(--result-u));
  line-height: 1;
  text-shadow: 0 0.45cqw #2846a4;
}

.results-stats li div {
  min-width: 0;
  width: 100%;
}

.results-stats strong,
.results-stats li div span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  white-space: nowrap;
}

.results-stats strong {
  font-size: clamp(0.85rem, calc(4.85 * var(--result-u)), 1.25rem);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgb(19 10 56 / 38%);
}

.results-stats li div span {
  margin-top: calc(0.35 * var(--result-u));
  font-size: clamp(0.62rem, calc(3.15 * var(--result-u)), 0.78rem);
  color: #e9ddff;
  letter-spacing: 0.02em;
}

.results-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(2.4 * var(--result-u));
  margin-top: calc(0.8 * var(--result-u));
}

.results-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, calc(1.5 * var(--result-u)), 8px);
  min-width: 0;
  min-height: calc(15.2 * var(--result-u));
  padding: calc(1.3 * var(--result-u)) clamp(8px, calc(3 * var(--result-u)), 14px);
  border: calc(0.62 * var(--result-u)) solid;
  border-radius: 999px;
  font-size: clamp(0.72rem, calc(4.15 * var(--result-u)), 1rem);
  font-weight: 1000;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), filter 0.16s ease, box-shadow 0.16s ease;
}

.results-button-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-button--play {
  border-color: #fff3ad;
  background: linear-gradient(180deg, #fff8ad, #ffce3a 60%, #ffad25);
  box-shadow:
    inset 0 calc(-0.8 * var(--result-u)) 0 #e97b1a99,
    inset 0 2px 0 rgb(255 255 255 / 78%),
    0 calc(1.4 * var(--result-u)) calc(2.8 * var(--result-u)) rgb(36 14 78 / 38%);
  color: #572207;
}

.results-button-icon {
  flex: none;
  font-size: clamp(1rem, calc(5.6 * var(--result-u)), 1.35rem);
  line-height: 1;
}

.results-button--home {
  border-color: #b9f0fe;
  background: linear-gradient(180deg, #b8f1ff, #6ed0ff 60%, #5096ff);
  box-shadow:
    inset 0 calc(-0.8 * var(--result-u)) 0 #236ac899,
    inset 0 2px 0 rgb(255 255 255 / 78%),
    0 calc(1.4 * var(--result-u)) calc(2.8 * var(--result-u)) rgb(28 16 76 / 38%);
  color: #162e73;
  text-decoration: none;
}

.results-button--home img {
  flex: none;
  width: clamp(0.9rem, calc(5.4 * var(--result-u)), 1.32rem);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.results-button--next {
  grid-column: 1 / -1;
  min-height: calc(14 * var(--result-u));
  border-color: #c2ffdf;
  background: linear-gradient(180deg, #7bffbe, #20cc78 62%, #119857);
  box-shadow:
    inset 0 calc(-0.8 * var(--result-u)) 0 #09663999,
    inset 0 2px 0 rgb(255 255 255 / 72%),
    0 calc(1.4 * var(--result-u)) calc(2.8 * var(--result-u)) rgb(18 28 72 / 36%);
  color: #06381f;
  font-size: clamp(0.9rem, calc(4.65 * var(--result-u)), 1.12rem);
}

.results-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (hover: hover) {
  .results-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
  }
}

.results-button:active {
  transform: translateY(2px);
}

@media (prefers-reduced-motion: no-preference) {
  .match-results[open] {
    animation: mrDialogFade 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .match-results[open] .results-podium .results-place[data-rank="1"] img {
    animation: mrChampionFloat 3.6s ease-in-out infinite;
  }

  .match-results[open] .gameplay-result-row {
    will-change: transform, opacity;
    animation: mrRowIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .match-results[open] .results-stats > li {
    will-change: transform, opacity;
    animation: mrStatIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  @supports (animation-delay: calc(sibling-index() * 0.1s)) {
    .match-results[open] .gameplay-result-row {
      animation-delay: calc((sibling-index() - 1) * 0.1s + 0.08s);
    }

    .match-results[open] .results-stats > li {
      animation-delay: calc((sibling-index() - 1) * 0.1s + 0.34s);
    }
  }

  @supports not (animation-delay: calc(sibling-index() * 0.1s)) {
    .match-results[open] .gameplay-result-row:nth-child(1) {
      animation-delay: 0.08s;
    }

    .match-results[open] .gameplay-result-row:nth-child(2) {
      animation-delay: 0.18s;
    }

    .match-results[open] .gameplay-result-row:nth-child(3) {
      animation-delay: 0.28s;
    }

    .match-results[open] .gameplay-result-row:nth-child(4) {
      animation-delay: 0.38s;
    }

    .match-results[open] .results-stats > li:nth-child(1) {
      animation-delay: 0.34s;
    }

    .match-results[open] .results-stats > li:nth-child(2) {
      animation-delay: 0.44s;
    }

    .match-results[open] .results-stats > li:nth-child(3) {
      animation-delay: 0.54s;
    }
  }

  @supports (animation-timeline: scroll()) and (animation-range: entry) {
    .match-results {
      animation: mrDialogFade 0.28s cubic-bezier(0.22, 1, 0.36, 1) both,
        mrScrollDrive linear both;
      animation-timeline: auto, scroll(self y);
      animation-range: normal, 0% 100%;
    }
  }
}

@keyframes mrDialogFade {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mrRowIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mrStatIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mrChampionFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-4px);
  }
}

@keyframes mrScrollDrive {
  from {
    --mr-scroll: 0;
  }
  to {
    --mr-scroll: 1;
  }
}
.screen--character {
  display: none;
  --design-width: 174;
  --design-height: 377;
  background: #7670ef url("./pages/character/background.webp") center / 100% 100% no-repeat;
}

.showcase[data-view="character"] > .screen:not(.screen--character) {
  display: none;
}

.showcase[data-view="character"] > .screen--character {
  display: block;
}

.character-header {
  position: absolute;
  z-index: 2;
  inset: 1.2% 3% auto;
  height: 12%;
}

.screen .character-back {
  position: absolute;
  top: 20%;
  left: 0;
  width: 13%;
}

.character-header h2 {
  position: absolute;
  inset: 0 11%;
  display: grid;
  place-items: center;
  padding-top: 5%;
  background: url("./pages/match_results/ribbon.png") center / 100% 100% no-repeat;
  color: #ffedc2;
  font-size: 10cqw;
  font-weight: 1000;
  text-shadow: 0 0.75cqw #641947, 0 0 1cqw #812058;
}

.character-hero {
  --pedestal-height: calc(84cqw * 210 / 910);
  --pedestal-footline: calc(0.72 * var(--pedestal-height));
  position: absolute;
  inset: 12% 8% 43%;
  pointer-events: none;
}

.character-pedestal {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: var(--pedestal-height);
  filter: drop-shadow(0 1.3cqw 1.6cqw #5547b280);
}

.character-preview {
  position: absolute;
  left: 50%;
  bottom: var(--pedestal-footline);
  width: auto;
  height: min(calc(100% - var(--pedestal-footline)), 88cqw);
  transform: translate(-50%, 4.5%);
  filter: drop-shadow(0 1.7cqw 1.55cqw #35207277);
}

.character-options {
  position: absolute;
  inset: 60% 2.2% auto;
  height: 15%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.4cqw;
}

.screen :is(.character-options, .board-options) button {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  padding: 0.75cqw;
  border: 0.65cqw solid #e1d6ff;
  border-radius: 5.4cqw;
  background: linear-gradient(#b7a3ff, #8274e6);
  box-shadow: 0 1cqw 1.2cqw #40307680;
}

.screen :is(.character-options, .board-options) button[aria-pressed="true"] {
  border-color: #fff2a8;
  background: linear-gradient(#ffdc57, #ffa926);
  box-shadow: 0 0 2.2cqw #ffd14f;
}

:is(.character-options, .board-options) img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

:is(.character-options, .board-options) button > span {
  border-radius: 3cqw;
  padding: 0.35cqw;
  background: #fff0c3;
  color: #44205f;
  font-size: 4.4cqw;
  font-weight: 900;
  line-height: 1.26;
}

.character-options small {
  display: block;
  color: #63448c;
  font-size: 3.2cqw;
  line-height: 1.2;
}

.screen .character-select {
  position: absolute;
  inset: 79% 18% auto;
  height: 7%;
  border: 0.9cqw solid #fff1a2;
  border-radius: 999px;
  background: linear-gradient(#fff782, #ffd334 62%, #ffab19);
  box-shadow: inset 0 -1cqw #e88d138a, 0 1.3cqw 1.65cqw #5541a5;
  color: #622706;
  font-size: 7.5cqw;
  font-weight: 1000;
}

:is(.screen--character, .screen--board) .bottom-nav {
  z-index: 3;
}

:is(.screen--character, .screen--board) .nav-item[aria-current="page"]::before {
  background: linear-gradient(#fff074, #ffbf24);
}

:is(.screen--character, .screen--board) .nav-item[aria-current="page"] {
  color: #4a205b;
  text-shadow: none;
}


.screen--board {
  display: none;
  --design-width: 174;
  --design-height: 377;
  background:
    radial-gradient(ellipse at 50% 46%, #ffaaee88, transparent 53%),
    #7670ef url("./pages/character/background.webp") center / 100% 100% no-repeat;
}

.showcase[data-view="board"] > .screen:not(.screen--board) {
  display: none;
}

.showcase[data-view="board"] > .screen--board {
  display: block;
}

.board-header {
  position: absolute;
  inset: 1% 3% auto;
  height: 9%;
  display: grid;
  place-items: center;
}

.board-header h2 {
  color: #fff1a6;
  font-size: 13cqw;
  line-height: 1;
  font-weight: 1000;
  text-shadow: 0 0.55cqw #dd961e, 0 1.05cqw #87462a, 0 1.7cqw 2.3cqw #1b1d77;
}

.board-label {
  position: absolute;
  inset: 11% 5% auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2cqw;
  font-weight: 900;
}

#board-name {
  max-width: 68%;
  padding: 0.8cqw 5cqw;
  overflow: hidden;
  border: 0.55cqw solid #fff3bc;
  border-radius: 999px;
  background: linear-gradient(#fff8d9, #ffd371);
  box-shadow: 0 0.75cqw #d1883f, 0 1.1cqw 1.3cqw #382c8980;
  color: #5c2b5c;
  font-size: 7cqw;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#board-size {
  padding: 0.65cqw 2.2cqw;
  border: 0.45cqw solid #a5e3ff;
  border-radius: 999px;
  background: linear-gradient(#3db8fa, #3856d3);
  font-size: 4.8cqw;
  white-space: nowrap;
}

.board-preview {
  position: absolute;
  inset: 18% 0 38%;
  display: grid;
  place-items: center;
  container-type: size;
}

.board-preview > * {
  width: min(93cqw, 100cqh);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 2.7cqw 2.4cqw #3f22788c);
}

.board-color-hunt {
  position: relative;
  container-type: inline-size;
}

.board-color-hunt .gameplay-bubbles {
  display: grid;
  --bubble-diameter: 17cqw;
  touch-action: auto;
}

.board-preview-popped .gameplay-bubble-face::before {
  opacity: 1;
}

.board-preview-popped .gameplay-bubble-face::after {
  opacity: 0;
}

.board-options {
  --scrollbar-thumb: #ffe680;
  --scrollbar-track: #3a2a7a;
  position: absolute;
  inset: 63.2% 2.5% auto;
  height: 16.6%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * 1.4cqw) / 3.6);
  grid-template-rows: minmax(0, 1fr);
  gap: 1.4cqw;
  padding: 0.7cqw 1.6cqw 1.8cqw;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 5cqw;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

@supports not (scrollbar-color: auto) {
  .board-options {
    /* Reset scrollbar-width: thin so browsers without scrollbar-color keep ::-webkit-scrollbar styling. */
    scrollbar-width: auto;
  }

  .board-options::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  .board-options::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--scrollbar-thumb);
  }

  .board-options::-webkit-scrollbar-track {
    border-radius: 999px;
    background: var(--scrollbar-track);
  }
}

@supports (animation-timeline: scroll(self inline)) {
  .board-options {
    --fade-size: 5cqw;
    --fade-dir: right;
    --fade-start-pos: 0;
    --fade-end-pos: 100%;
    mask:
      linear-gradient(black, black) no-clip subtract,
      linear-gradient(to var(--fade-dir), black, transparent) var(--fade-start-pos) 0 / var(--fade-start) 100% no-repeat no-clip,
      linear-gradient(to var(--fade-dir), transparent, black) var(--fade-end-pos) 0 / var(--fade-end) 100% no-repeat no-clip;
    animation: reveal-fade-start linear both, hide-fade-end linear both;
    animation-timeline: scroll(self inline);
    animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
  }

  .board-options:dir(rtl) {
    --fade-dir: left;
    --fade-start-pos: 100%;
    --fade-end-pos: 0;
  }
}

@keyframes reveal-fade-start {
  to {
    --fade-start: var(--fade-size);
  }
}

@keyframes hide-fade-end {
  from {
    --fade-end: var(--fade-size);
  }
}

.board-options button {
  scroll-snap-align: start;
}

.board-options button > span {
  display: grid;
  min-height: 2.5em;
  place-items: center;
  font-size: 3.65cqw;
  line-height: 1.05;
}

.screen .board-use {
  inset-block-start: 81.2%;
}

.screen .board-use:disabled {
  background: linear-gradient(#e4dcff, #ad9ce3);
  border-color: #e9ddff;
  box-shadow: inset 0 -1cqw #7768b775, 0 1.3cqw 1.65cqw #5541a5;
  color: #3f306d;
  cursor: default;
}

.room-board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
  font-size: 5cqw;
  font-weight: 800;
}

.room-board-color {
  width: 4cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--board-accent, #8dff75);
}

.board-thumbnail {
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  justify-self: center;
  align-self: center;
}

.board-thumbnail .gameplay-bubbles {
  pointer-events: none;
}

[data-board-theme="classic_rush"] {
  --board-accent: #53e9ee;
  --board-tile-light: #49a4ff;
  --board-tile: #1465d9;
  --board-tile-edge: #184caa;
  --board-well-shadow: #04236dbf;
  --board-well-dark: #073d9a;
  --board-well-light: #298ff4;
  --board-well-rim: #a4e8ffcf;
}

[data-board-theme="color_hunt"] {
  --board-accent: #53e9ee;
  --board-tile-light: #70f1f3;
  --board-tile: #23abc5;
  --board-tile-edge: #16869e;
  --board-well-shadow: #075f72c7;
  --board-well-dark: #0e8eaa;
  --board-well-light: #32c6d9;
  --board-well-rim: #a0fcf7bd;
}

[data-board-theme="pink_stage"] {
  --board-accent: #ffafe5;
  --board-tile-light: #ffa6df;
  --board-tile: #df67bc;
  --board-tile-edge: #a74a99;
  --board-well-shadow: #7d276ec4;
  --board-well-dark: #b946a4;
  --board-well-light: #ed74c5;
  --board-well-rim: #ffd3f1d9;
}

[data-board-theme="memory_rush"] {
  --board-accent: #dfbaff;
  --board-tile-light: #cdb6fb;
  --board-tile: #a784e5;
  --board-tile-edge: #8a60d4;
  --board-well-shadow: #492a92cf;
  --board-well-dark: #7252b7;
  --board-well-light: #aa8bea;
  --board-well-rim: #f1dcffe3;
}

.gameplay-board[data-board-theme="memory_rush"]::before {
  background-image: url("./pages/gameplay/board-gemmed-purple.png");
  clip-path: polygon(1% 27%, 4% 20%, 7% 16%, 9% 11%, 14% 8%, 23% 5%, 31% 4%, 32% 2%, 35% 1%, 42% 4%, 46% 1%, 50% 0%, 54% 1%, 58% 4%, 65% 1%, 68% 2%, 69% 4%, 77% 5%, 86% 8%, 91% 11%, 93% 16%, 96% 20%, 99% 27%, 99% 33%, 96% 41%, 97% 45%, 98% 48%, 95% 53%, 97% 59%, 99% 66%, 99% 72%, 97% 79%, 94% 84%, 91% 91%, 86% 95%, 78% 96%, 72% 99%, 64% 99%, 58% 98%, 50% 97%, 42% 98%, 36% 99%, 28% 99%, 22% 96%, 14% 95%, 9% 91%, 6% 84%, 3% 79%, 1% 72%, 1% 66%, 3% 59%, 5% 53%, 2% 48%, 3% 45%, 4% 41%, 1% 33%);
}

.gameplay-board[data-board-theme] .gameplay-bubbles {
  inset: 13% auto auto 13%;
  width: 74%;
  height: 74%;
  border-radius: 10%;
  --bubble-diameter: 15.2cqw;
}

/* The standard frame can give the four playable rows a little more room. */
.screen--gameplay .gameplay-board[data-board-theme] .gameplay-bubbles:not([data-board-layout="custom"]) {
  inset: 10% auto auto 10%;
  width: 80%;
  height: 80%;
  --bubble-diameter: 17.3cqw;
}

.gameplay-board[data-board-theme="classic_rush"]::before {
  background-image: url("./pages/gameplay/board-aqua-wave.png");
  clip-path: polygon(1% 29%, 2% 24%, 6% 18%, 7% 13%, 11% 9%, 16% 7%, 20% 7%, 25% 5%, 32% 3%, 36% 4%, 35% 1%, 40% 2%, 44% 4%, 50% 0%, 56% 4%, 60% 2%, 65% 1%, 64% 4%, 68% 3%, 75% 5%, 80% 7%, 84% 7%, 89% 9%, 93% 13%, 94% 18%, 98% 24%, 99% 29%, 97% 35%, 95% 41%, 98% 47%, 95% 53%, 98% 61%, 99% 67%, 98% 73%, 94% 79%, 94% 84%, 92% 88%, 88% 92%, 81% 94%, 76% 96%, 68% 98%, 61% 97%, 61% 99%, 50% 96%, 39% 99%, 39% 97%, 32% 98%, 24% 96%, 19% 94%, 12% 92%, 8% 88%, 6% 84%, 6% 79%, 2% 73%, 1% 67%, 2% 61%, 5% 53%, 2% 47%, 5% 41%, 3% 35%);
}

.gameplay-board[data-board-theme="color_hunt"]::before {
  background-image: url("./pages/gameplay/board-sapphire-blue.png");
  clip-path: polygon(1% 33%, 3% 28%, 6% 22%, 6% 16%, 8% 11%, 13% 8%, 16% 7%, 22% 7%, 30% 2%, 35% 1%, 39% 2%, 41% 5%, 45% 2%, 50% 0%, 55% 2%, 59% 5%, 61% 2%, 65% 1%, 70% 2%, 78% 7%, 84% 7%, 87% 8%, 92% 11%, 94% 16%, 94% 22%, 97% 28%, 99% 33%, 99% 38%, 97% 43%, 99% 45%, 96% 48%, 97% 51%, 94% 54%, 98% 60%, 99% 65%, 98% 70%, 94% 76%, 94% 86%, 91% 91%, 87% 95%, 80% 98%, 73% 98%, 62% 96%, 56% 96%, 50% 99%, 44% 96%, 38% 96%, 27% 98%, 20% 98%, 13% 95%, 9% 91%, 6% 86%, 6% 76%, 2% 70%, 1% 65%, 2% 60%, 6% 54%, 3% 51%, 4% 48%, 1% 45%, 3% 43%, 1% 38%);
}

.gameplay-board[data-board-theme="pink_stage"]::before {
  background-image: url("./pages/gameplay/board-candy-pink.png");
  clip-path: polygon(3% 25%, 4% 19%, 7% 13%, 12% 9%, 18% 6%, 26% 4%, 33% 4%, 40% 3%, 46% 2%, 49% 0%, 51% 0%, 54% 2%, 60% 3%, 67% 4%, 74% 4%, 82% 6%, 88% 9%, 93% 13%, 96% 19%, 97% 25%, 97% 35%, 96% 42%, 98% 44%, 99% 48%, 97% 52%, 96% 55%, 97% 68%, 97% 77%, 95% 84%, 92% 89%, 87% 94%, 81% 97%, 66% 99%, 34% 99%, 19% 97%, 13% 94%, 8% 89%, 5% 84%, 3% 77%, 3% 68%, 4% 55%, 3% 52%, 1% 48%, 2% 44%, 4% 42%, 3% 35%);
}

[data-board-theme="rainbow_pop"] {
  --board-accent: conic-gradient(#ff5fa2, #ffe135, #72ea24, #2fb8ff, #c55bff, #ff5fa2);
}

[data-board-theme="star_pop"] {
  --board-accent: linear-gradient(180deg, #ffe234 48%, #b85cff 52%);
}

[data-board-theme="paw_pop"] {
  --board-accent: #ff5cb8;
}

.gameplay-board[data-board-theme="rainbow_pop"]::before {
  background-image: url("./pages/gameplay/board-rainbow-pop.png");
}

.gameplay-board[data-board-theme="star_pop"]::before {
  background-image: url("./pages/gameplay/board-star-pop.png");
}

.gameplay-board[data-board-theme="paw_pop"]::before {
  background-image: url("./pages/gameplay/board-paw-pop.png");
}

.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] {
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble {
  position: absolute;
  left: var(--cell-x);
  top: var(--cell-y);
  width: var(--cell-size);
  height: var(--cell-size);
  translate: -50% -50%;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble::before {
  content: none;
}

.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble-face {
  width: 100%;
  height: 100%;
  box-shadow: 0 0 0 0.25cqw #0000002b;
}

.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble:focus-visible {
  outline-offset: 2px;
}

.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble--paw-pad {
  left: var(--pad-left);
  top: var(--pad-top);
  width: var(--pad-width);
  height: var(--pad-height);
  translate: none;
  border-radius: 0;
  clip-path: polygon(50.2% 0.6%, 59.9% 3.1%, 68.0% 10.6%, 73.7% 21.4%, 79.2% 32.4%, 87.1% 40.4%, 94.3% 49.9%, 98.4% 61.6%, 98.4% 74.6%, 94.6% 86.4%, 87.2% 95.4%, 77.8% 98.8%, 68.1% 96.9%, 59.3% 91.9%, 49.7% 89.0%, 40.1% 91.5%, 31.3% 96.6%, 21.6% 99.1%, 12.2% 95.7%, 4.8% 86.8%, 0.6% 75.2%, 1.6% 61.9%, 6.2% 50.5%, 13.5% 41.0%, 21.5% 33.2%, 27.2% 22.4%, 32.7% 11.5%, 40.7% 3.7%);
  --green-bubble: url("./pages/gameplay/bubbles/paw-pad-idle.png");
  --white-bubble: url("./pages/gameplay/bubbles/paw-pad-white.png");
  --shallow-press-bubble: url("./pages/gameplay/bubbles/paw-pad-shallow.png");
  --deep-press-bubble: url("./pages/gameplay/bubbles/paw-pad-deep.png");
  --popped-bubble: url("./pages/gameplay/bubbles/paw-pad-popped.png");
}

.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble--paw-pad .gameplay-bubble-face {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  translate: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble--paw-pad .gameplay-bubble-face::before,
.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble--paw-pad .gameplay-bubble-face::after,
.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble--paw-pad .gameplay-bubble-compress::before,
.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble--paw-pad .gameplay-bubble-compress::after {
  background: var(--bubble-art) center / 100% 100% no-repeat;
}

.gameplay-board[data-board-theme] .gameplay-bubbles[data-board-layout="custom"] .gameplay-bubble--paw-pad:focus-visible .gameplay-bubble-face {
  filter: drop-shadow(0 0 1cqw #fff5a3) drop-shadow(0 0 1.6cqw #fff5a3);
}

/* Waiting Room Multi-Mode Picker */
.screen--room .stage-panel:has(#room-mode-picker:not([hidden])) {
  --y: 223;
  --h: 68;
  border-image: none;
  border: 0.65cqw solid #8aaeffa6;
  border-radius: 5cqw;
  background: linear-gradient(180deg, #4b5ed1eb, #2a2888f2);
  box-shadow: inset 0 0.5cqw #c4d5ff55, 0 0.8cqw 1.8cqw #17124e88;
}

.screen--room .stage-panel:has(#room-mode-picker:not([hidden])) .stage-list {
  inset: calc(3.2 * var(--unit)) 5% auto;
  height: calc(11 * var(--unit));
  font-size: 4.1cqw;
}

/* Private Room layout stacks Room Status -> Room Code -> Mode Picker cleanly above Ready/Play */
.screen--room[data-private="true"] .online-room-status {
  --y: 205;
  --h: 13;
}

.screen--room[data-private="true"] .online-room-action {
  --y: 219;
  --h: 14;
}

.screen--room[data-private="true"] .stage-panel {
  --y: 235;
  --h: 57;
}

.screen--room[data-private="true"] .stage-panel:has(#room-mode-picker:not([hidden])) .stage-list {
  inset: calc(2.4 * var(--unit)) 5% auto;
  height: calc(9.5 * var(--unit));
  font-size: 3.7cqw;
}

.screen--room[data-private="true"] .room-mode-picker {
  inset: calc(12.5 * var(--unit)) 4.5% calc(3 * var(--unit));
  gap: calc(1.3 * var(--unit));
}

.room-mode-picker {
  position: absolute;
  inset: calc(15 * var(--unit)) 4.5% calc(4 * var(--unit));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: calc(2 * var(--unit));
  align-content: center;
}

.room-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(1.6 * var(--unit));
}

.room-mode-btn,
.room-rush-btn,
.room-step-btn {
  border: 0.4cqw solid #8aaeff88;
  border-radius: 999px;
  background: linear-gradient(180deg, #32449f, #212a6b);
  color: #e6eeff;
  font-size: 3.35cqw;
  font-weight: 800;
  line-height: 1.1;
  padding: calc(1.7 * var(--unit)) calc(1.2 * var(--unit));
  cursor: pointer;
  white-space: nowrap;
}

.room-mode-btn[aria-pressed="true"],
.room-rush-btn[aria-pressed="true"] {
  border-color: #fff2a4;
  background: linear-gradient(180deg, #fff582, #ffc82e 58%, #f4900b);
  color: #4f2005;
  box-shadow: inset 0 -0.45cqw #c9680688, 0 0.4cqw 0.9cqw #140b4677;
}

.room-mode-options {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(10 * var(--unit));
}

.room-rush-durations,
.room-level-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(2 * var(--unit));
}

.room-rush-btn {
  min-width: calc(20 * var(--unit));
  padding-inline: calc(2.5 * var(--unit));
}

.room-step-btn {
  display: grid;
  place-items: center;
  width: calc(11 * var(--unit));
  height: calc(8.5 * var(--unit));
  padding: 0;
}

.room-level-label {
  min-width: calc(34 * var(--unit));
  padding: calc(1.2 * var(--unit)) calc(2.6 * var(--unit));
  border-radius: 999px;
  background: #161854c4;
  border: 0.35cqw solid #7ca4ff66;
  color: #ffe97d;
  font-size: 3.5cqw;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.room-mode-hint {
  margin: 0;
  color: #dce6ff;
  font-size: 3.2cqw;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}

/* Pre-match Translucent Dark Countdown Overlay */
.gameplay-countdown {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2.5cqw;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
}

.gameplay-countdown-mode {
  padding: 1.2cqw 4.2cqw;
  border: 0.55cqw solid #ffe57a;
  border-radius: 999px;
  background: linear-gradient(180deg, #4b38b5, #291e78);
  box-shadow: 0 0.8cqw 2cqw #00000088, inset 0 0.4cqw #ffffff44;
  color: #fff6b8;
  font-size: clamp(0.85rem, 4.4cqw, 1.2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gameplay-countdown[hidden] {
  display: none;
}

.gameplay-countdown-value {
  font-size: clamp(4.5rem, 30cqw, 7.5rem);
  font-weight: 900;
  line-height: 1;
  color: #ffe85e;
  -webkit-text-stroke: 6px #4e1f78;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 #4e1f78, 0 0 28px rgba(255, 224, 92, 0.65);
  user-select: none;
}

.gameplay-countdown-value[data-step="play"] {
  font-size: clamp(3.4rem, 22cqw, 5.8rem);
  color: #7dff8b;
  -webkit-text-stroke: 6px #0f4c2a;
  text-shadow: 0 6px 0 #0f4c2a, 0 0 30px rgba(96, 255, 130, 0.72);
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: no-preference) {
  .gameplay-countdown-value.is-popping {
    animation: gameplay-countdown-pop 320ms cubic-bezier(0.22, 1.35, 0.36, 1) both;
  }
}

@keyframes gameplay-countdown-pop {
  0% {
    opacity: 0;
    transform: scale(0.42);
  }
  70% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Equipped Warna Pops bubble color skins from Shop (outside Color Hunt) */
:root[data-pop-color="berry_pink"] .gameplay-bubble:not(.gameplay-bubble--white):not([data-bubble-color]) .gameplay-bubble-face,
:root[data-pop-color="berry_pink"] .gameplay-rule-bubble:not([data-bubble-color]) {
  background-color: #f45ca8;
  filter: hue-rotate(196deg) saturate(1.42) brightness(1.06);
}

:root[data-pop-color="sky_aqua"] .gameplay-bubble:not(.gameplay-bubble--white):not([data-bubble-color]) .gameplay-bubble-face,
:root[data-pop-color="sky_aqua"] .gameplay-rule-bubble:not([data-bubble-color]) {
  background-color: #2bc4f8;
  filter: hue-rotate(92deg) saturate(1.36) brightness(1.04);
}

:root[data-pop-color="sunny_lemon"] .gameplay-bubble:not(.gameplay-bubble--white):not([data-bubble-color]) .gameplay-bubble-face,
:root[data-pop-color="sunny_lemon"] .gameplay-rule-bubble:not([data-bubble-color]) {
  background-color: #f5ce24;
  filter: hue-rotate(-56deg) saturate(1.58) brightness(1.14);
}

:root[data-pop-color="grape_magic"] .gameplay-bubble:not(.gameplay-bubble--white):not([data-bubble-color]) .gameplay-bubble-face,
:root[data-pop-color="grape_magic"] .gameplay-rule-bubble:not([data-bubble-color]) {
  background-color: #9e5bff;
  filter: hue-rotate(146deg) saturate(1.42) brightness(1.04);
}

:root[data-pop-color="coral_peach"] .gameplay-bubble:not(.gameplay-bubble--white):not([data-bubble-color]) .gameplay-bubble-face,
:root[data-pop-color="coral_peach"] .gameplay-rule-bubble:not([data-bubble-color]) {
  background-color: #ff7744;
  filter: hue-rotate(-96deg) saturate(1.52) brightness(1.06);
}
