/* Kos Bu Ratna - site styles. Cartoon "sticker" look: thick ink outlines like the show.
   ASCII only. */
:root {
  --ink: #2b2118;
  --bg: #fff8ec;
  --bg2: #fdeed6;
  --surface: #ffffff;
  --text: #2b2118;
  --muted: #6e5d4e;
  --line: #2b2118;
  --orange: #f39a3d;
  --orange-d: #d97a1c;
  --green: #2f6f4f;
  --green-l: #6ee07a;
  --sky: #5cc8ff;
  --pink: #ff7aa8;
  --yellow: #ffe45c;
  --violet: #b79cff;
  --red: #e5483f;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-l: 6px 6px 0 var(--ink);
  --radius: 18px;
  --maxw: 1180px;
  --head: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1612; --bg2: #251d17; --surface: #2c231c; --text: #f6ecdc; --muted: #c7b39c;
    --line: #0f0b08; --shadow: 4px 4px 0 #0b0806; --shadow-l: 6px 6px 0 #0b0806; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1612; --bg2: #251d17; --surface: #2c231c; --text: #f6ecdc; --muted: #c7b39c;
  --line: #0f0b08; --shadow: 4px 4px 0 #0b0806; --shadow-l: 6px 6px 0 #0b0806; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 17px;
  line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.08; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); font-weight: 800; }
h3 { font-size: 1.45rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* keyword colours of the show */
.k1 { color: #ffa53d; } .k2 { color: #6ee07a; } .k3 { color: #5cc8ff; }
.k4 { color: #ff7aa8; } .k5 { color: #ffe45c; } .k6 { color: #b79cff; }

/* ------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 3px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 14px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--head);
  font-weight: 800; font-size: 1.35rem; white-space: nowrap; }
.brand img { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--line); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; font-weight: 800; padding: 8px 12px; border-radius: 12px; font-size: .98rem; }
.nav a:hover { background: var(--bg2); }
.nav a.active { background: var(--yellow); color: #2b2118; }
.pill-toggle { display: inline-flex; border: 3px solid var(--line); border-radius: 999px; overflow: hidden;
  background: var(--surface); }
.pill-toggle button { border: 0; background: none; font: 800 .82rem var(--body); padding: 5px 10px;
  color: var(--text); cursor: pointer; }
.pill-toggle button[aria-pressed="true"] { background: var(--orange); color: #2b2118; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 3px solid var(--line); background: var(--surface);
  color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: grid; margin-left: auto; }
  .nav { position: fixed; inset: 66px 0 auto 0; background: var(--bg); border-bottom: 3px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 16px 16px; gap: 2px; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 1.1rem; }
}

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 800 1.08rem var(--head);
  padding: 12px 22px 10px; border-radius: 16px; border: 3px solid var(--ink); box-shadow: var(--shadow);
  background: var(--yellow); color: #2b2118; text-decoration: none; cursor: pointer; transition: transform .08s, box-shadow .08s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.orange { background: var(--orange); }
.btn.green { background: var(--green-l); }
.btn.sky { background: var(--sky); }
.btn.pink { background: var(--pink); }
.btn.red { background: #ff5a4e; color: #fff; }
.btn.ghost { background: var(--surface); color: var(--text); }
.btn.big { font-size: 1.35rem; padding: 15px 30px 13px; border-radius: 20px; }
.btn.small { font-size: .95rem; padding: 7px 14px 5px; border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }
.btn svg { width: 22px; height: 22px; flex: none; }

.card {
  background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-l);
}
.tag { display: inline-block; font: 800 .78rem var(--body); text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--yellow); color: #2b2118; }

/* ------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; border-bottom: 3px solid var(--line); }
.hero-bg { position: absolute; inset: 0; background: url(../assets/img/bg_courtyard.webp) center 30% / cover; }
.hero-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 38%,
              color-mix(in srgb, var(--bg) 20%, transparent) 70%, transparent 100%); }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; align-items: end;
  min-height: 600px; padding-top: 40px; }
.hero-text { align-self: center; padding-bottom: 40px; }
.hero-text p.lead { font-size: 1.22rem; max-width: 33em; font-weight: 600; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 26px 0 22px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats span { font-weight: 800; font-size: .92rem; background: var(--surface); border: 2px solid var(--line);
  border-radius: 999px; padding: 4px 12px; }
.hero-stats b { font-family: var(--head); font-size: 1.1rem; }
.cast { position: relative; height: 470px; }
.cast img { position: absolute; bottom: 0; filter: drop-shadow(0 8px 0 rgba(43,33,24,.18)); transform-origin: bottom center; }
.cast .c-lukas { left: 4%; height: 92%; animation: bob 3.2s ease-in-out infinite; }
.cast .c-ratna { left: 30%; height: 78%; animation: bob 3.6s ease-in-out -.8s infinite; }
.cast .c-dimas { right: 2%; height: 86%; animation: bob 3.4s ease-in-out -1.6s infinite; }
.cast .c-oyen { left: 48%; height: 36%; animation: bob 2.4s ease-in-out -.3s infinite; z-index: 2; }
.subtitle-demo { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(94%, 470px);
  background: rgba(20, 15, 11, .82); border-radius: 14px; padding: 10px 14px; text-align: center; z-index: 3;
  font-family: var(--head); color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.2); }
.subtitle-demo .id { font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.subtitle-demo .en { font-size: 1rem; opacity: .92; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-width: 860px) {
  .hero-bg::after { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 94%, transparent) 0%,
                    color-mix(in srgb, var(--bg) 70%, transparent) 55%, transparent 100%); }
  .hero .wrap { grid-template-columns: 1fr; min-height: 0; padding-top: 28px; }
  .hero-text { padding-bottom: 0; }
  .cast { height: 340px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------- sections */
section { padding: 84px 0; }
section.alt { background: var(--bg2); border-top: 3px solid var(--line); border-bottom: 3px solid var(--line); }
.sec-head { max-width: 720px; margin-bottom: 36px; }
.sec-head.center { margin-left: auto; margin-right: auto; }
.sec-head p { font-size: 1.12rem; color: var(--muted); font-weight: 600; }

/* games */
.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.game-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; transition: transform .15s; }
.game-card:hover { transform: translateY(-4px) rotate(-.4deg); }
.game-art { position: relative; height: 230px; border-bottom: 3px solid var(--line); overflow: hidden; }
.game-art.water { background: linear-gradient(180deg, #8fd3f5 0%, #49a9d8 60%, #2f86b8 100%); }
.game-art.road { background: #cfe2a8; }
.game-art.quiz { background: radial-gradient(circle at 50% 120%, #ffd36b, #f39a3d 70%); }
.game-art img { position: absolute; }
.game-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.game-body h3 { margin-bottom: .2em; }
.game-body .sub { font-family: var(--head); font-weight: 700; color: var(--orange-d); margin-bottom: .6em; }
.game-body p { color: var(--muted); font-weight: 600; flex: 1; }
.game-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.game-meta span { font-size: .8rem; font-weight: 800; border: 2px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.soon { opacity: .9; }
.soon .btn { background: var(--surface); color: var(--muted); box-shadow: none; cursor: default; }
@media (max-width: 980px) { .games { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .games { grid-template-columns: 1fr; } }

/* fish swimming in the game card */
.swim { animation: swim 9s linear infinite; }
@keyframes swim { from { transform: translateX(-160px); } to { transform: translateX(560px); } }
.swim.r { animation-name: swimr; }
@keyframes swimr { from { transform: translateX(560px) scaleX(-1); } to { transform: translateX(-160px) scaleX(-1); } }
.label-fish { position: absolute; font: 800 .9rem var(--head); background: #fff; color: #2b2118; border: 2px solid var(--ink);
  border-radius: 999px; padding: 0 9px; white-space: nowrap; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; counter-reset: s; }
.step { padding: 26px; position: relative; }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: -18px; left: 20px; width: 42px; height: 42px;
  border-radius: 50%; display: grid; place-items: center; background: var(--orange); border: 3px solid var(--ink);
  font: 800 1.3rem var(--head); color: #2b2118; }
.step .demo { background: #1f1813; border-radius: 12px; padding: 12px; color: #fff; text-align: center;
  font-family: var(--head); margin: 6px 0 14px; border: 3px solid var(--line); }
.step .demo .id { font-size: 1.3rem; font-weight: 800; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; gap: 34px; } }

/* episodes */
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 22px; }
.ep { overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform .15s; }
.ep:hover { transform: translateY(-3px); }
.ep .thumb { aspect-ratio: 16 / 9; background: #ddd center / cover; border-bottom: 3px solid var(--line); position: relative; }
.ep .num { position: absolute; top: 8px; left: 8px; font: 800 .85rem var(--head); background: var(--yellow); color: #2b2118;
  border: 2px solid var(--ink); border-radius: 8px; padding: 1px 8px; }
.ep .play { position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border-radius: 50%; background: #ff3b30;
  border: 3px solid var(--ink); display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: .15s; }
.ep:hover .play { opacity: 1; transform: scale(1); }
.ep .body { padding: 12px 14px 14px; }
.ep h3 { font-size: 1.22rem; margin: 0; }
.ep .en { color: var(--muted); font-weight: 700; font-size: .93rem; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font: 800 .82rem var(--head); padding: 1px 9px; border-radius: 999px; background: #241b15; border: 2px solid var(--ink); }

/* cast */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }
.person { padding: 18px; text-align: center; }
.person .pic { height: 190px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 10px;
  border-radius: 14px; background: var(--bg2); border: 2px solid var(--line); padding-top: 12px; }
.person .pic img { max-height: 170px; }
.person h3 { margin: 0; font-size: 1.3rem; }
.person p { color: var(--muted); font-weight: 600; font-size: .95rem; margin: .3em 0 0; }

/* contact */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 34px; align-items: start; }
.contact .mail { padding: 26px; }
.mail-img { margin: 10px 0 4px; height: 30px; width: auto; }
.mail-img.dark { display: none; }
:root[data-theme="dark"] .mail-img.light { display: none; }
:root[data-theme="dark"] .mail-img.dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mail-img.light { display: none; }
  :root:not([data-theme="light"]) .mail-img.dark { display: block; }
}
form.cform { padding: 26px; display: grid; gap: 14px; }
.field label { display: block; font-weight: 800; margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; font: 600 1rem var(--body); padding: 11px 13px; border-radius: 12px; border: 3px solid var(--line);
  background: var(--bg); color: var(--text); }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--orange); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; }
.form-msg { font-weight: 800; min-height: 1.4em; }
.form-msg.ok { color: #2f9e57; } .form-msg.err { color: var(--red); }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* youtube band */
.yt-band { display: flex; gap: 26px; align-items: center; padding: 28px; flex-wrap: wrap;
  background: linear-gradient(120deg, #ff6a3d, #f39a3d); color: #2b2118; }
.yt-band img { width: 110px; height: 110px; border-radius: 50%; border: 4px solid var(--ink); }
.yt-band h2 { margin: 0; }
.yt-band p { margin: 4px 0 0; font-weight: 700; }
.yt-band .btn { margin-left: auto; }

/* footer */
footer { border-top: 3px solid var(--line); padding: 40px 0 50px; background: var(--bg2); }
footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
footer p { margin: 0; color: var(--muted); font-weight: 600; font-size: .95rem; }
footer .links { display: flex; gap: 16px; flex-wrap: wrap; }
footer .links a { font-weight: 800; text-decoration: none; }

/* reveal on scroll */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.rv.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------- game pages */
.game-page { padding: 22px 0 60px; }
.game-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.game-title h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.game-title .sub { font-family: var(--head); font-weight: 700; color: var(--muted); font-size: 1.1rem; }
.stage-wrap { position: relative; border: 3px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-l);
  background: #2f86b8; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.stage-wrap canvas { display: block; width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(28, 20, 14, .55); z-index: 5; overflow-y: auto; }
.overlay[hidden] { display: none; }
.panel { background: var(--surface); color: var(--text); border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow-l);
  padding: 22px 24px; width: min(640px, 100%); max-height: 100%; overflow-y: auto; }
.panel h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: .1em; }
.opt-row { margin: 14px 0; }
.opt-row > .lbl { font-weight: 800; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  margin-bottom: 6px; display: block; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: 800 .95rem var(--body); padding: 8px 13px; border-radius: 12px; border: 2.5px solid var(--line);
  background: var(--bg); color: var(--text); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--orange); color: #2b2118; border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.seg.small button { padding: 4px 9px; font-size: .85rem; min-width: 38px; }
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  z-index: 3; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud .box { background: rgba(255, 255, 255, .94); color: #2b2118; border: 3px solid var(--ink); border-radius: 14px;
  padding: 3px 12px; font: 800 1.05rem var(--head); box-shadow: 3px 3px 0 var(--ink); white-space: nowrap; }
.health { flex: 1; max-width: 300px; height: 26px; background: #fff; border: 3px solid var(--ink); border-radius: 999px;
  overflow: hidden; box-shadow: 3px 3px 0 var(--ink); position: relative; }
.health > i { position: absolute; inset: 0; width: 100%; background: linear-gradient(180deg, #8af08f, #3fbf55);
  transition: width .35s cubic-bezier(.3,1.4,.6,1), background .3s; }
.health.mid > i { background: linear-gradient(180deg, #ffe45c, #f5b730); }
.health.low > i { background: linear-gradient(180deg, #ff8a7a, #e5483f); animation: blink .6s infinite; }
.health > b { position: absolute; inset: 0; display: grid; place-items: center; font: 800 .8rem var(--head); color: #2b2118;
  letter-spacing: .04em; }
@keyframes blink { 50% { opacity: .55; } }
.hud .spacer { flex: 1; }
.hud .icon-btn { width: 38px; height: 38px; background: #fff; color: #2b2118; border-color: var(--ink); }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.how .card { padding: 18px; }
.how h3 { font-size: 1.2rem; }
.how p { margin: 0; color: var(--muted); font-weight: 600; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }
.result-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; max-height: 210px; overflow-y: auto; }
.result-list li { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 2px solid var(--line); border-radius: 12px;
  padding: 5px 10px; font-weight: 700; }
.result-list li b { font-family: var(--head); font-size: 1.1rem; }
.result-list .say { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); background: var(--yellow);
  cursor: pointer; display: grid; place-items: center; padding: 0; color: #2b2118; }
.result-list .say svg { width: 16px; height: 16px; }
.bigscore { font: 800 3.4rem var(--head); line-height: 1; color: var(--orange-d); }
.stats-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.stats-row span { border: 2px solid var(--line); border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: .92rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
