/* Game modules are mounted only when first selected. */
.arcade-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.arcade-tab { min-width: 0; padding: 15px; gap: 11px; }
.arcade-tab strong { font-size: .88rem; }
.arcade-tab small { font-size: .7rem; }
.arcade-tab-number { display: none; }
.game-panel--classic { display: block; }
.game-panel { scroll-margin-top: 100px; }
.classic-back { margin: 0; padding: 0 36px 28px; }
.classic-game { padding: 30px 36px; max-width: 100%; min-width: 0; }
.classic-game .game-heading { margin-bottom: 22px; }
.classic-scorebar, .classic-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.classic-scorebar > div, .classic-stat { min-width: 100px; padding: 13px 18px; border: 1px solid #36425b; background: #101726; border-radius: 11px; }
.classic-scorebar span, .classic-stat span { display: block; color: #a9b8ce; font-size: .68rem; line-height: 1.5; }
.classic-scorebar strong, .classic-stat strong { display: block; color: #f4f5f8; font-size: 1.45rem; }
.classic-canvas-wrap { display: flex; justify-content: center; min-width: 0; }
.classic-canvas { display: block; max-width: 100%; width: min(100%, 640px); height: auto; border: 1px solid #35425b; border-radius: 14px; background: #0b1120; touch-action: none; }
.classic-canvas-square { width: min(100%, 400px); }
.classic-canvas:focus-visible, .classic-2048-board:focus-visible { outline: 3px solid #83e5b1; outline-offset: 4px; }
.classic-status { min-height: 1.7em; margin: 20px 0; color: #c3cede; font-size: .9rem; line-height: 1.65; }
.classic-controls, .classic-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-block: 18px; }
.classic-controls button, .classic-actions button { min-height: 44px; }
.classic-controls .button, .classic-actions .button { padding: 11px 20px; font-size: .875rem; }
.classic-direction-pad { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-left: auto; }
.classic-direction-pad > div { display: flex; gap: 6px; }
.classic-direction-pad button, .classic-directions button, .classic-pong-pad button { color: #e8edf6; border: 1px solid #4a5874; background: #263249; border-radius: 8px; min-width: 44px; min-height: 44px; padding: 8px 13px; font: inherit; cursor: pointer; touch-action: manipulation; }
.classic-direction-pad button:hover, .classic-directions button:hover, .classic-pong-pad button:hover { background: #394967; }
.classic-pong-pad { display: flex; gap: 8px; margin-left: auto; }
.classic-instructions, .classic-note { color: #a9b8ce; font-size: .85rem; line-height: 1.8; margin: 18px 0 0; max-width: 850px; }
.classic-storage-status { color: #f4ce75; font-size: .8rem; }
.classic-storage-status:empty { display: none; }
.classic-layout { min-width: 0; }
.classic-2048-board { width: min(100%, 420px); margin-inline: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; border: 1px solid #36435c; border-radius: 16px; background: #0d1423; touch-action: none; user-select: none; }
.classic-tile { display: grid; place-items: center; min-width: 0; aspect-ratio: 1; border-radius: 9px; background: #202a3c; color: #f1f4fa; font-size: clamp(1rem, 3.5vw, 2rem); font-weight: 800; }
.classic-tile[data-value="0"] { color: transparent; }
.classic-tile[data-value="2"] { background: #d7e3e6; color: #203146; }
.classic-tile[data-value="4"] { background: #b9d8d0; color: #173831; }
.classic-tile[data-value="8"] { background: #83e5b1; color: #173b2a; }
.classic-tile[data-value="16"] { background: #7ed0bb; color: #112f2d; }
.classic-tile[data-value="32"] { background: #7ebdce; color: #112c35; }
.classic-tile[data-value="64"] { background: #859bff; color: #101a3d; }
.classic-tile[data-value="128"], .classic-tile[data-value="256"] { background: #ad92ee; color: #221037; }
.classic-tile[data-value="512"], .classic-tile[data-value="1024"] { background: #e8accc; color: #34192e; }
.classic-tile[data-value="2048"] { background: #f4ce75; color: #342500; }
.classic-directions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.classic-mines-board { width: min(100%, 450px); display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; margin-inline: auto; padding: 8px; background: #0c1322; border: 1px solid #3b4860; border-radius: 14px; touch-action: manipulation; }
.classic-mine-cell { display: grid; place-items: center; min-width: 0; aspect-ratio: 1; padding: 0; border: 1px solid #475774; border-radius: 5px; color: #f1f4fa; background: #263650; font-size: clamp(.75rem, 2.5vw, 1.2rem); font-weight: 750; cursor: pointer; }
.classic-mine-cell.is-open { background: #142034; border-color: #253751; cursor: default; }
.classic-mine-cell[data-count="1"] { color: #9dacff; }
.classic-mine-cell[data-count="2"] { color: #83e5b1; }
.classic-mine-cell[data-count="3"] { color: #f4ce75; }
.classic-mine-cell[data-count="4"], .classic-mine-cell[data-count="5"], .classic-mine-cell[data-count="6"], .classic-mine-cell[data-count="7"], .classic-mine-cell[data-count="8"] { color: #f2b1c7; }
.classic-mine-cell.is-flagged { background: #3b3447; color: #f4ce75; }
.classic-mine-cell.is-mine { color: #f3b7c9; background: #432837; }
.classic-mine-cell.is-exploded, .classic-mine-cell.is-wrong-flag { background: #77354a; color: #fff; }
.classic-flag-toggle[aria-pressed="true"] { background: #f4ce75; color: #342500; border-color: #f4ce75; }
.classic-mine-cell:focus-visible { outline: 3px solid #f4ce75; outline-offset: 1px; position: relative; z-index: 1; }
.classic-xox-settings { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 22px; }
.classic-xox-setting { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.classic-xox-setting > span { color: #b9c4d6; font-size: .8rem; }
.classic-game > .classic-xox-setting { max-width:360px; margin-bottom:20px; }
.classic-select { max-width: 100%; padding: 11px 14px; min-height: 44px; border: 1px solid #465574; border-radius: 9px; background: #162135; color: #f1f4fa; font: inherit; font-size: 1rem; color-scheme: dark; }
.classic-select:focus-visible { outline: 3px solid #83e5b1; outline-offset: 3px; }
.classic-xox-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 10px; margin-inline: auto; width: min(100%, 360px); border: 1px solid #36435c; border-radius: 16px; background: #0d1423; }
.classic-xox-cell { display: grid; place-items: center; min-width: 0; min-height: 44px; aspect-ratio: 1; padding: 0; border: 1px solid #465574; border-radius: 10px; background: #202d43; color: #edf2fa; font: inherit; font-weight: 800; font-size: clamp(2rem, 8vw, 3.75rem); cursor: pointer; touch-action: manipulation; }
.classic-xox-cell[data-mark="X"] { color: #83e5b1; }
.classic-xox-cell[data-mark="O"] { color: #b1a1ff; }
.classic-xox-cell[aria-disabled="false"]:hover { background: #304561; }
.classic-xox-cell[aria-disabled="true"] { cursor: default; }
.classic-xox-cell.is-winning { background: #23443f; border-color: #83e5b1; }
.classic-xox-cell:focus-visible { outline: 3px solid #f4ce75; outline-offset: 2px; }
.arcade-library-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; scroll-margin-top:110px; }
.arcade-library-head h2 { margin:0 0 5px; font-size:1.65rem; }
.arcade-library-head p, .arcade-library-head > span { margin:0; color:#afbed4; font-size:.8rem; }
.arcade-categories { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.arcade-categories button { min-height:44px; padding:10px 17px; border:1px solid #5d6f9655; border-radius:100px; background:#19243a; color:#ccd8ed; font:inherit; font-size:.85rem; cursor:pointer; }
.arcade-categories button[aria-pressed="true"] { background:#c3eba0; color:#1c321b; border-color:#c3eba0; font-weight:750; }
.arcade-tab[hidden] { display:none; }
.arcade-tab[data-category="mind"] .arcade-tab-icon { background:linear-gradient(140deg,#346d6260,#acda9920); color:#b5f0c8; }
.arcade-tab[data-category="arcade"] .arcade-tab-icon { background:linear-gradient(140deg,#387fc260,#71cbd220); color:#a3dbff; }
.arcade-tab[data-category="table"] .arcade-tab-icon { background:linear-gradient(140deg,#a7734650,#dcb67520); color:#ffe0a3; }
.arcade-tab { background:linear-gradient(135deg,#23314b,#151e30); box-shadow:inset 0 1px #ffffff08; }
.arcade-tab.is-active { background:linear-gradient(135deg,#2b4e49,#25354c); box-shadow:0 6px 24px #0003; }
.arcade-mobile-picker { display:none; }
.classic-game:has(.classic-2048-board) { background:radial-gradient(ellipse at 80% 0,#8761b82b,transparent 60%); }
.classic-game:has(.classic-mines-board) { background:radial-gradient(ellipse at 20% 0,#30999330,transparent 65%); }
.classic-game:has(.classic-xox-board) { background:radial-gradient(ellipse at 80% 0,#566bcc35,transparent 60%); }
.classic-snake { background:radial-gradient(ellipse at 30% 0,#3c996333,transparent 70%); }
.classic-runner { background:radial-gradient(ellipse at 70% 0,#d18c5630,transparent 70%); }
.classic-game:has(.classic-canvas--pong) { background:radial-gradient(ellipse at 20% 0,#3d82b333,transparent 70%); }
.classic-canvas { border:3px solid #647aa566; box-shadow:0 15px 40px #040d2055,inset 0 1px #fff2; }
.classic-scorebar > div, .classic-stat { background:linear-gradient(145deg,#2b3e5b,#192740); box-shadow:inset 0 1px #ffffff16,0 5px 18px #050d1d30; }
.classic-2048-board { padding:13px; gap:10px; border:2px solid #bca8f080; background:linear-gradient(135deg,#4a3d70,#273759); box-shadow:0 15px 35px #05091655; }
.classic-tile { border:1px solid #ffffff18; box-shadow:inset 0 3px #ffffff28,inset 0 -4px #0002,0 3px 8px #0003; text-shadow:0 1px #fff2; }
.classic-tile[data-value="0"] { background:#182a465c; box-shadow:inset 0 2px 4px #0003; }
.classic-mines-board { padding:12px; gap:6px; background:linear-gradient(145deg,#356157,#213d4c); border:2px solid #76b7a875; box-shadow:0 14px 32px #0004; }
.classic-mine-cell { background:linear-gradient(150deg,#4f8073,#325751); border:1px solid #7eb2a4; border-radius:8px; box-shadow:inset 0 3px #c8f9e025,inset 0 -3px #061d233b; }
.classic-mine-cell.is-open { background:#112e34; border-color:#3e6667; box-shadow:inset 0 2px 4px #0003; }
.classic-mine-cell.is-flagged { background:linear-gradient(145deg,#8c6841,#695135); }
.classic-mine-cell.is-mine { background:#623b4d; }
.classic-mine-cell.is-exploded, .classic-mine-cell.is-wrong-flag { background:#963d59; }
.classic-xox-board { padding:15px; gap:12px; background:linear-gradient(140deg,#3b5374,#293251); border:2px solid #9ca8dc80; box-shadow:0 16px 35px #0004; }
.classic-xox-cell { background:linear-gradient(145deg,#324d6b,#243549); box-shadow:inset 0 3px #ffffff15,inset 0 -4px #0002,0 4px 8px #0003; border:1px solid #748cb277; border-radius:17px; }
.classic-xox-cell[data-mark="X"] { text-shadow:0 0 25px #83e5b160,0 3px #184b3d; }
.classic-xox-cell[data-mark="O"] { text-shadow:0 0 25px #b1a1ff60,0 3px #443671; }
.classic-brand-note { display:flex; gap:14px; align-items:center; margin-top:24px; padding:15px; border:1px solid #ffffff16; border-radius:14px; background:#1020387a; color:#c0cfe3; font-size:.82rem; line-height:1.6; }
.classic-brand-note img { width:48px; height:48px; border-radius:11px; object-fit:cover; }
.classic-brand-note p { margin:0; }
.classic-brand-note a { color:#b9ecd0; text-underline-offset:3px; }
@media (max-width: 1050px) {
  .arcade-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .arcade-tab { padding: 12px; }
  .arcade-tab-icon { flex-basis: 34px; width: 34px; height: 34px; font-size: 1.1rem; }
  .arcade-tab small { display: none; }
}
@media (max-width: 760px) {
  .arcade-library-head > span { display:none; }
  .has-game-picker .arcade-tabs, .has-game-picker .arcade-categories { display:none; }
  .has-game-picker .arcade-mobile-picker { display:grid; gap:8px; margin-bottom:18px; color:#bfd0e6; font-size:.85rem; }
  .arcade-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arcade-tab:last-child { grid-column: 1 / -1; }
  .arcade-tab { flex-direction: row; text-align: left; gap: 10px; padding: 11px; }
  .arcade-tab strong { font-size: .8rem; margin: 0; }
  .classic-game { padding: 22px 16px; }
  .classic-back { padding: 0 16px 22px; }
  .classic-controls, .classic-actions { gap: 8px; }
  .classic-scorebar, .classic-stats { gap: 8px; }
  .classic-scorebar > div, .classic-stat { padding: 10px 13px; min-width: 80px; }
  .classic-stat strong, .classic-scorebar strong { font-size: 1.2rem; }
  .classic-pong-pad { margin-left: 0; }
  .classic-direction-pad { width: 100%; margin-left: 0; }
  .classic-2048-board { gap: 6px; padding: 8px; }
}
@media (max-width: 360px) {
  .classic-mines-board { padding: 4px; gap: 3px; }
  .classic-mine-cell { font-size: .8rem; }
  .classic-controls .button, .classic-actions .button { padding: 10px 12px; font-size: .8rem; }
}
