/* Preserved games artwork and components, isolated from other routes. */
@scope (body:has(.game-shell)) {

:scope {
  --game-ink: #25324b;
  --game-muted: #6f7d9f;
  --game-line: rgba(126, 155, 220, 0.24);
  --game-blue: #6f95f4;
  --game-cyan: #63d6e7;
  --game-panel: rgba(255, 255, 255, 0.84);
  --game-deep: #101a31;
  --game-shadow: 0 22px 58px rgba(66, 91, 153, 0.18);
}

#page-header {
  position: fixed !important;
  top: 28px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  height: 72px !important;
  min-height: 72px !important;
  background: rgba(244, 248, 255, 0.78) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 42px rgba(82, 112, 178, 0.12);
  backdrop-filter: blur(16px);
}
#page-header::before,
#page-site-info {
  display: none !important;
}
#nav {
  top: 0 !important;
  height: 72px !important;
  padding: 0 clamp(20px, 4vw, 60px);
  color: var(--game-ink) !important;
  background: transparent !important;
  box-shadow: none !important;
}
#nav a,
#nav #site-name,
#nav .site-page {
  color: var(--game-ink) !important;
  text-shadow: none !important;
}
#content-inner.layout {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
}
#body-wrap {
  background:
    linear-gradient(135deg, rgba(245, 249, 255, 0.94), rgba(234, 241, 255, 0.9)),
    radial-gradient(circle at 16% 12%, rgba(111, 149, 244, 0.22), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(99, 214, 231, 0.18), transparent 28%) !important;
}
#page {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
#aside-content,
#post-comment,
.page-title {
  display: none !important;
}

.game-shell {
  min-height: 100vh;
  padding: 140px clamp(18px, 4vw, 56px) 70px;
  color: var(--game-ink);
}

/* ── Hero (full width) ── */
.game-hero {
  max-width: 1180px;
  margin: 0 auto 42px;
  text-align: center;
}
.game-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--game-blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.game-kicker::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--game-cyan);
  box-shadow: 0 0 0 6px rgba(99, 214, 231, 0.14);
}
.game-hero h1 {
  margin: 0 0 14px;
  color: #18233b;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 950;
}
.game-hero p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--game-muted);
  font-size: 15px;
  line-height: 1.8;
  font-weight: 700;
}

/* ── Game Grid ── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
}
.game-grid-item {
  position: relative;
  padding: 20px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: var(--game-panel);
  box-shadow: 0 12px 34px rgba(66, 91, 153, 0.1);
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  backdrop-filter: blur(12px);
}
.game-grid-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(66, 91, 153, 0.18);
  border-color: var(--game-blue);
}
.game-grid-icon {
  font-size: 28px;
  margin-bottom: 8px;
  line-height: 1;
}
.game-grid-item h3 {
  margin: 0 0 4px;
  color: #18233b;
  font-size: 16px;
  font-weight: 950;
}
.game-grid-item p {
  margin: 0;
  color: var(--game-muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
}

/* ── Detail Container ── */
.game-detail-container {
  display: none;
  max-width: 1180px;
  margin: 0 auto;
}
.game-detail-container.is-active {
  display: block;
}
.game-detail-container.is-active:has(.game-panel[data-game-panel="tetris"].is-active) {
  max-width: min(1840px, calc(100vw - 56px));
}
.game-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px 16px;
  border: 1px solid var(--game-line);
  border-radius: 12px;
  background: var(--game-panel);
  color: var(--game-ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 200ms, box-shadow 200ms;
}
.game-back-btn:hover {
  border-color: var(--game-blue);
  box-shadow: 0 4px 14px rgba(111, 149, 244, 0.14);
}

/* ── Detail Panel ── */
.game-panel {
  display: none;
  grid-template-columns: minmax(320px, 520px) minmax(280px, 1fr);
  gap: 22px;
  align-items: stretch;
}
.game-panel.is-active {
  display: grid;
}
.game-card,
.game-side {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: var(--game-panel);
  box-shadow: var(--game-shadow);
  backdrop-filter: blur(18px);
}
.game-card {
  padding: clamp(16px, 2.6vw, 26px);
}
.game-side {
  padding: 26px;
}
.game-card-head,
.game-score-row,
.game-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.game-card-head {
  align-items: center;
}
.game-card h2,
.game-side h2 {
  margin: 0;
  color: #18233b;
  font-size: 24px;
  font-weight: 950;
}
.game-note {
  margin: 12px 0 0;
  color: var(--game-muted);
  font-size: 14px;
  line-height: 1.8;
  font-weight: 700;
}
.game-score-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.game-score {
  min-width: 92px;
  padding: 10px 13px;
  border: 0;
  border-radius: 12px;
  background: #b9a99c;
  box-shadow: inset 0 -2px 0 rgba(88, 70, 57, 0.12);
}
.game-score span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.game-score strong {
  display: block;
  margin-top: 2px;
  color: #fff;
  font-size: 23px;
  font-weight: 950;
}
.game-btn {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  padding: 0 13px;
  color: #fff;
  background: linear-gradient(135deg, #5f87ef, #57cce1);
  box-shadow: 0 12px 26px rgba(95, 135, 239, 0.24);
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.game-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(95, 135, 239, 0.3);
}
.game-board {
  position: relative;
  --gap: 12px;
  --cell: calc((100% - (var(--gap) * 5)) / 4);
  display: block;
  aspect-ratio: 1;
  margin-top: 8px;
  border-radius: 18px;
  background: #b8aa9d;
  box-shadow:
    inset 0 3px 10px rgba(75, 57, 43, 0.16),
    0 18px 42px rgba(113, 91, 73, 0.16);
  touch-action: none;
}
.board-bg-cell {
  position: absolute;
  width: var(--cell);
  height: var(--cell);
  border-radius: 12px;
  background: rgba(238, 228, 218, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.tile {
  position: absolute;
  display: grid;
  place-items: center;
  width: var(--cell);
  height: var(--cell);
  border-radius: 12px;
  color: #776e65;
  background: #eee4da;
  font-size: clamp(22px, 5.5vw, 42px);
  font-weight: 950;
  box-shadow:
    inset 0 -3px 0 rgba(84, 68, 55, 0.08),
    0 10px 18px rgba(85, 65, 48, 0.08);
  transition: background 150ms ease, color 150ms ease;
}
.tile[data-value="2"] { background: #eee4da; }
.tile[data-value="4"] { background: #ede0c8; }
.tile[data-value="8"] { color: #f9f6f2; background: #f2b179; }
.tile[data-value="16"] { color: #f9f6f2; background: #f59563; }
.tile[data-value="32"] { color: #f9f6f2; background: #f67c5f; }
.tile[data-value="64"] { color: #f9f6f2; background: #f65e3b; }
.tile[data-value="128"] { color: #f9f6f2; background: #edcf72; font-size: clamp(20px, 4.8vw, 34px); }
.tile[data-value="256"] { color: #f9f6f2; background: #edcc61; font-size: clamp(20px, 4.8vw, 34px); }
.tile[data-value="512"] { color: #f9f6f2; background: #edc850; font-size: clamp(20px, 4.8vw, 34px); }
.tile[data-value="1024"],
.tile[data-value="2048"] {
  color: #f9f6f2;
  background: #edc53f;
  font-size: clamp(17px, 4vw, 30px);
}
.tile[data-value="4096"],
.tile[data-value="8192"] {
  color: #fff;
  background: #3c3a32;
  font-size: clamp(17px, 4vw, 30px);
}
.game-message {
  display: none;
  position: absolute;
  inset: var(--gap);
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: rgba(16, 26, 49, 0.74);
  text-align: center;
  font-size: 26px;
  font-weight: 950;
  backdrop-filter: blur(8px);
}
.game-message.is-visible {
  display: grid;
}
.game-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.game-list-item {
  padding: 14px;
  border: 1px solid var(--game-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
}
.game-list-item strong {
  display: block;
  margin-bottom: 4px;
  color: #223353;
  font-weight: 950;
}
.game-list-item span {
  color: var(--game-muted);
  font-size: 13px;
  font-weight: 700;
}

/* ── iframe containers ── */
.cube-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 390px;
  perspective: 900px;
}
.cube-live-frame {
  position: relative;
  width: 100%;
  min-height: 560px;
  height: 560px;
  border: 1px solid rgba(144, 170, 230, 0.18);
  border-radius: 18px;
  background: #080d18;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
}
/* nodie panel: stack sidebar below game, let container fit game ratio */
.game-panel[data-game-panel="nodie"] {
  grid-template-columns: 1fr;
}
.game-panel[data-game-panel="nodie"] .cube-live-frame {
  height: auto;
  min-height: 480px;
  aspect-ratio: 1366 / 880;
}
.game-panel[data-game-panel="sweep"] {
  --sweep-purple: #8d74df;
  position: relative;
  grid-template-columns: minmax(1080px, 1.6fr) minmax(320px, 0.45fr);
}
.game-panel[data-game-panel="sweep"]::before {
  content: "";
  position: absolute;
  left: -72px;
  bottom: -38px;
  width: min(380px, 22vw);
  height: min(660px, 72vh);
  background: url('/games/minesweeper/img/dongxuelian.png') 50% 100% / contain no-repeat;
  opacity: 0.34;
  filter: saturate(0.9);
  pointer-events: none;
  z-index: 0;
}
.game-panel[data-game-panel="sweep"]::after {
  content: "✦  ✿";
  position: absolute;
  right: 300px;
  top: -38px;
  color: rgba(141, 116, 223, 0.22);
  font-size: 74px;
  font-weight: 900;
  letter-spacing: 24px;
  pointer-events: none;
  z-index: 0;
}
.game-panel[data-game-panel="sweep"] .game-card,
.game-panel[data-game-panel="sweep"] .game-side {
  position: relative;
  z-index: 1;
  border-color: rgba(141, 116, 223, 0.18);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.9), rgba(247,244,255,0.76)),
    radial-gradient(circle at 95% 0%, rgba(141,116,223,0.13), transparent 26%);
}
.game-panel[data-game-panel="sweep"] .game-card {
  overflow: visible;
}
.game-panel[data-game-panel="sweep"] .game-card::before {
  content: "";
  position: absolute;
  inset: 20px auto auto 28px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(141,116,223,0.18), transparent 62%),
    repeating-linear-gradient(45deg, rgba(141,116,223,0.13) 0 2px, transparent 2px 10px);
  opacity: 0.52;
  pointer-events: none;
}
.game-panel[data-game-panel="sweep"] .game-side {
  overflow: hidden;
  min-height: 800px;
}
.game-panel[data-game-panel="sweep"] .game-side::before {
  content: "";
  position: absolute;
  right: -34px;
  bottom: 18px;
  width: 240px;
  height: 370px;
  background: url('/games/minesweeper/img/dongxuelian.png') 50% 100% / contain no-repeat;
  opacity: 0.2;
  pointer-events: none;
}
.game-panel[data-game-panel="sweep"] .game-side::after {
  content: "✿";
  position: absolute;
  right: 34px;
  top: 32px;
  color: rgba(141, 116, 223, 0.18);
  font-size: 92px;
  line-height: 1;
  pointer-events: none;
}
.game-panel[data-game-panel="sweep"] .game-card-head h2,
.game-panel[data-game-panel="sweep"] .game-side h2 {
  color: var(--sweep-purple);
}
.game-detail-container.is-active:has(.game-panel[data-game-panel="sweep"].is-active) {
  max-width: min(1780px, calc(100vw - 48px));
}
.game-panel[data-game-panel="sweep"] .cube-live-frame {
  height: min(84vh, 940px);
  min-height: 800px;
  background:
    radial-gradient(circle at 8% 14%, rgba(141,116,223,0.12), transparent 22%),
    linear-gradient(135deg, rgba(255,255,255,0.72), rgba(239,244,255,0.84));
  border-color: rgba(141, 116, 223, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.58), 0 24px 60px rgba(98, 82, 170, 0.12);
}
.game-panel[data-game-panel="tetris"] {
  position: relative;
  grid-template-columns: minmax(980px, 1.55fr) minmax(340px, 0.55fr);
  gap: 22px;
  align-items: stretch;
  --rikka-purple: #9a73ee;
  --rikka-deep: #4b2a84;
  --rikka-soft: rgba(157, 122, 239, 0.16);
  color: #4a3a73;
}
.game-panel[data-game-panel="tetris"]::before {
  content: "";
  position: fixed;
  right: -18px;
  top: 88px;
  width: min(430px, 24vw);
  height: min(840px, 78vh);
  background: url('/games/tetris/assets/rikka-character.png') 50% 18% / cover no-repeat;
  opacity: 0.15;
  filter: saturate(0.9);
  border-radius: 36px;
  pointer-events: none;
}
.tetris-hero {
  grid-column: 1 / -1;
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  text-align: center;
  margin: 28px 0 -4px;
  padding-top: 18px;
  overflow: hidden;
}
.tetris-hero::before,
.tetris-hero::after {
  content: "GO";
  position: absolute;
  color: rgba(154, 115, 238, 0.12);
  font-size: 118px;
  font-weight: 950;
  line-height: 1;
  transform: rotate(-18deg);
}
.tetris-hero::before {
  left: -8px;
  top: 4px;
}
.tetris-hero::after {
  right: 12px;
  bottom: -36px;
  font-size: 82px;
}
.tetris-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #8b6ee7;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.tetris-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b9dcff;
  box-shadow: 0 0 0 6px rgba(154, 115, 238, 0.1);
}
.tetris-hero h1 {
  margin: 18px 0 12px;
  color: #7250d8;
  font-size: clamp(36px, 4.2vw, 58px);
  font-weight: 950;
  letter-spacing: 0;
}
.tetris-hero p {
  max-width: 720px;
  margin: 0 auto;
  color: #7b66c9;
  font-size: 15px;
  line-height: 1.8;
  font-weight: 800;
}
.game-panel[data-game-panel="tetris"] .game-card {
  position: relative;
  min-height: 620px;
  padding: 18px;
  border: 1px solid rgba(154, 115, 238, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.88), rgba(249,246,255,0.76)),
    radial-gradient(circle at 8% 12%, rgba(154,115,238,0.15), transparent 24%);
  box-shadow: 0 22px 58px rgba(111, 85, 185, 0.16);
  backdrop-filter: blur(18px);
  overflow: hidden;
}
.game-panel[data-game-panel="tetris"] .game-card-head {
  display: flex;
  padding: 0 4px 12px;
  border-bottom: 1px dashed rgba(154, 115, 238, 0.22);
}
.game-panel[data-game-panel="tetris"] .game-card-head h2 {
  color: #8d66e6;
  font-size: 22px;
}
.tetris-play-layout {
  display: block;
  padding-top: 12px;
}
.tetris-character-card,
.tetris-mini-panel,
.tetris-score-card {
  border: 1px solid rgba(154, 115, 238, 0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.68);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42);
}
.tetris-character-card {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), rgba(244,238,255,0.78)),
    url('/games/tetris/assets/rikka-character.png') 50% 18% / auto 112% no-repeat;
}
.tetris-character-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 44%, rgba(255,255,255,0.9) 82%),
    radial-gradient(circle at 18% 20%, rgba(154,115,238,0.2), transparent 24%);
}
.tetris-speech {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 1;
  padding: 10px 12px;
  border: 1px solid rgba(154,115,238,0.22);
  border-radius: 16px 16px 16px 4px;
  color: #7a5ad6;
  background: rgba(255,255,255,0.84);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 900;
}
.tetris-mini-panel {
  padding: 12px;
  align-self: start;
}
.tetris-mini-label {
  display: block;
  margin-bottom: 8px;
  color: #9b7aea;
  font-size: 12px;
  font-weight: 950;
}
.tetris-mini-panel .game-btn {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(135deg, #8a63e8, #b767e7);
  box-shadow: 0 12px 26px rgba(138, 99, 232, 0.22);
}
.tetris-mini-panel select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(154,115,238,0.25);
  border-radius: 8px;
  color: #5b438d;
  background: rgba(255,255,255,0.82);
  font-weight: 800;
}
.game-panel[data-game-panel="tetris"] .cube-live-frame {
  width: 100%;
  height: min(88vh, 980px);
  min-height: 820px;
  border-radius: 8px;
  border: 1px solid rgba(80, 49, 134, 0.26);
  background:
    linear-gradient(rgba(180, 143, 245, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 143, 245, 0.12) 1px, transparent 1px),
    #2c1c4a;
  background-size: 32px 32px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 18px 34px rgba(70, 43, 132, 0.18);
}
.game-panel[data-game-panel="tetris"] .cube-live-frame iframe {
  width: 100%;
  height: 100%;
}
.tetris-score-stack {
  display: grid;
  gap: 8px;
}
.tetris-next {
  height: 72px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 52% 42%, rgba(185, 122, 255, 0.52), transparent 32%),
    linear-gradient(145deg, #55308d, #37215f);
}
.tetris-score-card {
  padding: 10px 11px;
  min-height: 88px;
}
.tetris-score-card span {
  display: block;
  color: #9778df;
  font-size: 11px;
  font-weight: 950;
}
.tetris-score-card strong {
  display: block;
  margin-top: 5px;
  color: #4d367f;
  font-size: 18px;
  font-weight: 950;
  text-align: right;
}
.game-panel[data-game-panel="tetris"] .game-side {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(154, 115, 238, 0.2);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.88), rgba(250,247,255,0.74)),
    radial-gradient(circle at 100% 0%, rgba(154,115,238,0.14), transparent 28%);
  box-shadow: 0 22px 58px rgba(111, 85, 185, 0.14);
}
.game-panel[data-game-panel="tetris"] .game-side h2,
.game-panel[data-game-panel="tetris"] .game-side .game-note {
  color: #8d66e6;
}
.game-panel[data-game-panel="tetris"] .game-side .game-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.game-panel[data-game-panel="tetris"] .game-side .game-list-item {
  position: relative;
  min-height: 78px;
  border-color: rgba(154, 115, 238, 0.18);
  border-radius: 12px;
  padding: 13px 14px 13px 48px;
  background: rgba(255,255,255,0.62);
}
.game-panel[data-game-panel="tetris"] .game-side .game-list-item::before {
  content: "☆";
  position: absolute;
  left: 18px;
  top: 16px;
  color: #a276f0;
  font-size: 22px;
  line-height: 1;
}
.game-panel[data-game-panel="tetris"] .game-side .game-list-item strong {
  color: #8d66e6;
  font-size: 15px;
}
.game-panel[data-game-panel="tetris"] .game-side .game-list-item span {
  color: #66538f;
  line-height: 1.62;
}
.tetris-quote {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 13px 16px;
  border: 1px solid rgba(154, 115, 238, 0.2);
  border-radius: 16px;
  color: #8b66e3;
  background: linear-gradient(135deg, rgba(248,243,255,0.88), rgba(239,230,255,0.72));
  font-size: 13px;
  font-weight: 900;
}
.tetris-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: url('/games/tetris/assets/rikka-character.png') 50% 16% / 76px auto no-repeat;
  box-shadow: 0 0 0 3px rgba(154, 115, 238, 0.18);
}
.tetris-live-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(154, 115, 238, 0.2);
  border-radius: 14px;
  background:
    radial-gradient(circle at 92% 16%, rgba(82, 214, 242, 0.14), transparent 30%),
    linear-gradient(145deg, rgba(255,255,255,0.82), rgba(246,240,255,0.68));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.48);
}
.tetris-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tetris-live-status {
  color: #6f4fd0;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tetris-live-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.tetris-live-stat {
  min-height: 66px;
  padding: 10px;
  border: 1px solid rgba(154, 115, 238, 0.16);
  border-radius: 10px;
  background: rgba(255,255,255,0.62);
}
.tetris-live-stat span,
.tetris-live-mini span {
  display: block;
  color: #9778df;
  font-size: 11px;
  font-weight: 950;
}
.tetris-live-stat strong,
.tetris-live-mini strong {
  display: block;
  margin-top: 6px;
  color: #4d367f;
  font-size: 20px;
  font-weight: 950;
  text-align: right;
}
.tetris-live-pieces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tetris-live-mini {
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid rgba(154, 115, 238, 0.16);
  border-radius: 10px;
  background:
    radial-gradient(circle at 70% 26%, rgba(180, 143, 245, 0.22), transparent 28%),
    rgba(255,255,255,0.58);
}
.tetris-live-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.tetris-action-btn {
  min-height: 38px;
  border: 1px solid rgba(154, 115, 238, 0.24);
  border-radius: 10px;
  color: #6a4ac8;
  background: rgba(255,255,255,0.72);
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.48);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.tetris-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(154, 115, 238, 0.42);
  background: rgba(250,246,255,0.94);
}
.tetris-action-btn.is-primary {
  color: #fff;
  background: linear-gradient(135deg, #8a63e8, #b767e7);
  box-shadow: 0 12px 24px rgba(138, 99, 232, 0.22);
}
.cube-live-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  overflow: hidden;
}
.cube-live-frame:fullscreen {
  border-radius: 0;
  background: #000;
}
.cube-live-frame:fullscreen iframe {
  min-height: 100vh;
}
.iframe-fs-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms;
  padding: 0;
}
.cube-live-frame:hover .iframe-fs-btn,
.cube-live-frame:fullscreen .iframe-fs-btn {
  opacity: 1;
}
.cube-live-frame:fullscreen .iframe-fs-btn {
  bottom: 14px;
  right: 14px;
}

/* ── Aqua Labyrinth frame ── */
.aqua-frame-wrap {
  position: relative;
  width: 100%;
  height: 520px;
  min-height: 520px;
  border: 1px solid rgba(144, 170, 230, 0.18);
  border-radius: 18px;
  background: #d9e4f5;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aqua-frame-wrap iframe {
  display: block;
  width: 320px;
  height: 480px;
  border: 0;
  flex-shrink: 0;
  transform-origin: center center;
}
.aqua-frame-wrap:fullscreen {
  border-radius: 0;
  background: #d9e4f5;
}
.aqua-frame-wrap:fullscreen iframe {
  width: 320px;
  height: 480px;
  min-height: auto;
}
.aqua-fs-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms;
}
.aqua-frame-wrap:hover .aqua-fs-btn,
.aqua-frame-wrap:fullscreen .aqua-fs-btn {
  opacity: 1;
}

/* ── Cube card (dark theme) ── */
.cube-card {
  color: #edf4ff;
  background:
    linear-gradient(145deg, rgba(20, 30, 56, 0.94), rgba(12, 18, 34, 0.96)),
    radial-gradient(circle at 28% 18%, rgba(95, 135, 239, 0.26), transparent 32%);
  border-color: rgba(144, 170, 230, 0.24);
  box-shadow: 0 28px 78px rgba(16, 26, 49, 0.28);
}
.cube-card .game-card-head h2 {
  color: #f5f8ff;
}
.cube-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}
.cube-meta-item {
  padding: 10px 12px;
  border: 1px solid rgba(144, 170, 230, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.cube-meta-item span {
  display: block;
  color: rgba(198, 212, 244, 0.62);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.cube-meta-item strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}
.cube-controls {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.cube-control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cube-control-label {
  width: 100%;
  color: rgba(198, 212, 244, 0.62);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.cube-controls .game-btn {
  min-height: 36px;
  color: #eaf1ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  border: 1px solid rgba(144, 170, 230, 0.22);
}
.cube-controls .game-btn:hover {
  background: rgba(95, 135, 239, 0.22);
}
.cube-controls .game-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}
.cube-controls .cube-primary {
  color: #fff;
  background: linear-gradient(135deg, #5f87ef, #57cce1);
  border-color: transparent;
}
.cube-speed-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cube-controls .cube-speed-option {
  min-height: 36px;
  min-width: 58px;
  border: 1px solid rgba(144, 170, 230, 0.22);
  border-radius: 12px;
  padding: 0 12px;
  color: #eaf1ff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}
.cube-controls .cube-speed-option.is-active {
  color: #fff;
  background: linear-gradient(135deg, #5f87ef, #57cce1);
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(87, 204, 225, 0.2);
}
.cube-status {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(144, 170, 230, 0.18);
  border-radius: 14px;
  color: rgba(218, 228, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.7;
}
.cube-status strong {
  color: #fff;
}
.cube-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cube-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(198, 212, 244, 0.4);
  flex-shrink: 0;
  transition: background 300ms;
}
.cube-status-dot.is-busy {
  background: #57cce1;
  box-shadow: 0 0 0 3px rgba(87, 204, 225, 0.2);
  animation: dot-pulse 1s ease-in-out infinite;
}
.cube-status-dot.is-done {
  background: #6be585;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.cube-stack {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(144, 170, 230, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.9;
  word-break: break-all;
  min-height: 36px;
  max-height: 160px;
  overflow-y: auto;
}
.cube-stack-label {
  display: block;
  margin-bottom: 4px;
  color: rgba(198, 212, 244, 0.45);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: inherit;
}
.cube-step {
  display: inline-block;
  margin: 1px 2px;
  padding: 1px 5px;
  border-radius: 4px;
  color: rgba(198, 212, 244, 0.5);
  transition: color 200ms, background 200ms;
}
.cube-step.is-done {
  color: rgba(198, 212, 244, 0.25);
  text-decoration: line-through;
}
.cube-step.is-current {
  color: #fff;
  background: rgba(95, 135, 239, 0.35);
  box-shadow: 0 0 0 1px rgba(95, 135, 239, 0.5);
}
.cube-side .game-list-item strong {
  color: #26395e;
}

/* ── Gobang ── */
.gobang-board-wrap {
  position: relative;
  display: grid;
  place-items: center;
  margin-top: 12px;
  border-radius: 18px;
  background: url(/games/gobang/bak.jpg) center/cover no-repeat;
  box-shadow: inset 0 3px 10px rgba(75, 57, 43, 0.16), 0 18px 42px rgba(113, 91, 73, 0.16);
  overflow: hidden;
}
.gobang-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1;
  cursor: pointer;
  touch-action: none;
}
.gobang-message {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: rgba(16, 26, 49, 0.74);
  text-align: center;
  font-size: 26px;
  font-weight: 950;
  backdrop-filter: blur(8px);
}
.gobang-message.is-visible {
  display: grid;
}
.gobang-turn {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
  font-weight: 900;
  font-size: 14px;
  color: var(--game-ink);
}
.gobang-mode-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.4);
  margin-bottom: 8px;
}
.gobang-mode-tab {
  min-height: 30px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  color: #5c6b8a;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}
.gobang-mode-tab:hover {
  color: var(--game-ink);
}
.gobang-mode-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #5f87ef, #57cce1);
  box-shadow: 0 6px 14px rgba(95, 135, 239, 0.24);
}
.gobang-actions {
  margin-top: 14px;
}

/* ── Responsive ── */
@media (max-width: 1180px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 860px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .game-panel.is-active {
    grid-template-columns: 1fr;
  }
  .game-panel[data-game-panel="tetris"],
  .game-panel[data-game-panel="sweep"] {
    grid-template-columns: 1fr;
  }
  .game-card,
  .game-side {
    border-radius: 18px;
  }
  .cube-live-frame {
    height: 420px;
    min-height: 420px;
  }
  .game-panel[data-game-panel="nodie"] .cube-live-frame {
    height: auto;
    min-height: 300px;
  }
  .game-panel[data-game-panel="tetris"] .cube-live-frame {
    height: 560px;
    min-height: 560px;
  }
  .game-panel[data-game-panel="sweep"] .cube-live-frame {
    height: 560px;
    min-height: 560px;
  }
  .tetris-hero {
    min-height: 140px;
    margin-top: 16px;
  }
  .tetris-play-layout {
    grid-template-columns: 1fr;
  }
  .tetris-character-card {
    min-height: 300px;
    background-size: cover;
  }
  .game-panel[data-game-panel="tetris"] .game-side {
    grid-template-columns: 1fr;
  }
  .tetris-live-stats,
  .tetris-live-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  #page-header {
    top: 0 !important;
    height: 60px !important;
    min-height: 60px !important;
  }
  #nav {
    height: 60px !important;
    padding: 0 14px !important;
  }
  #menus {
    display: none !important;
  }
  #toggle-menu {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .game-shell {
    padding-top: 76px !important;
    padding-inline: 12px !important;
    padding-bottom: 40px !important;
    min-height: 100vh !important;
    box-sizing: border-box !important;
  }
  .game-hero {
    margin: 0 auto 20px !important;
  }
  .game-hero h1 {
    font-size: clamp(26px, 7vw, 34px) !important;
    margin-bottom: 8px !important;
  }
  .game-hero p {
    font-size: 13px !important;
    line-height: 1.6 !important;
  }
  .game-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .game-grid-item {
    padding: 14px 10px 12px !important;
    border-radius: 14px !important;
  }
  .game-grid-icon {
    font-size: 24px !important;
    margin-bottom: 6px !important;
  }
  .game-grid-item h3 {
    font-size: 15px !important;
  }
  .game-grid-item p {
    font-size: 11px !important;
  }
  .game-detail-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  .game-detail-container.is-active:has(.game-panel[data-game-panel="tetris"].is-active),
  .game-detail-container.is-active:has(.game-panel[data-game-panel="sweep"].is-active) {
    max-width: 100% !important;
  }
  .game-panel.is-active {
    grid-template-columns: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 14px !important;
  }
  .game-panel[data-game-panel="tetris"],
  .game-panel[data-game-panel="sweep"],
  .game-panel[data-game-panel="nodie"] {
    grid-template-columns: 100% !important;
  }
  .game-panel[data-game-panel="sweep"]::before,
  .game-panel[data-game-panel="sweep"]::after,
  .game-panel[data-game-panel="tetris"]::before {
    display: none !important;
  }
  .game-card,
  .game-side {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
    padding: 16px 12px !important;
  }
  .game-card-head {
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .game-card-head h2 {
    font-size: 20px !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
  .game-actions {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .game-btn {
    font-size: 12px !important;
    padding: 0 10px !important;
    min-height: 32px !important;
  }
  .game-score-row {
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .game-score {
    min-width: 76px !important;
    padding: 6px 10px !important;
  }
  .game-score strong {
    font-size: 18px !important;
  }
  .game-board {
    --gap: 7px;
    max-width: min(340px, calc(100vw - 48px)) !important;
    margin: 8px auto !important;
    border-radius: 16px !important;
  }
  .tile {
    border-radius: 11px !important;
  }
  .cube-live-frame {
    height: 380px !important;
    min-height: 380px !important;
  }
  .game-panel[data-game-panel="nodie"] .cube-live-frame {
    height: auto !important;
    min-height: 220px !important;
  }
  .game-panel[data-game-panel="tetris"] .cube-live-frame {
    height: 480px !important;
    min-height: 480px !important;
  }
  .game-panel[data-game-panel="sweep"] .cube-live-frame {
    height: 480px !important;
    min-height: 480px !important;
  }
  .game-panel[data-game-panel="tetris"] .game-card,
  .game-panel[data-game-panel="tetris"] .game-side {
    padding: 12px !important;
  }
  .tetris-hero {
    min-height: 100px !important;
    padding: 16px 12px !important;
    margin-top: 8px !important;
  }
  .tetris-hero h1 {
    font-size: clamp(20px, 5vw, 26px) !important;
  }
  .tetris-play-layout {
    grid-template-columns: 1fr !important;
  }
  .game-panel[data-game-panel="tetris"] .game-side {
    grid-template-columns: 1fr !important;
  }
  .tetris-live-stats,
  .tetris-live-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .aqua-frame-wrap {
    height: 380px !important;
    min-height: 380px !important;
  }
  .cube-meta {
    grid-template-columns: 1fr !important;
  }
  .cube-speed-options {
    width: 100% !important;
  }
  .game-back-btn {
    margin-bottom: 12px !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
  }
}

/* ── Dark Mode ── */
:scope:is([data-theme='dark'] *) {
  --game-ink: #eaf1ff;
  --game-muted: #8b9ab8;
  --game-line: rgba(143, 170, 230, 0.2);
  --game-blue: #8fb5ff;
  --game-cyan: #63d6e7;
  --game-panel: rgba(20, 28, 50, 0.88);
  --game-deep: #0a1228;
  --game-shadow: 0 22px 58px rgba(0, 0, 0, 0.35);
}
:scope:is([data-theme='dark'] *) #body-wrap {
  background:
    linear-gradient(135deg, rgba(16, 21, 39, 0.96), rgba(10, 16, 30, 0.94)),
    radial-gradient(circle at 16% 12%, rgba(111, 149, 244, 0.14), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(99, 214, 231, 0.1), transparent 28%) !important;
}
:scope:is([data-theme='dark'] *) #page-header {
  background: rgba(16, 21, 39, 0.84) !important;
  border-bottom-color: rgba(143, 170, 230, 0.14);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}
:scope:is([data-theme='dark'] *) #nav a,
:scope:is([data-theme='dark'] *) #nav #site-name,
:scope:is([data-theme='dark'] *) #nav .site-page {
  color: var(--game-ink) !important;
}
:scope:is([data-theme='dark'] *) .game-card,
:scope:is([data-theme='dark'] *) .game-side,
:scope:is([data-theme='dark'] *) .game-grid-item,
:scope:is([data-theme='dark'] *) .game-back-btn {
  border-color: rgba(143, 170, 230, 0.18);
}
:scope:is([data-theme='dark'] *) .game-card h2,
:scope:is([data-theme='dark'] *) .game-side h2,
:scope:is([data-theme='dark'] *) .game-hero h1,
:scope:is([data-theme='dark'] *) .game-grid-item h3 {
  color: #eaf1ff;
}
:scope:is([data-theme='dark'] *) .game-hero p,
:scope:is([data-theme='dark'] *) .game-note,
:scope:is([data-theme='dark'] *) .game-grid-item p {
  color: #8b9ab8;
}
:scope:is([data-theme='dark'] *) .game-btn {
  box-shadow: 0 12px 26px rgba(95, 135, 239, 0.16);
}
:scope:is([data-theme='dark'] *) .game-btn:hover {
  box-shadow: 0 16px 32px rgba(95, 135, 239, 0.22);
}
:scope:is([data-theme='dark'] *) .game-board {
  background: #3c342e;
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.3), 0 18px 42px rgba(0,0,0,0.3);
}
:scope:is([data-theme='dark'] *) .board-bg-cell {
  background: rgba(238, 228, 218, 0.18);
}
:scope:is([data-theme='dark'] *) .game-message {
  background: rgba(10, 18, 40, 0.78);
}
:scope:is([data-theme='dark'] *) .game-list-item {
  border-color: rgba(143, 170, 230, 0.14);
  background: rgba(255, 255, 255, 0.04);
}
:scope:is([data-theme='dark'] *) .game-list-item strong {
  color: #d6e0fa;
}
:scope:is([data-theme='dark'] *) .game-list-item span {
  color: #6f85a6;
}
:scope:is([data-theme='dark'] *) .cube-live-frame {
  border-color: rgba(143, 170, 230, 0.12);
}
:scope:is([data-theme='dark'] *) .cube-card {
  background:
    linear-gradient(145deg, rgba(14, 20, 34, 0.96), rgba(8, 12, 24, 0.96)),
    radial-gradient(circle at 28% 18%, rgba(95, 135, 239, 0.16), transparent 32%);
  border-color: rgba(143, 170, 230, 0.18);
  box-shadow: 0 28px 78px rgba(0, 0, 0, 0.4);
}
:scope:is([data-theme='dark'] *) .cube-meta-item {
  border-color: rgba(143, 170, 230, 0.12);
  background: rgba(0, 0, 0, 0.18);
}
:scope:is([data-theme='dark'] *) .cube-status {
  border-color: rgba(143, 170, 230, 0.12);
  background: rgba(0, 0, 0, 0.16);
}
:scope:is([data-theme='dark'] *) .cube-controls .game-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(143, 170, 230, 0.14);
}
:scope:is([data-theme='dark'] *) .cube-controls .game-btn:hover {
  background: rgba(95, 135, 239, 0.16);
}
:scope:is([data-theme='dark'] *) .cube-controls .cube-speed-option {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(143, 170, 230, 0.14);
  color: #bdc8e6;
}
:scope:is([data-theme='dark'] *) .cube-stack {
  border-color: rgba(143, 170, 230, 0.08);
  background: rgba(0, 0, 0, 0.25);
}
:scope:is([data-theme='dark'] *) .gobang-board-wrap {
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.3), 0 18px 42px rgba(0,0,0,0.3);
}
:scope:is([data-theme='dark'] *) .gobang-turn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--game-ink);
}
:scope:is([data-theme='dark'] *) .gobang-mode-tabs {
  border-color: rgba(143, 170, 230, 0.18);
  background: rgba(20, 28, 50, 0.4);
}
:scope:is([data-theme='dark'] *) .gobang-mode-tab {
  color: #7a8eb8;
}
:scope:is([data-theme='dark'] *) .gobang-mode-tab:hover {
  color: #eaf1ff;
}
:scope:is([data-theme='dark'] *) .cube-side .game-list-item strong {
  color: #d6e0fa;
}
:scope:is([data-theme='dark'] *) .aqua-frame-wrap {
  border-color: rgba(143, 170, 230, 0.12);
  background: #1a2340;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
:scope:is([data-theme='dark'] *) .aqua-frame-wrap:fullscreen {
  background: #1a2340;
}
:scope:is([data-theme='dark'] *) .game-grid-item:hover {
  border-color: var(--game-blue);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}

}
body:has(.game-shell) #page-header { position:relative!important; top:0!important; margin:0!important; height:var(--site-nav-height)!important; min-height:var(--site-nav-height)!important; background:none!important; border:0!important; box-shadow:none!important; }
body:has(.game-shell) #nav { height:var(--site-nav-height)!important; }
body:has(.game-shell) #aside-content, body:has(.game-shell) .page-title { display:none!important; }
body:has(.game-shell) #content-inner.layout { display:block!important; width:100%!important; max-width:none!important; padding:0!important; margin:0!important; }
body:has(.game-shell) #page { border:0!important; border-radius:0!important; margin:0!important; padding:0!important; width:100%!important; }
body:has(.game-shell) .game-shell { padding-top:48px!important; }
@media(max-width:767px) { body:has(.game-shell) .game-shell { padding-top:28px!important; } }

/* Keep touch controls within reach without scrolling the board out of view. */
@media(max-width:767px) {
  body:has(.game-shell) [data-game-panel="tetris"].is-active { padding-bottom:165px; }
  body:has(.game-shell) [data-game-panel="tetris"].is-active .tetris-live-panel { position:fixed; bottom:0; left:0; right:0; width:100%; margin:0; padding:10px 16px max(10px,env(safe-area-inset-bottom)); border-radius:12px 12px 0 0; background:var(--site-paper); border:1px solid var(--site-line); z-index:950; box-shadow:0 -4px 20px #22334d14; }
  body:has(.game-shell) [data-game-panel="tetris"] :is(.tetris-live-stats,.tetris-live-pieces) { display:none; }
  body:has(.game-shell) [data-game-panel="tetris"] .tetris-live-head { margin:0 0 6px; }
  body:has(.game-shell) [data-game-panel="tetris"] .tetris-live-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  body:has(.game-shell) [data-game-panel="tetris"] .tetris-action-btn { min-height:32px; padding:5px 8px; border-radius:6px; }
}
