/* ===========================================================
   northerngamehub.com — Design System
   Inspired by onepagelove.com/concept-capers: cream backdrop,
   punchy sticker-pop colour blocks, thick ink outlines, chunky
   rounded display type, generous whitespace, playful toggles.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:ital,wght@0,400;0,600;0,700;0,800;1,700&display=swap');

:root{
  --cream: #FBF3E3;
  --cream-2: #F4E9D2;
  --ink: #191507;
  --pink: #FF2E86;
  --pink-deep: #D6116A;
  --yellow: #FFC93C;
  --navy: #202A6E;
  --navy-2: #2F3C93;
  --orange: #FF6A33;
  --green: #2FBF71;
  --white: #FFFDF8;

  --accent: var(--pink);
  --accent-deep: var(--pink-deep);

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --radius-pill: 999px;

  --shadow-pop: 6px 6px 0 var(--ink);
  --shadow-pop-sm: 4px 4px 0 var(--ink);
  --shadow-pop-lg: 9px 9px 0 var(--ink);

  --font-display: 'Baloo 2', ui-rounded, system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

[data-theme="dragon"]{
  --accent: var(--navy);
  --accent-deep: var(--navy-2);
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

body.no-scroll{ overflow: hidden; }

h1, h2, h3, h4{
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

h1{ font-weight: 800; }

p{ margin: 0 0 1em; }

a{ color: inherit; }

img, svg{ display: block; max-width: 100%; }

.container{
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Background texture: dotted grid, very subtle */
.dotgrid{
  background-image: radial-gradient(var(--ink) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  background-position: -6px -6px;
  opacity: .06;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: .8em 1.6em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-pop);
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover{
  transform: translate(-2px,-2px);
  box-shadow: 8px 8px 0 var(--ink);
}
.btn:active{
  transform: translate(2px,2px);
  box-shadow: 2px 2px 0 var(--ink);
}
.btn-accent{ background: var(--accent); color: var(--white); }
.btn-yellow{ background: var(--yellow); }
.btn-lg{ padding: 1em 2.1em; font-size: 1.15rem; }
.btn-block{ width: 100%; justify-content: center; }
.btn-ghost{ background: transparent; box-shadow: none; border-color: var(--ink); }
.btn-ghost:hover{ box-shadow: var(--shadow-pop-sm); }
.btn:disabled{ opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-pop); }

/* ---------- Nav ---------- */
.site-header{
  position: sticky; top: 0; z-index: 40;
  background: var(--cream);
  border-bottom: 3px solid var(--ink);
}
.nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
}
.brand{
  display: flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--ink);
}
.brand .brand-badge{
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--accent);
  border: 3px solid var(--ink);
  border-radius: 12px;
  font-size: 1.2rem;
  transform: rotate(-6deg);
  transition: transform .2s ease, background .2s ease;
}
.brand:hover .brand-badge{ transform: rotate(3deg) scale(1.05); }

.nav-links{
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a{
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  padding: .55em 1.1em;
  border-radius: var(--radius-pill);
  border: 3px solid transparent;
}
.nav-links a:hover{ border-color: var(--ink); background: var(--white); }
.nav-links a.is-active{ border-color: var(--ink); background: var(--accent); color: var(--white); }

.age-badge{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .85rem;
  background: var(--ink);
  color: var(--yellow);
  border-radius: var(--radius-pill);
  padding: .35em .9em;
  border: 3px solid var(--ink);
}

.nav-right{ display:flex; align-items:center; gap:14px; }

/* ---------- Mode toggle (Ritter / Drache) ---------- */
.mode-toggle{
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem;
}
.mode-toggle .label{ opacity:.75; }
.mode-toggle .switch{
  position: relative;
  width: 62px; height: 34px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  cursor: pointer;
  padding: 0;
  display:flex; align-items:center;
}
.mode-toggle .switch .knob{
  position: absolute;
  left: 3px;
  width: 24px; height: 24px;
  background: var(--accent);
  border: 3px solid var(--ink);
  border-radius: 50%;
  transition: transform .25s cubic-bezier(.5,1.8,.5,1), background .2s ease;
  display: grid; place-items: center;
  font-size: .7rem;
}
[data-theme="dragon"] .mode-toggle .switch .knob{ transform: translateX(28px); }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  padding: 76px 0 60px;
  overflow: hidden;
}
.hero-grid{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}
.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .85rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: .4em 1em;
  margin-bottom: 18px;
  box-shadow: var(--shadow-pop-sm);
}
.hero h1{
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
}
.hero h1 .hl{
  background: var(--accent);
  color: var(--white);
  padding: 0 .18em;
  border-radius: .2em;
  display: inline-block;
  transform: rotate(-1.5deg);
}
.hero .lede{
  font-size: 1.2rem;
  max-width: 46ch;
  font-weight: 600;
}
.hero-ctas{ display:flex; gap:14px; margin-top: 28px; flex-wrap: wrap; }

.hero-art{
  position: relative;
  display: grid;
  place-items: center;
}
.blob{
  position: absolute;
  border-radius: 42% 58% 61% 39% / 45% 41% 59% 55%;
}
.hero-scene{
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1/1;
  display: grid;
  place-items: center;
}
.hero-scene .blob-main{
  position:absolute; inset: 6%;
  background: var(--yellow);
  border: 4px solid var(--ink);
  animation: blobMorph 9s ease-in-out infinite;
}
.hero-scene .sticker{
  position: relative;
  z-index: 2;
  font-size: 6.2rem;
  filter: drop-shadow(4px 6px 0 rgba(25,21,7,.25));
}
.hero-scene .float-badge{
  position: absolute;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  padding: .5em .8em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .85rem;
  box-shadow: var(--shadow-pop-sm);
  animation: floaty 5s ease-in-out infinite;
}
.hero-scene .float-badge.b1{ top: 6%; left: -6%; animation-delay: .3s; }
.hero-scene .float-badge.b2{ bottom: 8%; right: -8%; animation-delay: 1.1s; background: var(--pink); color: var(--white); }
.hero-scene .float-badge.b3{ bottom: -4%; left: 12%; animation-delay: .7s; background: var(--navy); color: var(--white); }

@keyframes floaty{ 0%,100%{ transform: translateY(0) rotate(-3deg);} 50%{ transform: translateY(-12px) rotate(3deg);} }
@keyframes blobMorph{
  0%,100%{ border-radius: 42% 58% 61% 39% / 45% 41% 59% 55%; }
  50%{ border-radius: 58% 42% 39% 61% / 55% 59% 41% 45%; }
}

/* ---------- Section shells ---------- */
section{ position: relative; padding: 64px 0; }
.section-title-row{
  display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap;
  margin-bottom: 34px;
}
.section-title-row h2{ font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin:0; }
.tag-pill{
  font-family: var(--font-display); font-weight:700; font-size:.8rem;
  background: var(--ink); color: var(--cream);
  padding:.4em 1em; border-radius: var(--radius-pill);
}

/* ---------- Game cards ---------- */
.game-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.game-card{
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: var(--radius-l);
  padding: 30px;
  box-shadow: var(--shadow-pop-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.game-card:hover{ transform: translate(-4px,-4px); box-shadow: 13px 13px 0 var(--ink); }
.game-card .icon-badge{
  width: 84px; height: 84px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  display: grid; place-items: center;
  font-size: 2.6rem;
}
.game-card.gc-knight .icon-badge{ background: var(--yellow); }
.game-card.gc-ice .icon-badge{ background: #BFEFFF; }
.game-card h3{ font-size: 1.6rem; margin: 0; }
.game-card p{ opacity: .82; font-weight: 600; margin: 0; }
.game-card .meta-row{ display:flex; gap:8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.chip{
  font-family: var(--font-display); font-weight:700; font-size:.75rem;
  border: 2px solid var(--ink); border-radius: var(--radius-pill);
  padding: .3em .8em;
}
.game-card .play-cta{
  display:flex; align-items:center; gap:.5em;
  font-family: var(--font-display); font-weight: 800;
  margin-top: 6px;
}
.game-card .play-cta .arrow{ transition: transform .18s ease; }
.game-card:hover .play-cta .arrow{ transform: translateX(6px); }

/* ---------- About / feature rows ---------- */
.about-grid{
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 46px;
  align-items: center;
}
.sticker-panel{
  background: var(--navy);
  border: 4px solid var(--ink);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-pop-lg);
  padding: 36px;
  color: var(--white);
  position: relative;
}
.sticker-panel .stat{
  display:flex; align-items:baseline; gap:10px; margin-bottom: 18px;
}
.sticker-panel .stat b{ font-family: var(--font-display); font-size: 2.4rem; color: var(--yellow); }
.feature-list{ list-style:none; margin:0; padding:0; display:grid; gap:14px; }
.feature-list li{
  display:flex; gap:12px; align-items:flex-start;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-m);
  padding: 14px 18px;
  font-weight: 700;
}
.feature-list li .num{
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display:grid; place-items:center;
  font-family: var(--font-display);
  font-size: .85rem;
}

/* ---------- CTA banner ---------- */
.cta-banner{
  border: 4px solid var(--ink);
  border-radius: var(--radius-l);
  background: var(--yellow);
  padding: 50px;
  display: flex; align-items:center; justify-content:space-between; gap: 30px; flex-wrap: wrap;
  box-shadow: var(--shadow-pop-lg);
}
.cta-banner h2{ margin:0; font-size: clamp(1.7rem,3vw,2.3rem); max-width: 22ch; }

/* ---------- Footer ---------- */
.site-footer{
  border-top: 4px solid var(--ink);
  background: var(--ink);
  color: var(--cream);
  padding: 56px 0 26px;
  margin-top: 40px;
  position: relative;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 34px;
  margin-bottom: 40px;
}
.footer-grid h4{ font-family: var(--font-display); color: var(--yellow); font-size:1rem; margin-bottom: .9em; }
.footer-grid ul{ list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.footer-grid a{ text-decoration:none; opacity:.85; font-weight:600; }
.footer-grid a:hover{ opacity:1; text-decoration:underline; }
.footer-brand p{ opacity:.75; max-width: 32ch; }
.lang-switch{
  display:inline-flex; align-items:center; justify-content:center;
  min-width: 2.6em; padding:.35em .7em;
  border: 3px solid var(--ink); border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight:800; font-size:.78rem;
  text-decoration:none; color: var(--ink); background: var(--cream);
  letter-spacing:.03em;
}
.lang-switch:hover{ background: var(--yellow); }
.privacy-badge{
  display:inline-flex; align-items:center; gap:.5em;
  background: var(--cream); color: var(--ink);
  border-radius: var(--radius-pill);
  padding:.5em 1em;
  font-family: var(--font-display); font-weight:800; font-size:.8rem;
  margin-top: 14px;
  transform: rotate(-2deg);
  cursor: grab;
  user-select: none;
  border: 3px solid var(--ink);
}
.privacy-badge:active{ cursor: grabbing; }
.footer-bottom{
  border-top: 2px solid rgba(251,243,227,.2);
  padding-top: 22px;
  display:flex; justify-content:space-between; gap: 16px; flex-wrap: wrap;
  font-size: .85rem; opacity:.7;
}

/* ---------- Modals: Age gate + Cookie consent ---------- */
.modal-overlay{
  position: fixed; inset:0;
  background: rgba(25,21,7,.72);
  display:flex; align-items:center; justify-content:center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay[hidden]{ display:none; }
.modal-card{
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-pop-lg);
  padding: 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}
.modal-card .modal-icon{
  width: 74px; height:74px; margin: 0 auto 16px;
  background: var(--accent);
  border: 3px solid var(--ink);
  border-radius: 50%;
  display:grid; place-items:center;
  font-size: 2rem;
}
.modal-actions{ display:flex; gap:12px; justify-content:center; margin-top: 24px; flex-wrap:wrap; }
.modal-fine{ font-size:.8rem; opacity:.65; margin-top:18px; }

.cookie-bar{
  position: fixed; left:20px; right:20px; bottom:20px;
  max-width: 620px;
  margin: 0 auto;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-pop-lg);
  padding: 24px 26px;
  z-index: 190;
}
.cookie-bar[hidden]{ display:none; }
.cookie-bar h4{ margin: 0 0 .4em; font-size:1.15rem; }
.cookie-bar p{ font-size:.92rem; margin-bottom: 16px; }
.cookie-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.cookie-settings{ margin-top: 16px; display:grid; gap:10px; border-top: 2px dashed var(--ink); padding-top:16px; }
.cookie-settings[hidden]{ display:none; }
.cookie-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; font-weight:700; font-size:.9rem; }
.mini-switch{
  position: relative; width: 44px; height: 26px;
  background: var(--cream-2); border: 2px solid var(--ink); border-radius: var(--radius-pill);
  cursor:pointer;
}
.mini-switch .knob{
  position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%;
  background: var(--ink); transition: transform .2s ease;
}
.mini-switch.is-on{ background: var(--green); }
.mini-switch.is-on .knob{ transform: translateX(18px); background: var(--white); }
.mini-switch.is-locked{ opacity:.6; cursor:not-allowed; }

/* ---------- Game page ---------- */
.game-page-hero{ padding: 34px 0 8px; }
.game-page-hero .container{ display:flex; align-items:center; justify-content:space-between; gap: 20px; flex-wrap:wrap; }
.game-page-hero h1{ font-size: clamp(2rem,4vw,2.8rem); margin:0; }
.game-page-hero .lede{ font-weight:700; opacity:.8; margin: 6px 0 0; }

.game-stage-wrap{ padding: 22px 0 70px; }
.scoreboard{
  display:flex; align-items:center; justify-content:space-between;
  background: var(--ink); color: var(--cream);
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  border: 4px solid var(--ink);
  padding: 16px 26px;
}
.score-side{ text-align:center; min-width: 120px; }
.score-side .who{ font-family: var(--font-display); font-weight:700; font-size:.85rem; opacity:.75; letter-spacing:.03em; text-transform:uppercase; }
.score-side .num{ font-family: var(--font-display); font-size: 2.4rem; font-weight:800; }
.score-side.left .num{ color: var(--yellow); }
.score-side.right .num{ color: var(--pink); }
.score-mid{ text-align:center; }
.score-mid .level-tag{
  font-family: var(--font-display); font-weight:700; font-size:.8rem;
  background: var(--accent); padding:.35em 1em; border-radius: var(--radius-pill);
}

.stage-frame{
  position: relative;
  border: 4px solid var(--ink);
  border-top: none;
  border-radius: 0 0 var(--radius-m) var(--radius-m);
  background: var(--white);
  box-shadow: var(--shadow-pop-lg);
  overflow: hidden;
}
.stage-frame canvas{ display:block; width: 100%; height: auto; background: var(--cream-2); cursor: none; }

.stage-overlay{
  position:absolute; inset:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px;
  background: rgba(251,243,227,.92);
  text-align:center; padding: 20px;
  pointer-events: none; /* let mouse-move reach the canvas underneath so "move mouse to start" works */
}
.stage-overlay[hidden]{ display:none; }
.stage-overlay button{ pointer-events: auto; }
.stage-overlay h2{ font-size: clamp(1.5rem,3vw,2.1rem); margin:0; }
.stage-overlay p{ margin:0; font-weight:700; opacity:.75; max-width:38ch; }

.controls-legend{
  display:flex; gap: 22px; flex-wrap:wrap; margin-top: 22px;
}
.controls-legend .item{
  display:flex; align-items:center; gap:10px;
  background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius-m);
  padding: 10px 16px; font-weight:700; font-size:.9rem;
}
.kbd{
  font-family: var(--font-display);
  background: var(--ink); color: var(--cream);
  border-radius: 6px; padding: .2em .6em; font-size:.8rem;
}

.howto-grid{
  display:grid; grid-template-columns: repeat(3,1fr); gap: 22px; margin-top: 40px;
}
.howto-card{
  background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius-m);
  padding: 22px; box-shadow: var(--shadow-pop-sm);
}
.howto-card .num-badge{
  width: 40px; height:40px; border-radius:50%; background: var(--accent); color:var(--white);
  display:grid; place-items:center; font-family: var(--font-display); font-weight:800; margin-bottom: 12px;
}

/* ---------- Legal pages ---------- */
.legal-wrap{ padding: 50px 0 90px; }
.legal-card{
  background: var(--white); border: 4px solid var(--ink); border-radius: var(--radius-l);
  box-shadow: var(--shadow-pop-lg);
  padding: 46px; max-width: 860px; margin: 0 auto;
}
.legal-card h1{ font-size: 2.1rem; }
.legal-card h2{ font-size: 1.3rem; margin-top: 1.6em; }
.legal-card p, .legal-card li{ opacity:.85; }
.legal-card ul{ padding-left: 1.3em; }

/* ---------- Utility ---------- */
.mt-0{ margin-top:0; }
.center{ text-align:center; }
.visually-hidden{
  position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 940px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-art{ order:-1; }
  .about-grid{ grid-template-columns: 1fr; }
  .game-grid{ grid-template-columns: 1fr; }
  .footer-grid{ grid-template-columns: 1fr 1fr; }
  .howto-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 640px){
  .nav-links{ display:none; }
  .footer-grid{ grid-template-columns: 1fr; }
  .cta-banner{ padding: 30px; }
  .scoreboard{ padding: 12px 16px; }
  .score-side .num{ font-size:1.6rem; }
}
