/* HACKTOONS Reader Engine Styles */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Segoe UI',system-ui,sans-serif; background:#fdf6e3; color:#3a3a3a; }
header { text-align:center; padding:26px 14px 14px; }
header .brand { font-size:1.05rem; letter-spacing:4px; color:#2b6cb0; font-weight:700; text-decoration:none; }
header h1 { font-size:clamp(1.5rem,4vw,2.4rem); margin-top:8px; }
header .sub { color:#777; font-style:italic; margin-top:4px; }
.sharebar { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; padding:14px; }
.sharebar a, .sharebar button, .sharebtn {
  display:inline-flex; align-items:center; gap:6px; padding:9px 16px; border-radius:12px;
  border:3px solid #3a3a3a; font-weight:700; font-size:.9rem; cursor:pointer;
  text-decoration:none; color:#fff; font-family:inherit; box-shadow:3px 3px 0 rgba(58,58,58,.25);
}
.sb-wa { background:#25d366; } .sb-x { background:#1d9bf0; } .sb-li { background:#0a66c2; }
.sb-tg { background:#229ed9; } .sb-pin { background:#e60023; } .sb-cp { background:#fff; color:#3a3a3a; } .sb-nav { background:#f9d976; color:#3a3a3a; }

.progress-wrap { width:min(96vw,1400px); margin:0 auto 4px; height:6px; background:#e9ecef; border-radius:999px; overflow:hidden; border:1px solid #ced4da; }
.progress-bar { height:100%; width:9%; background:#2b6cb0; transition:width .2s ease; border-radius:999px; }

.stage { position:relative; width:min(96vw,1400px); aspect-ratio:16/9; margin:14px auto 8px;
         border:5px solid #3a3a3a; border-radius:18px; overflow:hidden; background:#fff;
         box-shadow:8px 8px 0 rgba(58,58,58,.12); touch-action:pan-y pinch-zoom; cursor:pointer; }
.stage img { width:100%; height:100%; object-fit:contain; display:block; background:#fdf6e3; }
.stage-zoom { transform: scale(1.75); transition: transform .25s ease; cursor: zoom-out !important; }
.pagenum { position:absolute; top:10px; left:10px; background:#f9d976; border:3px solid #3a3a3a;
           border-radius:999px; padding:4px 14px; font-weight:bold; font-size:.9rem; }
.fs-btn { position:absolute; top:10px; right:10px; z-index:4; background:#fff; border:2px solid #3a3a3a;
          border-radius:10px; padding:6px 12px; font-weight:bold; font-size:.85rem; cursor:pointer; box-shadow:2px 2px 0 #3a3a3a; }
.fs-btn:active { transform:translate(1px,1px); box-shadow:1px 1px 0 #3a3a3a; }
.hint-tip { text-align:center; font-size:.78rem; color:#888; margin-top:2px; font-style:italic; }

nav { display:flex; gap:12px; align-items:center; justify-content:center; padding:10px; }
nav button { font-family:inherit; font-weight:bold; font-size:1rem; cursor:pointer; background:#b8e6c9;
             border:3px solid #3a3a3a; border-radius:12px; padding:8px 18px; box-shadow:3px 3px 0 #3a3a3a; }
nav button:disabled { opacity:.4; }

h2.sec { text-align:center; font-size:1.15rem; margin:26px 0 10px; letter-spacing:1px; }
.files { display:flex; gap:14px; justify-content:center; padding:8px 0 20px; flex-wrap:wrap; }
.files a { font-weight:700; color:#2b6cb0; border:3px solid #3a3a3a; background:#b8e6c9; border-radius:12px; padding:8px 16px; text-decoration:none; box-shadow:3px 3px 0 rgba(58,58,58,.25); }

.learn { display:flex; flex-wrap:wrap; gap:14px; justify-content:center; padding:0 4vw 16px; max-width:1200px; margin:0 auto; }
.lcard { width:270px; background:#fff; border:3px solid #3a3a3a; border-radius:14px; padding:14px 16px;
         font-size:.9rem; line-height:1.5; color:#444; box-shadow:4px 4px 0 rgba(58,58,58,.1); }
.lcard b { display:inline-flex; width:26px; height:26px; border-radius:999px; border:2px solid #3a3a3a;
           align-items:center; justify-content:center; margin-right:8px; color:#fff; font-size:.85rem; }
.lcard.att b { background:#f38f8f; }
.lcard.def b { background:#b8e6c9; color:#3a3a3a; }

footer { text-align:center; padding:20px 16px 40px; color:#999; font-size:.85rem; }
footer a { color:#2b6cb0; }
.disclaimer { max-width:900px; margin:0 auto 14px; font-size:.72rem; color:#999; line-height:1.4; padding:0 16px; }

.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:#3a3a3a; color:#fff;
         padding:10px 22px; border-radius:12px; font-weight:bold; opacity:0; transition:opacity .3s; pointer-events:none; }
.toast.show { opacity:1; }

/* Lightbox Modal Reader (Universal Dark Theater for Mobile & Desktop) */
body.lb-open { overflow: hidden !important; }
.lb-modal { display: none; position: fixed; inset: 0; width: 100vw; height: 100vh; background: #000; z-index: 10000000; flex-direction: column; justify-content: space-between; align-items: center; box-sizing: border-box; user-select: none; -webkit-user-select: none; }
.lb-modal.active { display: flex !important; }
.lb-top { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 20px; z-index: 3; background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, transparent 100%); }
.lb-counter { font-weight: 700; font-size: 0.95rem; color: #f9d976; white-space: nowrap; }
.lb-title { font-size: 0.92rem; color: #e2e8f0; margin: 0 14px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-weight: 500; }
.lb-close { background: #fff; color: #1a202c; border: 2px solid #1a202c; border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 0.95rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.4); touch-action: manipulation; }
.lb-close:active { transform: scale(0.96); }
.lb-body { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 0 10px; }
.lb-img-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; cursor: pointer; }
.lb-img-wrap img { max-width: 98vw; max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; display: block; border-radius: 4px; box-shadow: 0 0 40px rgba(0,0,0,0.9); transition: transform 0.2s ease; }
.lb-img-wrap img.lb-zoomed { transform: scale(1.8); cursor: zoom-out; }
.lb-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(30,30,30,0.7); color: #fff; border: 2px solid rgba(255,255,255,0.4); border-radius: 50%; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; cursor: pointer; z-index: 3; transition: background 0.15s ease, transform 0.15s ease; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-arrow:hover { background: rgba(255,255,255,0.95); color: #000; }
.lb-arrow:disabled { opacity: 0.2; cursor: default; }
.lb-bottom { display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; padding: 10px 16px 14px; background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 100%); z-index: 3; }
.lb-navbtn { background: #b8e6c9; color: #1a202c; border: 2px solid #1a202c; font-weight: 700; font-size: 0.95rem; border-radius: 12px; padding: 7px 20px; cursor: pointer; box-shadow: 2px 2px 0 rgba(0,0,0,0.4); touch-action: manipulation; }
.lb-navbtn:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.lb-bot-idx { color: #fff; font-weight: 700; font-size: 0.95rem; }

@media (max-width:768px) {
  header { padding:16px 12px 6px; }
  header h1 { font-size:1.65rem; }
  header .sub { font-size:.85rem; }
  .stage { width:100vw; margin:8px 0 4px; border-left:none; border-right:none; border-radius:0; box-shadow:none; border-width:3px; }
  .pagenum { position:static; display:block; margin:6px auto 2px; width:fit-content; max-width:92vw; text-align:center; white-space:normal; font-size:.82rem; line-height:1.35; border-radius:12px; padding:6px 14px; }
  nav { padding:8px 10px 14px; gap:16px; }
  nav button { font-size:1.05rem; padding:10px 22px; min-width:105px; border-radius:12px; touch-action:manipulation; }
  #idx { font-size:1.05rem; font-weight:700; }
  .sharebar { gap:6px; padding:8px; }
  .sharebar a, .sharebar button { padding:8px 12px; font-size:.85rem; }
  .sharebar a span.lbl, .sharebar button span.lbl { display:none; }
  .lcard { width:100%; max-width:360px; }
  .progress-wrap { width:96vw; }
  .lb-arrow { display: none; }
  .lb-title { display: none; }
  .lb-top { padding: 8px 14px; }
  .lb-bottom { padding: 6px 12px 12px; }
  .lb-img-wrap img { max-height: calc(100vh - 105px); max-width: 100vw; }
}

@media (max-height:500px) and (orientation:landscape) {
  header, .sharebar, h2.sec, .files, .learn, footer, .hint-tip { display:none !important; }
  body { background:#000; overflow:hidden; }
  .progress-wrap { display:none; }
  .stage { width:100vw; height:82vh; margin:0; border:none; border-radius:0; background:#000; }
  .stage img { height:100%; width:100%; object-fit:contain; background:#000; }
  .pagenum { display:none; }
  nav { position:fixed; bottom:0; left:0; right:0; background:rgba(0,0,0,0.85); padding:4px; z-index:10; }
  nav button { background:#f9d976; color:#000; padding:4px 18px; font-size:.9rem; }
  #idx { color:#fff; }
}
