/* ===== Gaya bersama: buku catatan bergaris kotak, navy tebal, flat ===== */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-italic.woff2") format("woff2"); font-style: italic; font-weight: 100 900; font-display: block; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito.woff2") format("woff2"); font-style: normal; font-weight: 200 1000; font-display: block; }

:root {
  --ink: #1f2452;
  --ink-soft: #4a5080;
  --paper: #fbfaf6;
  --grid: #e6e3d9;
  --frame: #23213f;
  --blue: #2e6aa8;
  --blue-deep: #1d4f8a;
  --sky: #cfe9fb;
  --water: #4fa8e8;
  --water-deep: #2f86cc;
  --green: #5fae5c;
  --grass: #7cbf3a;
  --grass-deep: #5a9a2a;
  --yellow: #f2c14e;
  --red: #e0544b;
  --purple: #9b5de5;
  --pink: #f4a0a8;
  --ok: #3aa564;
  --shadow: 0 6px 0 var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--frame);
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Panggung 1600x900 yang diskalakan agar pas di layar/proyektor */
#viewport { position: fixed; inset: 0; display: grid; place-items: center; }
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1600px; height: 900px;
  transform-origin: 0 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 2px, transparent 2px),
    linear-gradient(90deg, var(--grid) 2px, transparent 2px);
  background-size: 56px 56px;
  border-radius: 18px;
  overflow: hidden;
}

/* Strip binder di kiri seperti slide */
.binder {
  position: absolute; left: 0; top: 0; bottom: 0; width: 54px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.35) 0 14px, transparent 14px 28px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 14px, transparent 14px 28px),
    #9db4dc;
  border-right: 3px solid #8aa2cc;
  z-index: 1;
}
.binder i {
  position: absolute; left: -14px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper); border: 7px solid var(--blue-deep);
}

.content { position: absolute; left: 84px; right: 30px; top: 22px; bottom: 22px; z-index: 2; }

/* Judul */
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.kicker {
  display: inline-block; font-weight: 900; font-size: 20px; letter-spacing: .08em;
  background: var(--ink); color: #fff; padding: 4px 14px; border-radius: 8px; margin-bottom: 6px;
}
h1.big {
  margin: 0; font-family: "Archivo", "Arial Black", sans-serif; font-style: italic; font-weight: 900;
  font-size: 54px; line-height: 1.02; letter-spacing: -.01em; color: var(--ink); text-transform: uppercase;
}

/* Toolbar kanan atas */
.toolbar { display: flex; gap: 10px; flex-shrink: 0; }
.tool {
  width: 58px; height: 58px; border-radius: 16px; border: 4px solid var(--ink);
  background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .2s;
  text-decoration: none; position: relative;
}
.tool svg { width: 28px; height: 28px; }
.tool:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.tool.off { background: #e9e7e0; }
.tool.off::after {
  content: ""; position: absolute; width: 40px; height: 5px; background: var(--red);
  border-radius: 3px; transform: rotate(-45deg); border: 2px solid var(--ink);
}
.tool[data-tip]:hover::before {
  content: attr(data-tip); position: absolute; top: 66px; right: 0; white-space: nowrap;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 15px; padding: 5px 10px; border-radius: 8px;
}

/* Tombol */
.btn {
  font-family: "Nunito", sans-serif; font-weight: 900; font-size: 22px; color: var(--ink);
  background: #fff; border: 4px solid var(--ink); border-radius: 16px; padding: 10px 18px;
  box-shadow: 0 5px 0 var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .08s, box-shadow .08s, background .15s, opacity .2s; line-height: 1.1;
}
.btn:hover { background: #fff8e3; }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: 0 5px 0 var(--ink); }
.btn.primary { background: var(--yellow); }
.btn.primary:hover { background: #f6cf6b; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.blue:hover { background: #3a7bbd; }
.btn.green { background: var(--ok); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.small { font-size: 18px; padding: 7px 12px; border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
.btn .ico { width: 24px; height: 24px; flex-shrink: 0; }
.btn.pulse, .pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse {
  0%,100% { outline: 0 solid rgba(155,93,229,.0); }
  50% { outline: 8px solid rgba(155,93,229,.55); }
}

/* Kartu */
.card {
  background: #fff; border: 4px solid var(--ink); border-radius: 20px; box-shadow: var(--shadow);
  padding: 16px 20px;
}
.card h3 { margin: 0 0 8px; font-family: "Archivo", sans-serif; font-style: italic; font-weight: 900; font-size: 24px; text-transform: uppercase; }

/* Kotak petunjuk biru + otak (seperti slide) */
.hintbox {
  position: relative; background: var(--blue); color: #fff; border: 4px solid var(--blue-deep);
  border-radius: 18px; padding: 14px 18px; font-weight: 800; font-size: 20px; line-height: 1.3;
  box-shadow: 0 5px 0 var(--blue-deep);
}
.hintbox .brain { position: absolute; right: -22px; top: -46px; width: 84px; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }

/* Layar pembuka & modal */
.overlay {
  position: absolute; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(31,36,82,.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  width: 1000px; max-width: 92%; background: var(--paper); border: 5px solid var(--ink); border-radius: 26px;
  box-shadow: 0 10px 0 var(--ink); padding: 34px 40px; position: relative;
  transform: scale(.9) translateY(20px); transition: transform .3s cubic-bezier(.2,1.6,.5,1);
  background-image:
    linear-gradient(var(--grid) 2px, transparent 2px),
    linear-gradient(90deg, var(--grid) 2px, transparent 2px);
  background-size: 40px 40px;
}
.overlay.show .modal { transform: none; }
.modal h2 {
  margin: 0 0 12px; font-family: "Archivo", sans-serif; font-style: italic; font-weight: 900; font-size: 46px;
  text-transform: uppercase; line-height: 1.05;
}
.modal p, .modal li { font-size: 24px; line-height: 1.4; font-weight: 700; margin: 0 0 10px; }
.modal ol, .modal ul { margin: 0 0 12px; padding-left: 34px; }
.modal .actions { display: flex; gap: 14px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.modal .soal { border: 3px solid var(--purple); border-radius: 12px; padding: 14px 18px; background: rgba(255,255,255,.8); }
.modal .big-emoji { font-size: 70px; line-height: 1; text-align: center; }

/* Toast */
.toast {
  position: absolute; left: 50%; top: 120px; transform: translate(-50%, -20px); z-index: 40;
  background: var(--ink); color: #fff; font-weight: 900; font-size: 24px; padding: 12px 24px; border-radius: 14px;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: var(--red); }
.toast.good { background: var(--ok); }

/* Log langkah */
.log { overflow-y: auto; font-size: 19px; font-weight: 700; }
.log table { width: 100%; border-collapse: collapse; }
.log th { position: sticky; top: 0; background: var(--ink); color: #fff; font-weight: 900; padding: 6px 8px; text-align: center; font-size: 17px; }
.log th:first-child { border-radius: 8px 0 0 8px; } .log th:last-child { border-radius: 0 8px 8px 0; }
.log td { padding: 6px 8px; border-bottom: 2px dashed var(--grid); text-align: center; }
.log td.act { text-align: left; }
.log tr.new td { animation: flash 1s; }
@keyframes flash { from { background: #fff3c4; } to { background: transparent; } }
.log .empty { color: #9a9cb3; text-align: center; padding: 24px 0; font-weight: 800; }

#confetti { position: absolute; inset: 0; pointer-events: none; z-index: 60; }
