:root {
  --bg: #0f1220;
  --bg-soft: #171b31;
  --card: #1c2140;
  --card-border: #2c3260;
  --text: #eef0ff;
  --muted: #aab0d6;
  --accent: #7c5cff;
  --accent-2: #00d0a6;
  --danger: #ff5c6c;
  --radius: 12px;
}
html[data-theme="light"] {
  --bg: #f4f5fb;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-border: #dde0f0;
  --text: #1b1e33;
  --muted: #5c617e;
  --accent: #5b3df0;
  --accent-2: #009e7e;
  --danger: #d92b3d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent-2); }
.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand-mark {
  display: inline-flex; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; align-items: center; justify-content: center;
}
.brand-name { font-size: 20px; font-weight: 800; }
.header-search { flex: 1; }
.header-search input {
  width: 100%; padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--card-border); background: var(--card); color: var(--text);
  font-size: 15px;
}
.theme-toggle {
  border: 1px solid var(--card-border); background: var(--card); color: var(--text);
  border-radius: 9px; padding: 8px 12px; cursor: pointer; font-size: 16px;
}
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.hero { padding: 28px 8px 10px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 40px); line-height: 1.15; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 8px 4px; }
.cat-card {
  min-width: 150px; padding: 14px; border: none; border-radius: 14px; cursor: pointer;
  color: #fff; text-align: left; display: flex; flex-direction: column; gap: 3px;
  font: inherit; flex-shrink: 0;
}
.cat-card .cat-emoji { font-size: 28px; }
.cat-card .cat-name { font-weight: 800; font-size: 15px; }
.cat-card .cat-count { font-size: 12px; opacity: .85; }
.cat-card.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.game-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px; padding: 16px 8px;
}
.game-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer; text-align: left;
  color: var(--text); font: inherit; padding: 0;
}
.game-card:hover { border-color: var(--accent); transform: translateY(-2px); transition: transform .15s, border-color .15s; }
.card-art {
  height: 130px; display: flex; align-items: center; justify-content: center;
  font-size: 56px; color: #fff;
}
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; font-size: 17px; }
.card-cat {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent-2);
}
.card-desc { margin: 0; color: var(--muted); font-size: 13.5px; flex: 1; }
.card-controls { margin: 0; font-size: 12.5px; color: var(--muted); }
.card-play { font-weight: 700; color: var(--accent-2); font-size: 14px; }
.empty-msg { padding: 24px 8px; color: var(--muted); }
.player-chrome {
  display: flex; align-items: center; gap: 12px; padding: 8px 0 4px; flex-wrap: wrap;
}
.player-chrome h2 { margin: 0; flex: 1; font-size: 22px; }
.player-desc { color: var(--muted); margin: 0 0 12px; }
.btn {
  border: 1px solid var(--card-border); background: var(--card); color: var(--text);
  border-radius: 9px; padding: 8px 14px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.btn:hover { border-color: var(--accent); }
.player-mount {
  background: var(--bg-soft); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.game-hud { font-weight: 700; font-size: 16px; text-align: center; }
.game-status { color: var(--muted); min-height: 22px; text-align: center; }
canvas.game-canvas {
  max-width: 100%; height: auto; background: #0b0e1a; border-radius: 8px;
  border: 1px solid var(--card-border); touch-action: none; display: block;
}
html[data-theme="light"] canvas.game-canvas { background: #141830; }
.touch-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.touch-btn {
  min-width: 52px; min-height: 46px; border-radius: 10px; font-size: 20px;
  border: 1px solid var(--card-border); background: var(--card); color: var(--text); cursor: pointer;
}
.touch-btn:active { background: var(--accent); color: #fff; }
.board-2048 {
  display: grid; grid-template-columns: repeat(4, 74px); grid-template-rows: repeat(4, 74px);
  gap: 8px; background: #141830; padding: 8px; border-radius: 10px;
}
.tile-2048 {
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
  font-size: 24px; font-weight: 800; color: #fff; background: #2a2f55;
}
.tile-2048.v2 { background: #5b6478; }
.tile-2048.v4 { background: #4a7de0; }
.tile-2048.v8 { background: #e07b39; }
.tile-2048.v16 { background: #e0573a; }
.tile-2048.v32 { background: #d63a4d; }
.tile-2048.v64 { background: #c22b5e; }
.tile-2048.v128 { background: #8a5cf0; }
.tile-2048.v256 { background: #5b3df0; }
.tile-2048.v512 { background: #009e7e; }
.tile-2048.v1024 { background: #0a7d64; }
.tile-2048.v2048 { background: #e8b400; color: #231f00; }
.memory-grid {
  display: grid; grid-template-columns: repeat(4, 74px); gap: 10px;
}
.memory-card {
  width: 74px; height: 74px; font-size: 32px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--card-border); background: var(--card); color: var(--text);
}
.memory-card.matched { border-color: var(--accent-2); opacity: .85; }
.mines-grid {
  display: grid; gap: 2px; background: #141830; padding: 6px; border-radius: 10px;
}
.mines-cell {
  width: 34px; height: 34px; font-size: 16px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--card-border); background: var(--card); color: var(--text); border-radius: 4px;
}
.mines-cell.revealed { background: var(--bg-soft); cursor: default; }
.mines-cell.mine-hit { background: var(--danger); color: #fff; }
.whack-grid { display: grid; grid-template-columns: repeat(3, 92px); gap: 12px; }
.whack-hole {
  width: 92px; height: 92px; font-size: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--card-border); background: var(--card);
}
.whack-hole.up { background: #2a2f55; }
.site-footer {
  border-top: 1px solid var(--card-border); text-align: center; color: var(--muted);
  padding: 24px 16px; font-size: 14px;
}
.site-footer p { margin: 4px 0; }
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; }
  .header-search { order: 3; flex-basis: 100%; }
  .board-2048 { grid-template-columns: repeat(4, 68px); grid-template-rows: repeat(4, 68px); }
  .memory-grid { grid-template-columns: repeat(4, 68px); }
  .memory-card { width: 68px; height: 68px; }
  .mines-cell { width: 32px; height: 32px; }
  .whack-grid { grid-template-columns: repeat(3, 84px); }
  .whack-hole { width: 84px; height: 84px; }
}

/* Brand logo + slogan (Abloom Play header lockup) */
.brand-logo { height: 38px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-slogan { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }

/* Mother-brand footer block (same as the other Abloom sites) */
.mother-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 16px; }
.mother-brand img { width: min(252px, 39%); height: auto; }
.mother-brand .mother-label { font-size: 12px; letter-spacing: .15em; text-transform: uppercase; }
.mother-brand p { margin: 0; }

/* Info pages */
.info-content { max-width: 800px; margin: 0 auto; padding: 28px 16px 40px; }
.info-content h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; }
.info-content h2 { margin-top: 28px; }
.info-content p, .info-content li { line-height: 1.7; }

/* Footer information links */
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin: 12px 0 4px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* Gaming vibe: animated cards */
.game-card { position: relative; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.game-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 0 0 1px var(--accent), 0 14px 34px rgba(124, 92, 255, .35); }
.card-art { position: relative; overflow: hidden; }
.card-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); }
.game-card:hover .card-art::after { animation: cardShine .7s ease; }
.game-card:hover .card-art { animation: artPop .45s ease; }
.game-card:hover .card-play { color: var(--accent); }
@keyframes cardShine { to { transform: translateX(120%); } }
@keyframes artPop { 0% { transform: scale(1); } 40% { transform: scale(1.16) rotate(-4deg); } 100% { transform: scale(1.08); } }

/* Gaming vibe: categories */
.filters-label { margin: 0 8px 2px; font-weight: 800; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cat-card { transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; }
.cat-card:hover { border-color: var(--accent); box-shadow: 0 0 14px rgba(124, 92, 255, .4); transform: translateY(-1px); }
.cat-card.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 0 16px rgba(124, 92, 255, .55); animation: activeGlow 2s ease-in-out infinite; }
@keyframes activeGlow { 0%, 100% { box-shadow: 0 0 12px rgba(124, 92, 255, .45); } 50% { box-shadow: 0 0 24px rgba(124, 92, 255, .8); } }
@media (prefers-reduced-motion: reduce) {
  .game-card:hover .card-art, .game-card:hover .card-art::after, .cat-card.active { animation: none; }
}

/* New games: Tic-Tac-Toe, Stack Tower, Simon Colors, Reaction Rush */
.tictac-grid { display: grid; grid-template-columns: repeat(3, 72px); gap: 8px; }
.tictac-cell { width: 72px; height: 72px; font-size: 32px; font-weight: 800; border-radius: 10px; border: 1px solid var(--card-border); background: var(--card); color: var(--text); cursor: pointer; }
.stack-stage { position: relative; width: 300px; max-width: 100%; height: 420px; background: #0b0e1a; border: 1px solid var(--card-border); border-radius: 10px; overflow: hidden; cursor: pointer; }
.stack-row { position: absolute; height: 20px; border-radius: 4px; }
.simon-grid { display: grid; grid-template-columns: repeat(2, 110px); gap: 10px; }
.simon-pad { width: 110px; height: 110px; border-radius: 14px; border: none; cursor: pointer; opacity: .55; transition: opacity .15s, transform .1s, box-shadow .15s; }
.simon-pad.lit { opacity: 1; transform: scale(1.04); box-shadow: 0 0 24px rgba(255, 255, 255, .35); }
.simon-pad.red { background: #e0393e; }
.simon-pad.green { background: #1f9d55; }
.simon-pad.blue { background: #2b6fe3; }
.simon-pad.yellow { background: #e8b400; }
.reaction-stage { width: 300px; max-width: 100%; height: 220px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; cursor: pointer; user-select: none; text-align: center; padding: 12px; box-sizing: border-box; }
.reaction-stage.idle { background: var(--card); color: var(--text); border: 1px solid var(--card-border); }
.reaction-stage.wait { background: #c0392b; color: #fff; }
.reaction-stage.ready { background: #1f9d55; color: #fff; }

/* CrazyGames-style layout: category cards, featured strip, Play overlay */
.cat-row { display: flex; gap: 12px; overflow-x: auto; padding: 10px 8px 16px; }
.cat-card { transition: transform .15s ease, box-shadow .2s ease; }
.cat-card:hover { transform: translateY(-2px); filter: brightness(1.08); }
.cat-card.active { box-shadow: 0 0 0 2px #fff, 0 0 22px rgba(124, 92, 255, .7); transform: translateY(-2px); }
.section-title { margin: 22px 8px 2px; font-size: 20px; font-weight: 800; }
.featured-row { display: flex; gap: 16px; overflow-x: auto; padding: 12px 8px 18px; scroll-snap-type: x mandatory; }
.featured-row .game-card { min-width: 230px; scroll-snap-align: start; }
.game-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card-art { aspect-ratio: 16 / 9; height: auto; }
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-play-btn { position: absolute; right: 10px; bottom: 10px; background: #7c5cff; color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); z-index: 1; }
.game-card:hover .card-play-btn { background: #00d0a6; }
