/* ===================================================================
   GameZone — Ocean Blue Theme
   Layout: Left (game stage 310px) + Right (bento catalog)
   Bento grid: base cell 110px
     - header card : 3x3 (330x330)  — all top content
     - ad card     : 3x3 (330x330)
     - game items  : 1x1 (110) default / 2x2 (220) / 3x3 (330)
   Gutter created with margin so grid areas stay exact multiples of 110.
   =================================================================== */

/* ---------- Theme tokens ---------- */

:root {
    --stage-w: 310px;
    --cell: 110px;
    /* base cell */
    --gut: 5px;
    /* half-gutter (visual gap = 10px) */
    /* Dark (default) — violet aurora */
    --bg: #0a0e1f;
    --bg-2: #11152e;
    --surface: #191e3e;
    --surface-2: #232a52;
    --border: #2e376b;
    --text: #eef0ff;
    --text-dim: #9aa2d4;
    --accent: #7c5cff;
    /* violet */
    --accent-2: #22d3ee;
    /* cyan */
    --accent-3: #ff5d9e;
    /* pink */
    --star: #ffd166;
    /* rating gold */
    --glow: 0 0 18px rgba(124, 92, 255, .55);
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="light"] {
    --bg: #f4f3fb;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #f0eefb;
    --border: #e2def4;
    --text: #1a1740;
    --text-dim: #6b6699;
    --accent: #6d44ff;
    --accent-2: #0aa5c4;
    --accent-3: #e84d8f;
    --star: #f5a623;
    --glow: 0 0 16px rgba(109, 68, 255, .3);
    --shadow: 0 10px 28px rgba(80, 60, 160, .18);
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    position: static !important;
    width: auto !important;
    height: auto !important;
    min-height: 100%;
    overflow: hidden !important;
    /* each section scrolls on its own */
    touch-action: manipulation;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font: inherit;
    cursor: pointer;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border-radius: 0 0 10px 0;
}

.skip-link:focus {
    left: 0;
}

/* ---------- App shell ---------- */

.app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    background: radial-gradient(1100px 600px at 10% -10%, rgba(124, 92, 255, .20), transparent 60%), radial-gradient(900px 500px at 110% 8%, rgba(34, 211, 238, .14), transparent 55%), var(--bg);
}

/* ===================================================================
   LEFT — GAME STAGE
   =================================================================== */

.stage {
    flex: 0 0 var(--stage-w);
    width: var(--stage-w);
    min-width: 0;
    padding: 16px;
    display: flex;
    transition: flex-basis .45s var(--ease), width .45s var(--ease), padding .45s var(--ease);
}

.stage__inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    min-height: 0;
}

.stage__screen {
    flex: 1 1 auto;
    min-height: 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .03) 0 12px, transparent 12px 24px), linear-gradient(160deg, var(--surface), var(--bg-2));
    box-shadow: var(--shadow), inset 0 0 60px rgba(124, 92, 255, .10);
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
}

.stage__placeholder {
    text-align: center;
    color: var(--text-dim);
    padding: 20px;
}

.stage__placeholder p {
    margin: 8px 0 2px;
    font-weight: 700;
    color: var(--text);
}

.stage__placeholder small {
    font-size: 12px;
}

.stage__logo {
    font-size: 44px;
    filter: drop-shadow(var(--glow));
}

.btn-play {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 22px;
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .5px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 24px rgba(124, 92, 255, .45);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(124, 92, 255, .6);
}

.btn-play:active {
    transform: translateY(0);
}

.btn-play__icon {
    font-size: 14px;
}

/* ===================================================================
   RIGHT — PANEL
   =================================================================== */

.panel {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    background: var(--bg-2);
    border-left: 1px solid var(--border);
    border-radius: 22px 0 0 22px;
    margin: 10px 0;
    box-shadow: var(--shadow);
    transition: flex-basis .45s var(--ease), max-width .45s var(--ease), transform .45s var(--ease);
    overflow: hidden;
}

.panel__scroll {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    border-radius: 22px 0 0 22px;
    /* clip content to the frame */
    padding: 12px 10px 20px;
    /* content spreads to the frame edges */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.panel__scroll::-webkit-scrollbar {
    width: 9px;
}

.panel__scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Toggle button ( » / info ) */

/* Toggle ( » / info ) sits next to the logo */

.panel__toggle {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    box-shadow: var(--glow);
    transition: transform .2s var(--ease), filter .2s;
}

.panel__toggle:hover {
    filter: brightness(1.12);
    transform: scale(1.05);
}

.panel__toggle-text {
    line-height: 1;
}

/* ===================================================================
   BENTO GRID — fixed 110px cells
   =================================================================== */

.grid {
    display: grid;
    /* min(110px, 31%) keeps >=3 columns on phones so the 3x3 blocks never overflow */
    grid-template-columns: repeat(auto-fill, minmax(min(var(--cell), 31%), 1fr));
    grid-auto-flow: dense;
    gap: 10px;
}

.grid>* {
    aspect-ratio: 1 / 1;
}

/* square cells; stretch evenly to the frame edges */

/* spans */

.game {
    grid-column: span 1;
    grid-row: span 1;
}

/* 1x1 = 110 */

.game--s2 {
    grid-column: span 2;
    grid-row: span 2;
}

/* 2x2 = 220 */

.game--s3 {
    grid-column: span 3;
    grid-row: span 3;
}

/* 3x3 = 330 */

.hcard,
.ad {
    grid-column: span 3;
    grid-row: span 3;
}

/* 3x3 = 330 */

/* ===================================================================
   HEADER CARD (3x3) — compact, holds all top content
   =================================================================== */

.hcard {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, var(--surface), var(--bg-2));
    box-shadow: var(--shadow);
}

.hcard__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}
article.hcard {
    overflow-y: auto;
}
article.hcard::-webkit-scrollbar {
    width: 4px;
}

.brand__mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 12px;
    box-shadow: var(--glow);
}

.brand__name {
    font-size: 16px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.icon-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s, transform .15s;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--accent-2);
}

.icon-btn:active {
    transform: scale(.94);
}

.icon-btn--theme {
    margin-left: auto;
}

.icon-btn__sun {
    display: none;
}

.icon-btn__moon {
    display: inline;
}

[data-theme="light"] .icon-btn__sun {
    display: inline;
}

[data-theme="light"] .icon-btn__moon {
    display: none;
}

/* Search */

.search {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px; /*0 4px 0 10px*/
    height: 30px;
    transition: border-color .2s, box-shadow .2s;
}

.search:focus-within {
    border-color: var(--accent);
    box-shadow: var(--glow);
}

.search__input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    outline: none;
    font-size: 14px;
    height: 30px;
}

.search__input::placeholder {
    color: var(--text-dim);
}

.search__btn {
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 14px;
    padding: 0 4px;
}

/* Wrapping rows (menu / categories) — show all chips inside the 3x3 card */

.hscroll {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.menu {
    margin: 0;
}

.menu__item {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: color .2s, background .2s, border-color .2s;
}

.menu__item:hover {
    color: var(--text);
    border-color: var(--accent);
}

.menu__item.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: 1px solid linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* Social */
ul.social {
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
}
.social {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.social__link {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: transform .18s var(--ease), color .2s, box-shadow .2s, border-color .2s;
}

.social__icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.social__icon--light {
    display: none;
}

.social__icon--dark {
    display: block;
}

[data-theme="light"] .social__icon--light {
    display: block;
}

[data-theme="light"] .social__icon--dark {
    display: none;
}

.social__link:hover {
    color: var(--accent-2);
    transform: translateY(-2px);
    border-color: var(--accent-2);
    box-shadow: var(--glow);
}

/* Title + rating + breadcrumb */

.game-head {
    margin-top: 2px;
}

.game-head__title {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.rating {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 3px 0;
    font-size: 14px;
    color: var(--text-dim);
}

.rating__stars {
    --rate: 100%;
    width: 90px;
    height: 16px;
    background: linear-gradient(90deg, var(--star) var(--rate), color-mix(in srgb, var(--text-dim) 45%, transparent) var(--rate));
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='92' height='16' viewBox='0 0 92 16'><g fill='black'><path d='M8 0l2.35 5.1L16 5.6l-4 3.9.94 5.5L8 12.4 3.06 15l.94-5.5-4-3.9 5.65-.5z'/><path d='M27 0l2.35 5.1L35 5.6l-4 3.9.94 5.5L27 12.4 22.06 15l.94-5.5-4-3.9 5.65-.5z'/><path d='M46 0l2.35 5.1L54 5.6l-4 3.9.94 5.5L46 12.4 41.06 15l.94-5.5-4-3.9 5.65-.5z'/><path d='M65 0l2.35 5.1L73 5.6l-4 3.9.94 5.5L65 12.4 60.06 15l.94-5.5-4-3.9 5.65-.5z'/><path d='M84 0l2.35 5.1L92 5.6l-4 3.9.94 5.5L84 12.4 79.06 15l.94-5.5-4-3.9 5.65-.5z'/></g></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='92' height='16' viewBox='0 0 92 16'><g fill='black'><path d='M8 0l2.35 5.1L16 5.6l-4 3.9.94 5.5L8 12.4 3.06 15l.94-5.5-4-3.9 5.65-.5z'/><path d='M27 0l2.35 5.1L35 5.6l-4 3.9.94 5.5L27 12.4 22.06 15l.94-5.5-4-3.9 5.65-.5z'/><path d='M46 0l2.35 5.1L54 5.6l-4 3.9.94 5.5L46 12.4 41.06 15l.94-5.5-4-3.9 5.65-.5z'/><path d='M65 0l2.35 5.1L73 5.6l-4 3.9.94 5.5L65 12.4 60.06 15l.94-5.5-4-3.9 5.65-.5z'/><path d='M84 0l2.35 5.1L92 5.6l-4 3.9.94 5.5L84 12.4 79.06 15l.94-5.5-4-3.9 5.65-.5z'/></g></svg>");
    -webkit-mask-size: 90px 16px;
    mask-size: 90px 16px;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.rating__num {
    font-weight: 800;
    color: var(--star);
}

.breadcrumb__list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--text-dim);
}

.breadcrumb__item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb__item+.breadcrumb__item::before {
    content: "›";
    margin: 0 6px;
    color: var(--text-dim);
}

.breadcrumb__item a:hover {
    color: var(--accent-2);
}

.breadcrumb__item[aria-current="page"] {
    color: var(--text);
    font-weight: 600;
}

/* Categories row */

.cats {
    margin: 0;
}

.cat {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: color .2s, border-color .2s, background .2s;
}

.cat:hover {
    color: var(--text);
    border-color: var(--accent-2);
}

.cat.is-active {
    color: #fff;
    background: var(--accent);
    border-color: transparent;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.game-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    max-width: 100%;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
    transition: transform .18s var(--ease), border-color .2s, background .2s, box-shadow .2s;
}

.game-tag:hover {
    color: var(--text);
    transform: translateY(-1px);
    border-color: var(--accent-2);
    background: var(--surface-2);
    box-shadow: var(--glow);
}

.game-tag__icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-right: 2px;
    background: #ffd166;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M20 10.6 13.4 4H5v8.4L11.6 19a2 2 0 0 0 2.8 0l5.6-5.6a2 2 0 0 0 0-2.8ZM8.5 9.5A1.5 1.5 0 1 1 8.5 6.5a1.5 1.5 0 0 1 0 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M20 10.6 13.4 4H5v8.4L11.6 19a2 2 0 0 0 2.8 0l5.6-5.6a2 2 0 0 0 0-2.8ZM8.5 9.5A1.5 1.5 0 1 1 8.5 6.5a1.5 1.5 0 0 1 0 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.game-tag__title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.game-tag__count {
    flex: 0 0 auto;
    color: #f39c12;
}

.tag-directory {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    padding: 4px 0 12px;
}

.tag-directory--content {
    padding-top: 0;
}

.tag-directory__intro {
    margin: 0 0 24px;
    color: var(--text-dim);
    font-size: 16px;
}

.tag-directory__group {
    margin: 0 0 28px;
}

.tag-directory__letter {
    margin: 0 0 14px;
    color: color-mix(in srgb, var(--text) 65%, var(--text-dim));
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}

.tag-directory__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px 14px;
}

.tag-directory__item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    transition: transform .18s var(--ease), border-color .2s, background .2s, box-shadow .2s;
}

.tag-directory__item:hover {
    color: var(--text);
    transform: translateY(-1px);
    border-color: var(--accent-2);
    background: var(--surface-2);
    box-shadow: var(--glow);
}

.tag-directory__title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tag-directory__count {
    flex: 0 0 auto;
    color: #f39c12;
}

/* ===================================================================
   AD CARD (3x3)
   =================================================================== */

.ad {
    display: flex;
    flex-direction: column;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 10px, transparent 10px 20px), var(--surface);
    padding: 10px;
}

.ad__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.ad__slot {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-2);
    color: var(--text-dim);
    font-size: 13px;
    letter-spacing: 1px;
}

/* ===================================================================
   GAME ITEM
   =================================================================== */

.game {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.game__media {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform .4s var(--ease);
}

/* placeholder game art colors (replace with real images later) */

.game:nth-of-type(7n+1) .game__media {
    background: linear-gradient(135deg, #7c5cff, #22d3ee);
}

.game:nth-of-type(7n+2) .game__media {
    background: linear-gradient(135deg, #ff5d9e, #ffb347);
}

.game:nth-of-type(7n+3) .game__media {
    background: linear-gradient(135deg, #22d3ee, #7c5cff);
}

.game:nth-of-type(7n+4) .game__media {
    background: linear-gradient(135deg, #a64bff, #ff5d9e);
}

.game:nth-of-type(7n+5) .game__media {
    background: linear-gradient(135deg, #5b8cff, #22d3ee);
}

.game:nth-of-type(7n+6) .game__media {
    background: linear-gradient(135deg, #ff7eb3, #7c5cff);
}

.game:nth-of-type(7n+7) .game__media {
    background: linear-gradient(135deg, #22d3ee, #34e3b0);
}

.game__name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .78));
    transform: translateY(110%);
    opacity: 0;
    transition: transform .28s var(--ease), opacity .28s var(--ease);
}

.game--s2 .game__name,
.game--s3 .game__name {
    font-size: 14px;
}

/* Hover: reveal name + zoom image */

.game:hover,
.game:focus-visible {
    transform: translateY(-3px);
    box-shadow: var(--glow), 0 14px 30px rgba(0, 0, 0, .4);
    z-index: 2;
    outline: none;
}

.game:hover .game__media,
.game:focus-visible .game__media {
    transform: scale(1.12);
}

.game:hover .game__name,
.game:focus-visible .game__name {
    transform: translateY(0);
    opacity: 1;
}

.foot {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
}

.pageDelimiter {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 18px 0 8px;
    padding: 0 12px;
}

.pageDelimiter ul,
.pageDelimiter ol,
.pageDelimiter .paginate,
.theme-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.theme-pagination {
    gap: 8px;
}

.pageDelimiter li {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.pageDelimiter a,
.pageDelimiter span,
.pageDelimiter strong,
.pageDelimiter b,
.theme-pagination__item {
    min-width: 28px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid color-mix(in srgb, var(--border) 70%, #fff 10%);
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--surface-2) 68%, #fff 12%);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    transition: transform .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}

.pageDelimiter a:hover,
.pageDelimiter a:focus-visible,
.theme-pagination__item:hover,
.theme-pagination__item:focus-visible {
    transform: translateY(-1px);
    border-color: var(--accent-2);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    outline: none;
}

.pageDelimiter .active,
.pageDelimiter .current,
.pageDelimiter .is-active,
.pageDelimiter li.active a,
.pageDelimiter a.active,
.pageDelimiter span.active,
.pageDelimiter strong,
.pageDelimiter b,
.theme-pagination__item.is-active {
    border-color: color-mix(in srgb, var(--accent) 70%, #fff 20%);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: var(--glow);
}

.pageDelimiter .disabled,
.pageDelimiter .is-disabled,
.pageDelimiter li.disabled a,
.pageDelimiter span.disabled,
.theme-pagination__item.is-disabled {
    cursor: default;
    opacity: .45;
    transform: none;
}

/* ===================================================================
   PLAYING / COLLAPSED STATES
   =================================================================== */

.app.is-playing .stage, 
.app.is-collapsed .stage {
    flex-basis: 100%;
    width: 100%;
    padding: 0;
}
.app.is-playing .btn-play,
.app.is-collapsed .btn-play {
    display: none;
}

.app.is-playing .panel,
.app.is-collapsed .panel {
    flex-basis: 0;
    max-width: 0;
    margin: 0;
    border: none;
    overflow: hidden;
}

.app.is-playing .panel__toggle,
.app.is-collapsed .panel__toggle {
    position: fixed;
    top: 14px;
    right: 14px;
    left: auto;
    z-index: 50;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    width: auto;
    height: 44px;
    padding: 0 16px;
}

/* ===================================================================
   RESPONSIVE — the bento grid reflows automatically (fixed 110px cells)
   =================================================================== */

/* Tablet */

@media (max-width: 1023px) {
    :root {
        --stage-w: 280px;
    }
}

/* Mobile PORTRAIT: left on top, right below */

@media (max-width: 767px) and (orientation: portrait) {
    html {
        overflow-y: auto !important;
    }
    body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
    .app {
        flex-direction: column;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }
    .stage {
        flex: 0 0 auto;
        width: 100%;
        height: 44vh;
        min-height: 240px;
        padding: 12px;
    }
    .panel {
        flex: 1 1 auto;
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: 22px 22px 0 0;
        margin: 0;
    }
    .panel__scroll {
        height: auto;
        overflow: visible;
        border-radius: 22px 22px 0 0;
        padding: 12px 10px 20px;
    }
    .panel__toggle {
        left: auto;
        right: 14px;
        top: 14px;
    }
    /* when playing on mobile: game fills the screen */
    .app.is-playing {
        min-height: 100dvh;
        overflow: hidden;
    }
    .app.is-playing .stage {
        height: 100dvh;
    }
}

/* Mobile LANDSCAPE: keep 2-column layout, left 310px */

@media (max-width: 900px) and (orientation: landscape) {
    :root {
        --stage-w: 310px;
    }
}

/* Reduce motion for users sensitive to animation */

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

section.info {
    flex: 1 0 auto;
    padding: 30px 10px;
}
.game__media img {
    display: block;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    width: 100%;
}
a {
    color: #007bff;
}
a:hover {
    color: #0056b3;
}
footer .flex-wrap a {
    margin: 0px 6px;
    color: var(--text-dim);
}
footer .flex-wrap a:hover {
    color: #0056b3;
}
