/* candy-swipe.com — "Candy Park" theme in the game's own colours:
   park sky, the blue striped board frame, navy board cells, the pink and blue UI badges,
   the green ACTIVATE button and the yellow of the MatchWin logo (sampled from game screenshots). */
:root {
  --sky: #5fc9fd;          /* park sky */
  --sky-soft: #e4f5ff;     /* page */
  --sky-mid: #c4e9fd;
  --cloud: #fff6fb;
  --board: #162643;        /* board cells */
  --board-deep: #12172a;   /* win display */
  --stripe-a: #8db9fa;     /* board frame stripes */
  --stripe-b: #6ea0f1;
  --royal: #496ccd;        /* game tabs and price badges */
  --royal-deep: #34519f;
  --peri: #5779d2;         /* CLOSE button */
  --pink: #d13c6c;         /* SETTINGS / BONUS badge */
  --pink-candy: #f74e9d;
  --green: #2cbe51;        /* ACTIVATE */
  --purple: #7a1dbb;       /* MatchWin ribbon */
  --gold: #f0b11b;         /* the WIN in the logo */
  --gold-2: #ffd34d;
  --gold-edge: #a8710a;
  --gold-ink: #1d1400;
  --ink: #18223f;
  --muted: #4c5a7a;
  --line: #bcd3f2;
  --white: #ffffff;
  --radius: 16px;
  --wrap: 1160px;
  --prose: 46rem;
  --stripes: repeating-linear-gradient(-45deg, var(--stripe-a) 0 9px, var(--stripe-b) 9px 18px);
  --head: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Lato", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
/* languages whose script Baloo 2 and Lato don't cover */
:root[lang="ru"] { --head: "M PLUS Rounded 1c", "Trebuchet MS", system-ui, sans-serif; --body: "PT Sans", "Segoe UI", system-ui, sans-serif; }
:root[lang="ja"] { --head: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", system-ui, sans-serif; --body: "M PLUS Rounded 1c", "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif; }
:root[lang="ko"] { --head: "Jua", "Malgun Gothic", system-ui, sans-serif; --body: "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; font-synthesis-weight: none; word-break: keep-all; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background-color: var(--sky-soft);
  background-image:
    radial-gradient(900px 380px at 88% -60px, rgb(255 255 255 / 85%), transparent 70%),
    radial-gradient(700px 320px at 6% 120px, rgb(255 214 232 / 55%), transparent 70%),
    linear-gradient(180deg, var(--sky-mid) 0, var(--sky-soft) 520px);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.06rem;
  line-height: 1.65;
}
img, svg { max-width: 100%; height: auto; }
a { color: #2f55c4; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--board); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pink-candy); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--head); color: var(--board); line-height: 1.12; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.15rem, 4.6vw, 3.5rem); font-weight: 800; margin: 0.15em 0 0.3em; }
h2 { font-size: clamp(1.6rem, 2.7vw, 2.1rem); font-weight: 800; margin: 0 0 0.5em; }
h3 { font-size: 1.3rem; font-weight: 700; margin: 1.5em 0 0.35em; }
p, ul, ol, dl { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
strong { color: var(--board); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--board); color: #fff; padding: 8px 14px; z-index: 50; border-radius: 8px; }
.skip:focus { left: 8px; }

/* top bar: white with the board's striped edge */
.topbar { position: sticky; top: 0; z-index: 30; background: rgb(255 255 255 / 94%); }
.topbar::after { content: ""; display: block; height: 6px; background: var(--stripes); }
@supports (backdrop-filter: blur(8px)) { .topbar { background: rgb(255 255 255 / 84%); backdrop-filter: blur(8px); } }
.topbar-in { max-width: var(--wrap); margin: 0 auto; padding: 9px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--board); flex: none; }
.brand-grid { display: grid; grid-template-columns: repeat(3, 9px); gap: 3px; padding: 4px; border-radius: 7px; background: var(--board); }
.brand-grid span { width: 9px; height: 9px; border-radius: 3px; background: var(--pink-candy); }
.brand-grid .g1 { background: var(--gold-2); } .brand-grid .g2 { background: var(--green); } .brand-grid .g3 { background: #4fb3f6; }
.brand-word { font-family: var(--head); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.01em; line-height: 1; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a { display: block; white-space: nowrap; padding: 7px 9px; border-radius: 999px; color: var(--board); text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 1.02rem; }
.site-nav a:hover { background: #e3ecff; }
.site-nav a[aria-current="page"] { background: var(--royal); color: #fff; }
.menu-btn { display: none; }

/* buttons: real money = solid logo yellow with a hard edge; the rest = the game's blue pills */
.btn-real {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; border: 2px solid var(--gold-edge);
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink);
  font-family: var(--head); font-weight: 800; font-size: 1.12rem; text-decoration: none; line-height: 1.15;
  box-shadow: 0 4px 0 var(--gold-edge); white-space: nowrap;
}
.btn-real:hover { color: var(--gold-ink); filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 5px 0 var(--gold-edge); }
.btn-real:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-edge); }
.btn-real--top { padding: 8px 18px; font-size: 1rem; flex: none; }
.btn-real--big { padding: 15px 32px; font-size: 1.22rem; }
.btn-soft {
  display: inline-flex; align-items: center; padding: 11px 22px; border-radius: 999px;
  border: 2px solid var(--royal-deep); background: var(--royal); color: #fff;
  font-family: var(--head); font-weight: 700; text-decoration: none; cursor: pointer; font-size: 1.05rem; line-height: 1.15;
  box-shadow: 0 3px 0 var(--royal-deep);
}
.btn-soft:hover { background: #5679dc; color: #fff; }

/* layout */
main { display: block; }
.crumbs { max-width: var(--wrap); margin: 0 auto; padding: 14px 16px 0; font-size: 0.92rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li { margin: 0; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a[aria-current="page"] { color: var(--board); text-decoration: none; font-weight: 700; }

.lede { max-width: var(--wrap); margin: 0 auto; padding: 34px 16px 30px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 44px; align-items: center; }
.lede--solo { grid-template-columns: minmax(0, 1fr); max-width: 912px; }
.lede--solo > * { max-width: var(--prose); }
.lead { font-size: 1.17rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }
/* the game board look: navy cells inside a blue striped frame */
.lede-side { background: var(--board); border: 10px solid transparent; border-radius: 24px; padding: 10px; background-image: linear-gradient(var(--board), var(--board)), var(--stripes); background-origin: border-box; background-clip: padding-box, border-box; box-shadow: 0 26px 50px -28px rgb(18 23 42 / 70%); }
.lede-art { display: block; width: 100%; border-radius: 12px; }

.board-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 10px 0 0; gap: 6px; }
main > section > .board-card { margin: 4px 0 22px; }
.board-card div { padding: 8px 10px; background: var(--board-deep); border-radius: 10px; }
.board-card dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--stripe-a); }
.board-card dd { margin: 0; font-family: var(--head); font-weight: 700; color: #fff; font-size: 1.02rem; line-height: 1.25; }

main > section { max-width: 912px; margin: 0 auto; padding: 34px 16px; border-top: 2px dashed var(--line); }
main > section > *, .prose > * { max-width: var(--prose); }
main > section > .table-scroll, main > section > .chart, main > section > .snap--wide, main > section > .phones,
main > section > .calc, main > section > .swipe-strip, main > section > .pieces, main > section > .shapes { max-width: none; }
.lede + section { border-top: 0; }

/* pictures */
.snap { margin: 18px 0 22px; }
.snap img { display: block; width: 100%; max-width: 760px; border-radius: var(--radius); border: 4px solid var(--stripe-b); background: var(--board); }
.snap--half img { max-width: 420px; }
.snap--wide img { max-width: 100%; }
.phones { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0 22px; }
.phones img { width: 220px; border-radius: 24px; border: 7px solid var(--board); background: var(--board); box-shadow: 0 16px 30px -18px rgb(18 23 42 / 60%); }
.candy { vertical-align: middle; }

/* pieces: icon + text rows, not boxes */
.pieces { list-style: none; padding: 0; margin: 16px 0 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 28px; }
.pieces li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); margin: 0; }
.pieces img { width: 64px; height: 64px; filter: drop-shadow(0 6px 8px rgb(18 23 42 / 22%)); }
.pieces b { display: block; font-family: var(--head); color: var(--board); font-size: 1.08rem; }
.pieces span { color: var(--muted); font-size: 0.98rem; }

/* move math */
.math { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 20px; font-family: var(--head); }
.math span { padding: 6px 14px; border-radius: 999px; background: var(--white); border: 2px solid var(--stripe-a); font-weight: 800; color: var(--board); }
.math .op { background: none; border: 0; padding: 0 2px; font-size: 1.3rem; }
.math .win { background: var(--board); color: var(--gold-2); border-color: var(--board); }

/* rule conflicts and side notes: a margin line, not a card */
.note { border-left: 5px solid var(--pink); padding: 2px 0 2px 16px; }
.note strong { color: var(--pink); }

/* strip between sections: a small game board with the yellow button */
.swipe-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 26px 0 6px; padding: 18px 22px; border: 8px solid transparent; border-radius: 22px; color: #fff; background-image: linear-gradient(var(--board), var(--board)), var(--stripes); background-origin: border-box; background-clip: padding-box, border-box; }
.swipe-strip p { margin: 0; font-family: var(--head); font-weight: 700; font-size: 1.15rem; line-height: 1.3; max-width: 40rem; }

/* home first screen: the game's own title art next to the title */
.lede--stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding-top: 28px; }
.lede-side--stage { padding: 0; overflow: hidden; }
.lede-side--stage .lede-art { border-radius: 14px; }
.stage-text .lead strong { color: var(--board); font-weight: 700; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; }
.chips li { margin: 0; padding: 4px 12px; font-size: 0.95rem; border-radius: 999px; background: var(--white); border: 2px solid var(--stripe-a); font-family: var(--head); font-weight: 600; color: var(--board); line-height: 1.3; }
.chips b { color: var(--pink); font-weight: 800; margin-right: 4px; }
.lede-art--tall { width: auto; max-width: 100%; max-height: 560px; margin: 0 auto; }
/* the ringmaster in every play strip */
.strip-host { flex: none; width: 96px; height: auto; border-radius: 14px; border: 3px solid var(--stripe-a); background: var(--board); }
.swipe-strip p { margin-right: auto; }

/* tables: header row in the game's tab blue */
.table-scroll { overflow-x: auto; margin: 16px 0 22px; -webkit-overflow-scrolling: touch; }
.grid-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--white); border-radius: var(--radius); overflow: hidden; font-size: 0.98rem; box-shadow: 0 0 0 2px var(--line); }
.grid-table caption { text-align: left; font-size: 0.9rem; color: var(--muted); padding: 0 0 8px; caption-side: top; }
.grid-table th, .grid-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e1eafa; vertical-align: top; }
.grid-table thead th { font-family: var(--head); font-size: 0.86rem; letter-spacing: 0.03em; text-transform: uppercase; color: #fff; background: var(--royal); font-weight: 700; border-bottom: 0; }
.grid-table tbody th { font-weight: 700; color: var(--board); }
.grid-table tbody tr:last-child th, .grid-table tbody tr:last-child td { border-bottom: 0; }
.grid-table tbody tr:nth-child(even) { background: #f5f8ff; }
.grid-table--narrow { max-width: 620px; }

/* charts */
.chart { margin: 14px 0 22px; max-width: 700px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart-label { font: 700 16px var(--head); fill: var(--board); }
.chart-value { font: 800 16px var(--head); fill: var(--board); }
.chart-bar--0 { fill: var(--royal); } .chart-bar--1 { fill: var(--pink-candy); } .chart-bar--2 { fill: var(--green); }

/* calculator */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin: 18px 0 24px; padding: 20px; background: var(--white); border: 3px solid var(--stripe-a); border-radius: 20px; }
.calc fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.calc legend { font-family: var(--head); font-weight: 800; color: var(--board); font-size: 1.2rem; margin-bottom: 8px; padding: 0; }
.calc label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.calc input, .calc select { width: 100%; font: inherit; padding: 9px 12px; border-radius: 12px; border: 2px solid #8fa6d8; background: #fff; color: var(--ink); }
.calc-out { background: var(--board); color: #dfe8ff; border-radius: 16px; padding: 16px; align-self: start; }
.calc-out p { margin: 0 0 8px; }
.calc-out output { display: block; font-family: var(--head); font-weight: 800; color: var(--gold-2); font-size: 1.3rem; line-height: 1.25; }

/* glossary */
.words { margin: 10px 0 0; }
.words div { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.words dt { font-family: var(--head); font-weight: 800; color: var(--board); font-size: 1.1rem; }
.words dd { margin: 2px 0 0; }

/* line-shape diagrams on a mini board */
.shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 26px; margin: 18px 0 24px; padding: 0; list-style: none; }
.shapes li { margin: 0; }
.shapes svg { display: block; width: 100%; max-width: 230px; background: var(--board); border-radius: 14px; border: 4px solid var(--stripe-b); }
.shapes .cell { fill: #22335a; }
.shapes .hit { fill: #6ee59a; }
.shapes .pick { fill: var(--pink-candy); }
.shapes .boom { fill: var(--gold-2); }
.shapes b { display: block; font-family: var(--head); color: var(--board); margin-top: 8px; line-height: 1.3; }

/* footer */
.base { background: var(--board-deep); color: #cdd8f5; margin-top: 40px; }
.base::before { content: ""; display: block; height: 8px; background: var(--stripes); }
.base-in { max-width: var(--wrap); margin: 0 auto; padding: 34px 16px 90px; }
.base-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.foot-title { color: var(--gold-2); font-size: 1.12rem; margin: 0 0 8px; }
.base ul { list-style: none; padding: 0; margin: 0; }
.base a { color: #fff; text-decoration-color: rgb(255 255 255 / 40%); }
.base a:hover { color: var(--gold-2); }
.base-note { margin: 26px 0 0; font-size: 0.93rem; border-top: 1px solid rgb(255 255 255 / 16%); padding-top: 18px; }
.base-copy { margin: 10px 0 0; font-size: 0.88rem; opacity: 0.8; }
.age { display: inline-block; font-family: var(--head); font-weight: 800; color: #fff; background: var(--pink); border-radius: 999px; padding: 0 9px; margin-right: 6px; }

/* phone bar and cookie note */
.pocket { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 9px 9px 9px 16px; border-radius: 999px; background: var(--board); color: #fff; box-shadow: 0 10px 30px rgb(18 23 42 / 40%), 0 0 0 3px var(--stripe-b); }
.pocket[hidden] { display: none; }
.pocket p { margin: 0 auto 0 0; font-family: var(--head); font-weight: 700; font-size: 0.98rem; line-height: 1.2; }
.pocket .btn-real { padding: 9px 16px; font-size: 1rem; }
.pocket-x { background: none; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 4px 6px; }
.cookie-note { position: fixed; left: 12px; bottom: 12px; z-index: 45; max-width: 420px; display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; border: 2px solid var(--stripe-a); border-radius: 16px; box-shadow: 0 10px 30px rgb(18 23 42 / 22%); font-size: 0.93rem; }
.cookie-note[hidden] { display: none; }
.cookie-note p { margin: 0; }
.cookie-note .btn-soft { padding: 6px 18px; }

/* language switcher: globe menu in the bar, a row in the phone menu and in the footer */
.tongues { position: relative; flex: none; }
.tongues summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; border: 2px solid #cfdcf7; background: #fff; color: var(--board); font: 700 0.92rem var(--head); line-height: 1; cursor: pointer; }
.tongues summary::-webkit-details-marker { display: none; }
.tongues summary:hover, .tongues[open] summary { border-color: var(--royal); }
.tongues-icon { width: 17px; height: 17px; flex: none; }
.tongues-list { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; list-style: none; margin: 0; padding: 8px; min-width: 176px; background: #fff; border: 2px solid var(--stripe-a); border-radius: 16px; box-shadow: 0 16px 30px rgb(18 23 42 / 22%); }
.tongues-list li { margin: 0; }
.tongues-list a { display: block; padding: 7px 12px; border-radius: 10px; color: var(--board); text-decoration: none; font-weight: 700; }
.tongues-list a:hover { background: #e3ecff; }
.tongues-list a[aria-current] { background: var(--royal); color: #fff; }
.site-nav .menu-tongues { display: none; }
.base-tongues ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 26px 0 0; padding: 0; }
.base-tongues li { margin: 0; }
.base-tongues a { font-weight: 700; }
.base-tongues a[aria-current] { text-decoration: none; opacity: 0.75; }

@media (min-width: 900px) { .pocket { display: none !important; } }
/* header: the menu folds into the Menu button below 1180 px (9 languages and a switcher share the bar) */
@media (max-width: 1180px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; padding: 7px 14px; border-radius: 999px; border: 2px solid var(--royal-deep); background: var(--royal); color: #fff; font: 700 1rem var(--head); cursor: pointer; }
  .js .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 6px solid var(--stripe-b); box-shadow: 0 14px 24px rgb(18 23 42 / 18%); }
  .js .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px 12px 12px; }
  .site-nav a { padding: 11px 12px; font-size: 1.08rem; }
  html:not(.js) .site-nav { display: none; }
  html:not(.js) .menu-btn { display: none; }
  .topbar-in { position: relative; gap: 10px; }
}
@media (max-width: 600px) {
  .topbar-in > .tongues { display: none; }
  .site-nav .menu-tongues { display: flex; flex-direction: row; flex-wrap: wrap; gap: 2px 16px; margin: 0 12px; padding: 10px 12px 14px; border-top: 2px solid #e3ecff; }
  .site-nav .menu-tongues a { padding: 6px 0; font-size: 1rem; background: none; color: var(--board); border-radius: 0; }
  .site-nav .menu-tongues a[aria-current] { color: var(--royal); text-decoration: underline; text-underline-offset: 4px; }
  /* the Menu button becomes a three-line icon; its text stays as the accessible name */
  .menu-btn { width: 44px; height: 38px; padding: 0; font-size: 0; }
  .menu-btn::before { content: ""; width: 18px; height: 14px; background: linear-gradient(#fff 0 0) top / 100% 2.5px no-repeat, linear-gradient(#fff 0 0) center / 100% 2.5px no-repeat, linear-gradient(#fff 0 0) bottom / 100% 2.5px no-repeat; }
}
@media (max-width: 370px) {
  .brand-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 900px) {
  .lede { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 22px; }
  .base-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .table-scroll .grid-table:not(.grid-table--narrow) { min-width: 640px; }
  .table-scroll { margin-right: -16px; padding-right: 16px; }
}
@media (max-width: 560px) {
  body { font-size: 1.02rem; }
  .brand-word { font-size: 1.2rem; }
  .brand-grid { grid-template-columns: repeat(3, 7px); padding: 3px; }
  .brand-grid span { width: 7px; height: 7px; }
  .btn-real--top { padding: 7px 13px; font-size: 0.92rem; }
  .board-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swipe-strip { flex-wrap: wrap; align-items: center; padding: 14px; gap: 14px; }
  .swipe-strip p { flex: 1 1 160px; font-size: 1.05rem; }
  .swipe-strip .btn-real { width: 100%; }
  .strip-host { width: 72px; }
  .actions .btn-real, .actions .btn-soft { width: 100%; justify-content: center; }
  .phones img { width: calc(50% - 9px); }
  .cookie-note { right: 12px; max-width: none; }
  h1 { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .btn-real:hover { transform: none; } }
