/* =================================================================
 * BLOOKET1 - PLAY PAGE
 * Builds on styles.css (tokens, header, sidebar, footer) and
 * carousel.css (cards + rails). Flat, no shadows; transform/opacity
 * animations only.
 * ================================================================= */

.play-main { padding-top: 10px; }

/* --- Breadcrumbs --- */
.play-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin: 0 0 10px 2px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
}
.play-breadcrumbs a { color: var(--text-secondary); transition: color 0.15s ease; }
.play-breadcrumbs a:hover { color: #fff; }
.play-breadcrumbs i { font-size: 9px; opacity: 0.7; }
.play-breadcrumbs span { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; }

/* --- Page grid: player + below on the left, recommendations + sticky ad on the right --- */
.play-layout {
  --side-w: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  grid-template-areas:
    "player side"
    "below  side";
  column-gap: 20px;
  align-items: start;
}

.player-shell { grid-area: player; min-width: 0; }
.play-below { grid-area: below; min-width: 0; }
.play-side {
  grid-area: side;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* =================================================================
 * PLAYER
 * ================================================================= */
.player-shell {
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - var(--header-height) - 140px);
  min-height: 340px;
  background: #000;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  isolation: isolate;
}

/* Click-to-play cover */
.player-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #07080d;
  cursor: pointer;
}

.player-cover-bg {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(36px) saturate(1.3);
  opacity: 0.55;
  transform: translateZ(0);
}

.player-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(7, 8, 13, 0.1) 0%, rgba(7, 8, 13, 0.75) 100%);
}

.player-cover-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.player-cover-thumb {
  width: clamp(150px, 24vw, 270px);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 18px;
  outline: 3px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.35s var(--ease-spring);
}

.player-cover:hover .player-cover-thumb { transform: translateY(-3px) scale(1.03); }

.player-cover-title {
  margin-top: 16px;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
}

.player-play-btn {
  margin-top: 16px;
  height: 56px;
  padding: 0 34px;
  border-radius: 999px;
  border: none;
  background: var(--accent-color);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.25s var(--ease-spring);
}

.player-play-btn i { font-size: 15px; }
.player-play-btn:hover,
.player-cover:hover .player-play-btn { background: var(--accent-hover); transform: scale(1.06); }
.player-play-btn:active { transform: scale(0.97); }

.player-cover-hint {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
}
.player-cover-hint i { color: var(--accent-gold); margin-right: 4px; }

/* Game frame */
#game-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  visibility: hidden;
}

.player-shell.is-playing #game-iframe { visibility: visible; }
.player-shell.is-playing .player-cover { display: none; }

/* Loading */
.player-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #000;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
}

.player-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent-color);
  animation: playerSpin 0.8s linear infinite;
}

@keyframes playerSpin { to { transform: rotate(360deg); } }

.player-exit-fs {
  display: none;
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 6;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(8, 9, 15, 0.6);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

/* --- Toolbar --- */
.player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 14px 12px 16px;
}

.player-id { display: flex; align-items: center; gap: 12px; min-width: 0; }

.player-id-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  object-fit: cover;
}

.player-id-text { min-width: 0; }

.player-title {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.player-chip {
  height: 22px;
  padding: 0 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.player-chip:hover { background: var(--accent-soft); color: #fff; }

.player-plays {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-muted);
}
.player-plays i { font-size: 9px; }

.player-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.player-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.2s var(--ease-spring);
}

.player-btn:hover { background: var(--bg-card-hover); }
.player-btn:active { transform: scale(0.9); }
.player-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-color); }
#btn-fav[aria-pressed="true"] { background: rgba(255, 77, 106, 0.14); color: #ff4d6a; }
#btn-fav.is-popping i { animation: favPop 0.4s var(--ease-spring); }

@keyframes favPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

.player-btn-primary { background: var(--accent-color); color: #fff; }
.player-btn-primary:hover { background: var(--accent-hover); }

/* Tooltips (hover devices only) */
@media (hover: hover) {
  .player-btn[data-label]:hover::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    border-radius: 8px;
    background: #fff;
    color: #0b0c13;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    animation: cgTooltipFade 0.12s ease forwards;
  }
  .player-menu-wrap .player-btn[aria-expanded="true"]::after { display: none; }
}

/* More menu */
.player-menu-wrap { position: relative; }

.player-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 30;
  min-width: 220px;
  padding: 6px;
  border-radius: 14px;
  background: var(--bg-elevated);
  outline: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  animation: menuIn 0.16s var(--ease-out);
  transform-origin: bottom right;
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.player-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.player-menu button i { width: 16px; color: var(--text-secondary); }
.player-menu button:hover { background: var(--bg-card-hover); }

.is-touch-only { display: none !important; }
html.is-touch .is-touch-only { display: flex !important; }

/* --- Theater mode: player spans the full width, side column hidden --- */
body.is-theater .play-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "player" "below"; }
body.is-theater .play-side { display: none; }
body.is-theater .player-stage { aspect-ratio: auto; height: calc(100vh - var(--header-height) - 120px); max-height: none; }
body.is-theater .play-quick { display: block; }
body.is-theater .play-breadcrumbs { display: none; }

/* =================================================================
 * TOUCH CONTROLS
 * ================================================================= */
.touch-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: #0d0e16;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.touch-dpad {
  position: relative;
  width: 148px;
  height: 148px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  touch-action: none;
}

.dpad-key {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background-color 0.08s ease, transform 0.08s ease;
}

.dpad-up { top: 6px; left: 48px; }
.dpad-down { bottom: 6px; left: 48px; }
.dpad-left { left: 6px; top: 48px; }
.dpad-right { right: 6px; top: 48px; }

.dpad-center {
  position: absolute;
  top: 58px;
  left: 58px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.dpad-key.is-pressed { background: var(--accent-color); transform: scale(0.94); }

.touch-buttons { display: flex; align-items: center; gap: 14px; }

.touch-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
  padding: 6px;
  touch-action: none;
  transition: background-color 0.08s ease, transform 0.08s ease;
}

.touch-btn:nth-child(2) { width: 58px; height: 58px; transform: translateY(-26px); }
.touch-btn.is-pressed { background: var(--accent-color); transform: scale(0.92); }
.touch-btn:nth-child(2).is-pressed { transform: translateY(-26px) scale(0.92); }

/* =================================================================
 * FULLSCREEN (native + iOS fallback)
 * ================================================================= */
.player-shell:fullscreen,
body.is-pseudo-fs .player-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #000;
}

body.is-pseudo-fs .player-shell {
  position: fixed;
  inset: 0;
  z-index: 5000;
  margin: 0;
  width: 100vw;
  height: 100dvh;
}

body.is-pseudo-fs { overflow: hidden; }

.player-shell:fullscreen .player-stage,
body.is-pseudo-fs .player-stage {
  flex: 1;
  aspect-ratio: auto;
  max-height: none;
  min-height: 0;
  height: auto;
  border-radius: 0;
}

.player-shell:fullscreen .player-toolbar,
body.is-pseudo-fs .player-toolbar { display: none; }

.player-shell:fullscreen .player-exit-fs,
body.is-pseudo-fs .player-exit-fs { display: flex; align-items: center; justify-content: center; }

/* Controls float over the game in fullscreen */
.player-shell:fullscreen .touch-controls,
body.is-pseudo-fs .touch-controls {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 7;
  padding: 0 max(22px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background: transparent;
  pointer-events: none;
}

.player-shell:fullscreen .touch-dpad,
.player-shell:fullscreen .touch-btn,
body.is-pseudo-fs .touch-dpad,
body.is-pseudo-fs .touch-btn { pointer-events: auto; opacity: 0.75; }

/* =================================================================
 * ADS - labelled, separated from the game, space reserved (no CLS)
 * ================================================================= */
.ad-unit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.ad-label {
  display: block;
  width: 100%;
  padding: 6px 0 4px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
}

.ad-unit ins.adsbygoogle { display: block; width: 100%; min-height: 0; }

.ad-unit-leaderboard { margin: 20px 0 6px; min-height: 120px; }
.ad-unit-leaderboard ins.adsbygoogle { min-height: 90px; }

.ad-unit-inarticle { margin: 18px 0; min-height: 276px; }
.ad-unit-inarticle ins.adsbygoogle { min-height: 250px; }

.ad-unit-multiplex { margin-top: 30px; min-height: 320px; }
.ad-unit-multiplex ins.adsbygoogle { min-height: 280px; }

.ad-unit-sticky {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  margin-top: 20px;
  min-height: 626px;
  background: rgba(255, 255, 255, 0.02);
}
.ad-unit-sticky ins.adsbygoogle { width: 300px; height: 600px; }

/* Unfilled slots collapse instead of leaving a hole */
.ad-unit:has(ins[data-ad-status="unfilled"]) { display: none; }

/* =================================================================
 * RECOMMENDATIONS
 * ================================================================= */
.play-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0 0 10px 2px;
}
.play-section-title i { color: var(--accent-color); font-size: 0.85em; }

.play-side-title { margin-top: 4px; }

.side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.side-grid .game-item { flex: none; width: auto; }
.side-grid .game-name { font-size: 12.5px; }
.side-grid .game-card-overlay { padding: 18px 9px 7px; }
.side-grid .game-item:hover { transform: translateY(-3px) scale(1.04); }
.side-grid .favorite-btn { width: 26px; height: 26px; font-size: 11px; top: 6px; right: 6px; }
.side-grid .badge-micro { top: 6px; left: 6px; height: 19px; font-size: 10px; padding: 0 6px; }

.side-grid:empty::before {
  content: "";
  grid-column: 1 / -1;
  height: 480px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-hover) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}

/* "Up next" grid (only when the side column is hidden) */
.play-quick { display: none; margin-top: 22px; }
.side-grid-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.side-grid-quick:empty::before { height: 210px; }

.play-rails { margin-top: 34px; }
.play-rails .game-category-section { --cols: 5; }

/* =================================================================
 * ABOUT + FACTS
 * ================================================================= */
.play-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 1fr);
  gap: 16px;
  margin-top: 22px;
  align-items: start;
}

.play-card {
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  padding: 24px 26px;
  min-width: 0;
}

.play-about-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fff;
  margin-bottom: 12px;
}

.play-about-body p,
.play-about-body li {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.75;
  color: var(--text-secondary);
}
.play-about-body p + p { margin-top: 12px; }
.play-about-body h2,
.play-about-body h3 { font-size: 1.1rem; font-weight: 900; color: #fff; margin: 20px 0 8px; }
.play-about-body ul,
.play-about-body ol { padding-left: 22px; margin-top: 8px; }
.play-about-body li + li { margin-top: 4px; }
.play-about-body li::marker { color: var(--accent-color); font-weight: 900; }
.play-about-body a { color: var(--accent-color); }
.play-about-body b, .play-about-body strong { color: var(--text-primary); }

.play-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
}
.play-card-title i { color: var(--accent-color); font-size: 0.9em; }
.play-card-title:not(:first-child) { margin-top: 24px; }

.play-controls-text { font-size: 14.5px; line-height: 1.65; color: var(--text-secondary); }

.play-keycaps {
  display: grid;
  grid-template-columns: repeat(3, 40px) 1fr;
  grid-template-rows: repeat(2, 40px);
  gap: 6px;
  margin-top: 14px;
  align-items: center;
}

.keycap {
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border-bottom: 3px solid rgba(0, 0, 0, 0.45);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
}

.keycap-up { grid-column: 2; grid-row: 1; }
.keycap-left { grid-column: 1; grid-row: 2; }
.keycap-down { grid-column: 2; grid-row: 2; }
.keycap-right { grid-column: 3; grid-row: 2; }
.keycap-wide { grid-column: 4; grid-row: 1 / span 2; justify-self: start; margin-left: 10px; height: 40px; }

.play-facts-list { display: flex; flex-direction: column; }
.play-facts-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
}
.play-facts-list > div:first-child { border-top: none; padding-top: 2px; }
.play-facts-list dt { font-size: 13.5px; font-weight: 800; color: var(--text-muted); }
.play-facts-list dd { font-size: 14px; font-weight: 800; color: var(--text-primary); text-align: right; }

.play-facts-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.play-facts-chips a {
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.15s ease;
}
.play-facts-chips a:hover { background: var(--accent-soft); }

/* =================================================================
 * HEADER SEARCH SUGGESTIONS
 * ================================================================= */
.cg-search-bar { position: relative; }

.play-search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1100;
  padding: 6px;
  border-radius: 16px;
  background: var(--bg-elevated);
  outline: 1px solid var(--border-strong);
  animation: menuIn 0.14s var(--ease-out);
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
}
.suggest-item img { width: 54px; height: 36px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.suggest-item small { display: block; font-size: 12px; color: var(--text-muted); font-weight: 700; }
.suggest-item:hover,
.suggest-item.is-active { background: var(--bg-card-hover); }
.suggest-empty { padding: 12px; font-size: 13.5px; color: var(--text-muted); }

/* =================================================================
 * "NEXT GAME" PROMPT
 * ================================================================= */
.next-prompt {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 4500;
  width: 380px;
  max-width: calc(100vw - 24px);
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-elevated);
  outline: 1px solid var(--border-strong);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.25s ease, transform 0.35s var(--ease-spring);
}
.next-prompt.is-visible { opacity: 1; transform: none; }

.next-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}
.next-prompt-head i { color: var(--accent-color); margin-right: 6px; }

.next-prompt-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.next-prompt-close:hover { background: var(--bg-card-hover); color: #fff; }
.next-prompt-close i { color: inherit; margin: 0; }

.next-prompt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.next-prompt-grid .favorite-btn { display: none; }

@media (max-width: 600px) {
  .next-prompt { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

/* =================================================================
 * TOAST
 * ================================================================= */
.play-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 6000;
  padding: 11px 18px;
  border-radius: 999px;
  background: #fff;
  color: #0b0c13;
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s var(--ease-spring);
}
.play-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* =================================================================
 * BREAKPOINTS
 * ================================================================= */
@media (min-width: 1700px) {
  .play-layout { --side-w: 340px; }
  .play-rails .game-category-section { --cols: 6; }
}

@media (max-width: 1279px) {
  .play-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "player" "below"; }
  .play-side { display: none; }
  .play-quick { display: block; }
}

@media (max-width: 1100px) {
  .play-info-grid { grid-template-columns: minmax(0, 1fr); }
  .play-rails .game-category-section { --cols: 4; }
}

@media (max-width: 900px) {
  .is-desktop-only { display: none !important; }
  .play-breadcrumbs { margin-bottom: 8px; }

  .player-shell {
    margin: 0 calc(var(--content-pad) * -1);
    border-radius: 0;
  }

  .player-stage {
    aspect-ratio: 16 / 10;
    min-height: 0;
    max-height: 70vh;
    border-radius: 0;
  }

  .player-toolbar { flex-wrap: wrap; gap: 12px; padding: 12px var(--content-pad); }
  .player-id { flex: 1 1 100%; }
  .player-actions { flex: 1 1 100%; justify-content: space-between; }
  .player-btn { width: 46px; height: 46px; }
  .player-menu { right: auto; left: 50%; transform-origin: bottom center; translate: -50% 0; }

  .ad-unit-leaderboard { min-height: 280px; }
  .ad-unit-leaderboard ins.adsbygoogle { min-height: 250px; }

  .play-card { padding: 20px; }
  .play-about-title { font-size: 1.2rem; }
}

@media (max-width: 768px) {
  .play-rails .game-category-section { --cols: 2; }
  .side-grid-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .touch-controls { padding: 12px 14px; }
  .touch-dpad { transform: scale(0.92); transform-origin: left center; }
}

@media (prefers-reduced-motion: reduce) {
  .player-spinner { animation-duration: 2s; }
  .player-menu, .play-search-suggest { animation: none; }
}

/* ==========================================================================
   Category pages (category/<slug>/index.html, generated by
   tools/build-category-pages.js). They reuse the play-page shell.
   ========================================================================== */
.category-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 16px;
  row-gap: 6px;
  align-items: center;
  margin: 6px 0 18px;
}
.category-hero-icon {
  grid-row: span 2;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg, 14px);
  background: var(--accent-soft);
  color: var(--accent-color);
  display: grid;
  place-items: center;
  font-size: 24px;
}
.category-hero-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}
.category-count {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.07);
  padding: 3px 9px;
  border-radius: 7px;
  letter-spacing: 0;
}
.category-hero-intro {
  margin: 0;
  max-width: 70ch;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  margin-bottom: 18px;
}
.category-chips::-webkit-scrollbar { display: none; }
.category-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #fff);
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.category-chip i { color: var(--text-secondary); font-size: 0.9em; transition: color 0.15s ease; }
.category-chip:hover { background: var(--accent-soft); }
.category-chip:hover i { color: var(--accent-color); }

.category-hero > div { display: contents; }
.category-hero .category-count { display: inline-flex; }

.category-grid-section { margin: 18px 0 8px; }
.category-about { margin-top: 24px; }

@media (max-width: 600px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-hero { column-gap: 12px; }
  .category-hero-icon { width: 44px; height: 44px; font-size: 19px; grid-row: auto; }
  .category-hero-intro { grid-column: 1 / -1; }
}
