:root {
  --c-dark: #22374a;
  --c-border: #5b3a1e;
  --c-border-dark: #2c1a0e;
  --c-sky: #45b8ff;
  --c-sky-dark: #1d7de0;
  --c-grass: #86d85f;
  --c-grass-dark: #46a446;
  --c-paper: #fff3d6;
  --c-red: #ff4d55;
  --c-red-dark: #c22b35;
  --c-yellow: #ffd43b;
  --c-orange: #ff8a3d;
  --c-white: #ffffff;
  --c-ink: #4a2c1a;
  --font-px: "Press Start 2P", monospace;
  --font-txt: "VT323", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background:
    radial-gradient(circle at 15% 10%, #3fae4f 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, #3fae4f 0%, transparent 40%),
    #1e5c30;
  font-family: var(--font-txt);
  color: var(--c-paper);
  overflow-x: hidden;
  image-rendering: pixelated;
}

/* ---------- CRT overlay ---------- */
.crt {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.14) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  opacity: .35;
}
.crt::after {
  content: "";
  position: fixed; inset: 0; z-index: 999;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.25) 100%);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(#3f8f3c, #2c5f31);
  border-bottom: 4px solid var(--c-border-dark);
  box-shadow: 0 4px 0 rgba(0,0,0,.35);
  position: relative; z-index: 5;
}

.logo {
  font-family: var(--font-px);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--c-yellow);
  background: transparent;
  border: 3px solid var(--c-yellow);
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--c-border), 0 4px 0 var(--c-border);
  image-rendering: pixelated;
}
.logo:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--c-border); }
.logo u { text-decoration: none; color: var(--c-white); }

.nav { display: flex; gap: 8px; flex-wrap: wrap; }

.px-btn {
  font-family: var(--font-px);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--c-white);
  background: var(--c-sky-dark);
  border: 3px solid var(--c-border);
  box-shadow: 0 3px 0 var(--c-border);
  padding: 10px 12px;
  cursor: pointer;
  transition: background .12s;
  image-rendering: pixelated;
}
.px-btn:hover { background: var(--c-sky); color: var(--c-dark); }
.px-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-border); }
.px-btn.btn-secret { background: var(--c-red-dark); }
.px-btn.btn-secret:hover { background: var(--c-red); color: var(--c-white); }
.px-btn.btn-cisco { background: #1b6338; color: #ffd43b; border-color: #ffd43b; }
.px-btn.btn-cisco:hover { background: #248a4d; color: #fff; }
.px-btn.muted { opacity: .65; }

/* ---------- Stage / canvas ---------- */
.stage {
  position: relative;
  width: min(960px, 96vw);
  margin: 18px auto;
  border: 6px solid var(--c-border);
  box-shadow:
    0 0 0 3px var(--c-paper),
    0 0 0 6px var(--c-border),
    0 14px 40px rgba(0,0,0,.55);
  background: var(--c-dark);
}
.stage canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.stage-hint {
  position: absolute;
  bottom: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(44,26,14,.82);
  color: var(--c-yellow);
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 1px;
  padding: 7px 10px;
  border: 2px solid var(--c-white);
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
  z-index: 3;
}

/* ---------- Language switcher ---------- */
.lang-seg {
  display: flex;
  gap: 4px;
}
.lang-seg-btn {
  font-family: var(--font-px);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--c-white);
  background: var(--c-sky-dark);
  border: 3px solid var(--c-border);
  box-shadow: 0 3px 0 var(--c-border);
  padding: 9px 10px;
  cursor: pointer;
  min-width: 46px;
  transition: background .12s;
}
.lang-seg-btn:hover { background: var(--c-sky); color: var(--c-dark); }
.lang-seg-btn.active { background: var(--c-yellow); color: var(--c-border); }
.lang-seg-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-border); }

.title-lang {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}
.title-lang .lang-seg-btn {
  font-size: 12px;
  padding: 12px 20px;
  background: rgba(15,25,15,.55);
  border: 3px solid #fff;
  color: #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.title-lang .lang-seg-btn.active {
  background: var(--c-yellow);
  color: var(--c-border);
  border-color: var(--c-border);
}

/* ---------- Touch controls (mobile) ---------- */
.touch-dpad {
  position: fixed;
  left: 10px; right: 10px;
  bottom: 14px;
  z-index: 40;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  pointer-events: none;
}
.pad-group {
  pointer-events: auto;
  filter: drop-shadow(0 7px 0 rgba(0,0,0,.3));
}

/* D-pad cross */
.dpad {
  position: relative;
  width: 216px; height: 216px;
}
.dpad::before,
.dpad::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #333c52, #1e2433);
  border: 3px solid #0f1420;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.10), inset 0 -5px 0 rgba(0,0,0,.45);
  z-index: 0;
}
.dpad::before { width: 216px; height: 76px; border-radius: 16px; }
.dpad::after  { width: 76px; height: 216px; border-radius: 16px; }

.dp {
  position: absolute;
  width: 66px; height: 66px;
  background: linear-gradient(180deg, #4a5775, #2c3550);
  border: 3px solid #0f1420;
  border-radius: 12px;
  color: #e6eeff;
  font-family: var(--font-px);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.18), inset 0 -4px 0 rgba(0,0,0,.4);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 1;
}
.dp:active {
  transform: translateY(4px);
  box-shadow: inset 0 1px 0 rgba(0,0,0,.5);
  background: linear-gradient(180deg, #3a4460, #232c44);
}
.dp-up    { left: 50%; top: 4px;    margin-left: -33px; }
.dp-down  { left: 50%; bottom: 4px; margin-left: -33px; }
.dp-left  { top: 50%; left: 4px;    margin-top: -33px; }
.dp-right { top: 50%; right: 4px;   margin-top: -33px; }

/* Action (E) button */
.action-btn {
  width: 82px; height: 82px;
  background: radial-gradient(circle at 32% 28%, #ff7a5c, #d8432e 60%, #a82c1f);
  border: 3px solid #5e1410;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-px);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 4px 0 rgba(255,255,255,.30), inset 0 -6px 0 rgba(0,0,0,.35), 0 0 0 4px rgba(255,255,255,.06);
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.action-btn::before {
  content: "A";
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--c-white);
  letter-spacing: 1px;
  opacity: .85;
  text-shadow: 0 2px 0 rgba(0,0,0,.4);
}
.action-btn:active {
  transform: translateY(4px);
  box-shadow: inset 0 2px 0 rgba(0,0,0,.4), 0 0 0 4px rgba(255,255,255,.06);
}

@media (pointer: coarse) {
  .touch-dpad { display: flex; }
  .stage-hint { white-space: normal; font-size: 7px; }
}
@media (max-width: 340px) {
  .dpad { width: 186px; height: 186px; }
  .dpad::before { width: 186px; height: 64px; }
  .dpad::after  { width: 64px; height: 186px; }
  .dp { width: 56px; height: 56px; }
  .dp-up, .dp-down { margin-left: -28px; }
  .dp-left, .dp-right { margin-top: -28px; }
  .action-btn { width: 70px; height: 70px; font-size: 20px; }
}

/* ---------- Bottom decor ---------- */
.deco {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 60px;
  background-image: url("images/grass_tile.svg");
  background-repeat: repeat-x;
  background-size: 160px 60px;
  background-position: bottom center;
  pointer-events: none;
  z-index: 2;
  image-rendering: pixelated;
  display: none;
}
@media (pointer: coarse) {
  .deco { display: block; }
}
.footer { padding-bottom: 72px; }

/* ---------- Image thumbnails inside modals ---------- */
.px-img-wrap {
  cursor: pointer;
  margin: 10px 0;
  text-align: center;
}
.px-img-wrap img {
  max-width: 320px;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 3px solid var(--c-border);
  box-shadow: 3px 3px 0 rgba(0,0,0,.25);
  background: #fff;
}
.px-img-wrap:hover img { box-shadow: 0 0 14px var(--c-yellow), 3px 3px 0 rgba(0,0,0,.25); }
.px-img-hint {
  font-family: var(--font-px);
  font-size: 8px;
  color: var(--c-sky-dark);
  letter-spacing: 1px;
  margin-top: 6px;
  animation: blink 1.2s steps(2, start) infinite;
}
.how-head {
  font-family: var(--font-px);
  font-size: 10px;
  color: var(--c-sky-dark);
  margin-bottom: 10px;
  letter-spacing: 1px;
  line-height: 1.6;
}
.px-detail {
  text-align: left;
  margin-top: 16px;
  border-top: 3px dashed var(--c-border);
  padding-top: 14px;
}
.px-detail h4 {
  font-family: var(--font-px);
  font-size: 9px;
  color: var(--c-sky-dark);
  margin-bottom: 5px;
  letter-spacing: 1px;
  line-height: 1.6;
}
.px-detail p { font-size: 19px; margin-bottom: 10px; }

/* ---------- Lightbox (full image viewer) ---------- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(5,8,16,.9);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.lightbox-overlay.hidden { display: none !important; }
.lightbox-box {
  width: min(920px, 96vw);
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--c-paper);
  color: var(--c-ink);
  border: 4px solid var(--c-border);
  box-shadow: 0 0 0 3px var(--c-white), 0 0 0 6px var(--c-border), 0 20px 60px rgba(0,0,0,.6);
  animation: popwindow .18s steps(4, end);
}
.lightbox-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  background: var(--c-sky-dark);
  border-bottom: 4px solid var(--c-border);
  padding: 10px 12px;
  font-family: var(--font-px);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--c-white);
  text-shadow: 2px 2px 0 var(--c-border);
  box-shadow: inset 0 -4px 0 rgba(255,255,255,.12);
}
.lightbox-title { line-height: 1.6; }
.lightbox-body { overflow-y: auto; padding: 14px; }
.lightbox-image {
  max-width: 100%;
  max-height: 62vh;
  width: auto;
  display: block;
  margin: 0 auto;
  border: 3px solid var(--c-border);
  box-shadow: 3px 3px 0 rgba(0,0,0,.25);
  background: #fff;
}

/* ---------- Mobile responsive ---------- */
@media (max-width: 640px) {
  .topbar { padding: 8px 10px; gap: 6px; }
  .px-btn { font-size: 8px; padding: 8px 8px; }
  .logo { font-size: 11px; }
  .px-window { width: 98vw; max-height: 90vh; }
  .px-body { padding: 12px; }
  .px-item h3 { font-size: 9px; }
  .px-item p { font-size: 17px; }
  .lightbox-box { width: 98vw; }
  .title-lang { margin-top: 14px; }
  .title-lang .lang-seg-btn { padding: 10px 16px; }
}

/* ---------- Prompt bubble ---------- */
.prompt {
  position: absolute;
  z-index: 4;
  background: var(--c-paper);
  color: var(--c-border);
  font-family: var(--font-px);
  font-size: 9px;
  padding: 8px 10px;
  border: 3px solid var(--c-border);
  box-shadow: 3px 3px 0 rgba(0,0,0,.5);
  transform: translate(-50%, -130%);
  animation: blink 0.8s steps(2, start) infinite;
  white-space: nowrap;
  pointer-events: none;
}
.prompt b { color: var(--c-red); }
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: .25; } }

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  z-index: 6;
  top: 14px; left: 50%; transform: translateX(-50%);
  background: var(--c-yellow);
  border: 3px solid var(--c-border);
  box-shadow: 4px 4px 0 rgba(0,0,0,.5);
  color: var(--c-border);
  font-family: var(--font-px);
  font-size: 9px;
  padding: 10px 14px;
  max-width: 80%;
  text-align: center;
  line-height: 1.6;
}
.toast.show { animation: pop .25s steps(3, end); }
.toast.hideout { animation: fadeout .4s steps(4, end) forwards; }
@keyframes pop { 0% { transform: translateX(-50%) scale(.6); } 70% { transform: translateX(-50%) scale(1.06);} 100% { transform: translateX(-50%) scale(1);} }
@keyframes fadeout { to { opacity: 0; visibility: hidden; } }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 14px 10px 30px;
  font-family: var(--font-px);
  font-size: 9px;
  color: #d9f2b5;
  text-shadow: 2px 2px 0 rgba(0,0,0,.4);
  letter-spacing: 1px;
}
#foot-name { color: var(--c-yellow); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6,10,20,.78);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(1px);
}
.modal-overlay.hidden, .hidden { display: none !important; }

.px-window {
  width: min(680px, 96vw);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--c-paper);
  color: var(--c-ink);
  border: 4px solid var(--c-border);
  box-shadow: 0 0 0 3px var(--c-white), 0 0 0 6px var(--c-border), 0 20px 60px rgba(0,0,0,.6);
  animation: popwindow .18s steps(4, end);
  image-rendering: pixelated;
}
@keyframes popwindow { 0% { transform: scale(.82); opacity: .3; } 100% { transform: scale(1); opacity: 1; } }

.px-title {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--c-sky-dark);
  border-bottom: 4px solid var(--c-border);
  padding: 12px 14px;
  font-family: var(--font-px);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--c-white);
  text-shadow: 2px 2px 0 var(--c-border);
  box-shadow: inset 0 -4px 0 rgba(255,255,255,.12);
}
.px-close {
  font-family: var(--font-px);
  font-size: 11px;
  width: 34px; height: 34px;
  background: var(--c-red);
  color: var(--c-white);
  border: 3px solid var(--c-border);
  box-shadow: 0 3px 0 var(--c-border);
  cursor: pointer;
}
.px-close:hover { background: #ff5a64; }
.px-close:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-border); }

.px-body {
  overflow-y: auto;
  padding: 18px;
  flex: 1;
  font-family: var(--font-txt);
  font-size: 21px;
  line-height: 1.45;
}
.px-body::-webkit-scrollbar { width: 16px; }
.px-body::-webkit-scrollbar-track { background: #e3d5b0; border-left: 3px solid var(--c-border); }
.px-body::-webkit-scrollbar-thumb {
  background: var(--c-sky-dark);
  border: 3px solid var(--c-border);
  box-shadow: inset 0 0 0 2px var(--c-white);
}

.px-foot {
  border-top: 4px solid var(--c-border);
  background: #eadfbf;
  padding: 9px 14px;
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 1px;
  color: #6b6147;
}

/* ---------- Content inside modal ---------- */
.px-section { margin-bottom: 18px; }
.px-sec-head {
  display: inline-block;
  font-family: var(--font-px);
  font-size: 9px;
  color: var(--c-white);
  background: var(--c-red);
  padding: 6px 9px;
  border: 3px solid var(--c-border);
  box-shadow: 3px 3px 0 var(--c-border);
  margin-bottom: 10px;
}
.px-item {
  background: #fff;
  border: 3px solid var(--c-border);
  box-shadow: 3px 3px 0 rgba(0,0,0,.25);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.px-item h3 { font-family: var(--font-px); font-size: 11px; color: var(--c-sky-dark); margin-bottom: 6px; letter-spacing: 1px; line-height: 1.5; }
.px-item .year {
  display: inline-block;
  font-family: var(--font-px); font-size: 8px;
  background: var(--c-yellow); color: var(--c-border);
  border: 2px solid var(--c-border);
  padding: 3px 6px; margin-right: 8px;
}
.px-item p { font-size: 20px; }
.px-item ul { margin: 6px 0 0 18px; }
.px-item a { color: var(--c-sky-dark); font-weight: bold; }
.px-item a:hover { background: var(--c-yellow); }

/* skill bars */
.px-skill { margin-bottom: 12px; }
.px-skill-bar {
  margin-top: 5px;
  height: 18px;
  background: #ded3b2;
  border: 3px solid var(--c-border);
  position: relative;
}
.px-skill-fill {
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--c-grass) 0 8px, var(--c-grass-dark) 8px 16px);
  transition: width .5s steps(8, end);
}
.px-skill-name, .px-skill-lvl { font-family: var(--font-px); font-size: 9px; }

/* contact rows */
.px-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 11px;
  background: #fff;
  border: 3px solid var(--c-border);
  box-shadow: 2px 2px 0 rgba(0,0,0,.2);
  padding: 9px 12px;
  font-size: 21px;
}
.px-row .ico { font-size: 24px; width: 30px; text-align: center; }
.px-row a { color: var(--c-red); text-decoration: none; border-bottom: 2px solid var(--c-yellow); }
.px-row a:hover { background: var(--c-yellow); border-bottom-color: var(--c-border); }

/* empty state */
.empty {
  border: 3px dashed var(--c-border);
  padding: 26px 18px;
  text-align: center;
  font-family: var(--font-px);
  font-size: 10px;
  line-height: 2;
  color: var(--c-ink);
  background: repeating-linear-gradient(45deg, #f8efd8 0 12px, #f3e9cd 12px 24px);
}
.empty .px-blink { animation: blink 1s steps(2, start) infinite; }
.empty code {
  background: var(--c-dark); color: var(--c-yellow);
  font-family: var(--font-txt); font-size: 18px;
  padding: 2px 6px; border: 2px solid var(--c-border);
}

/* signature */
.px-sig {
  text-align: right;
  font-family: var(--font-px);
  font-size: 10px;
  color: #fff;
  background: var(--c-dark);
  border: 3px solid var(--c-border);
  padding: 10px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.3);
  margin-top: 6px;
}

/* ================================================================
   TITLE SCREEN  (Bintang Adventure)
   ================================================================ */
#title-screen {
  position: fixed; inset: 0; z-index: 250;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
  background: #4fc3f7;
}
#title-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  image-rendering: pixelated;
}
.title-content {
  position: relative; z-index: 3;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 16px;
  width: 100%;
}
.title-main {
  font-family: var(--font-px);
  font-size: clamp(26px, 7.5vw, 62px);
  line-height: 1.3;
  letter-spacing: 2px;
  color: var(--c-yellow);
  text-shadow:
    3px 3px 0 var(--c-orange),
    6px 6px 0 var(--c-red),
    9px 9px 0 var(--c-border-dark),
    12px 12px 0 rgba(0,0,0,.35);
  animation: titlebob 1.4s steps(3, end) infinite;
  user-select: none;
}
.title-main .t2 { color: #7df57d; }
.title-main .t3 { color: #7de2ff; }
@keyframes titlebob {
  0% { transform: translateY(0); } 50% { transform: translateY(-6px); } 100% { transform: translateY(0); }
}
.title-sub {
  font-family: var(--font-px);
  font-size: clamp(8px, 2.2vw, 12px);
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0,0,0,.45);
  background: rgba(44,26,14,.6);
  border: 3px solid #fff;
  box-shadow: 3px 3px 0 var(--c-border-dark);
  padding: 9px 12px;
  margin-top: 18px;
  letter-spacing: 1px;
}
.title-flash {
  font-family: var(--font-px);
  font-size: clamp(9px, 2.4vw, 12px);
  color: var(--c-yellow);
  text-shadow: 2px 2px 0 #000;
  margin-top: 22px;
  animation: blink 1s steps(2, start) infinite;
}
.title-menu {
  display: flex; flex-direction: column; gap: 20px;
  margin-top: 40px;
  width: min(340px, 86vw);
}
.menu-btn {
  font-family: var(--font-px);
  font-size: clamp(11px, 3vw, 15px);
  letter-spacing: 2px;
  color: #fff;
  border: 4px solid var(--c-border-dark);
  padding: 18px 0;
  cursor: pointer;
  text-shadow: 2px 2px 0 rgba(0,0,0,.35);
  transition: filter .1s, transform .1s;
  image-rendering: pixelated;
}
.menu-btn:hover { filter: brightness(1.12); }
.menu-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--c-border-dark); }
#btn-play { background: linear-gradient(#58d05c, #3fae4f); box-shadow: 0 6px 0 var(--c-border-dark), 0 12px 24px rgba(0,0,0,.3); }
#btn-materi-menu {
  background: linear-gradient(#ffb703, #d98218);
  box-shadow: 0 6px 0 var(--c-border-dark), 0 12px 24px rgba(0,0,0,.3);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#btn-option { background: linear-gradient(#5bb8ff, #1d7de0); box-shadow: 0 6px 0 var(--c-border-dark), 0 12px 24px rgba(0,0,0,.3); }
.exit-wrap { position: relative; }
#btn-exit {
  background: linear-gradient(#ff6a6f, #c22b35);
  box-shadow: 0 6px 0 var(--c-border-dark), 0 12px 24px rgba(0,0,0,.3);
  opacity: .92;
  width: 100%;
}

/* police tape over EXIT */
.police-tape {
  position: absolute;
  left: -10%; right: -10%;
  top: 58%;
  transform: rotate(-3deg);
  height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-yellow);
  color: #111;
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 2px;
  white-space: nowrap;
  text-align: center;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 3px 0 rgba(0,0,0,.45), inset 0 0 0 2px rgba(17,17,17,.65);
  animation: tapewiggle 1.6s ease-in-out infinite;
}
.police-tape::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 28px, rgba(17,17,17,.22) 28px 32px);
}
@keyframes tapewiggle {
  0%, 100% { transform: rotate(-3deg) translateX(0); }
  50% { transform: rotate(-1deg) translateX(-4px); }
}
.police-post {
  position: absolute;
  left: -16px; top: -18px;
  width: 40px; height: 46px;
  display: flex; align-items: flex-end; justify-content: center;
  font-size: 26px;
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,.4));
  z-index: 3;
  pointer-events: none;
}
.title-hint {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 1px;
  color: #fff;
  background: rgba(15,25,15,.55);
  border: 2px solid #fff;
  padding: 7px 10px;
  white-space: nowrap;
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
  z-index: 3;
  text-align: center;
}
@media (max-width: 640px) {
  .title-hint { white-space: normal; width: 88%; font-size: 7px; line-height: 1.7; }
}

/* ---- mini popup used on title (police / news) ---- */
.title-pop {
  position: fixed; inset: 0; z-index: 270;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(12,20,12,.78);
  padding: 16px;
}
.title-pop.on { display: flex; animation: popwindow .18s steps(4, end); }
.pop-box {
  width: min(540px, 94vw);
  background: var(--c-paper);
  border: 4px solid var(--c-border-dark);
  box-shadow: 0 0 0 3px var(--c-white), 0 0 0 6px var(--c-border-dark), 0 20px 50px rgba(0,0,0,.6);
  color: var(--c-ink);
  text-align: center;
  padding: 22px 20px;
  font-size: 23px;
  line-height: 1.5;
}
.pop-title {
  font-family: var(--font-px);
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.pop-img { font-size: 46px; margin-bottom: 8px; }
.pop-text { margin-bottom: 18px; font-size: 22px; }
.pop-ok {
  font-family: var(--font-px);
  font-size: 11px;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(#58d05c, #3fae4f);
  border: 3px solid var(--c-border-dark);
  box-shadow: 0 3px 0 var(--c-border-dark);
  padding: 13px 24px;
  cursor: pointer;
}
.pop-ok:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-border-dark); }

/* ---- materi popup box ---- */
.materi-pop-box {
  width: min(580px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
}

.materi-menu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.materi-card-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: #fff;
  border: 3px solid var(--c-border-dark);
  box-shadow: 0 4px 0 var(--c-border-dark);
  cursor: pointer;
  text-decoration: none;
  color: var(--c-ink);
  transition: all .12s;
  position: relative;
}

.materi-card-btn:hover {
  background: #fff3d6;
  border-color: var(--c-sky-dark);
  transform: translateX(4px);
  box-shadow: -4px 4px 0 var(--c-border-dark);
}

.materi-card-btn.disabled {
  opacity: 0.65;
  background: #f1ede3;
  cursor: not-allowed;
  pointer-events: none;
}

.materi-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.materi-card-badge {
  font-family: var(--font-px);
  font-size: 8px;
  background: #176337;
  color: #ffd43b;
  padding: 3px 6px;
  border: 1px solid rgba(0,0,0,.3);
  letter-spacing: 1px;
}

.materi-card-badge.badge-gray {
  background: #6a7985;
  color: #fff;
}

.materi-card-meta {
  font-family: var(--font-px);
  font-size: 7px;
  color: #8c6843;
}

.materi-card-title {
  font-family: var(--font-px);
  font-size: 11px;
  color: var(--c-dark);
  letter-spacing: 1px;
}

.materi-card-desc {
  font-family: var(--font-txt);
  font-size: 18px;
  line-height: 1.3;
  color: #634a31;
}

/* ---- renovation gag ---- */
#reno {
  position: fixed; inset: 0; z-index: 280;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  padding: 18px;
  background:
    linear-gradient(rgba(0,0,0,.08), rgba(0,0,0,.08)),
    repeating-linear-gradient(45deg, #b5651d 0 26px, #9a4f17 26px 52px);
  border: 8px solid var(--c-border-dark);
}
#reno.on { display: flex; }
.reno-helmet { font-size: 52px; animation: bobble .45s steps(2, end) infinite; filter: drop-shadow(3px 4px 0 rgba(0,0,0,.35)); }
@keyframes bobble { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-7px) rotate(4deg); } }
.reno-title {
  font-family: var(--font-px);
  font-size: clamp(12px, 3.4vw, 18px);
  color: var(--c-yellow);
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 var(--c-border-dark);
  animation: blink 1s steps(2, start) infinite;
  text-align: center;
  line-height: 1.7;
}
.reno-sub {
  font-family: var(--font-px);
  font-size: 9px;
  color: #fff;
  background: var(--c-border-dark);
  border: 3px solid var(--c-yellow);
  padding: 7px 10px;
  letter-spacing: 1px;
}
.reno-progress {
  width: min(460px, 86vw);
  height: 28px;
  background: #5a3415;
  border: 4px solid var(--c-border-dark);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.18);
  position: relative;
  overflow: hidden;
}
.reno-fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, var(--c-yellow) 0 14px, var(--c-orange) 14px 28px);
  transition: width .18s steps(3, end);
}
.reno-msg {
  font-family: var(--font-txt);
  font-size: clamp(20px, 4.6vw, 26px);
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  background: var(--c-border-dark);
  border: 3px solid var(--c-yellow);
  padding: 8px 14px;
  min-height: 44px;
}
.reno-done {
  display: none;
  flex-direction: column; align-items: center; gap: 14px;
}
.reno-done.on { display: flex; }
.reno-done-title {
  font-family: var(--font-px);
  font-size: clamp(12px, 3vw, 15px);
  color: #fff;
  text-shadow: 3px 3px 0 var(--c-border-dark);
  line-height: 1.8;
  text-align: center;
}
.reno-back {
  font-family: var(--font-px);
  font-size: 11px;
  color: var(--c-border-dark);
  background: var(--c-yellow);
  border: 3px solid var(--c-border-dark);
  box-shadow: 0 4px 0 var(--c-border-dark);
  padding: 14px 26px;
  cursor: pointer;
}
.reno-back:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--c-border-dark); }