:root {
  --seam: #f8e14a;
  --slant: 42px;
  --seam-width: 3.5px;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--seam);
  color: #f4f7fb;
  font-family: Inter, system-ui, sans-serif;
  overflow: hidden;
}

.stage {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--seam);
}
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  background: #10141c;
  color: #f8e14a;
  border-bottom: 3px solid #f8e14a;
}
.topbar p {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
}
.footer {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  background: #10141c;
  color: #f8e14a;
  border-top: 3px solid #f8e14a;
}
.footer p {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.row {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.row + .row {
  margin-top: var(--seam-width);
}

.slice {
  position: relative;
  flex: 1 1 var(--slant);
  min-width: 0;
  height: 100%;
  margin-left: calc(var(--slant) * -1 + var(--seam-width));
  display: block;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
  filter: grayscale(0) brightness(1) saturate(1);
  transition: filter 0.4s var(--ease), flex-grow 0.45s var(--ease);
}
.row > .slice:first-child {
  margin-left: 0;
  flex-basis: calc(var(--slant) / 2);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
}
.row > .slice:last-child {
  flex-basis: calc(var(--slant) / 2);
  clip-path: polygon(var(--slant) 0, 100% 0, 100% 100%, 0 100%);
}
.slice:focus { outline: none; }
.slice:focus-visible {
  box-shadow: inset 0 0 0 3px currentColor;
}

.stage:has(.slice:hover) .slice:not(:hover) {
  filter: grayscale(1) brightness(0.72) saturate(0.05);
  pointer-events: none;
}
.stage:has(.slice:hover) .slice:hover {
  flex-grow: 1.65;
  filter: grayscale(0) brightness(1.06) saturate(1.12);
  z-index: 2;
}

.face {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 22px 18px 18px calc(var(--slant) + 14px);
  min-height: 0;
}
.row > .slice:first-child .face { padding-left: 18px; }
.row > .slice:last-child .face { padding-right: 16px; }

.host, .hint {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Minecraft */
.mc {
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 236, 170, 0.5), transparent 26%),
    linear-gradient(180deg, #4d94dc 0%, #7eb6ef 52%, #c5e4fb 100%);
  color: #14210c;
}
.sky { position: absolute; inset: 0; pointer-events: none; }
.sun {
  position: absolute;
  top: 9%;
  right: 12%;
  width: 46px;
  height: 46px;
  background: #ffe56a;
  box-shadow: inset 8px 8px 0 #fff4b0, inset -5px -5px 0 #e6b423, 0 0 0 6px rgba(255, 229, 106, 0.28);
}
.cloud {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  box-shadow:
    14px 0 #fff, 28px 0 #fff, 42px 0 #fff,
    0 -14px #fff, 14px -14px #fff, 28px -14px #fff,
    14px -28px #fff;
}
.cloud.c1 { top: 16%; left: 18%; }
.cloud.c2 { top: 28%; right: 22%; transform: scale(0.72); transform-origin: top right; }
.block {
  position: absolute;
  top: 20%;
  right: 30%;
  width: 36px;
  height: 36px;
  background:
    linear-gradient(#8fd14f, #8fd14f) 0 0 / 100% 10px no-repeat,
    linear-gradient(#3d7a22, #3d7a22) 0 10px / 100% 4px no-repeat,
    linear-gradient(#6a452c, #6a452c) 8px 22px / 10px 6px no-repeat,
    #8b6240;
  animation: bob 3.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.tree {
  position: absolute;
  left: 14%;
  bottom: 72px;
  width: 92px;
  height: 128px;
}
.leaves {
  position: absolute;
  left: 10px;
  top: 0;
  width: 16px;
  height: 16px;
  background: #3f9a2c;
  box-shadow:
    16px 0 #2f7d22, 32px 0 #4cb038,
    -8px 16px #358a26, 8px 16px #57b840, 24px 16px #2a701c, 40px 16px #3f9a2c,
    0 32px #2f7d22, 16px 32px #3f9a2c, 32px 32px #57b840,
    8px 48px #2c741f, 24px 48px #358a26;
}
.log {
  position: absolute;
  left: 34px;
  bottom: 0;
  width: 18px;
  height: 52px;
  background:
    linear-gradient(#3e2915, #3e2915) 7px 0 / 4px 100% no-repeat,
    #6b4423;
}
.mc .copy {
  position: relative;
  z-index: 1;
  text-align: center;
  width: min(100%, 280px);
  margin: 0 auto;
}
.mc .kicker {
  margin: 0 0 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #1d4a12;
}
.mc h2 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(13px, 1.3vw, 20px);
  line-height: 1.45;
  color: #f8e14a;
  text-shadow: 3px 3px 0 #3b2a08;
}
.slot {
  margin: 14px auto 0;
  padding: 12px 12px 10px;
  background: #2b2b2b;
  border: 4px solid #111;
  box-shadow:
    inset 3px 3px 0 #5a5a5a,
    inset -3px -3px 0 #1a1a1a,
    4px 4px 0 rgba(20, 40, 70, 0.25);
}
.slot-label {
  display: block;
  margin-bottom: 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: #bdb8ae;
}
.address {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(8px, 0.75vw, 11px);
  line-height: 1.6;
  color: #7cff6b;
  text-shadow: 2px 2px 0 #14330f;
  user-select: text;
}
.mc .hint {
  margin-top: 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: #9a9a9a;
  opacity: 1;
}
.mc.copied .slot {
  box-shadow:
    inset 3px 3px 0 #7cff6b,
    inset -3px -3px 0 #14330f,
    4px 4px 0 rgba(20, 40, 70, 0.25);
}
.mc.copied .hint { color: #7cff6b; }
.terrain {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}
.terrain .col {
  flex: 1;
  background:
    linear-gradient(#7cc04a, #7cc04a) 0 0 / 100% 12px no-repeat,
    linear-gradient(#2f6818, #2f6818) 0 12px / 100% 4px no-repeat,
    linear-gradient(#6a452c, #6a452c) 18% 46% / 18% 12% no-repeat,
    #8b6240;
}
.terrain .h1 { height: 36px; }
.terrain .h2 { height: 58px; }
.terrain .h3 { height: 78px; }
.terrain .h4 { height: 96px; }

/* AlgoTrading */
.algo { background: #0c1016; color: #e8eef6; }
.dash {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.live {
  padding: 2px 7px;
  border-radius: 999px;
  background: #1f7a3a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.dash-sub {
  margin: 0;
  color: #9aa6b2;
  font-size: 11px;
}
.price {
  margin: 4px 0 0;
  font-size: clamp(22px, 1.8vw, 28px);
  font-weight: 700;
  letter-spacing: -0.04em;
}
.chg {
  margin: 0;
  color: #3ddc6a;
  font-size: 12px;
  font-weight: 600;
}
.spark {
  width: 100%;
  height: 48px;
  margin-top: 6px;
}
.spotify h2 {
  margin: 0 0 10px;
  font-size: clamp(16px, 1.3vw, 22px);
  font-weight: 600;
  letter-spacing: -0.03em;
}
/* Builder */
.builder { background: #0e1218; color: #e8eef7; }
.toolbar, .swatches, .bricks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  padding: 5px 8px;
  border-radius: 8px;
  background: #1c2430;
  color: #d5deea;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pill.on { background: #3b9ee8; color: #fff; }
.swatches i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: block;
}
.swatches .red { background: #c23b32; }
.swatches .blue { background: #2f6fdb; }
.swatches .yellow { background: #e2b423; }
.swatches .green { background: #3c9a45; }
.swatches .orange { background: #e07a2f; }
.brick {
  width: 34px;
  height: 22px;
  border-radius: 3px;
  background:
    radial-gradient(circle at 8px 6px, #ff6b5a 3px, transparent 3.5px),
    radial-gradient(circle at 22px 6px, #ff6b5a 3px, transparent 3.5px),
    linear-gradient(#e24b3c, #b4332a);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25);
}
.brick.wide { width: 56px; }

/* Cardshelf */
.cards { background: #0e1016; color: #f3f4f6; }
.shelf-brand {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.shelf {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cc {
  border-radius: 10px;
  overflow: hidden;
  background: #171a22;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.art {
  display: block;
  height: 28px;
  position: relative;
}
.art::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 8px;
  width: 12px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(#f6d98a, #c9a24a);
}
.art.amex { background: linear-gradient(120deg, #1d4e89, #0b1c33 70%); }
.art.hdfc { background: linear-gradient(120deg, #1e3a5f, #0c1424 72%); }
.art.axis { background: linear-gradient(120deg, #7a2048, #2a1024 70%); }
.cc .bank {
  display: block;
  padding: 6px 8px 0;
  color: #9aa3b2;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cc strong {
  display: block;
  padding: 1px 8px 7px;
  font-size: 12px;
  font-weight: 600;
}

/* Pterodactyl */
.ptero { background: #3d4c59; color: #e8eef3; }
.console-ui { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ptero-name { margin: 0; font-size: 15px; font-weight: 700; }
.console-tab {
  margin: 0;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 2px solid #2ec4b6;
  padding-bottom: 3px;
}
.srv {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 6px;
  background: #2a343e;
}
.srv strong {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.starting {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f5c518;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.starting::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f5c518;
}
.power { display: flex; gap: 4px; }
.power span {
  flex: 1;
  text-align: center;
  padding: 5px 0;
  border-radius: 3px;
  background: #4e5966;
  color: #d7dee6;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.power .stop { background: #e23d3d; color: #fff; }
.term {
  padding: 8px;
  border-radius: 6px;
  background: #12171c;
  color: #c9d0d6;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 8px;
  line-height: 1.45;
}
.term p { margin: 0; }
.term .prompt { color: #2ec4b6; }
.meters { display: flex; gap: 6px; }
.meter {
  flex: 1;
  height: 42px;
  border-radius: 6px;
  background: #2a343e;
}

/* Plex */
.plex {
  background: #1f1f1f;
  color: #e8e8e8;
}
.plex-ui { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.plex-bar { display: flex; align-items: center; }
.plex-logo {
  color: #e5a00d;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}
.plex-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.plex-head strong { font-size: 13px; font-weight: 700; }
.plex-head span {
  color: #e5a00d;
  font-size: 10px;
  font-weight: 700;
  border-bottom: 2px solid #e5a00d;
  padding-bottom: 2px;
}
.shelf {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 6px;
}
.show { min-width: 0; }
.poster {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 78px;
  border-radius: 2px;
  overflow: hidden;
}
.poster b {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.poster.monkeys {
  background: linear-gradient(180deg, #3a241c 0%, #120e0c 72%);
  color: #d7c3b4;
}
.poster.ateam {
  background:
    linear-gradient(#1a1a1a, #1a1a1a) 8% 58% / 84% 16% no-repeat,
    linear-gradient(180deg, #5c4a28, #1c180f 68%);
  color: #e6c15a;
}
.poster.ahsoka {
  background:
    linear-gradient(112deg, transparent 44%, #f2f2f2 44% 48%, transparent 48%),
    linear-gradient(180deg, #3a4450, #15191e 70%);
}
.poster.andor {
  background: linear-gradient(180deg, #8a4b32 0%, #2a1812 62%, #120e0c 100%);
}
.show strong {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.show em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 8px;
  color: #9a9a9a;
}

/* Spotify */
.spotify {
  background:
    linear-gradient(180deg, #3f1518 0%, #121212 48%);
  color: #fff;
}
.cover {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  background:
    linear-gradient(115deg, transparent 42%, #e11d2e 42% 52%, transparent 52%),
    linear-gradient(160deg, #2b2b2b, #0c0c0c 70%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}
.spotify-stack { position: relative; }
.slice.spotify .face {
  padding-left: 28px;
  padding-right: 10px;
}
.spotify-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.play {
  position: absolute;
  top: 50px;
  left: 44px;
  z-index: 1;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1db954;
  cursor: pointer;
}
.play:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.play::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 10px;
  border-style: solid;
  border-width: 8px 0 8px 12px;
  border-color: transparent transparent transparent #000;
}
.play.is-playing::before {
  left: 12px;
  top: 10px;
  width: 4px;
  height: 16px;
  border: 0;
  background: #000;
  box-shadow: 8px 0 #000;
}
.play-hint {
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.play.is-playing .play-hint { visibility: hidden; }
.spotify-embed {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  height: 152px;
  overflow: visible;
  transform: translateY(calc(100% + 72px));
  transition: transform 0.35s var(--ease);
  pointer-events: none;
}
.spotify-embed.is-open {
  transform: none;
  pointer-events: auto;
}
.spotify-embed-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: -52px;
  height: 52px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 12px 12px 0 0;
  background: #10141c;
  border-bottom: 3px solid #f8e14a;
}
.spotify-playlist {
  grid-column: 2;
  justify-self: center;
  color: #f8e14a;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-align: center;
}
.spotify-playlist:hover { text-decoration: underline; }
.spotify-close {
  grid-column: 3;
  justify-self: end;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e23d3d;
  font: 700 22px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.spotify-close:hover {
  color: #ff6b7a;
}
.spotify-close:focus-visible {
  outline: 2px solid #ff6b7a;
  outline-offset: 2px;
}
.spotify-playlist:focus-visible {
  outline: 2px solid #f8e14a;
  outline-offset: 2px;
}
.spotify-embed iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 12px;
}
.spotify h2 { margin-bottom: 4px; font-size: clamp(15px, 1.2vw, 20px); }
.tracks {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tracks li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #d4d4d4;
}
.tracks li span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tracks li span:last-child { color: #a7a7a7; flex: none; }
.spotify .host { color: #1db954; opacity: 1; font-weight: 600; }

/* Games */
.games {
  background:
    radial-gradient(circle at 20% 0%, rgba(78, 192, 202, 0.18), transparent 42%),
    #141820;
  color: #f4f7fb;
}
.slice.games { cursor: default; }
.games .face {
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: Bahnschrift, sans-serif;
}
.catalogue-open {
  align-self: center;
  margin: 0;
  padding: 14px 18px;
  border: 4px solid #3b2a08;
  background: #f8e14a;
  color: #3b2a08;
  font: 700 15px Bahnschrift, sans-serif;
  cursor: pointer;
  box-shadow:
    inset 3px 3px 0 #fff4b0,
    inset -3px -3px 0 #c4a024,
    4px 4px 0 rgba(0, 0, 0, 0.45);
}
.catalogue-open:hover { background: #ffe56a; }
.catalogue-open:active {
  background: #e6c83a;
  box-shadow:
    inset -3px -3px 0 #fff4b0,
    inset 3px 3px 0 #c4a024;
  transform: translate(2px, 2px);
}
.catalogue-open:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.games-title {
  margin: 0;
  width: 100%;
  font-family: Bahnschrift, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #f8e14a;
  text-align: center;
}
.game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
}
.game-list > li {
  min-width: 0;
}
.game-list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 8px 4px;
  border-radius: 8px;
  background: #1e2633;
  color: inherit;
  text-decoration: none;
  text-align: center;
}
.game-list a:hover { background: #283244; }
.game-mark {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(#4ec0ca, #2f8f99);
}
.game-mark::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 12px;
  width: 16px;
  height: 12px;
  border-radius: 8px 8px 6px 6px;
  background: #f8e14a;
  box-shadow: 12px 2px 0 -4px #e23d3d;
}
.game-mark.dino {
  background: linear-gradient(#f7f4ee, #e4ddd2);
}
.game-mark.dino::before { content: none; }
.game-mark.dino svg { display: block; width: 100%; height: 100%; }
.game-mark.react {
  background: #1a1f2a;
}
.game-mark.react::before { content: none; }
.game-mark.react svg { display: block; width: 100%; height: 100%; }
.game-mark.targets {
  background: #1a1f2a;
}
.game-mark.targets::before { content: none; }
.game-mark.targets svg { display: block; width: 100%; height: 100%; }
.game-mark.twenty48 {
  background: #bbada0;
}
.game-mark.twenty48::before { content: none; }
.game-mark.twenty48 svg { display: block; width: 100%; height: 100%; }
.game-mark.snake {
  background: #102016;
}
.game-mark.snake::before { content: none; }
.game-mark.snake svg { display: block; width: 100%; height: 100%; }
.game-mark.shooter {
  background: #10141c;
}
.game-mark.shooter::before { content: none; }
.game-mark.shooter svg { display: block; width: 100%; height: 100%; }
.game-mark.tetris {
  background: #10141c;
}
.game-mark.tetris::before { content: none; }
.game-mark.tetris svg { display: block; width: 100%; height: 100%; }
.game-mark.pong {
  background: #10141c;
}
.game-mark.pong::before { content: none; }
.game-mark.pong svg { display: block; width: 100%; height: 100%; }
.game-mark.minesweeper {
  background: #10141c;
}
.game-mark.minesweeper::before { content: none; }
.game-mark.minesweeper svg { display: block; width: 100%; height: 100%; }
.game-mark.memory {
  background: #10141c;
}
.game-mark.memory::before { content: none; }
.game-mark.memory svg { display: block; width: 100%; height: 100%; }
.game-mark.simon {
  background: #10141c;
}
.game-mark.simon::before { content: none; }
.game-mark.simon svg { display: block; width: 100%; height: 100%; }
.game-mark.typing {
  background: #10141c;
}
.game-mark.typing::before { content: none; }
.game-mark.typing svg { display: block; width: 100%; height: 100%; }
.game-mark.higherlower {
  background: #10141c;
}
.game-mark.higherlower::before { content: none; }
.game-mark.higherlower svg { display: block; width: 100%; height: 100%; }
.game-mark.twentyone {
  background: #10141c;
}
.game-mark.twentyone::before { content: none; }
.game-mark.twentyone svg { display: block; width: 100%; height: 100%; }
.game-mark.breakout {
  background: #10141c;
}
.game-mark.breakout::before { content: none; }
.game-mark.breakout svg { display: block; width: 100%; height: 100%; }
.game-mark.frogger {
  background: #10141c;
}
.game-mark.frogger::before { content: none; }
.game-mark.frogger svg { display: block; width: 100%; height: 100%; }
.game-mark.doodlejump {
  background: linear-gradient(145deg, #4a9fd4, #7ec8f0);
}
.game-mark.doodlejump::before { content: none; }
.game-mark.doodlejump svg { display: block; width: 100%; height: 100%; }
.game-name { min-width: 0; width: 100%; }
.game-name strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.game-name em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 9px;
  line-height: 1.25;
  color: #9aa6b8;
}
.snake-controls .on-phone,
.shooter-controls .on-phone,
.tetris-controls .on-phone,
.pong-controls .on-phone,
.minesweeper-controls .on-phone,
.memory-controls .on-phone,
.simon-controls .on-phone,
.typing-controls .on-phone,
.higherlower-controls .on-phone,
.twentyone-controls .on-phone,
.breakout-controls .on-phone,
.frogger-controls .on-phone,
.doodlejump-controls .on-phone { display: none; }

.game-popup {
  position: fixed;
  inset: 0;
  font-family: Bahnschrift, sans-serif;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 10, 14, 0.72);
  overscroll-behavior: none;
}
.game-popup[hidden] { display: none; }
.game-popup.is-playing,
.game-popup.is-playing .game-popup-sheet {
  touch-action: none;
  overscroll-behavior: none;
}
.game-popup-sheet {
  width: min(440px, 100%);
  height: min(760px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 3px solid #f8e14a;
  border-radius: 12px;
  background: #10141c;
  outline: none;
}
.game-popup-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 8px;
  background: #10141c;
  color: #f8e14a;
  border-bottom: 3px solid #f8e14a;
}
.game-popup-side {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-self: start;
}
.game-popup-side-end {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-self: end;
}
.game-popup-bar p {
  grid-column: 2;
  justify-self: center;
  margin: 0;
  max-width: min(240px, 52vw);
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  color: #f8e14a;
}
.game-popup-bar button {
  height: 32px;
  padding: 0;
  border: 0;
  font: 700 20px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}
#game-popup-close {
  width: 32px;
  border-radius: 0;
  background: transparent;
  color: #e23d3d;
}
#game-popup-close:hover {
  color: #ff6b7a;
}
#game-popup-back {
  width: auto;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #2a3140;
  color: #c8d0dc;
}
#game-popup-back:hover {
  background: #353e4f;
  color: #e8ecf2;
}
.game-popup-bar button:focus-visible {
  outline: 2px solid #f8e14a;
  outline-offset: 2px;
}
#game-popup-close:focus-visible {
  outline-color: #ff6b7a;
}
.game-catalogue {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}
.game-catalogue[hidden],
.game-popup iframe[hidden],
#game-popup-back[hidden] { display: none; }
.game-popup iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #70c5ce;
  touch-action: none;
  overscroll-behavior: none;
}

@media (max-width: 980px) {
  :root { --slant: 28px; --seam-width: 2.5px; }
  .mc h2 { font-size: 11px; }
  .spotify h2 { font-size: 16px; }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--seam-width);
    height: auto;
    min-height: 100dvh;
    padding: 0;
    overflow: visible;
    background: var(--seam);
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-column: 1 / -1;
  }
  .stage { padding-bottom: 40px; }
  .footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    grid-column: 1 / -1;
  }
  .row { display: contents; }
  .row > .slice,
  .row > .slice:first-child,
  .row > .slice:last-child,
  .row > .slice:nth-child(odd),
  .row > .slice:nth-child(even) {
    flex: none;
    width: auto;
    height: auto;
    min-height: 300px;
    margin: 0;
    clip-path: none;
  }
  .face,
  .row > .slice .face,
  .row > .slice:first-child .face,
  .row > .slice:last-child .face,
  .slice.spotify .face {
    padding: 16px 12px;
  }
  .mc .face { padding-bottom: 64px; }
  .terrain { height: 48px; }
  .terrain .h1 { height: 22px; }
  .terrain .h2 { height: 32px; }
  .terrain .h3 { height: 42px; }
  .terrain .h4 { height: 48px; }
  .sun { right: 8%; width: 28px; height: 28px; }
  .block { right: 18%; top: 10%; width: 24px; height: 24px; }
  .tree { left: 6%; bottom: 12px; transform: scale(0.5); transform-origin: bottom left; }
  .stage:has(.slice:hover) .slice:not(:hover) {
    filter: grayscale(0) brightness(1) saturate(1);
    pointer-events: auto;
    z-index: auto;
  }
  .stage:has(.slice:hover) .slice:hover {
    filter: grayscale(0) brightness(1) saturate(1);
    flex-grow: 0;
    z-index: auto;
  }
  .snake-controls .on-desktop,
  .shooter-controls .on-desktop,
  .tetris-controls .on-desktop,
  .pong-controls .on-desktop,
  .minesweeper-controls .on-desktop,
  .memory-controls .on-desktop,
  .simon-controls .on-desktop,
  .typing-controls .on-desktop,
  .higherlower-controls .on-desktop,
  .twentyone-controls .on-desktop,
  .breakout-controls .on-desktop,
  .frogger-controls .on-desktop,
  .doodlejump-controls .on-desktop { display: none; }
  .snake-controls .on-phone,
  .shooter-controls .on-phone,
  .tetris-controls .on-phone,
  .pong-controls .on-phone,
  .minesweeper-controls .on-phone,
  .memory-controls .on-phone,
  .simon-controls .on-phone,
  .typing-controls .on-phone,
  .higherlower-controls .on-phone,
  .twentyone-controls .on-phone,
  .breakout-controls .on-phone,
  .frogger-controls .on-phone,
  .doodlejump-controls .on-phone { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
