:root {
  --game-bg: #f7fbff;
  --game-surface: rgba(255, 255, 255, 0.82);
  --game-border: rgba(35, 51, 65, 0.09);
  --game-line: rgba(64, 96, 124, 0.12);
  --game-sky: #dfeeff;
  --game-mint: #dff7ed;
  --game-lavender: #efe9ff;
  --game-peach: #fff0e6;
  --game-gold: #fff2c8;
  --game-blue: #4d7ef0;
  --game-mint-strong: #3a8d79;
  --game-text: #1f2a35;
  --game-muted: #60727f;
}

.games-page-shell { position: relative; padding: 44px 0 72px; }
.games-page-shell::before,
.games-page-shell::after { content: ""; position: absolute; inset: auto; border-radius: 50%; filter: blur(12px); opacity: 0.6; pointer-events: none; }
.games-page-shell::before { width: 320px; height: 320px; background: rgba(117, 160, 255, 0.12); top: 10px; right: 6%; }
.games-page-shell::after { width: 260px; height: 260px; background: rgba(93, 206, 170, 0.12); bottom: 24px; left: 5%; }
.games-shell { max-width: 1200px; position: relative; z-index: 1; }
.games-shell--page { max-width: 1240px; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(77, 126, 240, 0.35); outline-offset: 2px; }
.games-header { position: relative; padding: 40px 24px 24px; border-radius: 32px; background: linear-gradient(135deg, rgba(223,240,255,0.9), rgba(239,249,245,0.72), rgba(255,255,255,0.76)); border: 1px solid var(--game-border); box-shadow: 0 18px 40px rgba(41, 52, 61, 0.06); overflow: hidden; }
.games-header::before { content: ""; position: absolute; inset: 0 auto auto -30px; width: 180px; height: 180px; border-radius: 50%; background: rgba(129, 168, 255, 0.12); filter: blur(6px); }
.games-header::after { content: ""; position: absolute; right: -20px; bottom: -30px; width: 200px; height: 200px; border-radius: 50%; background: rgba(85, 195, 160, 0.12); filter: blur(8px); }
.games-header h1 { position: relative; z-index: 1; max-width: 760px; font-size: clamp(42px, 6vw, 72px); line-height: .96; letter-spacing: -0.06em; }
.games-header p { position: relative; z-index: 1; max-width: 700px; margin-top: 18px; color: var(--game-muted); font-size: 1.08rem; line-height: 1.75; }
.games-notice { margin-top: 20px; padding: 14px 18px; border-left: 4px solid var(--game-blue); border-radius: 14px; background: rgba(255,255,255,0.68); color: var(--game-muted); font-size: 0.96rem; box-shadow: inset 0 1px 0 rgba(255,255,255,0.75); }
.games-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; position: relative; z-index: 1; }
.toggle-inline { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,0.7); border: 1px solid var(--game-border); font-weight: 700; color: var(--game-text); box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.toggle-inline input { accent-color: var(--game-blue); }
.games-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 26px; padding: 14px 16px; border: 1px solid var(--game-border); border-radius: 20px; background: rgba(255,255,255,0.72); backdrop-filter: blur(10px); box-shadow: 0 10px 24px rgba(59, 77, 104, 0.04); }
.games-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-chip { border: 1px solid transparent; border-radius: 999px; padding: 9px 14px; background: rgba(134, 153, 176, 0.08); color: var(--game-muted); font-weight: 700; transition: all 0.2s ease; }
.filter-chip.is-active { background: linear-gradient(135deg, rgba(77,126,240,0.14), rgba(96, 220, 177, 0.12)); border-color: rgba(77, 126, 240, 0.2); color: var(--game-blue); box-shadow: 0 8px 18px rgba(77,126,240,0.08); }
.games-search { display: inline-flex; align-items: center; gap: 8px; min-width: min(100%, 280px); padding: 10px 12px; border-radius: 999px; background: rgba(255,255,255,0.8); border: 1px solid var(--game-border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.games-search input { width: 100%; background: transparent; border: 0; outline: none; color: var(--game-text); }
.games-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.games-grid--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game-card { display: flex; flex-direction: column; gap: 16px; min-height: 225px; padding: 20px; border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(246,250,255,0.78)); border: 1px solid rgba(33, 52, 72, 0.08); box-shadow: 0 12px 28px rgba(46,61,72,0.04); transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; position: relative; overflow: hidden; }
.game-card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 4px; background: linear-gradient(90deg, rgba(77,126,240,0.8), rgba(86,203,167,0.7), rgba(210,148,255,0.7)); opacity: 0.85; }
.game-card:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(46,61,72,0.08); border-color: rgba(77,126,240,0.14); }
.game-card__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.game-category { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.game-category--mint { background: var(--game-mint); color: var(--game-mint-strong); }
.game-category--blue { background: var(--game-sky); color: var(--game-blue); }
.game-category--lavender { background: var(--game-lavender); color: #6958af; }
.game-category--gold { background: var(--game-gold); color: #8c6a00; }
.game-category--peach { background: var(--game-peach); color: #b3512d; }
.game-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; padding: 5px 8px; border-radius: 999px; background: rgba(76, 106, 122, 0.08); color: var(--game-muted); font-size: 0.68rem; font-weight: 700; }
.game-card h3 { font-size: clamp(24px, 2.2vw, 32px); line-height: 1.1; }
.game-card p { margin: 0; color: var(--game-muted); line-height: 1.65; }
.game-card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; color: var(--game-muted); font-size: 0.82rem; font-weight: 700; }
.game-card__meta span { padding: 6px 10px; border-radius: 999px; background: rgba(24,34,40,0.04); }
.game-card__actions { display: flex; justify-content: flex-start; }
.game-card__actions .button { box-shadow: 0 12px 20px rgba(77, 126, 240, 0.14); }
.button.small { padding: 9px 16px; font-size: 0.9rem; }
.game-favorite { border: 0; background: rgba(72, 92, 110, 0.08); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; font-size: 1.2rem; box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.games-page__header { display: grid; gap: 12px; margin-bottom: 24px; padding: 4px 0; }
.games-page__header h1 { margin: 0; }
.games-page__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.game-meta-pill { display: inline-flex; padding: 8px 12px; border-radius: 999px; background: linear-gradient(135deg, rgba(76, 126, 240, 0.1), rgba(82, 191, 164, 0.1)); color: var(--game-blue); font-weight: 700; border: 1px solid rgba(76, 126, 240, 0.12); }
.game-detail-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(240px,0.8fr); gap: 24px; margin-top: 24px; }
.game-stage-panel, .game-aside-panel { background: rgba(255,255,255,0.78); border: 1px solid var(--game-border); border-radius: 28px; box-shadow: 0 18px 40px rgba(41,52,61,0.05); }
.game-stage-panel { padding: 24px; background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(245,249,255,0.8)); }
.game-launch-panel { display: grid; gap: 14px; min-height: 300px; place-content: center; justify-items: start; padding: 36px; border: 1px solid rgba(77,126,240,0.12); border-radius: 22px; background: linear-gradient(135deg, rgba(239,246,255,0.92), rgba(239,249,245,0.86)); text-align: left; }
.game-launch-panel h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.game-launch-panel p { max-width: 540px; margin: 0; color: var(--game-muted); line-height: 1.7; }
.game-launch-panel .button { margin-top: 6px; }
.game-aside-panel { display: grid; gap: 18px; padding: 20px; background: linear-gradient(180deg, rgba(246,248,255,0.9), rgba(255,255,255,0.82)); }
.game-aside__card { border: 1px solid var(--game-border); border-radius: 18px; background: linear-gradient(135deg, rgba(247,250,255,0.9), rgba(255,255,255,0.75)); padding: 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.game-aside__card h3 { font-size: 1.35rem; margin-bottom: 12px; }
.game-aside__card p { color: var(--game-muted); line-height: 1.65; }
.game-aside__list { display: grid; gap: 12px; }
.game-card--small { min-height: 0; }
.game-shell { display: grid; gap: 18px; padding: 20px; border-radius: 28px; background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(240,246,255,0.82)); border: 1px solid var(--game-border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 16px 28px rgba(56, 70, 94, 0.05); }
.memory-game { background: linear-gradient(135deg, rgba(223,247,237,0.94), rgba(255,255,255,0.95)); }
.sequence-game { background: linear-gradient(135deg, rgba(233,240,255,0.92), rgba(247,245,255,0.9)); }
.attention-game, .observation-game { background: linear-gradient(135deg, rgba(255,240,233,0.9), rgba(255,255,255,0.9)); }
.stroop-game { background: linear-gradient(135deg, rgba(246,244,255,0.9), rgba(255,255,255,0.92)); }
.reaction-game { background: linear-gradient(135deg, rgba(231,245,241,0.9), rgba(255,255,255,0.92)); }
.breathing-game { background: linear-gradient(135deg, rgba(235,245,255,0.94), rgba(244,249,255,0.9)); }
.number-game, .math-game, .word-game { background: linear-gradient(135deg, rgba(255,249,232,0.94), rgba(255,255,255,0.9)); }
.tracking-game { background: linear-gradient(135deg, rgba(239,246,255,0.94), rgba(255,255,255,0.9)); }
.zen-game { background: linear-gradient(135deg, rgba(233,248,241,0.94), rgba(255,255,255,0.9)); }
.game-shell .button, .game-shell button, .game-shell input { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.game-shell .button:hover, .game-shell button:hover { transform: translateY(-1px); }
.game-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.game-inline-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.difficulty-pill { border: 1px solid var(--game-border); border-radius: 999px; background: rgba(255,255,255,0.8); padding: 8px 12px; font-weight: 700; }
.difficulty-pill.is-active { background: rgba(77,126,240,0.12); color: var(--game-blue); border-color: rgba(77,126,240,0.2); }
.game-status-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.game-stat { display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px; background: rgba(240,246,255,0.85); border: 1px solid var(--game-border); }
.game-stat span { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--game-muted); }
.game-stat strong { display: block; font-size: 1.05rem; }
.game-inline-note { color: var(--game-muted); font-weight: 600; line-height: 1.6; }
.memory-board { display: grid; gap: 12px; margin-top: 8px; justify-items: center; }
.memory-card { display: grid; place-items: center; width: min(100%, 86px); aspect-ratio: 1; border: 1px solid rgba(77,126,240,0.18); border-radius: 18px; background: linear-gradient(135deg, #dfeeff, #edf7ff); color: transparent; font-size: 1.8rem; font-weight: 700; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; box-shadow: inset 0 -6px 14px rgba(75,122,221,0.12); }
.memory-card.is-visible { color: var(--game-text); background: linear-gradient(135deg, #ffffff, #f3f8ff); box-shadow: inset 0 0 0 2px rgba(77,126,240,0.2), 0 8px 18px rgba(77,126,240,0.08); }
.memory-card:not(.is-visible):hover { transform: translateY(-2px); }
.sequence-board { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 16px; padding-top: 8px; }
.sequence-button { position: relative; min-height: 110px; border-radius: 22px; border: 0; font-size: 2rem; font-weight: 800; color: #fff; box-shadow: inset 0 -10px 16px rgba(0,0,0,0.08), 0 12px 22px rgba(40,56,72,0.12); }
.sequence-button::after { content: ""; position: absolute; inset: 8px; border-radius: 16px; border: 2px solid rgba(255,255,255,0.35); opacity: 0; transition: opacity 0.2s ease; }
.sequence-button--one { background: linear-gradient(135deg, #6f8fff, #4d7ef0); }
.sequence-button--two { background: linear-gradient(135deg, #60d5b9, #34b698); }
.sequence-button--three { background: linear-gradient(135deg, #f3b66d, #e18e40); }
.sequence-button--four { background: linear-gradient(135deg, #bb9ef7, #8f73d7); }
.sequence-button.is-lit { box-shadow: 0 0 0 6px rgba(255,255,255,0.95), 0 0 0 14px rgba(77,126,240,0.18), 0 24px 52px rgba(117, 138, 190, 0.28); transform: scale(1.02); }
.sequence-button.is-lit::after { opacity: 1; }
.sequence-status { padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, rgba(239,249,245,0.95), rgba(255,255,255,0.78)); color: var(--game-text); font-weight: 700; border: 1px solid rgba(76, 126, 240, 0.08); }
.stroop-word-wrap { display: grid; place-items: center; min-height: 170px; }
.stroop-word { font-size: clamp(3rem, 6vw, 6rem); font-weight: 900; letter-spacing: -0.08em; text-shadow: 0 10px 18px rgba(31,42,53,0.08); }
.stroop-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stroop-options button, .reaction-button, .attention-cell, .word-letter, .choice-button, .tracking-dot, .number-cell { border: 1px solid var(--game-border); border-radius: 18px; background: rgba(255,255,255,0.8); min-height: 52px; font-weight: 800; }
.attention-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.attention-cell { min-height: 88px; font-size: clamp(1.7rem, 4vw, 2.5rem); background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,235,219,0.85)); border-color: rgba(188, 124, 82, 0.2); box-shadow: inset 0 1px 0 rgba(255,255,255,0.7); }
.attention-cell:nth-child(odd) { background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(228,244,255,0.8)); }
.reaction-box { display: grid; place-items: center; gap: 18px; min-height: 220px; padding: 24px; border-radius: 26px; background: linear-gradient(135deg, rgba(234,246,255,0.9), rgba(240,253,247,0.8)); }
.reaction-status { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; }
.reaction-button { min-width: 180px; background: linear-gradient(135deg, #4d7ef0, #72b7ff); color: #fff; }
.reaction-button.is-ready { background: linear-gradient(135deg, #3ba77d, #4cc99b); }
.breathing-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.breathing-visual { display: grid; place-items: center; min-height: 220px; }
.breath-orb { width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.95), rgba(106,197,222,0.8) 40%, rgba(77,126,240,0.9)); box-shadow: 0 24px 52px rgba(77,126,240,0.22); transition: transform 0.6s ease, width 0.6s ease, height 0.6s ease; }
.breath-orb[data-phase="inhalar"] { transform: scale(1.25); }
.breath-orb[data-phase="mantener"] { transform: scale(1.12); }
.breath-orb[data-phase="exhalar"] { transform: scale(0.85); }
.breath-message { text-align: center; font-size: 1.2rem; font-weight: 800; }
.number-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.number-grid.is-complete { display: block; }
.number-cell { min-height: 60px; }
.math-question-wrap { display: grid; gap: 16px; }
.math-question { display: grid; place-items: center; min-height: 120px; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 900; border-radius: 20px; background: rgba(243,250,255,0.9); }
#math-answer { min-height: 56px; border-radius: 16px; border: 1px solid var(--game-border); padding: 0 16px; font-size: 1.3rem; }
.word-clue { display: flex; justify-content: center; gap: 8px; min-height: 90px; align-items: center; font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: 0.2em; font-weight: 800; }
.word-choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.word-letter { min-width: 52px; background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(242,248,255,0.8)); }
.word-result { color: var(--game-muted); font-weight: 700; }
.observation-display { min-height: 120px; display: grid; place-items: center; font-size: clamp(2.2rem, 4vw, 3.2rem); border-radius: 20px; background: rgba(244,247,255,0.9); }
.choice-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.choice-button { min-height: 74px; font-size: 1.8rem; background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,238,214,0.8)); }
.tracking-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tracking-dot { min-height: 82px; font-size: 2rem; background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(233,243,255,0.8)); }
.tracking-dot.is-selected { box-shadow: 0 0 0 3px rgba(77,126,240,0.28), 0 10px 20px rgba(77,126,240,0.12); background: linear-gradient(135deg, rgba(228,238,255,0.95), rgba(211,232,255,0.8)); }
.zen-toolbar { display: flex; justify-content: flex-end; gap: 8px; }
#zen-canvas { width: 100%; max-width: 760px; height: auto; border-radius: 26px; background: linear-gradient(180deg, #edf9f5 0%, #f7f5f0 100%); border: 1px solid var(--game-border); box-shadow: 0 14px 36px rgba(55,75,85,0.06); }
.empty-state { grid-column: 1 / -1; padding: 26px; border: 1px dashed var(--game-border); border-radius: 16px; color: var(--game-muted); text-align: center; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.game-result-card { display: grid; gap: 18px; padding: 18px; border-radius: 20px; background: linear-gradient(135deg, rgba(233,248,241,0.9), rgba(242,247,255,0.9)); border: 1px solid var(--game-border); }
.game-result-card h3 { font-size: 1.7rem; }
@media (max-width: 980px) {
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .games-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .game-launch-panel { min-height: 260px; padding: 26px 20px; }
  .games-toolbar { flex-direction: column; align-items: stretch; }
  .games-grid, .games-grid--compact { grid-template-columns: 1fr; }
  .game-status-row, .result-grid { grid-template-columns: 1fr; }
  .sequence-board { grid-template-columns: 1fr 1fr; }
  .stroop-options, .choice-grid { grid-template-columns: 1fr 1fr; }
  .number-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
