/* plusminusi — styles */

@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-cyrillic-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2212, U+2215, U+20AC, U+2122, U+2191, U+2193, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos-text-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2212, U+2215, U+20AC, U+2122, U+2191, U+2193, U+FEFF, U+FFFD;
}

:root {
  --ink: #171A3B;
  --ink-soft: #565B80;
  --paper: #F1F2F8;
  --card: #FFFFFF;
  --line: #DADCEB;
  --plus: #12B76A;
  --plus-deep: #0B8A4F;
  --minus: #F04438;
  --minus-deep: #C2261B;
  --gold: #FFC531;
  --mode: #2F5BEA;

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-lg: 28px;
  --r-md: 16px;
  --r-pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* ---------- Wordmark ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; grid-template-rows: 1fr 1fr; overflow: hidden;
  font-family: var(--display); font-weight: 900; font-size: 17px; line-height: 1; color: #fff;
}
.brand-mark span { display: grid; place-items: center; }
.brand-mark span:first-child { background: var(--plus); }
.brand-mark span:last-child { background: var(--minus); }

/* ---------- Home ---------- */
.site-head {
  max-width: 1160px; margin: 0 auto; padding: 22px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.site-head .total { font-size: 15px; color: var(--ink-soft); }

.hero {
  max-width: 1160px; margin: 0 auto; padding: 24px 20px 56px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.hero h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(40px, 6.4vw, 78px); line-height: 1.02; letter-spacing: -0.035em;
  margin: 0 0 22px;
}
.hero p { font-size: 19px; color: var(--ink-soft); max-width: 30em; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px; border: 0; border-radius: var(--r-pill);
  font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
  text-decoration: none; transition: transform .12s ease, background-color .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #262A58; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--ink); }

/* Hero demo: a frozen round of the game */
.demo {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  border-radius: var(--r-lg); overflow: hidden; min-height: 340px;
  box-shadow: 0 30px 60px -30px rgba(23, 26, 59, .45);
  text-decoration: none; color: #fff;
}
.demo-side { padding: 26px 22px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.demo-side:first-child { background: #2F5BEA; padding-right: 56px; }
.demo-side:nth-child(2) { background: #1F3FB8; padding-left: 56px; }
.demo-flag { width: 64px; height: 48px; border-radius: 8px; margin-bottom: auto; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.demo-name { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.demo-val { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.demo-sub { font-size: 14px; opacity: .8; }
.demo-btns { display: grid; gap: 8px; margin-top: 8px; }
.demo-btns span {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-pill);
  font-family: var(--display); font-weight: 700; font-size: 14px; background: rgba(255,255,255,.14);
}
.demo-btns b { font-size: 20px; line-height: 1; width: 18px; text-align: center; }
.demo-btns span:first-child { background: var(--plus); }
.demo-disc { left: 50%; top: 50%; }

/* Mode catalogue */
.catalogue { max-width: 1160px; margin: 0 auto; padding: 0 20px 72px; }
.group { margin-top: 40px; }
.group h2 {
  font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.tile {
  --c: var(--mode);
  position: relative; display: flex; flex-direction: column;
  min-height: 210px; padding: 20px; border-radius: var(--r-lg);
  background: var(--c); color: #fff; text-decoration: none; overflow: hidden;
  transition: transform .15s ease;
}
.tile:hover { transform: translateY(-3px); }
.tile:active { transform: scale(.98); }
.tile-glyph {
  position: absolute; right: -14px; top: -34px;
  font-family: var(--display); font-weight: 900; font-size: 170px; line-height: 1;
  color: rgba(255,255,255,.13); pointer-events: none; user-select: none;
}
.tile-visual { height: 54px; display: flex; align-items: center; gap: 8px; margin-bottom: auto; position: relative; }
.tile-visual img { width: 48px; height: 36px; border-radius: 6px; box-shadow: 0 0 0 2px rgba(255,255,255,.3); }
.tile-visual .em { font-size: 40px; line-height: 1; }
.tile-visual .sym {
  width: 50px; height: 50px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.18); font-family: var(--display); font-weight: 800; font-size: 22px;
}
.tile h3 { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; line-height: 1.15; margin: 18px 0 6px; position: relative; }
.tile p { margin: 0; font-size: 15px; opacity: .85; position: relative; }
.tile-best {
  position: absolute; right: 16px; bottom: 16px;
  padding: 4px 10px; border-radius: var(--r-pill); background: rgba(0,0,0,.22);
  font-size: 13px; font-weight: 600;
}

.site-foot { max-width: 1160px; margin: 0 auto; padding: 28px 20px 40px; color: var(--ink-soft); font-size: 14px; border-top: 1px solid var(--line); }
.site-foot p { margin: 4px 0; }

/* ---------- Game ---------- */
body.game { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: var(--ink); }
.game-bar {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px;
  background: var(--paper); position: relative; z-index: 5;
}
.back {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px; border-radius: var(--r-pill);
  text-decoration: none; font-weight: 600; font-size: 15px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.back:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.bar-title { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scores { display: flex; gap: 8px; }
.score-chip { display: flex; flex-direction: column; align-items: flex-end; padding: 2px 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.score-chip small { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }
.score-chip b { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.score-chip.best b { color: #B7860B; }
.score-chip.bump b { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

.stage { position: relative; flex: 1; overflow: hidden; }
.track { position: absolute; inset: 0; display: flex; }
.track.slide { transition: transform .55s cubic-bezier(.65, 0, .35, 1); }

.panel {
  flex: 0 0 50%; position: relative; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 32px 28px; gap: 10px;
  background: var(--bg, var(--mode));
}
.track { width: 150%; }
.panel { flex-basis: calc(100% / 3); }
.panel::before {
  /* oversized glyph watermark: + on the asking side, value side gets − */
  content: attr(data-glyph);
  position: absolute; right: 0.04em; bottom: -0.3em;
  font-family: var(--display); font-weight: 900; font-size: min(42vh, 22vw); line-height: 1;
  color: rgba(255,255,255,.06); pointer-events: none;
}
.visual { position: relative; height: clamp(90px, 22vh, 190px); display: grid; place-items: center; margin-bottom: 8px; }
.visual img { height: 100%; width: auto; aspect-ratio: 4 / 3; border-radius: 14px; box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 20px 40px -20px rgba(0,0,0,.6); object-fit: cover; }
.visual .em { font-size: clamp(76px, 18vh, 160px); line-height: 1; filter: drop-shadow(0 14px 18px rgba(0,0,0,.3)); }
.visual .sym, .visual .mono {
  height: 100%; aspect-ratio: 1; border-radius: 24px; display: grid; place-items: center;
  background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 3px rgba(255,255,255,.3);
  font-family: var(--display); font-weight: 800; font-size: clamp(40px, 9vh, 84px); letter-spacing: -0.03em;
}
.visual .sym { position: relative; }
.visual .sym small { position: absolute; left: 12px; top: 8px; font-size: 14px; font-weight: 600; opacity: .8; letter-spacing: 0; }
.name { position: relative; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3.2vw, 36px); line-height: 1.12; letter-spacing: -0.025em; max-width: 14em; margin: 0; }
.metric { position: relative; font-size: 16px; opacity: .82; margin: 0; }
.value { position: relative; font-family: var(--display); font-weight: 800; font-size: clamp(30px, 5vw, 58px); letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; margin: 4px 0 0; }
.value .unit { font-size: .42em; font-weight: 600; letter-spacing: 0; margin-left: .3em; opacity: .85; }

.choices { position: relative; display: grid; gap: 12px; width: min(320px, 100%); margin-top: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px;
  min-height: 62px; padding: 0 22px 0 10px; border: 0; border-radius: var(--r-pill);
  font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; color: #fff;
  transition: transform .1s ease, filter .1s ease;
}
.choice .g {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.22); font-size: 28px; font-weight: 900; line-height: 1;
}
.choice .k { margin-left: auto; font-family: var(--body); font-size: 13px; font-weight: 600; opacity: .7; padding: 2px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.choice.more { background: var(--plus); box-shadow: 0 6px 0 var(--plus-deep); }
.choice.less { background: var(--minus); box-shadow: 0 6px 0 var(--minus-deep); }
.choice:hover { filter: brightness(1.06); }
.choice:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.choice:disabled { cursor: default; }
.than { position: relative; font-size: 16px; opacity: .82; margin: 6px 0 0; }

/* The ± disc between panels */
.disc {
  position: absolute; z-index: 4; left: 50%; top: 50%;
  width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper); color: var(--ink);
  box-shadow: 0 0 0 8px rgba(255,255,255,.18), 0 14px 30px -10px rgba(0,0,0,.5);
  font-family: var(--display); font-weight: 900; font-size: 38px; line-height: 1;
  transition: background-color .2s ease, color .2s ease, transform .25s ease;
}
.disc.ok { background: var(--plus); color: #fff; transform: scale(1.12); }
.disc.bad { background: var(--minus); color: #fff; transform: scale(1.12); }

/* Game over sheet */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px;
  background: rgba(23, 26, 59, .55); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.sheet-wrap.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: min(440px, 100%); background: var(--card); border-radius: var(--r-lg); padding: 30px 26px 24px; text-align: center;
  transform: translateY(16px); transition: transform .3s cubic-bezier(.2, .9, .3, 1.2);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet h2 { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; margin: 0 0 4px; }
.sheet .big { font-family: var(--display); font-weight: 900; font-size: 92px; line-height: 1; letter-spacing: -0.05em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.sheet .rec { font-size: 16px; color: var(--ink-soft); margin: 0 0 18px; }
.sheet .rec.new { color: #9A7006; font-weight: 700; }
.sheet .miss { font-size: 15px; background: var(--paper); border-radius: var(--r-md); padding: 12px 14px; margin: 0 0 20px; text-align: left; }
.sheet .miss b { font-weight: 700; }
.sheet-actions { display: grid; gap: 10px; }
.sheet-actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet .btn { width: 100%; }
.toast { font-size: 14px; color: var(--plus-deep); min-height: 1.4em; margin: 10px 0 0; }

.loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: var(--display); font-size: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-bottom: 40px; }
  .demo { min-height: 280px; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .site-head { padding: 16px; }
  .hero, .catalogue { padding-left: 16px; padding-right: 16px; }
  .site-foot { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile { min-height: 170px; padding: 16px; border-radius: 22px; }
  .tile h3 { font-size: 17px; margin-top: 12px; }
  .tile p { display: none; }
  .tile-best { position: static; align-self: flex-start; margin-top: 10px; }
  .demo-side { padding: 18px 14px; }
  .demo-name { font-size: 17px; }
  .demo-val { font-size: 15px; white-space: nowrap; }
  .demo-side:first-child { padding-right: 40px; }
  .demo-side:nth-child(2) { padding-left: 40px; }
  .site-head .total { display: none; }

  /* Game stacks vertically on phones */
  .game-bar { padding: 10px 12px; gap: 8px; }
  .back .lbl { display: none; }
  .back { padding: 8px 10px; }
  .bar-title { font-size: 14px; }
  .score-chip { padding: 2px 10px; }
  .score-chip b { font-size: 16px; }
  .track { flex-direction: column; width: 100%; height: 150%; }
  .panel { flex-basis: calc(100% / 3); padding: 16px 18px; gap: 4px; }
  .track.slide { transform: translateY(-33.3333%); }
  .visual { height: clamp(60px, 12vh, 110px); margin-bottom: 4px; }
  .visual .em { font-size: clamp(56px, 11vh, 96px); }
  .name { font-size: clamp(20px, 6vw, 26px); }
  .value { font-size: clamp(28px, 9vw, 40px); }
  .metric, .than { font-size: 14px; }
  .choices { grid-template-columns: 1fr 1fr; width: 100%; max-width: 380px; gap: 10px; margin-top: 8px; }
  .choice { min-height: 54px; font-size: 16px; padding: 0 14px 0 6px; gap: 8px; }
  .choice .g { width: 38px; height: 38px; font-size: 24px; }
  .choice .k { display: none; }
  .disc { left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; font-size: 30px; }
  .panel::before { display: none; }
  .visual { height: clamp(52px, 9.5vh, 90px); }
  .visual .em { font-size: clamp(48px, 9vh, 84px); }
  .disc { width: 56px; height: 56px; margin: -28px 0 0 -28px; font-size: 26px; box-shadow: 0 0 0 6px rgba(255,255,255,.18), 0 10px 20px -8px rgba(0,0,0,.5); }
}

/* Desktop slide is horizontal: one panel = 1/3 of the 150%-wide track */
@media (min-width: 701px) {
  .track.slide { transform: translateX(-33.3333%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
