/* =====================================================================
 * style.css — DOM absolute positioning (tanpa canvas)
 * ===================================================================== */

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

:root {
  --player-size: 160px;
  --nav-w: 80px;
  --panel-w: 380px;
  --ui-font: "Segoe UI", system-ui, sans-serif;
  --border: #2a3448;
  --accent: #ffd54a;
  --dim: #8a90a0;
  --surface: rgba(10, 12, 20, 0.97);
}

html, body {
  width: 100%; height: 100%;
  background: #0b0b10;
  font-family: var(--ui-font);
  overflow: hidden;
  color: #fff;
  user-select: none;
}

/* =====================================================================
 * GAME WORLD
 * ===================================================================== */

#viewport {
  position: relative;
  width: 100vw; height: 100vh;
  overflow: hidden;
  background: #06070a;
}
#gameContainer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#world {
  position: absolute;
  left: 0; top: 0;
  will-change: transform;
}

#background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

/* ---- Player ---- */
#player {
  position: absolute;
  width: var(--player-size);
  height: var(--player-size);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  transform: translate(-50%, -50%);
  z-index: 50;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5));
}

/* ---- Object sprites (opsional) ---- */
.game-object {
  position: absolute;
  transform: translate(-50%, -50%);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  z-index: 20;
  transition: filter 0.3s ease;
}
.game-object.near {
  filter: drop-shadow(0 0 10px rgba(255,213,74,0.9))
          drop-shadow(0 0 4px rgba(255,213,74,0.6));
}

/* ---- Interact glow (pulsing dot per object) ---- */
.interact-glow {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,213,74,0.35) 0%, transparent 70%);
  border: 2px solid rgba(255,213,74,0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 15;
}
.interact-glow.near {
  opacity: 1;
  animation: pulse-glow 1.5s infinite ease-in-out;
}
@keyframes pulse-glow {
  0%, 100% { transform: translate(-50%,-50%) scale(0.9);
              box-shadow: 0 0 8px rgba(255,213,74,0.5); }
  50%       { transform: translate(-50%,-50%) scale(1.15);
              box-shadow: 0 0 20px rgba(255,213,74,0.9); }
}

/* ---- Debug overlays ---- */
.hotspot { display: none; }
.debug .hotspot {
  display: block;
  position: absolute;
  transform: translate(-50%,-50%);
  border: 1px dashed rgba(120,200,255,0.7);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
}
#debugWalkable { display: none; }
.debug #debugWalkable { display: block; }

/* =====================================================================
 * HUD OVERLAYS
 * ===================================================================== */

/* ---- Press E prompt ---- */
#prompt {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.82);
  border: 2px solid var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 18px;
  z-index: 100;
  pointer-events: none;
  white-space: nowrap;
}
#prompt b { color: var(--accent); }

/* ---- Controls hint ---- */
#controls {
  position: absolute;
  left: 12px; bottom: 12px;
  background: rgba(0,0,0,0.55);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  color: #9aa0b2;
  z-index: 100;
}

/* ---- Dialog box ---- */
#dialog {
  position: absolute;
  left: 50%; bottom: 6%;
  transform: translateX(-50%);
  width: min(680px, 80vw);
  background: rgba(10,12,20,0.96);
  border: 2px solid #4a5a80;
  border-radius: 12px;
  padding: 18px 22px;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
#dialogSpeaker {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
#dialogText { font-size: 17px; line-height: 1.55; min-height: 26px; }
#dialogHint { margin-top: 12px; font-size: 11px; color: var(--dim); text-align: right; }

/* ---- Puzzle modal (Bento Layout) ---- */
#puzzleOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
#bentoBox {
  display: flex;
  gap: 20px;
  width: min(1000px, 95vw);
  max-height: 85vh;
}
.bento-panel {
  background: #12151f;
  border: 2px solid #4a5a80;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  overflow-y: auto;
}
#bentoLeft {
  flex: 1.2;
  min-width: 350px;
  display: flex;
  flex-direction: column;
}
.bento-left-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}
.puzzle-info-column,
.puzzle-interact-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#puzzleLeftCheatsheet {
  margin-top: 10px;
  border-top: 1px dashed rgba(74, 90, 128, 0.4);
  padding-top: 14px;
  animation: slideDown 0.25s ease-out;
}
#puzzleLeftCheatsheet .cheatsheet-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
#puzzleToggleKamus {
  background: #2a3043;
  color: #fff;
  border: 2px solid #4a5a80;
  transition: all 0.2s ease;
}
#puzzleToggleKamus:hover {
  background: #3c4560;
  border-color: var(--accent);
}
#puzzleToggleKamus.active {
  background: var(--accent);
  color: #0b0b10;
  border-color: var(--accent);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
#bentoRight {
  flex: 0.8;
  min-width: 300px;
  border-color: var(--accent);
  display: flex;
  flex-direction: column;
}

#puzzleTitle { font-size: 20px; font-weight: 700; color: #fff; }
#puzzleKind {
  display: inline-block;
  margin: 6px 0 14px;
  font-size: 11px;
  color: #0b0b10;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}
#puzzlePrompt {
  font-family: var(--ui-font);
  background: #0a0c14;
  padding: 12px;
  border-radius: 8px;
  white-space: pre-wrap;
  color: #cfd2dc;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.puzzle-cipher { margin-bottom: 16px; }
.puzzle-label { color: var(--dim); font-size: 12px; margin-right: 8px; }
#puzzleCipher {
  font-family: "Consolas", monospace;
  font-size: 20px;
  letter-spacing: 3px;
  color: #75ff91;
}
#puzzleInput {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 8px;
  border: 2px solid #4a5a80;
  background: #0a0c14;
  color: #fff;
  text-transform: uppercase;
  outline: none;
  font-family: "Consolas", monospace;
  letter-spacing: 2px;
}
#puzzleInput:focus { border-color: var(--accent); }
#puzzleFeedback { min-height: 20px; margin: 10px 2px; font-size: 14px; }
#puzzleFeedback.ok  { color: #75ff91; }
#puzzleFeedback.err { color: #ff6b6b; }
.puzzle-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: auto; }
.puzzle-actions button {
  padding: 10px 18px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
#puzzleSubmit { background: var(--accent); color: #0b0b10; }
#puzzleClose  { background: #2a3043; color: #fff; }
#puzzleToggleHelp { display: none; background: #2e3852; color: #fff; border: 2px solid #4a5a80; }
#puzzleCloseHelp  { display: none; }
#puzzleJumpToInput { display: none; background: rgba(74,90,128,0.22); color: #cfd2dc; border: 1px solid rgba(255,255,255,0.14); }

/* Info Edukasi (Bento Kanan) */
#tutorialTitle {
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: 1px;
}
#tutorialContent {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tut-section {
  background: rgba(10,12,20,0.6);
  padding: 14px 18px;
  border-radius: 8px;
  border-left: 4px solid #4a5a80;
}
.tut-heading {
  font-size: 13px;
  text-transform: uppercase;
  color: #75ff91;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
#tutorialContent p {
  font-size: 14px;
  line-height: 1.6;
  color: #cfd2dc;
}

/* ---- Simulator UI ---- */
#puzzleSimulatorContainer {
  background: #0a0c14;
  border: 1px solid #4a5a80;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.sim-caesar-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}
.sim-btn {
  background: #2a3043;
  color: #fff;
  border: 2px solid #4a5a80;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.sim-btn:hover { background: #4a5a80; }
.sim-btn:active { background: var(--accent); color: #000; }
.sim-shift-val {
  font-size: 32px;
  font-family: "Consolas", monospace;
  color: var(--accent);
  width: 50px;
  text-align: center;
}
.sim-alphabet-box {
  background: #0a0c14;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid #4a5a80;
  width: 100%;
  overflow-x: auto;
}
.sim-alpha-row {
  display: flex;
  margin: 6px 0;
  font-family: "Consolas", monospace;
  font-size: 13px;
  align-items: center;
}
.alpha-label {
  color: var(--dim);
  width: 65px;
  flex-shrink: 0;
  font-weight: 600;
}
.alpha-text {
  color: #cfd2dc;
  letter-spacing: 2px;
  white-space: pre;
}
#simAlphaCipher {
  color: #75ff91;
}
.sim-preview-box {
  width: 100%;
  background: #000;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
}
.sim-preview-text {
  font-family: "Consolas", monospace;
  font-size: 24px;
  letter-spacing: 4px;
  color: #75ff91;
}

/* =====================================================================
 * SIDE NAVIGATION
 * ===================================================================== */

#sideNav {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: var(--nav-w);
  z-index: 310;
  background: rgba(8,10,18,0.94);
  border-left: 1px solid var(--border);
  border-radius: 10px 0 0 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-size: 11px;
  font-family: var(--ui-font);
  letter-spacing: 0.3px;
  width: 100%;
}
.nav-btn img {
  width: 38px; height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: grayscale(0.6) brightness(0.75);
  transition: filter 0.15s;
}
.nav-btn:hover,
.nav-btn.active {
  background: rgba(74,90,128,0.38);
  color: var(--accent);
}
.nav-btn:hover img,
.nav-btn.active img {
  filter: grayscale(0) brightness(1.05);
}

/* Notification dot */
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ff4444;
  border: 1px solid #0b0b10;
  display: none;
}
.nav-btn.has-new .notif-dot { display: block; }

/* =====================================================================
 * SIDE PANELS (slide in from right, sit left of nav)
 * ===================================================================== */

.side-panel {
  position: absolute;
  right: var(--nav-w);
  top: 0;
  width: var(--panel-w);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  /* slide hidden behind the nav initially */
  transform: translateX(calc(100% + var(--nav-w)));
  transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
  z-index: 320;
  pointer-events: none;
}
.side-panel.open {
  transform: translateX(0);
  pointer-events: all;
}

/* ---- Panel header ---- */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}
.panel-close {
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  font-size: 15px;
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.panel-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ---- Scrollable body ---- */
.panel-body {
  padding: 14px 18px;
  overflow-y: auto;
  flex: 1;
}
.panel-empty { color: #555; font-style: italic; font-size: 13px; }

/* ---- Tab bar (Notebook) ---- */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tab-btn {
  flex: 1;
  padding: 10px 4px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--ui-font);
  letter-spacing: 0.3px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* =====================================================================
 * INVENTORY
 * ===================================================================== */
.inv-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.inv-item:last-child { border-bottom: none; }
.inv-icon {
  width: 42px; height: 42px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 4px;
  border: 1px solid var(--border);
}
.inv-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.inv-desc { font-size: 11px; color: var(--dim); line-height: 1.45; }

/* =====================================================================
 * NOTEBOOK — PEOPLE
 * ===================================================================== */
.person-card {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.person-card:last-child { border-bottom: none; }
.person-card.locked { opacity: 0.35; }
.person-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.person-status {
  display: inline-block;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(255,213,74,0.15);
  color: var(--accent);
  margin-bottom: 7px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.person-desc { font-size: 11px; color: var(--dim); line-height: 1.45; }

/* =====================================================================
 * NOTEBOOK — LOCATIONS
 * ===================================================================== */
.loc-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.loc-item:last-child { border-bottom: none; }
.loc-item.locked { opacity: 0.3; }
.loc-name { font-size: 13px; font-weight: 600; color: #66aaff; margin-bottom: 3px; }
.loc-desc { font-size: 11px; color: var(--dim); line-height: 1.45; }

/* =====================================================================
 * NOTEBOOK — KEYWORDS
 * ===================================================================== */
.kw-area { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.kw-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(74,90,128,0.3);
  border: 1px solid #4a5a80;
  border-radius: 4px;
  font-size: 11px;
  font-family: "Consolas", monospace;
  letter-spacing: 0.5px;
  color: #cfd2dc;
}
.kw-empty { color: #555; font-size: 12px; font-style: italic; }

/* =====================================================================
 * QUEST JOURNAL
 * ===================================================================== */
.quest-chapter { margin-bottom: 22px; }
.quest-chapter-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #4a5a80;
  margin-bottom: 3px;
}
.quest-chapter-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.quest-intro { font-size: 11px; color: var(--dim); margin-bottom: 12px; line-height: 1.4; }
.quest-obj {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 5px 0;
}
.quest-check {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid #4a5a80;
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color 0.2s, background 0.2s;
}
.quest-obj.done .quest-check { border-color: #75ff91; background: #75ff91; }
.quest-text { font-size: 12px; line-height: 1.45; }
.quest-obj.done .quest-text { color: var(--dim); text-decoration: line-through; }

/* =====================================================================
 * CIPHER GUIDE
 * ===================================================================== */
.cipher-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.cipher-card.unlocked { border-color: #3a4a68; }

.cipher-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  cursor: pointer;
  user-select: none;
}
.cipher-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: rgba(74,90,128,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  font-family: "Consolas", monospace;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: 0;
}
.cipher-locked .cipher-icon { color: #444; background: rgba(0,0,0,0.2); }
.cipher-title { font-size: 13px; font-weight: 700; }
.cipher-locked .cipher-title { color: #555; }
.cipher-short { font-size: 10px; color: var(--dim); margin-top: 1px; }
.cipher-locked .cipher-short { color: #444; }
.cipher-badge {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.cipher-unlocked-badge { background: rgba(117,255,145,0.12); color: #75ff91; }
.cipher-locked-badge   { background: rgba(255,255,255,0.04); color: #444; }

.cipher-body { padding: 0 13px 12px; display: none; }
.cipher-card.open .cipher-body { display: block; }

.cipher-row { margin-bottom: 9px; }
.cipher-row-label {
  font-size: 9px;
  color: #4a5a80;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 3px;
}
.cipher-row-text {
  font-family: "Consolas", monospace;
  font-size: 11px;
  color: #cfd2dc;
  white-space: pre-wrap;
  background: rgba(0,0,0,0.3);
  padding: 6px 8px;
  border-radius: 4px;
  line-height: 1.5;
}

/* =====================================================================
 * INVESTIGATION BOARD (SVG)
 * ===================================================================== */
#boardContent { padding: 10px 14px 14px; }
#boardSVG { display: block; overflow: visible; }
.board-empty-text {
  font-size: 12px; color: #555; font-style: italic;
}

/* =====================================================================
 * MAP SCREEN
 * ===================================================================== */

#mapScreen {
  position: absolute;
  inset: 0;
  z-index: 150;
  background: url("Asset/bg/map.png") center/cover no-repeat;
  background-color: #0f1525;
}

.map-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%);
  pointer-events: none;
}
.map-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}
.map-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

#mapCloseBtn {
  position: absolute;
  bottom: 18px; left: 50%; transform: translateX(-50%);
  padding: 8px 22px;
  background: rgba(10,12,20,0.88);
  border: 1px solid #4a5a80;
  border-radius: 8px;
  color: #9aa0b2;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#mapCloseBtn:hover { color: #fff; border-color: var(--accent); }

.map-loc {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 7px 15px;
  background: rgba(8, 10, 20, 0.88);
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--ui-font);
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}
.map-loc:hover:not(:disabled) {
  background: rgba(255, 213, 74, 0.18);
  box-shadow: 0 0 16px rgba(255, 213, 74, 0.5);
}
.map-loc:disabled,
.map-loc.locked {
  border-color: #333;
  color: #444;
  cursor: not-allowed;
  background: rgba(8, 10, 20, 0.6);
}
.map-loc.current {
  border-color: #75ff91;
  color: #75ff91;
}
.map-loc.current:hover {
  box-shadow: 0 0 16px rgba(117,255,145,0.45);
}

/* =====================================================================
 * END SCREEN
 * ===================================================================== */

#endScreen {
  position: absolute;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 1.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#endBox {
  text-align: center;
  max-width: 480px;
  padding: 0 24px;
}
.end-tag {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.end-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
}
.end-sub {
  font-size: 15px;
  color: #9aa0b2;
  line-height: 1.7;
  margin-bottom: 22px;
}
.end-divider {
  width: 60px; height: 2px;
  background: var(--accent);
  margin: 0 auto 22px;
  opacity: 0.6;
}
.end-credits {
  font-size: 12px;
  color: #555;
  margin-bottom: 26px;
}
.end-btn {
  padding: 12px 32px;
  background: var(--accent);
  color: #0b0b10;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--ui-font);
  transition: opacity 0.2s;
}
.end-btn:hover { opacity: 0.85; }

/* =====================================================================
 * UTIL
 * ===================================================================== */
.hidden { display: none !important; }

/* =====================================================================
 * INTERACTION GLOW
 * ===================================================================== */
.interact-glow {
  position: absolute;
  pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 0 15px 5px rgba(117, 255, 145, 0);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
  z-index: 5;
}

.interact-glow.active {
  box-shadow: 0 0 20px 8px rgba(117, 255, 145, 0.6);
  background-color: rgba(117, 255, 145, 0.1);
  animation: pulse-glow 1.5s infinite alternate;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 15px 5px rgba(117, 255, 145, 0.4); background-color: rgba(117, 255, 145, 0.05); }
  100% { box-shadow: 0 0 25px 10px rgba(117, 255, 145, 0.8); background-color: rgba(117, 255, 145, 0.2); }
}

/* =========================================
 * MAIN MENU & PROLOGUE
 * ========================================= */
#mainMenu {
  position: absolute;
  inset: 0;
  background: url("Asset/bg/tile.png") center/cover no-repeat;
  background-color: #06070a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  text-align: center;
  transition: opacity 1s ease-in-out;
}
#menuContent {
  animation: fadeIn 2s ease-out;
  background: rgba(0, 0, 0, 0.6);
  padding: 40px;
  border-radius: 12px;
  backdrop-filter: blur(5px);
  margin-top: 35vh;
}
.menu-title {
  font-family: "Consolas", monospace;
  font-size: 48px;
  color: #cfd2dc;
  letter-spacing: 4px;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(117,255,145,0.3);
}
.menu-subtitle {
  font-family: var(--ui-font);
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 10px;
  text-transform: uppercase;
  margin-bottom: 40px;
}
.menu-input {
  display: block;
  margin: 0 auto 30px;
  padding: 12px 20px;
  font-size: 16px;
  color: #fff;
  background: rgba(10, 12, 20, 0.8);
  border: 1px solid #4a5a80;
  border-radius: 8px;
  width: 80%;
  max-width: 300px;
  text-align: center;
}
.menu-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(117, 255, 145, 0.3);
}
.menu-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.menu-btn {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.3s;
  box-shadow: 0 0 15px rgba(117,255,145,0.1);
  width: 100%;
  max-width: 300px;
}
.menu-btn:hover {
  background: var(--accent);
  color: #0b0b10;
  box-shadow: 0 0 30px rgba(117,255,145,0.4);
  transform: scale(1.05);
}
.menu-btn.alt-btn {
  font-size: 14px;
  padding: 10px 20px;
  border-color: #4a5a80;
  color: #cfd2dc;
  box-shadow: none;
}
.menu-btn.alt-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(117, 255, 145, 0.1);
  transform: scale(1.02);
}

/* Modal for Story & Credit */
#storyScreen, #creditScreen, #nameScreen {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: rgba(10, 12, 20, 0.95);
  border: 1px solid var(--accent);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  padding: 30px;
  color: #cfd2dc;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #4a5a80;
  padding-bottom: 15px;
  margin-bottom: 20px;
}
.modal-header h2 {
  color: var(--accent);
  font-size: 24px;
  margin: 0;
}
.modal-close {
  background: transparent;
  border: none;
  color: #cfd2dc;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover {
  color: #ff6b6b;
}
.modal-body h3 {
  color: #fff;
  margin-top: 15px;
  margin-bottom: 10px;
}
.modal-body p, .modal-body li {
  font-size: 15px;
  line-height: 1.6;
  color: #9aa0b2;
}
.modal-body a {
  color: var(--accent);
  text-decoration: none;
}
.modal-body a:hover {
  text-decoration: underline;
}

#prologueScreen {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 40px;
  text-align: center;
  transition: opacity 2s ease-in-out;
}
#prologueText {
  font-family: "Consolas", monospace;
  font-size: 20px;
  color: #cfd2dc;
  line-height: 1.8;
  max-width: 800px;
  min-height: 100px;
}
#prologueHint {
  margin-top: 40px;
  font-family: var(--ui-font);
  font-size: 14px;
  color: #7a8298;
  animation: pulse 2s infinite;
}

#epilogueScreen {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1400;
  padding: 40px;
  text-align: center;
  transition: opacity 2s ease-in-out;
}
#epilogueText {
  font-family: "Consolas", monospace;
  font-size: 20px;
  color: #cfd2dc;
  line-height: 1.8;
  max-width: 800px;
  min-height: 100px;
}
#epilogueAnimation {
  margin-top: 40px;
  width: 240px;
  height: 160px;
  position: relative;
  overflow: hidden;
}
.epi-char {
  width: 160px;
  height: 160px;
  position: absolute;
  top: 0;
  background-size: cover;
  background-position: center;
  transition: transform 4s linear;
}
#epiPlayer {
  left: -40px;
  background-image: url('Asset/Sprit/Main\ -\ right\ 1.png');
  transform: translateX(-160px);
}
#epiProf {
  right: -40px;
  background-image: url('Asset/Sprit/prof\ -\ side\ 1.png');
  transform: translateX(160px) scaleX(-1);
}
#epilogueAnimation.start #epiPlayer {
  transform: translateX(40px);
}
#epilogueAnimation.start #epiProf {
  transform: translateX(-40px) scaleX(-1);
}
#epilogueHint {
  margin-top: 40px;
  font-family: var(--ui-font);
  font-size: 14px;
  color: #7a8298;
  animation: pulse 2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
 * NAV — fix tap responsiveness
 * ===================================================================== */
.nav-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* =====================================================================
 * TOUCH CONTROLS (D-pad + action buttons, mobile only)
 * ===================================================================== */
#touchControls {
  display: none;
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  right: calc(var(--nav-w) + 10px);
  z-index: 150;
  pointer-events: none;
  justify-content: space-between;
  align-items: flex-end;
}

#dpad {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 4px;
  pointer-events: auto;
}
.dpad-center {
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.dpad-btn {
  background: rgba(10,14,28,0.75);
  border: 2px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 0.1s;
}
.dpad-btn:active { background: rgba(74,90,128,0.6); }

#touchActionBtns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  align-items: center;
}
.touch-action-btn {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: rgba(10,14,28,0.75);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-family: var(--ui-font);
  transition: background 0.1s;
}
.touch-action-btn:active { background: rgba(255,213,74,0.25); }
.touch-action-map {
  border-color: #66aaff;
  color: #66aaff;
}

/* =====================================================================
 * RESPONSIVE — mobile (touch device)
 * ===================================================================== */
@media (hover: none) and (pointer: coarse) {
  #touchControls { display: flex; }
  #controls { display: none; }
}

/* =====================================================================
 * RESPONSIVE — landscape mobile (small height)
 * ===================================================================== */
@media (max-height: 520px) {
  :root {
    --nav-w: 62px;
    --panel-w: min(340px, 72vw);
  }

  /* Main menu adjustments */
  #mainMenu {
    background-size: cover;
    background-position: center;
    align-items: flex-end;
    padding-bottom: 24px;
  }
  #menuContent {
    margin-top: 0;
    padding: 10px;
    background: transparent;
    backdrop-filter: none;
    transform: none;
    width: 100%;
  }
  .menu-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    width: 100%;
  }
  .menu-btn, .menu-btn.alt-btn {
    width: auto;
    max-width: none;
    padding: 10px 16px;
    font-size: 12px;
  }


  /* Smaller nav buttons */
  .nav-btn { padding: 8px 4px 6px; font-size: 9px; }
  .nav-btn img { width: 28px; height: 28px; }
  #sideNav { gap: 0; padding: 4px 4px; }

  /* Smaller dialog */
  #dialog { padding: 12px 16px; }
  #dialogText { font-size: 14px; }
  #dialogHint { font-size: 10px; margin-top: 8px; }

  /* Puzzle: stack vertically, but optimized for landscape mobile */
  #bentoBox {
    flex-direction: column;
    width: min(98vw, 840px);
    max-height: 92vh;
    overflow: hidden; /* Avoid double scrollbars */
  }
  #bentoLeft {
    min-width: 0;
    padding: 12px;
    height: 100%;
    overflow: hidden !important; /* Columns scroll instead */
    display: flex;
    flex-direction: column;
  }
  .bento-left-content {
    flex-direction: row;
    gap: 16px;
    align-items: stretch;
    height: 100%;
    min-height: 0;
  }
  .puzzle-info-column {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
  }
  .puzzle-interact-column {
    flex: 1.1;
    overflow-y: auto;
    padding-right: 6px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
  }
  #bentoRight {
    min-width: 0;
    flex: 1;
    padding: 12px;
    height: 100%;
    overflow-y: auto;
  }

  /* Hide bentoRight (Panduan) by default on landscape mobile and show Toggle Help button */
  #bentoBox #bentoRight {
    display: none !important;
  }
  #puzzleToggleHelp {
    display: inline-block !important;
  }
  #puzzleJumpToInput {
    display: inline-block !important;
  }

  /* When show-help is active, hide the puzzle and show the guide */
  #bentoBox.show-help #bentoLeft {
    display: none !important;
  }
  #bentoBox.show-help #bentoRight {
    display: flex !important;
    width: 100%;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
  }
  #puzzleCloseHelp {
    display: block !important;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #2a3043;
    border: 1px solid var(--accent);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    align-self: flex-start;
  }

  /* Make elements inside #bentoLeft super compact on mobile landscape */
  #puzzleTitle { font-size: 16px; }
  #puzzleKind { margin: 2px 0 6px; font-size: 10px; padding: 1px 6px; }
  #puzzlePrompt {
    padding: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.4;
    max-height: 120px;
    overflow-y: auto;
  }
  .puzzle-cipher { margin-bottom: 8px; }
  #puzzleCipher { font-size: 16px; }
  #puzzleInput {
    padding: 8px 10px;
    font-size: 14px;
    margin-top: 6px;
  }
  #puzzleFeedback { min-height: 15px; margin: 4px 2px; font-size: 12px; }
  .puzzle-actions { margin-top: 8px; gap: 6px; }
  .puzzle-actions button { padding: 6px 12px; font-size: 12px; }

  /* Make Caesar Simulator compact on landscape mobile */
  .sim-caesar-controls { gap: 10px; }
  .sim-btn { width: 32px; height: 32px; font-size: 14px; }
  .sim-shift-val { font-size: 20px; width: 35px; }
  .sim-alphabet-box { padding: 6px 10px; }
  .sim-alpha-row { font-size: 11px; margin: 2px 0; }
  .sim-preview-box { padding: 8px; }

  /* Compact touch controls */
  #dpad {
    grid-template-columns: repeat(3, 46px);
    grid-template-rows: repeat(3, 46px);
    gap: 3px;
  }
  .dpad-btn { font-size: 15px; }
  .touch-action-btn { width: 50px; height: 50px; font-size: 15px; }
  #touchControls { bottom: 10px; }
}

/* =====================================================================
 * RESPONSIVE — narrow screens (small width, e.g. portrait phones)
 * ===================================================================== */
@media (max-width: 500px) {
  :root {
    --nav-w: 58px;
    --panel-w: calc(100vw - var(--nav-w));
  }

  .nav-btn { padding: 8px 2px 6px; font-size: 8px; }
  .nav-btn img { width: 26px; height: 26px; }

  #dialog { width: 92vw; padding: 12px 14px; }
  #dialogText { font-size: 14px; }

  .modal-box { padding: 20px 16px; }
  .modal-header h2 { font-size: 18px; }
}

/* =====================================================================
 * RESPONSIVE — safe area for notched / rounded phones
 * ===================================================================== */
@supports (padding: env(safe-area-inset-bottom)) {
  #sideNav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* =====================================================================
 * DIALOG HINT — responsive text
 * ===================================================================== */
.hint-touch  { display: none; }
.hint-desktop { display: inline; }

@media (hover: none) and (pointer: coarse) {
  .hint-touch   { display: inline; }
  .hint-desktop { display: none; }
}

/* =====================================================================
 * FULLSCREEN BUTTON
 * ===================================================================== */
#fullscreenBtn {
  position: fixed;
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  background: rgba(8, 10, 18, 0.75);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 7px;
  color: rgba(255,255,255,0.55);
  font-size: 17px;
  cursor: pointer;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  line-height: 1;
  padding: 0;
  font-family: system-ui, sans-serif;
}
#fullscreenBtn:hover,
#fullscreenBtn:active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(8, 10, 18, 0.95);
}

/* =====================================================================
 * ORIENTATION PROMPT (portrait + touch device only)
 * ===================================================================== */
#orientationPrompt {
  display: none;
  position: fixed;
  inset: 0;
  background: #06070a;
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  color: #fff;
  text-align: center;
  padding: 40px;
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  #orientationPrompt { display: flex; }
}

/* Phone icon that animates into landscape */
.orient-phone {
  position: relative;
  width: 52px;
  height: 86px;
  border: 3px solid var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: phone-tilt 2.4s ease-in-out infinite;
}
.orient-screen {
  width: 34px;
  height: 54px;
  background: rgba(255,213,74,0.12);
  border-radius: 4px;
}
.orient-dot {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

@keyframes phone-tilt {
  0%, 35%  { transform: rotate(0deg); }
  65%, 100% { transform: rotate(-90deg); }
}

.orient-text {
  font-size: 18px;
  color: #e0e4f0;
  letter-spacing: 0.3px;
}
.orient-sub {
  font-size: 13px;
  color: var(--dim);
}

/* =====================================================================
 * LOADING SCREEN
 * ===================================================================== */
#loadingScreen {
  position: absolute;
  inset: 0;
  background-color: #06070a;
  background-image: url("Asset/bg/tile.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.8s ease-in-out, visibility 0.8s;
  text-align: center;
}
#loadingScreen.fade-out {
  opacity: 0;
  visibility: hidden;
}
#loadingContent {
  width: min(450px, 90vw);
  background: rgba(10, 12, 20, 0.9);
  padding: 40px;
  border-radius: 14px;
  border: 1px solid #4a5a80;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}
.loading-title {
  font-family: "Consolas", monospace;
  font-size: 26px;
  letter-spacing: 3px;
  margin-bottom: 8px;
  color: #fff;
  text-shadow: 0 0 10px rgba(117, 255, 145, 0.2);
}
.loading-subtitle {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 24px;
}
.progress-container {
  width: 100%;
  height: 6px;
  background: #181d2b;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
#progressBar {
  width: 0%;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: width 0.15s ease-out;
}
#loadingStatus {
  font-family: "Consolas", monospace;
  font-size: 20px;
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 8px;
}
.loading-file {
  font-family: "Consolas", monospace;
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 20px;
}
#loadingPlayBtn {
  margin: 10px auto 0;
  display: block;
}

/* =====================================================================
 * CREDIT SCREEN MODAL & CARDS
 * ===================================================================== */
.credit-modal-box {
  max-width: 900px;
  width: 95%;
  background: rgba(10, 12, 20, 0.96);
  border: 1px solid var(--accent);
  box-shadow: 0 0 40px rgba(255, 213, 74, 0.15);
}

.credit-screen {
  text-align: center;
  padding: 10px 0;
}

.credit-head {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(255, 213, 74, 0.25);
}

.credit-task {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 30px;
  font-family: "Consolas", monospace;
  letter-spacing: 1px;
}

.credit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  justify-content: center;
  margin-top: 10px;
}

.cr-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.cr-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.cr-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 213, 74, 0.12);
}

.cr-card:hover::before {
  opacity: 1;
}

.cr-role {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.cr-photo {
  width: 105px;
  height: 105px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  margin-bottom: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.cr-card:hover .cr-photo {
  transform: scale(1.06);
  border-color: var(--accent);
}

.cr-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  text-align: center;
}

.cr-nrp {
  font-family: "Consolas", monospace;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 12px;
}

.cr-email {
  font-size: 11px;
  color: var(--dim);
  text-align: center;
  word-break: break-all;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  width: 100%;
  padding-top: 12px;
  margin-top: auto;
  transition: color 0.3s;
}

.cr-card:hover .cr-email {
  color: #fff;
}

/* Responsive adjustments for credits screen */
@media (max-width: 768px) {
  .credit-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .credit-modal-box {
    max-width: 600px;
  }
}

@media (max-width: 520px) {
  .credit-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .cr-card {
    padding: 18px 12px;
  }
  .credit-head {
    font-size: 20px;
  }
  .credit-modal-box {
    max-height: 85vh;
    overflow-y: auto;
  }
}

/* =====================================================================
 * CHEATSHEET & SCROLL UX IMPROVEMENTS
 * ===================================================================== */
.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 8px;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cheatsheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px 4px;
  font-family: "Consolas", monospace;
  font-size: 11px;
  transition: background-color 0.2s, border-color 0.2s;
}

.cheatsheet-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

.cheatsheet-item .char-lbl {
  color: var(--accent);
  font-weight: 700;
  font-size: 10px;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.cheatsheet-item .char-val {
  color: #fff;
  font-weight: 600;
}

.scroll-indicator-hint {
  display: none;
  font-size: 11px;
  color: var(--accent);
  text-align: center;
  padding: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  margin-top: 12px;
  letter-spacing: 0.5px;
  animation: pulse-scroll-hint 1.5s infinite alternate;
  background: rgba(255, 213, 74, 0.03);
  border-radius: 6px;
}

@keyframes pulse-scroll-hint {
  0% { opacity: 0.35; transform: scale(0.99); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-height: 520px) {
  .scroll-indicator-hint {
    display: block;
  }
}

/* Mobile: make sure puzzle actions remain reachable */
@media (hover: none) and (pointer: coarse) {
  #puzzleJumpToInput { touch-action: manipulation; }
}

/* Custom scrollbars to ensure scrollability is obvious */
.bento-panel::-webkit-scrollbar,
.cheatsheet-grid::-webkit-scrollbar,
.puzzle-info-column::-webkit-scrollbar,
.puzzle-interact-column::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.bento-panel::-webkit-scrollbar-track,
.cheatsheet-grid::-webkit-scrollbar-track,
.puzzle-info-column::-webkit-scrollbar-track,
.puzzle-interact-column::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.bento-panel::-webkit-scrollbar-thumb,
.cheatsheet-grid::-webkit-scrollbar-thumb,
.puzzle-info-column::-webkit-scrollbar-thumb,
.puzzle-interact-column::-webkit-scrollbar-thumb {
  background: #4a5a80;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.bento-panel::-webkit-scrollbar-thumb:hover,
.cheatsheet-grid::-webkit-scrollbar-thumb:hover,
.puzzle-info-column::-webkit-scrollbar-thumb:hover,
.puzzle-interact-column::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}


