:root {
  --pixel-yellow: #ffd438;
  --pixel-cyan: #35d1c5;
  --pixel-night: #071a23;
  --pixel-blue: #123446;
  --pixel-green: #28a968;
  --pixel-cream: #fff6cc;
}

.arcade-body {
  background: var(--paper);
}

.arcade-body main {
  width: min(1280px, calc(100% - 48px));
}

.arcade-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  min-height: 360px;
  padding: 66px 0 50px;
  align-items: center;
  gap: clamp(42px, 7vw, 92px);
  overflow: visible;
}

.arcade-hero__copy {
  position: relative;
  z-index: 1;
}

.arcade-hero h1 {
  max-width: 850px;
}

.arcade-hero h1 span {
  color: var(--green);
}

.arcade-hero__copy > p:last-child {
  max-width: 690px;
  margin: 0;
  color: #59676e;
  font-size: 1rem;
  line-height: 1.7;
}

.arcade-cabinet {
  position: relative;
  z-index: 1;
  width: 246px;
  justify-self: end;
  padding: 18px 18px 27px;
  border: 1px solid #243943;
  border-radius: 22px;
  background: var(--ink);
  box-shadow: 0 24px 55px rgba(9, 26, 35, 0.18);
}

.arcade-cabinet::before {
  position: absolute;
  top: 9px;
  right: 18px;
  left: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--yellow);
  content: "";
}

.cabinet-screen {
  position: relative;
  display: grid;
  height: 192px;
  overflow: hidden;
  border: 6px solid #20343e;
  border-radius: 11px;
  place-items: center;
  background: linear-gradient(#17aaa5 0 58%, #23995e 58%);
  box-shadow: inset 0 0 0 4px #06151c;
}

.cabinet-screen::after {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.42) 50%);
  background-size: 100% 4px;
  content: "";
  pointer-events: none;
}

.cabinet-screen span {
  display: grid;
  width: 72px;
  height: 72px;
  border: 7px solid var(--pixel-cream);
  border-radius: 50%;
  color: var(--pixel-cream);
  font: 900 30px/1 ui-monospace, monospace;
  place-items: center;
}

.cabinet-screen i {
  position: absolute;
  right: 16px;
  bottom: 38px;
  left: 16px;
  height: 6px;
  background: var(--pixel-cream);
  box-shadow: 0 -52px 0 rgba(255, 255, 255, 0.4);
}

.cabinet-screen b {
  position: absolute;
  bottom: 12px;
  color: var(--pixel-cream);
  font: 900 10px/1 ui-monospace, monospace;
  animation: arcade-blink 1s steps(1) infinite;
}

.cabinet-controls {
  display: flex;
  height: 62px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.cabinet-controls i {
  width: 12px;
  height: 33px;
  margin-top: -18px;
  background: #c8d1d4;
  box-shadow: 0 -8px 0 4px #e84b42;
}

.cabinet-controls span {
  width: 22px;
  height: 12px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 4px 0 #9b850d;
}

@keyframes arcade-blink {
  50% { opacity: 0; }
}

.arcade-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
  overflow: hidden;
}

.arcade-summary article {
  min-width: 0;
  padding: 21px 24px;
  border-right: 1px solid var(--line-soft);
}

.arcade-summary article:last-child {
  border-right: 0;
}

.arcade-summary span,
.arcade-summary strong {
  display: block;
}

.arcade-summary span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.arcade-summary strong {
  color: var(--ink);
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: -0.035em;
  white-space: normal;
}

.arcade-summary #arcade-account-state {
  color: var(--green);
  font-size: clamp(0.82rem, 1.3vw, 1.05rem);
  line-height: 1.25;
}

.arcade-heading {
  display: flex;
  margin: 52px 0 18px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.arcade-heading h2,
.arcade-leader-preview h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  letter-spacing: -0.045em;
}

.arcade-heading > p {
  max-width: 430px;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.arcade-heading .eyebrow,
.arcade-title-line .eyebrow,
.arcade-leader-preview .eyebrow {
  margin-bottom: 7px;
}

.arcade-library {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.arcade-game-card,
.quick-game-card,
.arcade-leader-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.arcade-game-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  overflow: hidden;
}

.arcade-game-card:hover {
  border-color: #c4cfca;
  box-shadow: var(--shadow);
}

.game-pixel-preview {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: linear-gradient(#2dbbc0 0 44%, #176b4b 44% 49%, #2aa866 49%);
  image-rendering: pixelated;
}

.game-pixel-preview::after {
  position: absolute;
  right: 8%;
  bottom: 12%;
  left: 8%;
  height: 5px;
  background: var(--pixel-cream);
  box-shadow: 0 -62px 0 rgba(255, 246, 204, 0.9);
  content: "";
}

.preview-score {
  position: absolute;
  top: 18px;
  left: 18px;
  color: var(--pixel-cream);
  font: 900 13px/1 ui-monospace, monospace;
  text-shadow: 2px 2px #173542;
}

.preview-goal {
  position: absolute;
  top: 23%;
  left: 15%;
  width: 70%;
  height: 42%;
  border: 8px solid var(--pixel-cream);
  background:
    repeating-linear-gradient(90deg, transparent 0 15px, rgba(255, 255, 255, 0.42) 16px 18px),
    repeating-linear-gradient(0deg, transparent 0 12px, rgba(255, 255, 255, 0.35) 13px 15px);
}

.preview-keeper {
  position: absolute;
  z-index: 2;
  top: 42%;
  left: calc(50% - 9px);
  width: 18px;
  height: 48px;
  background: #f0aa27;
  box-shadow:
    -14px 15px 0 #f0aa27,
    14px 15px 0 #f0aa27,
    -8px 42px 0 #102d3a,
    8px 42px 0 #102d3a;
}

.preview-ball,
.juggle-preview-ball {
  position: absolute;
  z-index: 3;
  display: grid;
  border: 4px solid #122b35;
  border-radius: 50%;
  color: #122b35;
  background: var(--pixel-cream);
  font: 900 10px/1 monospace;
  place-items: center;
}

.preview-ball {
  top: 34%;
  left: 72%;
  width: 26px;
  height: 26px;
}

.juggle-pixel-preview {
  background: linear-gradient(#126c9b 0 57%, #17794f 57% 61%, #20a45f 61%);
}

.juggle-pixel-preview::before {
  position: absolute;
  inset: 24% 12% 27%;
  border-top: 5px solid rgba(255, 255, 255, 0.82);
  border-bottom: 5px solid rgba(255, 255, 255, 0.82);
  background: repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 255, 255, 0.12) 29px 31px);
  content: "";
}

.juggle-preview-player {
  position: absolute;
  z-index: 2;
  bottom: 30px;
  left: 47%;
  width: 18px;
  height: 44px;
  background: #f4c43b;
  box-shadow: inset 0 -16px #0c2531;
  animation: juggle-player 2.4s steps(6, end) infinite;
}

.juggle-preview-player::before {
  position: absolute;
  top: -13px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: #9a5a32;
  box-shadow: 0 -3px #152c38;
  content: "";
}

.juggle-preview-player i,
.juggle-preview-player b {
  position: absolute;
  bottom: -13px;
  width: 6px;
  height: 16px;
  background: #132b36;
}

.juggle-preview-player i { left: 1px; }
.juggle-preview-player b {
  right: 1px;
  transform: rotate(-35deg);
  transform-origin: top;
}

.juggle-preview-player em {
  position: absolute;
  right: -13px;
  bottom: -9px;
  width: 15px;
  height: 5px;
  background: #f4efe0;
  box-shadow: 3px 3px #102832;
}

.juggle-preview-ball {
  top: 30%;
  left: 58%;
  width: 22px;
  height: 22px;
  animation: juggle-ball 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes juggle-ball {
  0%, 100% { transform: translate(-54px, 82px) rotate(0); }
  47% { transform: translate(12px, -12px) rotate(190deg); }
}

@keyframes juggle-player {
  0%, 100% { transform: translateX(-25px); }
  50% { transform: translateX(28px); }
}

.arcade-game-card__copy {
  padding: clamp(30px, 4vw, 50px);
}

.arcade-title-line {
  display: flex;
  align-items: flex-start;
  gap: 17px;
}

.arcade-index,
.quick-symbol {
  display: grid;
  color: var(--ink);
  background: var(--yellow);
  font-weight: 900;
  place-items: center;
}

.arcade-index {
  flex: 0 0 46px;
  height: 46px;
  border-radius: 11px;
  font-size: 0.88rem;
}

.arcade-game-card h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.05em;
}

.arcade-game-card__copy > p {
  max-width: 670px;
  margin: 22px 0;
  color: var(--muted);
  line-height: 1.68;
}

.arcade-game-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 25px 0;
}

.arcade-game-meta span {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #f7f9f7;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.arcade-game-meta strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.73rem;
  letter-spacing: 0;
  text-transform: none;
}

.arcade-personal {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.arcade-game-card .card-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.arcade-game-card .button {
  display: inline-flex;
  padding-inline: 17px;
  align-items: center;
  text-decoration: none;
}

.quick-library-heading {
  margin-top: 62px;
}

.quick-library-heading p:last-child {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.quick-game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.quick-game-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 315px;
  padding: 24px;
  flex-direction: column;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.quick-game-card:hover {
  border-color: #c4cfca;
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.quick-symbol {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  border-radius: 11px;
  font: 900 1.1rem/1 ui-monospace, monospace;
}

.quick-game-card small {
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.quick-game-card h3 {
  margin: 8px 0 0;
  font-size: 1.28rem;
  letter-spacing: -0.035em;
}

.quick-game-card > p {
  margin: 11px 0 17px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.58;
}

.quick-game-card > a {
  margin-top: auto;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 820;
  text-decoration: none;
}

.quick-game-card > a:hover {
  color: var(--ink);
}

.arcade-leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.arcade-leader-preview {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1.28fr);
  padding: 28px;
  align-items: start;
  gap: 28px;
}

.arcade-leader-preview > div > p:last-child {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.arcade-leaders {
  display: grid;
}

.arcade-leaders span {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  padding: 11px 4px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.73rem;
}

.arcade-leaders span:last-child {
  border-bottom: 0;
}

.arcade-leaders b {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--yellow);
  font-size: 0.65rem;
  place-items: center;
}

.arcade-leaders strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arcade-leaders em {
  color: var(--green);
  font-style: normal;
  font-weight: 850;
}

.arcade-rating {
  display: grid;
  margin: 4px 0 18px;
  gap: 8px;
}

.arcade-rating__summary {
  display: flex;
  align-items: center;
  gap: 7px;
}

.arcade-rating__summary > span {
  color: #c6a900;
  font-size: 1.1rem;
}

.arcade-rating__summary strong {
  color: var(--muted);
  font-size: 0.66rem;
}

.arcade-rating__buttons {
  display: flex;
  gap: 2px;
}

.arcade-rating__buttons button {
  padding: 0;
  border: 0;
  color: #c4cdd1;
  background: transparent;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.arcade-rating__buttons button:hover,
.arcade-rating__buttons button.selected {
  color: #c6a900;
}

.arcade-rating__buttons button:disabled {
  cursor: wait;
}

.arcade-rating__notice {
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1.4;
}

.arcade-rating.compact .arcade-rating__notice {
  display: none;
}

.arcade-rating.compact .arcade-rating__buttons button {
  font-size: 1.35rem;
}

@media (max-width: 1100px) {
  .quick-game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .arcade-body main {
    width: min(100% - 32px, 1280px);
  }

  .arcade-hero {
    grid-template-columns: minmax(0, 1fr) 220px;
    min-height: 320px;
    padding-block: 52px 42px;
    gap: 32px;
  }

  .arcade-cabinet {
    width: 215px;
  }

  .cabinet-screen {
    height: 165px;
  }

  .arcade-game-card {
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  }

  .arcade-leaderboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .arcade-body main {
    width: min(100% - 24px, 1280px);
  }

  .arcade-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-block: 42px 34px;
  }

  .arcade-cabinet {
    display: none;
  }

  .arcade-game-card {
    grid-template-columns: 1fr;
  }

  .arcade-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arcade-summary article:nth-child(2) {
    border-right: 0;
  }

  .arcade-summary article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-soft);
  }

  .game-pixel-preview {
    min-height: 275px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .arcade-heading {
    margin-top: 42px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .arcade-heading > p {
    max-width: none;
    text-align: left;
  }

  .arcade-game-meta {
    grid-template-columns: 1fr;
  }

  .arcade-leader-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .quick-game-grid {
    grid-template-columns: 1fr;
  }

  .arcade-game-card,
  .quick-game-card,
  .arcade-leader-preview {
    border-radius: var(--radius);
  }

  .arcade-game-card__copy {
    padding: 26px 22px;
  }

  .arcade-title-line {
    gap: 13px;
  }

  .arcade-index {
    flex-basis: 42px;
    height: 42px;
  }

  .arcade-game-card .card-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-game-card {
    min-height: 270px;
  }

  .arcade-leader-preview {
    padding: 23px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cabinet-screen b,
  .juggle-preview-player,
  .juggle-preview-ball {
    animation: none;
  }
}
