@font-face {
  font-family: Fredoka;
  src: url("../assets/fonts/Fredoka.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}
:root {
  --font-display: Fredoka, system-ui, sans-serif;
  --font-body: Fredoka, system-ui, sans-serif;
}
.logo,
.turn,
.win-title,
.play {
  font-weight: 700;
}
button {
  touch-action: manipulation;
}
.menu-screen button {
  scroll-margin-block: 16px;
}
button:focus-visible {
  outline: 3px solid #7566ba;
  outline-offset: 4px;
}
.game-modes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 12px auto 0;
}
.game-modes button {
  min-height: 40px;
  border: 0;
  border-radius: 13px;
  background: #ece8f7;
  color: #746c9d;
  font: 600 14px var(--font-body);
  cursor: pointer;
}
.game-modes button[aria-pressed="true"] {
  color: #534b8e;
  background: #fff;
  box-shadow:
    0 2px 0 #cfc9e9,
    0 3px 8px #69609926;
}
.game-mode-description {
  font: 500 13px/1.3 var(--font-body);
  color: #8b84aa;
  margin: 8px 0 0;
}
.custom-rules {
  margin: 10px 0;
  border-radius: 14px;
  background: #f0edf9;
  text-align: left;
  color: #625a91;
}
.custom-rules summary {
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
}
.custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px 14px;
}
.custom-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 500 13px/1.2 var(--font-body);
}
.custom-grid label:has(select) {
  align-items: flex-start;
  flex-direction: column;
}
.custom-grid select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d7d1eb;
  border-radius: 9px;
  background: #fff;
  color: #554e80;
  font: 600 13px var(--font-body);
}
.custom-grid input {
  width: 19px;
  height: 19px;
  accent-color: #8173bf;
  flex: none;
}
.custom-grid label:has(input:disabled) {
  opacity: 0.5;
}
.custom-done {
  display: block;
  margin: 0 auto 12px;
  border: 0;
  border-radius: 12px;
  background: #d9d3ef;
  color: #544e87;
  padding: 12px 18px;
  font: 700 13px var(--font-body);
  cursor: pointer;
}
@media (max-width: 700px) {
  .game-modes button {
    font-size: 11px;
    min-height: 38px;
  }
  .game-modes {
    gap: 3px;
  }
  .game-mode-description {
    font-size: 11px;
  }
  .custom-grid label {
    font-size: 12px;
  }
}
body.menu-open .top {
  visibility: hidden;
}
.menu-screen {
  padding: 12px;
  background: #e5dff11a;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: safe center;
  overflow-x: hidden;
}
.menu-shell {
  position: relative;
  isolation: isolate;
  width: min(660px, 100%);
  text-align: center;
  color: #434276;
  animation: menu-arrive 0.6s cubic-bezier(0.18, 0.9, 0.22, 1.15) both;
}
.menu-frame {
  position: absolute;
  z-index: -1;
  inset: 140px 0 0;
  width: 100%;
  height: calc(100% - 140px);
  pointer-events: none;
}
.menu-brand {
  display: flex;
  align-items: end;
  justify-content: center;
  margin: 0;
  line-height: 1;
}
.menu-brand img {
  display: block;
  width: 460px;
  max-width: 80%;
  height: auto;
  animation: menu-mascot 5.5s ease-in-out infinite;
  transform-origin: center 88%;
  filter: drop-shadow(0 5px 3px #75639415);
}
.menu-body {
  padding: 2px 38px 42px;
}
.menu-tagline {
  margin: 0;
  color: #8b88b9;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
}
.mode-switch {
  display: flex;
  gap: 8px;
  padding: 4px;
  margin: 14px auto 0;
  max-width: 400px;
  border-radius: 18px;
  background: #ebe9f7;
  box-shadow: inset 0 2px 3px #a6a0c71c;
}
.mode-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  border: 0;
  border-radius: 14px;
  min-height: 36px;
  padding: 6px 9px;
  background: transparent;
  font: 600 15px/1.15 var(--font-body);
  color: #8580ac;
  cursor: pointer;
  transition:
    transform 0.18s,
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}
.mode-switch button[aria-pressed="true"] {
  background: #fff;
  color: #5e568e;
  box-shadow: 0 3px 7px #6e609a20;
}
.mode-switch button:hover {
  transform: translateY(-1px);
}
.mode-switch svg {
  width: 19px;
  height: 19px;
  display: block;
}
.menu-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  font-size: 25px;
  line-height: 1.2;
  margin: 16px 0 12px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.menu-heading svg {
  display: block;
  width: 27px;
  height: 27px;
  color: #f283a0;
  transform: rotate(-14deg);
}
.menu-heading > span:last-child svg {
  transform: rotate(14deg);
}
.menu-screen .seats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}
.menu-screen .seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  min-width: 0;
  height: 168px;
  padding: 8px 5px 7px;
  border-radius: 24px;
  border: 2px solid #ffffff80;
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--sc), white 30%),
    color-mix(in srgb, var(--sc), white 10%)
  );
  color: var(--tc);
  box-shadow:
    inset 0 2px 1px #ffffff66,
    inset 0 -5px 0 #0000000a,
    0 4px 0 color-mix(in srgb, var(--sc), #d7c9de 45%),
    0 7px 9px #5e506b12;
  font-family: var(--font-body);
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.16s,
    box-shadow 0.16s,
    filter 0.16s;
}
.menu-screen .seat:hover {
  transform: translateY(-5px);
  filter: brightness(1.035);
  box-shadow:
    inset 0 2px 1px #ffffff88,
    inset 0 -5px 0 #00000008,
    0 7px 0 color-mix(in srgb, var(--sc), #d7c9de 45%),
    0 13px 12px #5e506b18;
}
.menu-screen .seat:active {
  transform: translateY(3px) scale(0.97);
}
.menu-screen .seat-cat {
  display: block;
  width: 108px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 224/180;
  flex: none;
  transition: transform 0.2s;
  filter: drop-shadow(0 2px 1px #65415820);
}
.menu-screen .seat:hover .seat-cat {
  transform: translateY(-2px) rotate(-3deg);
}
.menu-screen .seat b {
  display: block;
  font: 700 22px/1.08 var(--font-body);
  letter-spacing: -0.35px;
  white-space: nowrap;
  margin: 1px 0 0;
}
.menu-screen .seat small {
  font-size: 14px;
  font-weight: 500;
  margin: 1px 0 0;
  line-height: 1.2;
  opacity: 0.95;
}
.seat-state {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
  height: 23px;
}
.menu-screen .seat-state svg {
  width: 22px;
  height: 22px;
}
.menu-screen .seat.off {
  background: #e4e2ed;
  box-shadow:
    inset 0 2px 1px #fff8,
    inset 0 -5px 0 #76729012,
    0 4px 0 #ccc8df;
  color: #8c87a7;
}
.menu-screen .seat.off .seat-cat {
  filter: grayscale(1);
  opacity: 0.48;
}
.selection-tip {
  font-size: 13px;
  color: #9a93b6;
  line-height: 1.25;
  margin: 9px 0 0;
  font-weight: 500;
}
.menu-screen .warn {
  margin: 6px 0 0;
  min-height: 0;
  font: 600 14px/1.3 var(--font-body);
  color: #bb4970;
}
.menu-screen .warn:empty {
  display: none;
}
.menu-play {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 19px;
  width: 100%;
  height: 104px;
  border: 0;
  padding: 0 55px 5px;
  margin: 8px 0 0;
  background: transparent url("../assets/menu-play-v1.webp") center/100% 100% no-repeat;
  color: #754000;
  font: 700 34px/1 var(--font-body);
  cursor: pointer;
  filter: drop-shadow(0 4px 3px #bd7c2020);
  transition:
    transform 0.17s,
    filter 0.17s;
  transform-origin: center 60%;
}
.menu-play svg {
  width: 35px;
  height: 40px;
  display: block;
  transition: transform 0.2s;
}
.menu-play:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.015);
  filter: brightness(1.045) drop-shadow(0 8px 5px #bd7c202c);
}
.menu-play:hover .play-icon svg {
  transform: translateX(3px);
}
.menu-play:active:not(:disabled) {
  transform: translateY(4px) scale(0.98);
  filter: brightness(0.98);
}
.menu-play:disabled {
  filter: grayscale(0.8) opacity(0.65);
  cursor: not-allowed;
}
.menu-resume {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 4px auto 2px;
  padding: 9px 18px;
  border: 0;
  border-radius: 16px;
  background: #e8e3f6;
  color: #676099;
  font: 600 16px/1.2 var(--font-body);
  cursor: pointer;
  transition:
    background 0.18s,
    transform 0.18s;
}
.menu-resume:hover {
  background: #ded7ef;
  transform: translateY(-1px);
}
.menu-resume svg {
  display: block;
  width: 15px;
  height: 15px;
}
.menu-footer {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 9px;
}
.menu-footer button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 1;
  border: 0;
  border-right: 1px solid #e4dfef;
  background: transparent;
  padding: 2px 5px;
  color: #827db2;
  font: 600 14px/1 var(--font-body);
  cursor: pointer;
  transition:
    color 0.16s,
    transform 0.16s;
}
.menu-footer button:last-child {
  border: 0;
}
.menu-footer button:hover,
.menu-footer button[aria-expanded="true"] {
  color: #524a8e;
  transform: translateY(-2px);
}
.footer-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e8e6fb;
  box-shadow:
    inset 0 2px 1px #fff,
    inset 0 -3px 0 #c9c4e54d;
}
.footer-icon svg {
  display: block;
  width: 27px;
  height: 27px;
}
.menu-details {
  min-height: 296px;
  box-sizing: border-box;
  padding-top: 12px;
}
.menu-details h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 25px;
  line-height: 1.2;
  margin: 10px 0 18px;
  font-weight: 700;
}
.menu-details h2 svg {
  display: block;
  width: 24px;
  height: 24px;
  color: #8982b5;
}
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid #ebe7f3;
  text-align: left;
}
.option-row b {
  display: block;
  font-size: 19px;
  font-weight: 600;
}
.option-row small {
  display: block;
  font-size: 13px;
  color: #9991b6;
  margin-top: 5px;
}
.option-toggle,
.speed-choice button {
  border: 0;
  border-radius: 13px;
  padding: 10px 13px;
  background: #eee9f9;
  color: #79709f;
  font: 600 15px/1 var(--font-body);
  cursor: pointer;
}
.option-toggle[aria-pressed="true"],
.speed-choice button[aria-pressed="true"] {
  background: #d5f2e4;
  color: #38876d;
}
.speed-choice {
  display: flex;
  gap: 5px;
  flex: none;
}
.menu-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 18px auto 0;
  border: 0;
  background: transparent;
  color: #8279a5;
  font: 600 14px/1 var(--font-body);
  padding: 7px;
  cursor: pointer;
}
.menu-back svg {
  width: 13px;
  height: 13px;
  display: block;
}
.menu-rule-list {
  text-align: left;
  margin: 0;
  padding-left: 23px;
  font-size: 16px;
  color: #8c83a5;
  line-height: 1.45;
}
.menu-rule-list li {
  padding: 0 0 9px 4px;
}
.menu-rule-list b {
  color: #575079;
  font-weight: 600;
}
.menu-shortcuts {
  font-size: 13px;
  color: #9b94b2;
  margin: 2px 0 0;
}
.menu-screen.menu-leaving {
  pointer-events: none;
  animation: menu-screen-out 0.16s ease-in both;
}
.menu-leaving .menu-shell {
  animation: menu-depart 0.16s ease-in both;
}
.seat-pop {
  animation: menu-seat-pop 0.4s cubic-bezier(0.2, 0.8, 0.25, 1.3);
}
.has-resume .menu-brand img {
  width: 370px;
}
@keyframes menu-arrive {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes menu-mascot {
  0%,
  100% {
    transform: translateY(0) rotate(-0.4deg);
  }
  50% {
    transform: translateY(-4px) rotate(0.4deg);
  }
}
@keyframes menu-seat-pop {
  0% {
    transform: scale(0.94);
  }
  45% {
    transform: translateY(-5px) scale(1.045);
  }
  100% {
    transform: none;
  }
}
@keyframes menu-depart {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}
@keyframes menu-screen-out {
  to {
    opacity: 0;
  }
}
@media (min-width: 701px) and (max-height: 930px) {
  .menu-brand img {
    width: 390px;
  }
  .menu-frame {
    top: 120px;
    height: calc(100% - 120px);
  }
  .menu-body {
    padding-bottom: 37px;
  }
  .menu-play {
    height: 96px;
  }
  .menu-screen .seat {
    height: 164px;
  }
}
@media (min-width: 701px) and (max-height: 790px) {
  .menu-shell {
    width: 590px;
  }
  .menu-brand img {
    width: 300px;
  }
  .menu-frame {
    top: 90px;
    height: calc(100% - 90px);
  }
  .menu-body {
    padding: 0 33px 21px;
  }
  .menu-tagline {
    font-size: 17px;
  }
  .mode-switch {
    margin-top: 9px;
  }
  .mode-switch button {
    min-height: 31px;
    font-size: 14px;
  }
  .menu-heading {
    font-size: 22px;
    margin: 11px 0 10px;
  }
  .menu-screen .seat {
    height: 145px;
    border-radius: 20px;
  }
  .menu-screen .seat-cat {
    width: 92px;
  }
  .menu-screen .seat b {
    font-size: 20px;
  }
  .menu-play {
    height: 86px;
    font-size: 30px;
  }
  .footer-icon {
    width: 41px;
    height: 41px;
  }
  .footer-icon svg {
    width: 23px;
    height: 23px;
  }
  .menu-details {
    min-height: 262px;
  }
}
@media (max-width: 700px) {
  .menu-screen {
    padding: 8px;
  }
  .menu-shell {
    width: min(440px, 100%);
  }
  .menu-brand img {
    width: 270px;
    max-width: 78%;
  }
  .has-resume .menu-brand img {
    width: 230px;
  }
  .menu-frame {
    top: 84px;
    height: calc(100% - 84px);
  }
  .menu-body {
    padding: 1px 20px 28px;
  }
  .menu-tagline {
    font-size: 15px;
    line-height: 1.3;
  }
  .mode-switch {
    margin-top: 11px;
    gap: 3px;
    padding: 3px;
    border-radius: 14px;
  }
  .mode-switch button {
    font-size: 13px;
    padding: 6px 4px;
    min-height: 31px;
    gap: 6px;
    border-radius: 11px;
  }
  .mode-switch svg {
    width: 15px;
    height: 15px;
  }
  .menu-heading {
    font-size: 18px;
    gap: 7px;
    margin: 13px 0 10px;
    letter-spacing: -0.2px;
  }
  .menu-heading svg {
    width: 20px;
    height: 20px;
  }
  .menu-screen .seats {
    gap: 6px;
  }
  .menu-screen .seat {
    height: 125px;
    padding: 6px 2px 5px;
    border-radius: 18px;
    border-width: 1.5px;
  }
  .menu-screen .seat-cat {
    width: 76px;
  }
  .menu-screen .seat b {
    font-size: 15px;
    letter-spacing: -0.25px;
  }
  .menu-screen .seat small {
    font-size: 11px;
    margin-top: 2px;
  }
  .seat-state {
    height: 17px;
    margin-top: 4px;
  }
  .menu-screen .seat-state svg {
    width: 17px;
    height: 17px;
  }
  .selection-tip {
    font-size: 11px;
    margin-top: 9px;
  }
  .menu-play {
    height: 71px;
    padding: 0 34px 3px;
    gap: 11px;
    font-size: 25px;
    margin-top: 9px;
  }
  .menu-play svg {
    width: 23px;
    height: 26px;
  }
  .menu-footer {
    margin-top: 9px;
  }
  .menu-footer button {
    font-size: 11px;
    gap: 5px;
    padding: 2px 3px;
  }
  .footer-icon {
    width: 34px;
    height: 34px;
  }
  .footer-icon svg {
    width: 20px;
    height: 20px;
  }
  .menu-resume {
    font-size: 13px;
    padding: 8px 12px;
  }
  .menu-details {
    min-height: 249px;
    padding-top: 10px;
  }
  .menu-details h2 {
    font-size: 21px;
    margin-bottom: 12px;
  }
  .option-row {
    gap: 9px;
    padding: 17px 0;
  }
  .option-row b {
    font-size: 16px;
  }
  .option-row small {
    font-size: 11px;
  }
  .option-toggle,
  .speed-choice button {
    font-size: 13px;
    padding: 10px;
  }
  .menu-rule-list {
    font-size: 13px;
    line-height: 1.4;
    padding-left: 19px;
  }
  .menu-rule-list li {
    padding-bottom: 7px;
  }
  .menu-shortcuts {
    font-size: 11px;
  }
  .menu-back {
    font-size: 12px;
    margin-top: 13px;
  }
}
@media (max-width: 350px) {
  .menu-brand img {
    width: 235px;
  }
  .menu-body {
    padding-inline: 16px;
  }
  .menu-tagline {
    font-size: 13px;
  }
  .menu-heading {
    font-size: 16px;
    gap: 5px;
  }
  .menu-heading svg {
    width: 17px;
    height: 17px;
  }
  .menu-screen .seat {
    height: 115px;
  }
  .menu-screen .seat b {
    font-size: 13px;
  }
  .menu-screen .seat small {
    font-size: 10px;
  }
  .menu-play {
    font-size: 23px;
    height: 65px;
    padding-inline: 30px;
    gap: 8px;
  }
  .footer-icon {
    width: 30px;
    height: 30px;
  }
  .menu-footer button {
    font-size: 10px;
    gap: 4px;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  .menu-brand img,
  .has-resume .menu-brand img {
    width: 210px;
  }
  .menu-body {
    padding-bottom: 14px;
  }
  .menu-frame {
    top: 65px;
    height: calc(100% - 65px);
  }
  .mode-switch {
    margin-top: 8px;
  }
  .menu-heading {
    margin: 10px 0 8px;
  }
  .menu-screen .seat {
    height: 112px;
  }
  .menu-screen .seat-cat {
    width: 66px;
  }
  .selection-tip {
    margin-top: 7px;
  }
  .menu-play {
    height: 64px;
    margin-top: 6px;
  }
  .menu-footer {
    margin-top: 6px;
  }
  .menu-details {
    min-height: 229px;
  }
  .menu-tagline {
    font-size: 13px;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  .menu-screen {
    padding: 7px;
  }
  .menu-shell {
    width: min(780px, 100%);
    display: grid;
    grid-template-columns: 230px 1fr;
    align-items: center;
    padding: 14px 17px;
    box-sizing: border-box;
  }
  .menu-frame {
    top: 0;
    height: 100%;
  }
  .menu-brand img,
  .has-resume .menu-brand img {
    width: 230px;
    max-width: 100%;
  }
  .menu-body {
    padding: 0 10px 2px;
  }
  .menu-tagline {
    display: none;
  }
  .mode-switch {
    margin-top: 4px;
    padding: 3px;
  }
  .mode-switch button {
    font-size: 12px;
    min-height: 29px;
  }
  .mode-switch svg {
    width: 14px;
    height: 14px;
  }
  .menu-heading {
    font-size: 18px;
    gap: 7px;
    margin: 9px 0 8px;
  }
  .menu-heading svg {
    width: 18px;
    height: 18px;
  }
  .menu-screen .seats {
    gap: 6px;
  }
  .menu-screen .seat {
    height: 108px;
    padding: 4px 2px;
  }
  .menu-screen .seat-cat {
    width: 67px;
  }
  .menu-screen .seat b {
    font-size: 15px;
  }
  .menu-screen .seat small {
    font-size: 11px;
  }
  .seat-state {
    margin-top: 2px;
    height: 16px;
  }
  .menu-screen .seat-state svg {
    width: 16px;
    height: 16px;
  }
  .selection-tip {
    font-size: 10px;
    margin-top: 6px;
  }
  .menu-play {
    font-size: 24px;
    height: 69px;
    padding: 0 40px 4px;
    margin-top: 3px;
    gap: 12px;
  }
  .menu-play svg {
    width: 23px;
    height: 25px;
  }
  .menu-footer {
    margin-top: 4px;
  }
  .menu-footer button {
    font-size: 11px;
    gap: 5px;
  }
  .footer-icon {
    width: 30px;
    height: 30px;
  }
  .footer-icon svg {
    width: 17px;
    height: 17px;
  }
  .menu-resume {
    font-size: 12px;
    padding: 5px 12px;
  }
  .menu-details {
    min-height: 196px;
    padding-top: 0;
  }
  .menu-details h2 {
    font-size: 20px;
    margin: 4px 0 10px;
  }
  .option-row {
    padding: 10px 0;
  }
  .option-row b {
    font-size: 16px;
  }
  .option-row small {
    font-size: 11px;
  }
  .menu-rule-list {
    font-size: 12px;
    line-height: 1.3;
  }
  .menu-shortcuts {
    font-size: 10px;
  }
  .menu-back {
    font-size: 11px;
    margin-top: 9px;
  }
}

/* Secondary screens are independent of the small welcome panel. */
.menu-hud {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  z-index: 8;
}
.menu-hud button,
.aux-head button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid #dedcf4;
  border-radius: 14px;
  color: #655f9f;
  background: #f9f8ff;
  box-shadow:
    0 4px 0 #b9b4d7,
    0 7px 15px #554f8024;
  cursor: pointer;
  transition: transform 0.15s;
}
.menu-hud button:hover,
.aux-head button:hover {
  transform: translateY(-2px);
}
.menu-hud button:active,
.aux-head button:active {
  transform: translateY(2px);
}
.menu-hud svg {
  width: 21px;
  height: 21px;
  display: block;
}
.menu-screen.aux-open .menu-shell,
.menu-screen.aux-open .menu-hud {
  visibility: hidden;
}
.aux-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #45426a55;
  backdrop-filter: blur(3px);
}
.aux-card {
  box-sizing: border-box;
  width: min(620px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 26px 30px 30px;
  border: 3px solid #b7a8ee;
  border-radius: 30px;
  color: #454275;
  background: #faf8ff;
  box-shadow:
    0 7px 0 #9182d1,
    0 18px 40px #3d355436;
}
.aux-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.aux-head h2 {
  margin: 0;
  font: 700 28px var(--font-display);
}
.aux-head button {
  flex: none;
  width: 44px;
  height: 44px;
  font: 500 30px/1 var(--font-body);
}
.aux-intro,
.aux-note {
  font: 500 15px/1.5 var(--font-body);
  color: #69638d;
}
.aux-note {
  margin-bottom: 0;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #eae6f4;
  text-align: left;
}
.setting-row b,
.setting-row small {
  display: block;
}
.setting-row b,
.volume-row b {
  font-size: 17px;
}
.setting-row small {
  margin-top: 4px;
  font-size: 13px;
  color: #716b8e;
}
.setting-row select {
  max-width: 58%;
  min-height: 44px;
  border: 2px solid #ded8ef;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  color: #514a80;
  font: 600 14px var(--font-body);
}
.volume-row {
  display: block;
  margin: 18px 0;
  text-align: left;
}
.volume-row > span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.volume-row output {
  font-size: 14px;
  color: #77709b;
}
.volume-row input {
  display: block;
  width: 100%;
  margin: 10px 0;
  accent-color: #8d7adc;
  cursor: pointer;
}
.rule-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.rule-cards article {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  background: #f1eefb;
  border-radius: 16px;
  text-align: left;
}
.rule-cards article > span {
  font-size: 27px;
}
.rule-cards b {
  font-size: 16px;
}
.rule-cards p {
  margin: 5px 0 0;
  font: 500 13px/1.4 var(--font-body);
  color: #69638d;
}
.rule-cards img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  flex: none;
}
.player-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px 0 0;
  font: 600 14px var(--font-body);
  color: #68618f;
}
.player-count > div {
  display: flex;
  gap: 5px;
  background: #ebe7f7;
  padding: 4px;
  border-radius: 14px;
}
.player-count button {
  width: 42px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #777098;
  font: 700 16px var(--font-body);
  cursor: pointer;
}
.player-count button[aria-pressed="true"] {
  background: white;
  color: #554d8f;
  box-shadow: 0 2px 5px #6e609a26;
}
.player-count button:disabled {
  opacity: 0.35;
}
.welcome-cats img:only-child {
  width: clamp(120px, 16vw, 200px);
  height: clamp(120px, 16vw, 200px);
}
.menu-shell[data-view="home"] #menuHome {
  flex-basis: clamp(125px, 18vw, 210px);
}
.menu-shell:not([data-view="home"]) .menu-brand img {
  width: calc(var(--brand-width) * 0.72);
}
.menu-shell:not([data-view="home"]) .menu-frame {
  top: calc(var(--brand-width) * 0.23);
  height: calc(100% - var(--brand-width) * 0.23);
}
.menu-shell:is([data-view="custom"], [data-view="customExtra"]) .menu-brand {
  display: none;
}
.menu-shell:is([data-view="custom"], [data-view="customExtra"]) .menu-frame {
  top: 0;
  height: 100%;
}
.custom-grid select {
  border: 2px solid #d8d1ed;
  border-radius: 12px;
  background: #fff;
  color: #514a80;
  min-height: 44px;
  padding: 8px;
  font: 600 14px var(--font-body);
}
.custom-select-group {
  text-align: left;
  font: 500 14px/1.2 var(--font-body);
  color: #504a78;
}
.exit-choice {
  display: flex;
  gap: 3px;
  margin-top: 7px;
  padding: 4px;
  border-radius: 12px;
  background: #ded9ef;
}
.exit-choice button {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #655b8b;
  font: 600 12px var(--font-body);
  cursor: pointer;
}
.exit-choice button[aria-pressed="true"] {
  background: #fff;
  color: #514a80;
  box-shadow: 0 2px 5px #746e9930;
}
.custom-grid input[type="checkbox"] {
  appearance: none;
  width: 39px;
  height: 23px;
  border-radius: 20px;
  background: #c9c5d8;
  position: relative;
  transition: background 0.15s;
  cursor: pointer;
}
.custom-grid input[type="checkbox"]:before {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px #534d7244;
  transition: transform 0.15s;
}
.custom-grid input[type="checkbox"]:checked {
  background: #8b7bdd;
}
.custom-grid input[type="checkbox"]:checked:before {
  transform: translateX(16px);
}
.custom-grid input:focus-visible,
.custom-grid select:focus-visible,
.volume-row input:focus-visible {
  outline: 3px solid #7566ba;
  outline-offset: 3px;
}
.custom-grid label {
  font-size: 14px;
  color: #504a78;
}
.game-modes button small,
.game-mode-description,
.selection-tip {
  color: #665f83;
}
.hud-logo {
  display: block;
  width: 105px;
  height: 48px;
  object-fit: contain;
}
@media (max-width: 620px) {
  .tray .hint {
    font-size: 13px;
    color: #5d6395;
  }
  .tray .chip {
    font-size: 12px;
  }
  .tray .turn {
    font-size: 20px;
  }
}
@media (max-width: 700px) {
  .menu-hud {
    top: 8px;
    right: 8px;
    gap: 5px;
  }
  .menu-hud button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .aux-card {
    padding: 20px;
    border-radius: 24px;
  }
  .aux-head h2 {
    font-size: 23px;
  }
  .setting-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .setting-row select {
    max-width: none;
    width: 100%;
  }
  .rule-cards {
    grid-template-columns: 1fr;
  }
  .welcome-cats img:only-child {
    width: 150px;
    height: 150px;
  }
  .menu-shell[data-view="home"] #menuHome {
    flex-basis: 150px;
  }
  .player-count {
    gap: 8px;
  }
  .hud-logo {
    width: 82px;
    height: 43px;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  .welcome-cats img:only-child {
    width: 105px;
    height: 105px;
  }
  .menu-shell[data-view="home"] #menuHome {
    flex-basis: 105px;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  .menu-shell:not([data-view="home"]) .menu-frame {
    top: 0;
    height: 100%;
  }
  .welcome-cats img:only-child {
    width: 95px;
    height: 95px;
  }
  .menu-shell[data-view="home"] #menuHome {
    flex-basis: 95px;
  }
  .menu-hud {
    top: 4px;
    right: 4px;
  }
  .menu-hud button {
    width: 40px;
    height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .menu-hud button,
  .custom-grid input,
  .custom-grid input:before {
    transition: none;
  }
}
/* Keep the actual contents inside each card, with space between menu groups. */
.menu-screen .seat {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 84px 24px 18px 22px;
  row-gap: 4px;
  align-content: center;
  justify-content: stretch;
  justify-items: center;
  height: 190px;
  padding: 12px 8px;
}
.menu-screen .seat-cat {
  width: 104px;
  max-height: 84px;
  object-fit: contain;
}
.menu-screen .seat b,
.menu-screen .seat small {
  margin: 0;
}
.seat-state {
  margin: 0;
  height: 22px;
}
.menu-heading {
  margin-bottom: 18px;
}
.selection-tip {
  margin: 12px 0 0;
}
.menu-play {
  margin-top: 18px;
}
.menu-resume {
  min-height: 44px;
  margin: 12px auto 0;
  padding: 9px 18px;
  box-sizing: border-box;
}
.menu-footer {
  margin-top: 18px;
}
.menu-footer button {
  min-height: 48px;
}
.mode-switch button,
.option-toggle,
.speed-choice button,
.menu-back {
  min-height: 44px;
  box-sizing: border-box;
}
.has-resume .menu-brand img {
  width: 290px;
}
body:not(.game-started) .top,
body:not(.game-started) .tray,
body.menu-open .tray {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
body.game-revealing #fx {
  pointer-events: none;
}
.tray.game-entering {
  opacity: var(--intro-opacity, 0);
  transform: translateY(var(--intro-y, 20px)) scale(var(--intro-scale, 0.94));
  pointer-events: none;
}
@media (min-width: 701px) and (max-height: 930px) {
  .menu-screen .seat {
    height: 180px;
    grid-template-rows: 78px 24px 16px 20px;
    padding: 12px 8px;
    row-gap: 3px;
  }
  .menu-screen .seat-cat {
    width: 96px;
    max-height: 78px;
  }
  .seat-state {
    height: 20px;
  }
}
@media (min-width: 701px) and (max-height: 790px) {
  .menu-brand img {
    width: 260px;
  }
  .has-resume .menu-brand img {
    width: 210px;
  }
  .menu-screen .seat {
    height: 165px;
    grid-template-rows: 68px 22px 16px 19px;
    padding: 12px 6px;
    row-gap: 3px;
  }
  .menu-screen .seat-cat {
    width: 84px;
    max-height: 68px;
  }
  .seat-state {
    height: 19px;
  }
  .menu-heading {
    margin-bottom: 14px;
  }
  .menu-footer {
    margin-top: 14px;
  }
}
@media (max-width: 700px) {
  .menu-screen .seat {
    height: 138px;
    grid-template-rows: 58px 18px 14px 18px;
    padding: 9px 3px;
    row-gap: 3px;
  }
  .menu-screen .seat-cat {
    width: 72px;
    max-height: 58px;
  }
  .seat-state {
    height: 18px;
  }
  .menu-screen .seat-state svg {
    width: 16px;
    height: 16px;
  }
  .menu-heading {
    margin-bottom: 14px;
  }
  .selection-tip {
    margin-top: 11px;
  }
  .menu-play {
    margin-top: 16px;
  }
  .menu-footer {
    margin-top: 15px;
  }
  .menu-footer button {
    min-height: 44px;
  }
  .menu-resume {
    margin-top: 11px;
    font-size: 13px;
  }
  .has-resume .menu-brand img {
    width: 205px;
  }
  .menu-body {
    padding-bottom: 28px;
  }
  .option-row {
    gap: 8px;
  }
  .menu-back {
    padding-block: 12px;
  }
}
@media (max-width: 350px) {
  .menu-screen .seat {
    height: 128px;
    grid-template-rows: 52px 16px 13px 16px;
    padding: 8px 3px;
    row-gap: 3px;
  }
  .menu-screen .seat-cat {
    width: 64px;
    max-height: 52px;
  }
  .seat-state {
    height: 16px;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  .menu-brand img {
    width: 180px;
  }
  .has-resume .menu-brand img {
    width: 155px;
  }
  .menu-frame {
    top: 49px;
    height: calc(100% - 49px);
  }
  .menu-body {
    padding-bottom: 23px;
  }
  .menu-heading {
    margin-block: 12px 13px;
  }
  .selection-tip {
    margin-top: 10px;
  }
  .menu-play {
    margin-top: 14px;
  }
  .menu-footer {
    margin-top: 12px;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  .menu-brand img,
  .has-resume .menu-brand img {
    width: 210px;
  }
  .menu-frame {
    top: 0;
    height: 100%;
  }
  .menu-screen .seat {
    height: 128px;
    grid-template-rows: 50px 18px 13px 16px;
    padding: 8px 2px;
    row-gap: 3px;
  }
  .menu-screen .seat-cat {
    width: 62px;
    max-height: 50px;
  }
  .seat-state {
    height: 16px;
  }
  .menu-heading {
    margin-block: 10px 12px;
  }
  .menu-play {
    margin-top: 10px;
  }
  .menu-footer {
    margin-top: 12px;
  }
  .menu-resume {
    min-height: 44px;
    margin-top: 10px;
  }
  .menu-body {
    padding-block: 4px 12px;
  }
  .menu-shell {
    margin-block: 3px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .menu-shell,
  .menu-brand img,
  .seat-pop,
  .menu-screen.menu-leaving,
  .menu-leaving .menu-shell {
    animation: none !important;
  }
  .menu-screen button,
  .menu-screen .seat-cat,
  .menu-play svg {
    transition: none;
  }
}
/* Each setup step has its own compact panel, keeping the ears in proportion. */
.game-modes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.game-modes button {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  min-height: 90px;
  padding: 9px 12px;
  background: #efedf9;
  border: 2px solid #fff9;
  box-shadow: 0 3px 0 #d7d1e9;
  color: #514a80;
}
.game-modes button:hover,
.game-modes button:focus-visible {
  background: #e5e1f5;
  transform: translateY(-2px);
}
.game-modes button canvas {
  width: 64px;
  height: 52px;
  object-fit: contain;
  flex: none;
}
.game-modes button b {
  font-size: 16px;
  white-space: nowrap;
}
.game-modes button small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #8e86a9;
}
.game-modes button {
  display: grid;
  grid-template-columns: 64px 1fr;
  column-gap: 10px;
  row-gap: 0;
  align-content: center;
}
.game-modes button canvas,
.mode-pair {
  grid-column: 1;
  grid-row: 1 / 3;
}
.game-modes button b,
.game-modes button small {
  grid-column: 2;
}
.mode-pair {
  position: relative;
  display: block;
  width: 64px;
  height: 52px;
}
.mode-pair canvas {
  position: absolute;
  width: 46px;
  height: 46px;
  top: 3px;
}
.mode-pair canvas:first-child {
  left: 0;
}
.mode-pair canvas:last-child {
  right: 0;
}
#customRules .custom-grid {
  background: #f0edf9;
  border-radius: 15px;
  padding: 14px;
  margin-top: 4px;
}
#customRules .menu-heading {
  margin: 8px 0 14px;
}
#customRules .custom-done {
  margin: 14px auto 0;
  min-height: 44px;
}
#customRules .menu-back,
#modeSetup .menu-back,
#playerSetup .menu-back {
  margin-top: 10px;
}
@media (max-width: 700px) {
  .game-modes {
    gap: 7px;
  }
  .game-modes button {
    grid-template-columns: 45px 1fr;
    column-gap: 4px;
    min-height: 79px;
    padding: 7px 5px;
  }
  .game-modes button canvas {
    width: 45px;
    height: 40px;
  }
  .game-modes button b {
    font-size: 13px;
  }
  .game-modes button small {
    font-size: 10px;
    line-height: 1.2;
  }
  .mode-pair {
    width: 45px;
    height: 40px;
  }
  .mode-pair canvas {
    width: 33px !important;
    height: 33px !important;
  }
}
.menu-shell {
  container-type: inline-size;
  min-height: min(790px, calc(100dvh - 24px));
}
.menu-frame {
  border-style: solid;
  border-width: 1px;
  border-image-source: url("../assets/menu-frame-v1.webp");
  border-image-slice: 140 190 70 190 fill;
  border-image-width: 21.212cqw 28.788cqw 10.606cqw 28.788cqw;
  border-image-repeat: stretch;
}
.menu-shell {
  height: min(730px, calc(100dvh - 24px));
  min-height: 0;
  display: flex;
  flex-direction: column;
  --brand-width: 380px;
}
.menu-brand {
  flex: none;
}
.menu-brand img,
.has-resume .menu-brand img {
  width: var(--brand-width);
}
.menu-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #c8c1e3 transparent;
}
.menu-shell[data-view="home"] #menuHome {
  flex: 0 0 110px;
}
.welcome-cats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.welcome-cats img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px #77709925);
}
.welcome-cats img:nth-child(2) {
  width: 100px;
  height: 100px;
}
.menu-shell[data-view="home"] .menu-body {
  justify-content: space-evenly;
}
.menu-shell[data-view="home"] .menu-footer {
  margin-top: 0;
}
.menu-shell:not([data-view="home"]) .menu-tagline,
.menu-shell:not([data-view="home"]) .menu-footer {
  display: none;
}
.menu-screen .seat:hover .seat-cat {
  transform: translateY(-2px);
}
#modeSetup,
#playerSetup,
#customRules {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.game-modes button {
  min-height: 104px;
}
.game-modes button small {
  font-size: 12px;
}
.game-modes button .mode-pair canvas {
  width: 46px;
  height: 46px;
}
.menu-back {
  min-width: 120px;
  padding: 10px 16px;
  border-radius: 12px;
  background: #efedf9;
  color: #5e568f;
  font-size: 14px;
}
@media (min-width: 701px) and (max-height: 930px) {
  .menu-shell {
    --brand-width: 330px;
  }
}
@media (min-width: 701px) and (max-height: 790px) {
  .menu-shell {
    --brand-width: 260px;
  }
}
@media (max-width: 700px) {
  .menu-shell {
    --brand-width: 230px;
  }
  .game-modes button {
    min-height: 90px;
  }
  .game-modes button small {
    font-size: 11px;
  }
  .game-modes button .mode-pair canvas {
    width: 33px;
    height: 33px;
  }
}
@media (max-width: 350px) {
  .menu-shell {
    --brand-width: 235px;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  .menu-shell {
    --brand-width: 180px;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  .menu-shell {
    display: grid;
    --brand-width: 210px;
  }
  .menu-body {
    height: 100%;
    box-sizing: border-box;
  }
}
.game-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 500px);
  margin: 0 auto;
}
.game-modes button {
  display: flex;
  align-items: center;
  min-height: 77px;
  padding: 4px 15px 4px 8px;
  text-align: left;
  gap: 12px;
  border-radius: 18px;
  background: linear-gradient(110deg, #f8f5ff, #eeebfa);
  transition:
    transform 0.18s,
    box-shadow 0.18s,
    background 0.18s;
}
.game-modes button img {
  display: block;
  width: 76px;
  height: 68px;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 3px 2px #77709935);
  transition: transform 0.2s;
}
.game-modes button .mode-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.game-modes button b {
  font: 700 17px/1.1 var(--font-body);
  color: #484478;
}
.game-modes button small {
  font: 500 12px/1.25 var(--font-body);
  color: #817a9f;
}
.mode-arrow {
  font: 600 28px/1 var(--font-body);
  color: #a39ac7;
}
.game-modes button:hover img {
  transform: translateY(-3px) rotate(-3deg);
}
.game-modes button:active {
  transform: scale(0.98);
}
.game-modes button[data-game-mode="classic"] {
  background: linear-gradient(105deg, #fff2f3, #f5eaf5);
}
.game-modes button[data-game-mode="quick"] {
  background: linear-gradient(105deg, #fff6dc, #f7eff1);
}
.game-modes button[data-game-mode="teams"] {
  background: linear-gradient(105deg, #e5f7ed, #e9f1fc);
}
.game-modes button[data-game-mode="custom"] {
  background: linear-gradient(105deg, #eaf4ff, #f2eafb);
}
@media (max-width: 700px) {
  .game-modes {
    gap: 6px;
  }
  .game-modes button {
    min-height: 69px;
    padding: 3px 10px 3px 5px;
    gap: 8px;
  }
  .game-modes button img {
    width: 67px;
    height: 62px;
  }
  .game-modes button b {
    font-size: 15px;
  }
  .game-modes button small {
    font-size: 11px;
  }
  .mode-arrow {
    font-size: 24px;
  }
}
@media (max-width: 700px) {
  .game-modes button small,
  .custom-grid label,
  .custom-grid select {
    font-size: 12px;
  }
  .welcome-cats img {
    width: 64px;
    height: 64px;
  }
  .welcome-cats img:nth-child(2) {
    width: 78px;
    height: 78px;
  }
  .menu-shell[data-view="home"] #menuHome {
    flex-basis: 88px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-modes button,
  .game-modes button img {
    transition: none;
  }
  .game-modes button:hover img {
    transform: none;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  .menu-body {
    padding-top: 38px;
  }
  .game-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .game-modes button {
    min-height: 86px;
    padding: 3px 7px;
    gap: 5px;
  }
  .game-modes button img {
    width: 58px;
    height: 60px;
  }
  .game-modes button b {
    font-size: 14px;
  }
  .game-modes button small {
    font-size: 11px;
  }
  .mode-arrow {
    font-size: 22px;
  }
}
@keyframes menu-step-arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.menu-view:not([hidden]) {
  animation: menu-step-arrive 0.24s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  .menu-view:not([hidden]) {
    animation: none;
  }
}

/* Keep the primary action intact and give text enough room at each breakpoint. */
.menu-play {
  flex-shrink: 0;
}
.menu-shell[data-view="players"] #playerSetup {
  flex: 0 0 auto;
  justify-content: flex-start;
}
.menu-shell[data-view="players"] .menu-heading {
  margin-block: 10px 12px;
}
.menu-shell[data-view="players"] .menu-back {
  margin-top: 7px;
}
.game-modes button b {
  font-size: 20px;
}
.game-modes button small {
  font-size: 15px;
  line-height: 1.3;
  color: #6e678e;
}
.game-mode-description {
  font-size: 15px;
}
@media (min-width: 701px) and (min-height: 791px) {
  .menu-shell[data-view="home"] .menu-brand img {
    width: 420px;
  }
  .menu-shell[data-view="players"] .seat {
    height: 145px;
    grid-template-rows: 58px 22px 16px 18px;
    padding: 7px 6px;
    row-gap: 3px;
  }
  .menu-shell[data-view="players"] .seat-cat {
    width: 76px;
    max-height: 58px;
  }
  .menu-shell[data-view="players"] .menu-play {
    height: 80px;
    margin-top: 10px;
  }
  .menu-shell[data-view="players"] .menu-body {
    padding-bottom: 24px;
  }
}
@media (max-width: 700px) {
  .game-modes button b {
    font-size: 17px;
  }
  .game-modes button small {
    font-size: 13px;
  }
  .game-mode-description {
    font-size: 13px;
  }
  .menu-shell[data-view="home"] .menu-brand img {
    width: 270px;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  .menu-shell[data-view="home"] .menu-brand img {
    width: 200px;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  .game-modes button b {
    font-size: 16px;
  }
  .game-modes button small {
    font-size: 12px;
  }
  .menu-shell[data-view="players"] .menu-body {
    padding-top: 30px;
  }
  .menu-shell[data-view="players"] .game-mode-description,
  .menu-shell[data-view="players"] .selection-tip {
    display: none;
  }
  .menu-shell[data-view="players"] .menu-heading {
    margin-block: 4px;
    font-size: 16px;
  }
  .menu-shell[data-view="players"] .seat {
    height: 92px;
    grid-template-rows: 36px 16px 12px 14px;
    padding: 4px 2px;
    row-gap: 2px;
  }
  .menu-shell[data-view="players"] .seat-cat {
    width: 47px;
    max-height: 36px;
  }
  .menu-shell[data-view="players"] .seat b {
    font-size: 14px;
  }
  .menu-shell[data-view="players"] .seat small {
    font-size: 10px;
  }
  .menu-shell[data-view="players"] .seat-state svg {
    width: 14px;
    height: 14px;
  }
  .menu-shell[data-view="players"] .menu-play {
    height: 56px;
    margin-top: 0;
  }
  .menu-shell[data-view="players"] .menu-back {
    margin-top: 3px;
  }
}

/* Seats set to "fora" nap in place: closed eyes on the portrait plus drifting Zzz. */
.menu-screen .seat {
  position: relative;
}
.menu-screen .seat.off .seat-cat {
  opacity: 0.72;
}
.seat-zzz {
  position: absolute;
  top: 2%;
  right: 6%;
  width: 34px;
  height: 40px;
  pointer-events: none;
  font-weight: 700;
  color: #7b6fd6;
  text-shadow:
    0 0 3px #fff,
    0 0 3px #fff;
}
.seat-zzz i {
  position: absolute;
  left: 0;
  bottom: 0;
  font-style: normal;
  line-height: 1;
  opacity: 0;
  animation: seat-zzz 2.7s ease-out infinite;
}
.seat-zzz i:nth-child(1) {
  font-size: 11px;
}
.seat-zzz i:nth-child(2) {
  font-size: 14px;
  animation-delay: 0.9s;
}
.seat-zzz i:nth-child(3) {
  font-size: 18px;
  animation-delay: 1.8s;
}
@keyframes seat-zzz {
  0% {
    opacity: 0;
    transform: translate(0, 4px) rotate(-8deg);
  }
  20% {
    opacity: 1;
  }
  70% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(14px, -26px) rotate(10deg);
  }
}

/* Opening and setup: artwork leads, while each step keeps its own readable surface. */
.menu-shell:is([data-view="home"], [data-view="modes"], [data-view="players"], [data-view="ask"]) {
  width: min(570px, 100%);
  height: auto;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
}
.menu-shell:is([data-view="home"], [data-view="modes"], [data-view="players"], [data-view="ask"])
  .menu-frame {
  display: none;
}
.menu-shell[data-view="home"] .menu-brand img {
  width: min(510px, 90vw);
  max-width: 100%;
}
.menu-shell[data-view="home"] .menu-body {
  flex: none;
  overflow: visible;
  justify-content: flex-start;
  align-items: center;
  padding: 0 20px 12px;
}
.menu-shell[data-view="home"] #menuHome {
  display: none;
}
.menu-shell[data-view="home"] .menu-tagline {
  color: #5e5897;
  text-shadow: 0 1px 8px #fff;
  font-size: clamp(18px, 2vw, 23px);
  margin: 3px 0 24px;
}
.menu-shell[data-view="home"] .menu-play {
  max-width: 500px;
  margin: 0;
}
.menu-shell[data-view="home"] .menu-resume {
  margin-top: 14px;
}
.menu-shell:is([data-view="modes"], [data-view="players"], [data-view="ask"]) .menu-brand {
  display: none;
}
.menu-shell:is([data-view="modes"], [data-view="players"], [data-view="ask"]) .menu-body {
  flex: 0 1 auto;
  overflow: auto;
  padding: 22px 24px 24px;
  border-radius: 30px;
  background: rgba(255, 251, 253, 0.91);
  box-shadow: 0 10px 35px #53437735;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#modeSetup,
#playerSetup,
#askLudo {
  flex: 0 0 auto;
  justify-content: flex-start;
}
#modeSetup .menu-heading {
  margin: 0 0 3px;
}
.mode-subtitle {
  margin: 0 0 16px;
  color: #7770a8;
  font-size: 15px;
  font-weight: 600;
}
.game-modes {
  width: 100%;
  gap: 10px;
}
.game-modes button {
  min-height: 100px;
  padding: 7px 16px 7px 10px;
  border-radius: 22px;
  box-shadow:
    0 3px 0 #d4c8e2,
    0 6px 13px #67558116;
}
.game-modes button img {
  width: 100px;
  height: 90px;
}
.game-modes button b {
  font-size: 22px;
}
.game-modes button small {
  font-size: 15px;
}
.game-modes button[data-game-mode="classic"] b {
  color: #c63768;
}
.game-modes button[data-game-mode="quick"] b {
  color: #388962;
}
.game-modes button[data-game-mode="teams"] b {
  color: #3775bd;
}
.game-modes button[data-game-mode="custom"] b {
  color: #b66a12;
}
.mode-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: #ded8f2;
  color: #665d9d;
}
.menu-shell[data-view="players"] .menu-body {
  padding-top: 24px;
}
.menu-shell[data-view="players"] .game-mode-description {
  margin: 0 0 16px;
  color: #5e588f;
  font-size: 16px;
  font-weight: 600;
}
.menu-shell[data-view="players"] .selection-tip {
  color: #746e9a;
  font-size: 14px;
}
.menu-shell[data-view="players"] .menu-play {
  margin-top: 14px;
}
@media (max-width: 700px) {
  .menu-shell:is(
    [data-view="home"],
    [data-view="modes"],
    [data-view="players"],
    [data-view="ask"]
  ) {
    width: min(440px, 100%);
    max-height: calc(100dvh - 72px);
    margin-top: 52px;
  }
  .menu-shell[data-view="home"] .menu-brand img {
    width: min(390px, 92vw);
  }
  .menu-shell[data-view="home"] .menu-body {
    width: 100%;
    box-sizing: border-box;
    padding: 0 12px;
  }
  .menu-shell[data-view="home"] .menu-tagline {
    font-size: 18px;
    margin: 0 0 20px;
  }
  .menu-shell:is([data-view="modes"], [data-view="players"], [data-view="ask"]) .menu-body {
    padding: 18px 16px 20px;
    border-radius: 24px;
  }
  #modeSetup .menu-heading {
    font-size: 22px;
    gap: 7px;
  }
  .mode-subtitle {
    font-size: 13px;
    margin-bottom: 12px;
  }
  .game-modes {
    gap: 8px;
  }
  .game-modes button {
    min-height: 82px;
    padding: 5px 10px 5px 7px;
    gap: 8px;
  }
  .game-modes button img {
    width: 76px;
    height: 72px;
  }
  .game-modes button b {
    font-size: 18px;
  }
  .game-modes button small {
    font-size: 13px;
  }
  .mode-arrow {
    width: 32px;
    height: 32px;
    font-size: 24px;
  }
  .menu-shell[data-view="players"] .game-mode-description {
    font-size: 13px;
    margin-bottom: 10px;
  }
  .menu-shell[data-view="players"] .selection-tip {
    font-size: 12px;
  }
}
@media (max-height: 700px) {
  .menu-shell[data-view="home"] .menu-brand img {
    width: min(360px, 65vh, 80vw);
  }
  .menu-shell[data-view="home"] .menu-tagline {
    margin-bottom: 10px;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  .menu-shell[data-view="home"] {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: min(780px, 100%);
  }
  .menu-shell[data-view="home"] .menu-brand {
    width: 48%;
  }
  .menu-shell[data-view="home"] .menu-brand img {
    width: 100%;
  }
  .menu-shell[data-view="home"] .menu-body {
    width: 52%;
    height: auto;
    padding: 0 20px;
  }
  .menu-shell:is([data-view="modes"], [data-view="players"], [data-view="ask"]) {
    width: min(760px, 100%);
  }
  .game-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .game-modes button {
    min-height: 75px;
  }
  .game-modes button img {
    width: 65px;
    height: 62px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .seat-zzz i {
    animation: none;
    opacity: 1;
  }
  .seat-zzz i:nth-child(1) {
    transform: translate(0, 0);
  }
  .seat-zzz i:nth-child(2) {
    transform: translate(7px, -12px);
  }
  .seat-zzz i:nth-child(3) {
    transform: translate(15px, -26px);
  }
}

/* A consistent, high-contrast back control stays at the start of every step. */
.menu-screen .menu-view > .menu-back {
  align-self: flex-start;
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  min-width: 46px;
  margin: 0 0 8px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 15px;
  background: #ded9f3;
  color: #514780;
  box-shadow: 0 3px 0 #bbb2dd;
  font-size: 0;
  line-height: 1;
}
.menu-screen .menu-view > .menu-back::before {
  content: "←";
  font: 700 29px/1 var(--font-body);
}
.menu-screen .menu-view > .menu-back:hover {
  background: #d0c9ed;
  transform: translateY(-2px);
}
.tutorial-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  margin: 0 0 12px;
  padding: 8px 14px;
  border: 2px solid #fff;
  border-radius: 17px;
  background: #e5dff8;
  color: #504681;
  text-align: left;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: 0 3px 0 #c8bfdf;
  transition:
    transform 0.16s,
    background 0.16s;
}
.tutorial-entry:hover {
  background: #d8d0f1;
  transform: translateY(-2px);
}
.tutorial-entry:active {
  transform: translateY(1px);
}
.tutorial-entry > span:first-child {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff7;
  color: #7261af;
  font-size: 22px;
}
.tutorial-entry > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}
.tutorial-entry b {
  font-size: 16px;
  line-height: 1.1;
}
.tutorial-entry small {
  font-size: 12px;
  color: #665d90;
}
.tutorial-entry > span:last-child {
  font-size: 25px;
  line-height: 1;
}
@media (max-width: 700px) {
  .menu-screen .menu-view > .menu-back {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 13px;
    margin-bottom: 7px;
  }
  .tutorial-entry {
    min-height: 52px;
    margin-bottom: 9px;
    padding: 6px 10px;
  }
}

/* Keep the back arrow in the header instead of reserving a separate row. */
.menu-view:has(> .menu-back) {
  position: relative;
}
.menu-screen .menu-view > .menu-back {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin: 0;
  border: 1px solid #fff;
  border-radius: 14px;
  background: linear-gradient(145deg, #f5f3ff, #dcd8f3);
  box-shadow:
    0 3px 0 #b8addd,
    0 5px 10px #62559324;
  transition:
    transform 0.16s,
    box-shadow 0.16s;
}
.menu-screen #modeSetup > .menu-back,
.menu-screen #playerSetup > .menu-back,
.menu-screen #customRules > .menu-back {
  margin: 0;
}
.menu-screen .menu-view > .menu-back::before {
  content: "";
  width: 25px;
  height: 25px;
  background: center/contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23564b92' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5m7-7-7 7 7 7'/%3E%3C/svg%3E");
}
#modeSetup > .menu-heading,
#askLudo > .menu-heading,
#customRules > .menu-heading,
.menu-shell[data-view="players"] .game-mode-description {
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-shell[data-view="players"] .game-mode-description {
  line-height: 1.3;
}
@media (max-width: 700px) {
  #modeSetup > .menu-heading,
  #askLudo > .menu-heading,
  #customRules > .menu-heading,
  .menu-shell[data-view="players"] .game-mode-description {
    padding-inline: 48px;
  }
  #modeSetup > .menu-heading {
    min-height: 54px;
  }
  #modeSetup > .menu-back {
    top: 5px;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  .menu-shell[data-view="players"] .menu-heading {
    min-height: 44px;
    padding-inline: 52px;
  }
}

/* Illustrated mode cards, with the same color and scale hierarchy as the concept. */
#modeSetup .game-modes {
  gap: 12px;
}
#modeSetup .game-modes button {
  min-height: 142px;
  padding: 7px 14px 7px 8px;
  gap: 12px;
  border: 2px solid #fff;
  border-radius: 28px;
  box-shadow:
    0 4px 0 #bdb1d452,
    0 8px 15px #7a61921a;
}
#modeSetup .game-modes button img {
  width: 40%;
  height: 125px;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px #81629a25);
}
#modeSetup .game-modes button .mode-copy {
  gap: 7px;
}
#modeSetup .game-modes button b {
  font-size: clamp(20px, 2.1vw, 26px);
  line-height: 1.05;
}
#modeSetup .game-modes button small {
  font-size: 15px;
  line-height: 1.25;
  color: #655f8d;
}
#modeSetup .game-modes button[data-game-mode="classic"] {
  background: #faedf3;
}
#modeSetup .game-modes button[data-game-mode="quick"] {
  background: #e3fae9;
}
#modeSetup .game-modes button[data-game-mode="teams"] {
  background: #e1edfc;
}
#modeSetup .game-modes button[data-game-mode="custom"] {
  background: #fff4dc;
}
#modeSetup .game-modes button[data-game-mode="classic"] b {
  color: #e62770;
}
#modeSetup .game-modes button[data-game-mode="quick"] b {
  color: #138c3c;
}
#modeSetup .game-modes button[data-game-mode="teams"] b {
  color: #075dcc;
}
#modeSetup .game-modes button[data-game-mode="custom"] b {
  color: #e96805;
}
#modeSetup .mode-arrow {
  width: 45px;
  height: 45px;
  font-size: 35px;
  line-height: 1;
}
#modeSetup [data-game-mode="classic"] .mode-arrow {
  background: #f9bdd8;
  color: #e62770;
}
#modeSetup [data-game-mode="quick"] .mode-arrow {
  background: #a7e9b7;
  color: #138c3c;
}
#modeSetup [data-game-mode="teams"] .mode-arrow {
  background: #acd0fb;
  color: #075dcc;
}
#modeSetup [data-game-mode="custom"] .mode-arrow {
  background: #ffd58c;
  color: #e96805;
}
@media (max-width: 700px) {
  #modeSetup .game-modes {
    gap: 9px;
  }
  #modeSetup .game-modes button {
    min-height: 112px;
    gap: 7px;
    padding: 5px 9px 5px 5px;
    border-radius: 22px;
  }
  #modeSetup .game-modes button img {
    width: 39%;
    height: 101px;
  }
  #modeSetup .game-modes button b {
    font-size: 19px;
  }
  #modeSetup .game-modes button small {
    font-size: 12px;
  }
  #modeSetup .mode-arrow {
    width: 32px;
    height: 32px;
    font-size: 27px;
  }
}
@media (max-width: 350px) {
  #modeSetup .game-modes button img {
    width: 35%;
  }
  #modeSetup .game-modes button b {
    font-size: 17px;
  }
  #modeSetup .game-modes button small {
    font-size: 11px;
  }
}
@media (min-width: 701px) and (min-height: 501px) and (max-height: 850px) {
  #modeSetup .game-modes {
    gap: 9px;
  }
  #modeSetup .game-modes button {
    min-height: 122px;
  }
  #modeSetup .game-modes button img {
    height: 108px;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  #modeSetup .game-modes button {
    min-height: 100px;
  }
  #modeSetup .game-modes button img {
    height: 86px;
    width: 35%;
  }
  #modeSetup .game-modes button b {
    font-size: 17px;
  }
  #modeSetup .game-modes button small {
    font-size: 12px;
  }
  #modeSetup .mode-arrow {
    width: 30px;
    height: 30px;
    font-size: 25px;
  }
}

/* Back arrow: flex keeps the icon dead-center (a 2-row grid pushed it up by the hidden "Voltar" text). */
.menu-screen .menu-view > .menu-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* End of css/menu.css */
