/* ==========================================================
   BASE
========================================================== */

body {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================================
   PAPER BACKGROUND
========================================================== */

.paper-texture {
  position: fixed;
  inset: 0;
  background:
    url("../assets/textures/halftone.svg"), linear-gradient(#faf8f4, #f5f2ea);
  background-size: 180px, cover;
  opacity: 0.35;
  z-index: -3;
}

/* ==========================================================
   HALFTONE
========================================================== */

.halftone {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
  z-index: -2;
  background-image: radial-gradient(#000 1.2px, transparent 1.2px);
  background-size: 12px 12px;
}

.halftone-left {
  top: -120px;
  left: -120px;
}

.halftone-right {
  bottom: -150px;
  right: -150px;
}

/* ==========================================================
   SPEED LINES
========================================================== */

.speed-lines {
  position: fixed;
  inset: 0;
  background: url("../assets/textures/speedlines.svg");
  background-size: cover;
  opacity: 0.06;
  pointer-events: none;
}

/* ==========================================================
   FLOATING PANELS
========================================================== */

.floating-panels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.floating-panels span {
  position: absolute;
  border: 3px solid rgb(0 0 0 / 8%);
  background: rgb(255 255 255 / 35%);
}

.floating-panels span:nth-child(1) {
  width: 160px;
  height: 110px;
  left: 8%;
  top: 18%;
  transform: rotate(-10deg);
}

.floating-panels span:nth-child(2) {
  width: 140px;
  height: 180px;
  right: 7%;
  top: 15%;
  transform: rotate(8deg);
}

.floating-panels span:nth-child(3) {
  width: 180px;
  height: 110px;
  bottom: 12%;
  left: 12%;
  transform: rotate(6deg);
}

.floating-panels span:nth-child(4) {
  width: 150px;
  height: 160px;
  bottom: 8%;
  right: 10%;
  transform: rotate(-7deg);
}

/* ==========================================================
   MAIN CONTAINER
========================================================== */

.container {
  width: min(95%, 820px);
  margin: auto;
  padding: 3rem 0;
}

/* ==========================================================
   HEADER
========================================================== */

.chapter-box {
  border: var(--border-thick);
  background: white;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.chapter-small {
  font-size: 0.9rem;
  letter-spacing: 4px;
  color: var(--accent);
  font-weight: bold;
}

.chapter-box h1 {
  margin: 0.6rem 0;
  font-size: var(--fs-hero);
  font-family: var(--font-heading);
  letter-spacing: 2px;
}

.jp {
  font-size: 1rem;
  opacity: 0.65;
}

/* ==========================================================
   CARD
========================================================== */

.manga-card {
  position: relative;
  background: white;
  border: var(--border-thick);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  overflow: visible;
}

/* ==========================================================
   PANELS
========================================================== */

.panel {
  margin-bottom: 1.7rem;
}

.panel label {
  display: block;
  font-family: var(--font-title);
  letter-spacing: 2px;
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}

/* ==========================================================
   INPUT GROUP
========================================================== */

.input-group {
  display: flex;
  gap: 0.75rem;
}

.input-group input {
  flex: 1;
  height: 58px;
  border: var(--border-normal);
  padding: 0 1rem;
  font-size: 1rem;
  background: #fafafa;
  transition: var(--normal);
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================
   SMALL BUTTONS
========================================================== */

.input-group button {
  width: 100px;
  border: var(--border-normal);
  background: black;
  color: white;
  font-family: var(--font-title);
  letter-spacing: 2px;
  transition: var(--fast);
}

.input-group button:hover {
  background: var(--accent);
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================
   ACTION BUTTONS
========================================================== */

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.action-buttons button {
  height: 64px;
  border: var(--border-thick);
  font-size: 1.2rem;
  font-family: var(--font-title);
  letter-spacing: 3px;
  transition: var(--normal);
}

.primary {
  background: black;
  color: white;
}

.secondary {
  background: white;
  color: black;
}

.action-buttons button:hover {
  transform: translate(-5px, -5px);
  box-shadow: var(--shadow-md);
}

.primary:hover {
  background: var(--accent);
}

.secondary:hover {
  background: #efefef;
}

/* ==========================================================
   OUTPUT
========================================================== */

.output-panel {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  margin-top: 2rem;
  padding: 3rem;
  background: #fff;
  border: 5px solid #111;
  overflow: hidden;
}

.output-placeholder {
  position: relative;
  z-index: 2;
  font-family: var(--font-title);
  letter-spacing: 3px;
  color: #666;
}

/* ==========================================================
   FOOTER
========================================================== */

footer {
  margin-top: 2rem;
  text-align: center;
  font-style: italic;
  opacity: 0.65;
}

.corner {
  position: absolute;
  width: 70px;
  height: 70px;
  border: 5px solid black;
}

.corner.tl {
  top: -5px;
  left: -5px;
  border-right: none;
  border-bottom: none;
}

.corner.tr {
  top: -5px;
  right: -5px;
  border-left: none;
  border-bottom: none;
}

.corner.bl {
  bottom: -5px;
  left: -5px;
  border-right: none;
  border-top: none;
}

.corner.br {
  bottom: -5px;
  right: -5px;
  border-left: none;
  border-top: none;
}

/* ==========================================================
   COMPLETION RESULT
========================================================== */

.completion-result {
  width: 100%;
  display: grid;
  gap: 1rem;
  text-align: center;
}

.completion-result > * {
  position: relative;
  padding: 1rem 0;
}

.completion-result > *::before {
  content: "";
  position: absolute;
  left: 4%;
  top: 0;
  width: 92%;
  height: 3px;
  background: #111;
}

.completion-result > *:last-child::after {
  content: "";
  position: absolute;
  left: 6%;
  bottom: 0;
  width: 92%;
  height: 6px;
  background: #111;
}

.completion-result h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 7vw, 5rem);
  line-height: 0.9;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.completion-result h3 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 3px;
}

.status {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 10px;
  color: #777;
}

.time {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 3px;
}
