/* DIJEN TECH — games layer ("toon" theme), shared by every game.
   A game's own colours live in ../{game}/theme.css.
   Everything here is scoped to <body class="toon">, which the games hub and
   every game page set, so the company pages keep their own look. Colours and
   fonts are the variables at the top - change them there only. */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Patrick+Hand&display=swap');

.toon {
  --ink: #1d2747;
  --ink-soft: #55628a;
  --blue: #1687ff;
  --blue-deep: #0b63c9;
  --line: #7fb2f5;
  --soft: #cfe0f7;
  --pink: #ff5c93;
  --pink-deep: #d6336c;
  --yellow: #ffd84d;
  --yellow-deep: #e6b800;
  --green: #22c17b;
  --green-deep: #12915a;
  --cream: #fffaf0;
  --font-toon: "Fredoka", "Baloo 2", system-ui, sans-serif;
  --font-hand: "Patrick Hand", "Fredoka", cursive;

  color: var(--ink);
  font-family: var(--font-toon);
  font-size: 17px;
  line-height: 1.5;
  background-color: #e3f1ff;
  background-image: url("sky.svg"), linear-gradient(180deg, #cfe7ff 0%, #e6f3ff 40%, #f4f9ff 100%);
  background-size: 420px 420px, 100% 100%;
  background-repeat: repeat, no-repeat;
}
.toon h1, .toon h2, .toon h3 { font-family: var(--font-toon); font-weight: 700; letter-spacing: 0; margin: 0; }
.toon p { margin: 0; }
.toon [hidden] { display: none !important; }
.toon .blue { color: var(--blue); }
.toon .pink { color: var(--pink); }
/* yellow highlighter stroke behind a word */
.toon .mark {
  padding: 0 .12em;
  background: linear-gradient(transparent 52%, var(--yellow) 52% 92%, transparent 92%);
  border-radius: 6px;
}

/* — site chrome, softened for the sky — */
.toon .site-nav {
  background: color-mix(in srgb, #fff 72%, transparent);
  border-bottom: 3px solid #fff;
}
.toon .site-nav .links a:not(.button) { color: var(--ink); font-weight: 600; }
.toon .site-footer { border-top: 0; color: var(--ink-soft); justify-content: center; text-align: center; }

/* — page column — */
.toon main { padding: 22px 16px 56px; overflow-x: clip; }
.game-shell { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.game-shell .game-shell { max-width: none; margin: 0; }

/* — buttons: chunky pills that press down — */
.tbtn {
  --face: linear-gradient(180deg, #3ea5ff, #0f7fff);
  --edge: var(--blue-deep);
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 26px; border: 3px solid #fff; border-radius: 999px; cursor: pointer;
  font-family: var(--font-toon); font-weight: 700; font-size: 19px; line-height: 1.1;
  color: #fff; text-decoration: none; text-align: center;
  background: var(--face);
  box-shadow: 0 6px 0 var(--edge), 0 14px 22px rgba(22, 80, 160, .18);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tbtn:hover { color: #fff; transform: translateY(-2px); }
.tbtn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--edge); }
.tbtn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.tbtn .arrow {
  display: grid; place-items: center; flex: none; width: 30px; height: 30px;
  border-radius: 50%; background: #fff; color: var(--blue); font-size: 17px; line-height: 1;
}
.tbtn-lg { width: 100%; font-size: 23px; padding: 20px 28px; }
.tbtn-sm { font-size: 15.5px; padding: 11px 18px; box-shadow: 0 4px 0 var(--edge); }
.tbtn-pink { --face: linear-gradient(180deg, #ff7dab, #ff4f8b); --edge: var(--pink-deep); }
.tbtn-pink .arrow { color: var(--pink); }
.tbtn-green { --face: linear-gradient(180deg, #37d691, #1cb671); --edge: var(--green-deep); }
.tbtn-white {
  --face: #fff; --edge: var(--soft);
  color: var(--ink); border-color: var(--soft);
  box-shadow: 0 5px 0 var(--edge);
}
.tbtn-white:hover { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 14px 12px; }
.actions > * { flex: 1 1 auto; }
.actions form { display: flex; }
.actions form .tbtn { flex: 1; }

/* — hero: thought bubble, mascot peeking over a notebook page — */
.toon-hero { position: relative; display: flex; flex-direction: column; }
.hero-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 6px;
  padding: 0 4px; margin-bottom: -26px;
}
.toon .bubble {
  position: relative; max-width: 220px; margin: 0 0 44px;
  padding: 22px 24px; text-align: center;
  font-weight: 600; font-size: 20px; line-height: 1.15;
  background: #fff; border: 3px solid var(--line);
  border-radius: 48% 52% 50% 50% / 56% 54% 46% 44%;
  box-shadow: 0 6px 0 rgba(40, 90, 170, .12);
}
.bubble::before, .bubble::after {
  content: ""; position: absolute; background: #fff; border: 3px solid var(--line); border-radius: 50%;
}
.bubble::before { width: 20px; height: 20px; right: 4px; bottom: -16px; }
.bubble::after { width: 10px; height: 10px; right: -12px; bottom: -28px; }
.mascot { flex: none; width: min(42vw, 170px); animation: bob 3.2s ease-in-out infinite; }
.mascot .avatar { display: block; width: 100%; height: auto; }

.note {
  position: relative; z-index: 1;
  padding: 36px 20px 28px 46px;
  background: var(--cream) repeating-linear-gradient(transparent 0 36px, #e4ebf7 36px 38px);
  border: 4px solid var(--line); border-radius: 26px;
  box-shadow: 0 10px 0 rgba(40, 90, 170, .13);
  transform: rotate(-1.5deg);
}
/* punched holes down the margin */
.note::before {
  content: ""; position: absolute; left: 10px; top: 24px; bottom: 24px; width: 24px;
  background: radial-gradient(circle at 12px 12px, #e3f1ff 0 6px, #b7cfee 6px 8px, transparent 8.5px) 0 0 / 24px 46px repeat-y;
}
/* a strip of washi tape */
.note::after {
  content: ""; position: absolute; top: -17px; left: 28px; width: 112px; height: 34px;
  background: repeating-linear-gradient(45deg, #ffb7cb 0 9px, #ffa3bd 9px 18px);
  border-radius: 3px; opacity: .92; transform: rotate(-7deg);
  box-shadow: 0 2px 4px rgba(214, 51, 108, .18);
}
.note h1 { font-size: clamp(34px, 10.5vw, 52px); line-height: 1.06; overflow-wrap: anywhere; }
.note h1 small { display: block; font-size: .62em; font-weight: 600; margin-bottom: 6px; }
.note .hand {
  display: block; margin-top: 18px;
  font-family: var(--font-hand); font-size: 23px; line-height: 1.25; color: var(--ink);
  transform: rotate(-2.5deg); transform-origin: left center;
}
.note .squiggle { display: block; height: 4px; margin: 14px 12% 0 0; border-radius: 4px; background: var(--blue); }

/* little floating decorations */
.sticker { position: absolute; z-index: 2; font-size: 26px; line-height: 1; pointer-events: none; animation: floaty 4s ease-in-out infinite; }
.sticker.s1 { right: -6px; bottom: -14px; font-size: 34px; }
.sticker.s2 { left: -8px; bottom: -12px; animation-delay: -1.3s; }
.sticker.s3 { right: 8px; top: 34%; font-size: 22px; animation-delay: -2.4s; }
.hero-cta { margin-top: 26px; }

/* — cards — */
.tcard {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 22px 18px; background: #fff;
  border: 3px solid var(--soft); border-radius: 26px;
  box-shadow: 0 6px 0 rgba(40, 90, 170, .11);
}
.tcard h2 { font-size: 22px; line-height: 1.2; }
.toon .hint { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.toon .error {
  padding: 10px 14px; border-radius: 14px; font-weight: 600; font-size: 15.5px;
  color: #a3123f; background: #ffe6ee; border: 2px solid #ffb3c9;
}
.toon-title { text-align: center; font-size: clamp(28px, 8vw, 36px); line-height: 1.1; }
.toon .toon-sub { text-align: center; font-weight: 600; font-size: 17px; color: var(--pink-deep); margin-top: -14px; text-wrap: balance; }

/* — forms — */
.toon .field > label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
.toon .input {
  width: 100%; min-height: 50px; padding: 10px 16px;
  font-family: var(--font-toon); font-size: 17px; color: var(--ink); caret-color: var(--pink);
  background: #fff; border: 3px solid var(--soft); border-radius: 18px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.toon .input::placeholder { color: #9aa6c4; }
.toon .input:hover { border-color: var(--line); }
.toon .input:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(22, 135, 255, .18); }
.toon .radio { flex: none; }
.toon .radio .dot {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: #fff; border: 3px solid var(--soft); border-radius: 50%;
  transition: transform .12s ease;
}
.toon .radio:hover .dot { border-color: var(--pink); transform: scale(1.08); }
.toon .radio input:checked + .dot { background: var(--pink); border-color: var(--pink); box-shadow: none; }
.toon .radio input:checked + .dot::after { content: "✓"; color: #fff; font-weight: 700; font-size: 18px; line-height: 1; }
.toon .radio input:focus-visible + .dot { outline: 3px solid var(--ink); outline-offset: 2px; }

/* — how to play — */
.howto { list-style: none; margin: 0; }
.howto.tcard { gap: 0; padding: 4px 18px; }
.howto li { display: grid; grid-template-columns: 68px 1fr; gap: 16px; align-items: center; padding: 18px 0; }
.howto li + li { border-top: 2px dashed var(--soft); }
.howto .tile {
  display: grid; place-items: center; width: 68px; height: 68px; font-size: 32px;
  border-radius: 22px; background: #ffe1ec;
}
.howto li:nth-child(2) .tile { background: #d9ecff; }
.howto li:nth-child(3) .tile { background: #fff1b8; }
.howto h3 { font-size: 18px; text-transform: uppercase; letter-spacing: .02em; }
.howto p { font-size: 16px; color: var(--ink-soft); }

/* — quiz builder — */
#q-list { counter-reset: question; }
.q-card { counter-increment: question; }
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-num {
  align-self: flex-start; padding: 4px 14px; border-radius: 999px;
  font-weight: 700; font-size: 14.5px; color: #6b4e00; background: var(--yellow);
  transform: rotate(-2deg);
}
.q-card .q-num::after { content: " " counter(question); }
.q-remove {
  border: 0; background: none; cursor: pointer; padding: 6px 4px;
  font-family: var(--font-toon); font-weight: 600; font-size: 14.5px; color: var(--ink-soft);
}
.q-remove::before { content: "✕ "; }
.q-remove:hover { color: var(--pink-deep); }
.opt-row { display: flex; align-items: center; gap: 12px; }
.opt-row .input { flex: 1; min-width: 0; }
.opt-row:has(input:checked) .input { border-color: var(--pink); background: #fff4f8; }

/* — playing — */
.stepped .step { display: none; }
.stepped .step.is-current { display: flex; animation: pop .28s ease-out; }
.q-head { display: flex; align-items: center; gap: 12px; }
.q-head .avatar { flex: none; width: 54px; height: 54px; }
.q-head .q-num { align-self: center; }
.progress { height: 16px; border-radius: 999px; background: #dfeeff; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--soft); overflow: hidden; }
.progress i {
  display: block; height: 100%; min-width: 16px; border-radius: 999px;
  background: repeating-linear-gradient(-45deg, #ff7dab 0 10px, #ff5c93 10px 20px);
}
.q-title { font-size: clamp(23px, 6.4vw, 28px); line-height: 1.2; overflow-wrap: anywhere; }
.choices { display: flex; flex-direction: column; gap: 14px; counter-reset: choice; }
.choice {
  counter-increment: choice; position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; cursor: pointer;
  font-weight: 600; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere;
  background: #fff; border: 3px solid var(--soft); border-radius: 22px;
  box-shadow: 0 5px 0 var(--soft);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.choice::before {
  content: counter(choice, upper-alpha);
  display: grid; place-items: center; flex: none; width: 40px; height: 40px;
  border-radius: 50%; font-weight: 700; font-size: 17px;
  background: #ffe1ec; color: var(--pink-deep);
}
.choice:nth-child(4n+2)::before { background: #d9ecff; color: var(--blue-deep); }
.choice:nth-child(4n+3)::before { background: #fff1b8; color: #7a5a00; }
.choice:nth-child(4n+4)::before { background: #d6f5e4; color: #0f6f45; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--line); transform: translateY(-2px); }
.choice:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--soft); }
.choice:has(input:checked) { border-color: var(--blue); background: #ecf5ff; box-shadow: 0 5px 0 var(--blue); }
.choice:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }

/* — result — */
.result-top { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.result-top .mascot { width: 150px; }
.burst {
  display: grid; place-items: center; width: 168px; height: 168px; margin-top: -30px;
  border-radius: 50%; background: var(--yellow);
  border: 6px dashed #fff; outline: 7px solid var(--yellow);
  box-shadow: 0 10px 0 var(--yellow-deep);
  font-weight: 700; font-size: 54px; line-height: 1; color: var(--pink-deep);
  transform: rotate(-6deg); animation: burst .5s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes burst { from { opacity: 0; transform: rotate(-30deg) scale(.5); } to { opacity: 1; transform: rotate(-6deg) scale(1); } }
.result-top h1 { font-size: clamp(32px, 9vw, 44px); line-height: 1.1; margin-top: 14px; }
.result-top p { font-size: 18px; color: var(--ink-soft); max-width: 30ch; }

/* — scoreboard — */
.board-wrap { display: flex; flex-direction: column; gap: 18px; padding-top: 12px; }
.board-banner {
  position: relative; align-self: center;
  display: flex; align-items: center; gap: 10px; padding: 12px 24px;
  font-weight: 700; font-size: clamp(26px, 7.5vw, 34px); line-height: 1.1;
  background: var(--yellow); border-radius: 16px 22px 14px 24px;
  box-shadow: 0 6px 0 var(--yellow-deep); transform: rotate(-2deg);
}
.board-banner::before {
  content: "💕"; position: absolute; top: -16px; left: 50%;
  width: 92px; height: 28px; font-size: 13px; letter-spacing: 6px; line-height: 28px; text-align: center;
  background: #ff8fb1; border-radius: 3px; transform: translateX(-50%) rotate(4deg);
}
.board-count {
  align-self: center; padding: 8px 20px;
  font-size: 16px; color: var(--ink-soft);
  background: #fff; border: 2px solid var(--soft); border-radius: 14px;
}
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.board-row {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px 14px 14px; background: #fff;
  border: 3px solid var(--soft); border-radius: 24px;
  box-shadow: 0 5px 0 rgba(40, 90, 170, .11);
}
.board-row .avatar { flex: none; width: 70px; height: 70px; }
.board-rank {
  position: absolute; top: -13px; left: -8px;
  display: grid; place-items: center; width: 36px; height: 36px;
  font-weight: 700; font-size: 15px;
  background: #e3f1ff; border: 3px solid #fff; border-radius: 50%;
  box-shadow: 0 3px 0 rgba(40, 90, 170, .16);
}
.board-row:nth-child(1) .board-rank { background: var(--yellow); }
.board-row:nth-child(2) .board-rank { background: #dde4ee; }
.board-row:nth-child(3) .board-rank { background: #f5c9a0; }
.board-main { flex: 1; min-width: 0; }
.board-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.board-name { font-weight: 700; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-score { flex: none; font-weight: 700; font-size: 24px; color: var(--pink-deep); }
.bar { height: 14px; margin-top: 6px; border-radius: 999px; background: #ffe1ec; overflow: hidden; }
.bar i { display: block; height: 100%; min-width: 14px; border-radius: 999px; background: linear-gradient(90deg, #ff7dab, #ff4f8b); }
.board-verdict { display: block; margin-top: 5px; font-size: 14px; color: var(--ink-soft); }
.board-row.is-me { border-color: var(--blue); background: #f1f8ff; }
.board-row.is-me::after {
  content: "you"; position: absolute; top: -13px; right: 16px; padding: 3px 12px;
  font-weight: 700; font-size: 13px; color: #fff; background: var(--blue); border-radius: 999px;
}
.board-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.board-empty .avatar { width: 96px; height: 96px; }

/* — answer lists — */
.review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.review li {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  background: #f4f9ff; border: 2px solid var(--soft); border-radius: 18px;
  font-size: 16px; line-height: 1.35; overflow-wrap: anywhere;
}
.review b { display: block; font-weight: 600; }
.review span { color: var(--ink-soft); }
.review a { color: var(--blue-deep); text-decoration: none; }
.toon details > summary { cursor: pointer; font-weight: 700; font-size: 20px; list-style-position: inside; }
.toon details[open] > summary { margin-bottom: 14px; }
.faq { display: flex; flex-direction: column; gap: 14px; }
.faq details { gap: 0; padding: 16px 18px; }
.faq summary { font-size: 18px; line-height: 1.3; }
.faq p { font-size: 16px; color: var(--ink-soft); }

/* — games hub — */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 22px; }
.game-card { align-items: center; text-align: center; color: var(--ink); text-decoration: none; transition: transform .16s ease; }
.game-card:hover { color: var(--ink); transform: translateY(-4px) rotate(-.6deg); }
.game-card .avatar { width: 116px; height: 116px; margin-top: -8px; }
.game-card h3 { font-size: 24px; }
.game-card p { font-size: 16px; color: var(--ink-soft); }
.game-card .tbtn { width: 100%; margin-top: 4px; }

/* — motion — */
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-9px) rotate(2deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(8deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 620px) {
  .toon main { padding-top: 34px; }
  .bubble { max-width: 250px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot, .sticker, .burst, .stepped .step.is-current { animation: none; }
  .tbtn, .choice, .game-card { transition: none; }
}
