/* ═══════════════════════════════════════════════════════════════
   NUMERUMS – Crayon & Clay  |  styles.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --green:        #4ecb71;
  --green-dark:   #3ab85c;
  --green-bg:     #e8f9ee;
  --green-game:   #5dd27a;
  --blue-btn:     #4ba8f5;
  --blue-btn-hov: #2e93e8;
  --text:         #1a1a1a;
  --text-mid:     #444;
  --text-light:   #888;
  --border:       #e0e0e0;
  --bg:           #ffffff;
  --bg-footer:    #e8eaed;
  --ad-dark:      #111;
  --ad-green:     #2d9e4e;
  --radius:       12px;
  --radius-sm:    8px;
  --font-head:    'Inter', sans-serif;
  --font-body:    'Inter', sans-serif;
  --shadow:       0 2px 12px rgba(0,0,0,.07);
  --shadow-md:    0 4px 24px rgba(0,0,0,.10);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.navbar__inner {
  max-width: 850px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
}
.navbar__logo { height: 40px; width: auto; flex-shrink: 0; display: block; }
.navbar__brand {
  display: flex;
  align-items: center;
}
.navbar__links { display: flex; gap: 40px; }
.navbar__link {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  transition: color .2s;
}
.navbar__link:hover { color: var(--text-mid); }
.navbar__link--lang { cursor: default; }

/* ── Page layout ────────────────────────────────────────────── */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}
.layout {
  display: grid;
  grid-template-columns: 550px 260px;
  gap: 40px;
  justify-content: center;
  align-items: start;
}

/* ── Game header ────────────────────────────────────────────── */
.game-header {
  margin-bottom: 16px;
  scroll-margin-top: 110px;
}
.game-title {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ── Game board ─────────────────────────────────────────────── */
.game-board {
  width: 550px;
  height: 640px;
  background: #cfd6be;
  border-radius: 16px;
  padding: 0;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.game-board--frame { padding: 0; }
.main-game-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  display: block;
}
.game-board[data-active-game="onetosix"] {
  background: #d4d4d4;
}
.game-board__level {
  text-align: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 17px;
  color: #1a1a1a;
  margin-bottom: 10px;
}
.game-board__progress {
  height: 5px;
  background: rgba(0,0,0,.15);
  border-radius: 99px;
  margin: 0 auto 20px;
  max-width: 200px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: #1a1a1a;
  border-radius: 99px;
  transition: width .4s ease;
}

/* playable grid */
.game-board__play {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.play-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.play-cell {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  user-select: none;
}
.play-cell.selectable {
  background: rgba(255,255,255,.85);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.play-cell.selectable:hover {
  background: #fff;
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.play-cell.selectable.selected {
  background: #fff;
  outline: 3px solid #1a1a1a;
  transform: scale(1.06);
}
.play-cell.op-cell {
  background: transparent;
  color: rgba(0,0,0,.7);
  font-size: 26px;
  width: 28px;
}
.play-cell.equals {
  color: rgba(0,0,0,.5);
  font-size: 22px;
  width: 28px;
  background: transparent;
}
.play-cell.answer {
  background: rgba(255,255,255,.5);
  color: rgba(0,0,0,.5);
  cursor: pointer;
  transition: background .2s;
}
.play-cell.answer.revealed {
  background: rgba(255,255,255,.9);
  color: var(--text);
}
.play-cell.answer.correct {
  background: #fff;
  color: #1db954;
  animation: pop .3s ease;
}
.play-cell.answer.wrong {
  background: #fff;
  color: #e53935;
  animation: shake .3s ease;
}

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

/* hidden original grid (decorative shown initially) */
.game-board__grid { display: none; }

/* ── Ad Banner Horizontal ───────────────────────────────────── */
.ad-banner { margin-bottom: 24px; }
.ad-banner--horizontal .ad-banner__inner {
  background: #1a3a1c;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}
.ad-banner__icons {
  font-size: 22px;
  letter-spacing: -2px;
  flex-shrink: 0;
}
.ad-banner__text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ad-tag {
  font-size: 10px;
  color: rgba(255,255,255,.6);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ad-name {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 900;
  color: #f5c518;
}
.ad-cta {
  background: #fff;
  color: #1a3a1c;
  border: none;
  border-radius: 50px;
  padding: 7px 18px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
  flex-shrink: 0;
}
.ad-cta:hover { opacity: .85; }

/* ── Game description ───────────────────────────────────────── */
.game-desc { margin-bottom: 40px; max-width: 550px; }
.game-desc__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.game-desc__text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: #6b6b6b;
  line-height: 1.6;
  max-width: 550px;
}
.read-more {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--blue-btn);
  transition: color .2s;
}
.read-more:hover { color: var(--blue-btn-hov); }

/* ── Aside column ───────────────────────────────────────────── */
.col-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 51px; /* offset = game-title (35px line-height) + game-header margin-bottom (16px) */
}

.game-card {
  width: 260px;
  height: 370px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: 0;
  padding: 0;
  background: #e8e8e8;
}
.game-card--switcher {
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .2s;
}
.game-card--switcher:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.game-card--switcher:focus-visible {
  outline: 3px solid var(--blue-btn);
  outline-offset: 4px;
}
.game-card__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.game-card__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 96px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  color: var(--text);
  letter-spacing: -0.01em;
  pointer-events: none;
}
.game-card__cta {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  width: 140px;
  height: 40px;
  border-radius: 999px;
  background: var(--blue-btn);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  pointer-events: none;
}
.game-card--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 246px; /* fills remaining iframe space: 640 - 370 (switcher) - 24 (gap) */
}
.game-card__ad-label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  color: #9a9a9a;
  letter-spacing: 0.04em;
}

/* ── Ad cards ───────────────────────────────────────────────── */
.ad-card {
  border-radius: var(--radius);
  overflow: hidden;
  padding: 18px 16px;
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ad-card--dark {
  background: var(--ad-dark);
  color: #fff;
}
.ad-card--green {
  background: var(--ad-green);
  color: #fff;
  text-align: center;
  align-items: center;
}
.ad-card__tagline {
  font-size: 15px;
  line-height: 1.3;
  font-family: var(--font-head);
  font-weight: 700;
  color: #fff;
}
.ad-card__tagline strong { font-weight: 900; }
.ad-card__cta {
  display: inline-block;
  margin-top: 10px;
  background: var(--blue-btn);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-head);
  transition: opacity .2s;
}
.ad-card__cta:hover { opacity: .85; }
.ad-card__cta--outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.6);
  color: #fff;
}
.ad-card__brand {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.adobe-product { font-size: 11px; color: rgba(255,255,255,.7); }
.adobe-badge {
  background: #001e36;
  color: #4ba8f5;
  font-weight: 800;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .03em;
}
.adobe-visual {
  height: 60px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0a3d8f 0%, #4ba8f5 50%, #00c8ff 100%);
  opacity: .85;
}

/* green ad card */
.ad-card__sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  color: rgba(255,255,255,.8);
  text-transform: uppercase;
}
.ad-card__game {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 900;
  color: #f5c518;
  line-height: 1;
  margin: 2px 0;
}
.cards-display {
  font-size: 28px;
  letter-spacing: -4px;
  margin: 6px 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}

/* ── Promo cards ────────────────────────────────────────────── */
.promo-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  position: relative;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.promo-card__ribbon {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--blue-btn);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-head);
  padding: 4px 8px;
  border-radius: 0 var(--radius) 0 var(--radius-sm);
}
.promo-card__left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.promo-card__icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 10px;
  line-height: 1.3;
  flex-shrink: 0;
}
.numerums-icon {
  background: var(--green);
  color: #1a1a1a;
  font-size: 11px;
  letter-spacing: -.5px;
}
.onesix-icon {
  background: #7c4dff;
  color: #fff;
  font-size: 14px;
  letter-spacing: 2px;
}
.promo-card__info { flex: 1; }
.promo-card__info strong { display: block; font-size: 13px; font-weight: 700; }
.promo-card__info span  { font-size: 11px; color: var(--text-light); }
.stars { font-size: 12px; color: #f5a623; margin-top: 2px; }
.half-star { opacity: .4; }
.promo-card__stores {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qr-placeholder { flex-shrink: 0; opacity: .7; }
.store-btns { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.store-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #111;
  color: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 9px;
  line-height: 1.3;
  font-family: var(--font-body);
  transition: opacity .2s;
}
.store-btn:hover { opacity: .8; }
.store-btn b { font-size: 10px; }
.store-btn svg { flex-shrink: 0; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--bg-footer);
  padding: 48px 24px;
}
.footer__inner {
  max-width: 850px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.footer__logo { width: 48px; height: 48px; margin-bottom: 4px; }
.footer__name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
}
.footer__copy {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
}

/* ── Toast notification ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a1a;
  color: #fff;
  padding: 10px 24px;
  border-radius: 50px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  z-index: 200;
  transition: transform .3s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .layout { gap: 32px; }
  .page-content { padding: 40px 24px 56px; }
  .navbar__inner { max-width: 842px; }
  .footer__inner { max-width: 842px; }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 550px);
    justify-content: center;
  }
  .col-aside {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    padding-top: 0;
  }
  .game-card--placeholder { height: 370px; }
  .navbar__inner { max-width: 550px; }
  .footer__inner { max-width: 550px; }
}

@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .navbar__inner { height: 72px; padding: 0 16px; max-width: none; }
  .navbar__logo { height: 32px; }
  .navbar__links { gap: 20px; }
  .navbar__link { font-size: 15px; }

  .page-content {
    width: 100%;
    max-width: none;
    padding: 24px 16px 40px;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .col-main, .col-aside { min-width: 0; }

  .game-title { font-size: 26px; }
  .game-board {
    width: 100%;
    height: auto;
    aspect-ratio: 550 / 640;
  }

  .col-aside {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .game-card { width: 100%; max-width: 320px; }

  .game-desc__title { font-size: 24px; }
  .footer { padding: 32px 16px; }

  body[data-active-game="onetosix"] {
    background: #d4d4d4;
    overflow-x: hidden;
  }
  body[data-active-game="onetosix"] .navbar { display: none; }
  body[data-active-game="onetosix"] .page-content {
    max-width: none;
    min-height: 100dvh;
    padding: 0;
  }
  body[data-active-game="onetosix"] .layout { display: block; }
  body[data-active-game="onetosix"] .game-header {
    width: 100vw;
    height: 58px;
    margin: 0;
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 0;
  }
  body[data-active-game="onetosix"] .game-title {
    font-size: 22px;
    line-height: 1.1;
  }
  body[data-active-game="onetosix"] .game-board {
    width: 100%;
    height: calc(100dvh - 58px);
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body[data-active-game="onetosix"] .game-desc,
  body[data-active-game="onetosix"] .col-aside,
  body[data-active-game="onetosix"] .footer {
    display: none;
  }
  body[data-active-game="onetosix"] .main-game-frame {
    height: 100%;
    border-radius: 0;
  }
}
