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

:root {
  --ink: #2b2826;
  --ink-soft: #5a544f;
  --red: #c0392b;
  --blue: #2b5b8c;
  --paper: #f6efe1;
  --paper-dark: #ebe0c8;
  --line: #cfc2a4;
  --marker: #ffe97a;
}

body {
  background: #d9cdb0;
  color: var(--ink);
  font-family: "Klee One", "Yu Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  font-weight: 400;
  line-height: 1.9;
  padding: 30px 12px;
}

/* ===== Paper (the notebook) ===== */
.paper {
  max-width: 880px;
  margin: 0 auto;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 35px,
      rgba(150, 130, 90, 0.18) 35px,
      rgba(150, 130, 90, 0.18) 36px
    ),
    radial-gradient(ellipse at top left, #fbf6e8 0%, var(--paper) 60%, var(--paper-dark) 100%);
  padding: 60px 50px 80px;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 20px 40px rgba(0,0,0,0.25),
    0 60px 60px -30px rgba(0,0,0,0.2);
  border-radius: 4px;
}

/* Left margin red line */
.paper::before {
  content: "";
  position: absolute;
  left: 80px; top: 0; bottom: 0;
  width: 1.5px;
  background: rgba(192, 57, 43, 0.4);
}

/* Three-hole punch */
.paper::after {
  content: "";
  position: absolute;
  left: 22px; top: 0; bottom: 0;
  width: 16px;
  background:
    radial-gradient(circle at 50% 12%, #c5b894 0 6px, transparent 7px),
    radial-gradient(circle at 50% 50%, #c5b894 0 6px, transparent 7px),
    radial-gradient(circle at 50% 88%, #c5b894 0 6px, transparent 7px);
}

/* ===== Section block ===== */
.block {
  position: relative;
  padding: 30px 0 40px 70px;
  border-bottom: 1.5px dashed var(--line);
}
.block:last-of-type { border-bottom: none; }

.margin-note {
  position: absolute;
  left: 0;
  top: 38px;
  font-family: "Yomogi", cursive;
  font-size: 0.85rem;
  color: var(--red);
  transform: rotate(-6deg);
  letter-spacing: 0.05em;
}

/* ===== Headings (handwritten) ===== */
.h-handwrite {
  font-family: "Yomogi", "Klee One", cursive;
  font-size: 1.8rem;
  color: var(--ink);
  margin-bottom: 18px;
  display: inline-block;
  position: relative;
  letter-spacing: 0.03em;
}
.h-handwrite::after {
  content: "";
  position: absolute;
  left: -4px; right: -8px;
  bottom: -4px;
  height: 8px;
  background: var(--marker);
  z-index: -1;
  opacity: 0.65;
  transform: skewX(-12deg) rotate(-1deg);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 40px 0 50px 70px;
  border-bottom: 1.5px dashed var(--line);
  position: relative;
}
.kicker {
  font-family: "Yomogi", cursive;
  color: var(--red);
  font-size: 0.95rem;
  margin-bottom: 14px;
  letter-spacing: 0.1em;
}
.title-main {
  display: block;
  font-family: "Shippori Mincho", serif;
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(192,57,43,0.15);
}
.title-sub {
  display: block;
  font-family: "Yomogi", cursive;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-top: 12px;
}
.hero-doodle {
  margin-top: 30px;
  font-family: "Yomogi", cursive;
  color: var(--ink-soft);
}
.tile-mini { font-size: 2rem; }
.arrow { display: block; font-size: 1.3rem; color: var(--red); margin: 4px 0; }
.hand-note { display: inline-block; transform: rotate(-3deg); }

/* Washi tape */
.washi-tape {
  position: absolute;
  width: 140px;
  height: 28px;
  background: rgba(192, 57, 43, 0.35);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.2) 0 8px,
    transparent 8px 16px
  );
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tape-1 { top: -8px; left: 100px; transform: rotate(-6deg); }
.tape-2 {
  top: -8px; right: 60px; transform: rotate(8deg);
  background: rgba(43, 91, 140, 0.3);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.2) 0 8px, transparent 8px 16px);
}

/* ===== Body text ===== */
.body {
  font-size: 1.02rem;
  margin-bottom: 16px;
}
.marker {
  background: linear-gradient(transparent 60%, var(--marker) 60%);
  padding: 0 2px;
}
.underline-wave {
  text-decoration: underline wavy var(--red);
  text-underline-offset: 4px;
}
.hand-note-inline {
  font-family: "Yomogi", cursive;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ===== Post-it ===== */
.post-it {
  display: inline-block;
  padding: 18px 20px;
  font-family: "Yomogi", cursive;
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow:
    2px 4px 0 rgba(0,0,0,0.08),
    0 6px 10px rgba(0,0,0,0.12);
  margin: 18px 12px;
  position: relative;
}
.post-it.pink   { background: #ffd6e0; }
.post-it.yellow { background: #fff6a8; }
.post-it.blue   { background: #cfe4ff; }
.rotate-l { transform: rotate(-3deg); }
.rotate-r { transform: rotate(2.5deg); }

/* ===== Check list ===== */
.check-list {
  list-style: none;
  margin: 20px 0;
  font-family: "Yomogi", cursive;
  font-size: 1.05rem;
}
.check-list li {
  padding: 4px 0;
}

/* ===== Tiles ===== */
.tile-sketch {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 30px 0;
}
.tile-card {
  background: #fffaf0;
  padding: 18px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  flex: 1 1 360px;
  box-shadow: 3px 4px 0 rgba(0,0,0,0.08);
}
.tile-card h3 {
  font-family: "Yomogi", cursive;
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--red);
}
.tile-card h3 small {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-left: 6px;
  font-weight: normal;
}
.tile-card .caption {
  font-family: "Yomogi", cursive;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 10px;
}
.hand-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 32px;
  height: 46px;
  padding: 2px;
  background: #fffef5;
  border: 1.3px solid var(--ink);
  border-radius: 5px;
  font-family: "Shippori Mincho", serif;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.05;
  color: var(--ink);
  box-shadow:
    inset 0 -3px 0 rgba(0,0,0,0.08),
    1px 1px 0 rgba(0,0,0,0.1);
  /* slight wobble */
  transform: rotate(var(--w, 0deg));
}
.tile:nth-child(2n)   { --w: -1deg; }
.tile:nth-child(3n)   { --w: 1.2deg; }
.tile:nth-child(5n+1) { --w: 0.6deg; }
.tile.pin   { color: var(--blue); font-size: 1.1rem; }
.tile.sou   { color: #2e7d32; }
.tile.ji    { background: #fff8e0; }
.tile.haku  { background: #ffffff; border-width: 2px; border-color: var(--blue); }
.tile.hatsu { color: #2e7d32; }
.tile.chun  { color: var(--red); }

/* ===== Agari example ===== */
.agari-example {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  margin: 24px 0 8px;
  padding: 22px 16px;
  background: rgba(255,255,255,0.4);
  border: 1.5px dashed var(--ink);
  border-radius: 6px;
}
.meld {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.meld > .tile { margin-bottom: 2px; }
.meld .meld-label {
  font-family: "Yomogi", cursive;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 6px;
  text-align: center;
  line-height: 1.4;
}
.meld > .tile + .tile { margin-top: 0; }
.meld {
  flex-direction: row;
  flex-wrap: wrap;
  max-width: 140px;
  justify-content: center;
  gap: 3px;
}
.plus {
  font-family: "Yomogi", cursive;
  font-size: 1.4rem;
  color: var(--red);
  align-self: center;
}

/* ===== Flow ===== */
.flow {
  list-style: none;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.flow li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-family: "Klee One", sans-serif;
}
.step-num {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border: 2px solid var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: "Yomogi", cursive;
  font-weight: 600;
  color: var(--red);
  background: #fffaf0;
  transform: rotate(-4deg);
}
.flow li:nth-child(2n) .step-num { transform: rotate(5deg); }

/* ===== Yaku cards ===== */
.yaku-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 22px;
  margin-top: 24px;
}
.yaku-card {
  background: #fffaf0;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 16px 16px 18px;
  box-shadow: 3px 4px 0 rgba(0,0,0,0.1);
  position: relative;
}
.yaku-card h3 {
  font-family: "Yomogi", cursive;
  font-size: 1.25rem;
  color: var(--red);
  margin: 4px 0 8px;
}
.yaku-card p {
  font-size: 0.9rem;
  line-height: 1.7;
}
.han {
  position: absolute;
  top: -10px; right: -8px;
  background: var(--red);
  color: #fff;
  font-family: "Yomogi", cursive;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 14px;
  transform: rotate(8deg);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.15);
}

/* ===== Score table ===== */
.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: "Klee One", sans-serif;
}
.score-table th, .score-table td {
  padding: 10px 12px;
  border-bottom: 1.5px dotted var(--line);
  text-align: left;
}
.score-table th {
  font-family: "Yomogi", cursive;
  color: var(--red);
  border-bottom: 2px solid var(--ink);
}
.score-table td.big {
  font-family: "Yomogi", cursive;
  color: var(--red);
  font-size: 1.1rem;
}

/* ===== Manner ===== */
.manner {
  list-style: none;
  margin: 20px 0;
  font-family: "Klee One", sans-serif;
  font-size: 1rem;
}
.manner li { padding: 6px 0; }

.closing {
  margin-top: 30px;
  font-family: "Yomogi", cursive;
  color: var(--ink-soft);
}
.sign {
  text-align: right;
  font-family: "Yomogi", cursive;
  color: var(--ink-soft);
  margin-top: 20px;
  transform: rotate(-2deg);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 30px 0 0;
  font-family: "Yomogi", cursive;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  body { padding: 10px 4px; }
  .paper { padding: 40px 24px 50px 50px; }
  .paper::before { left: 38px; }
  .paper::after { left: 8px; width: 12px; }
  .block { padding-left: 0; }
  .margin-note {
    position: static;
    transform: rotate(-3deg);
    display: inline-block;
    margin-bottom: 8px;
  }
  .hero { padding-left: 0; }
  .title-main { font-size: 2.4rem; }
  .h-handwrite { font-size: 1.4rem; }
  .agari-example { justify-content: center; }
}
