/* kanga — playful, paper-feel blog */

:root {
  --paper: #fbf6ec;
  --paper-shade: #f3ead8;
  --ink: #2a2622;
  --ink-soft: #5a5048;
  --accent: #d94a3a;
  --accent-soft: #f7b7a3;
  --rule: #d9cdb4;
  --highlight: #fce98f;

  /* Arcade palette for the index */
  --neon-pink:   #ff3aa1;
  --neon-yellow: #ffd23a;
  --neon-green:  #3aff89;
  --neon-blue:   #3a8aff;
  --neon-orange: #ff6b3a;
  --neon-magenta:#c43aff;
  --neon-cyan:   #3affe2;
  --night:       #0a0420;
  --night-2:     #1b0e3a;
  --night-3:     #2b0e5a;
  --cream:       #fbf6ec;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  line-height: 1.6;
}

body {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(217, 74, 58, 0.05) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 60%, rgba(80, 100, 60, 0.05) 0 2px, transparent 3px),
    radial-gradient(circle at 30% 85%, rgba(40, 80, 130, 0.04) 0 2px, transparent 3px);
  background-size: 220px 220px, 320px 320px, 280px 280px;
}

#rain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

/* Masthead */
.mast {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
}
.mast h1 {
  font-size: 64px;
  margin: 0;
  letter-spacing: -2px;
  font-weight: 800;
  font-style: italic;
  color: var(--ink);
  transform: rotate(-2deg);
}
.mast .stamp {
  display: inline-block;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", serif;
  font-size: 18px;
  letter-spacing: 2px;
  padding: 4px 12px;
  transform: rotate(4deg);
  margin-bottom: 12px;
}
.tagline {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 36px 4px;
  font-size: 18px;
}
.kb-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.kb-link:hover { text-decoration: underline; }
.kb-icon {
  height: 2.4em;
  width: auto;
  vertical-align: middle;
  margin-left: 0.5em;
  transform: rotate(-10deg);
  transform-origin: center;
}

.rule {
  border: none;
  border-top: 1px dashed var(--rule);
  margin: 28px 0;
}

/* Post list */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-list li {
  margin: 0 0 32px;
  padding: 18px 20px;
  background: var(--paper-shade);
  border-radius: 4px;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.06);
  transform: rotate(-0.3deg);
  transition: transform 120ms ease;
}
.post-list li:nth-child(even) { transform: rotate(0.4deg); }
.post-list li:hover { transform: rotate(0deg) translateY(-2px); }
.post-list .date {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}
.post-list h2 {
  margin: 4px 0 6px;
  font-size: 26px;
}
.post-list h2 a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(transparent 65%, var(--highlight) 65%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 220ms ease;
  padding: 0 2px;
}
.post-list h2 a:hover { background-size: 100% 100%; }
.post-list .blurb {
  margin: 0;
  color: var(--ink-soft);
}
.post-list .tag {
  display: inline-block;
  font-size: 11px;
  font-family: "Courier New", monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 8px;
}

.post-list .actions {
  margin: 14px 0 4px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.post-list .action {
  display: inline-block;
  padding: 7px 16px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-decoration: none;
  border-radius: 3px;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.post-list .action.play {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.post-list .action.play:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.post-list .action.read {
  color: var(--ink);
  border: 1px solid var(--rule);
  background: transparent;
}
.post-list .action.read:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Footer */
footer {
  margin-top: 60px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  font-style: italic;
}

/* Post page */
.back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--ink-soft);
  text-decoration: none;
  font-family: "Courier New", monospace;
  font-size: 13px;
}
.back:hover { color: var(--accent); }

.post-head h1 {
  font-size: 38px;
  margin: 0 0 4px;
  line-height: 1.15;
}
.post-head .meta {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

.kanji-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  background: var(--paper-shade);
  padding: 24px;
  border-radius: 6px;
  margin: 28px 0 36px;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.06);
}
.kanji-card .glyph {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", serif;
  font-size: 110px;
  line-height: 1;
  color: var(--ink);
}
.kanji-card .info dt {
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 8px;
}
.kanji-card .info dt:first-child { margin-top: 0; }
.kanji-card .info dd {
  margin: 2px 0 0;
  font-size: 17px;
}

/* Game */
.game {
  background: var(--paper-shade);
  border: 1px dashed var(--rule);
  border-radius: 6px;
  padding: 22px;
  margin: 24px 0;
}
.game h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.game p.howto {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-style: italic;
}
.stage {
  position: relative;
  background: var(--paper);
  border-radius: 4px;
  height: 360px;
  overflow: hidden;
  user-select: none;
  cursor: grab;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.stage.pulling { cursor: grabbing; }

.target-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(217, 74, 58, 0.12);
  border-left: 2px dashed var(--accent);
  border-right: 2px dashed var(--accent);
  pointer-events: none;
}

.anchor, .knot {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.anchor {
  left: 40px;
  background: var(--ink);
}
.knot {
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background 120ms;
}
.knot.snapped { background: #888; }

.band {
  position: absolute;
  top: 50%;
  left: 40px;
  height: 4px;
  background: var(--ink);
  transform-origin: left center;
  transform: translateY(-50%);
  border-radius: 2px;
}

.scoreboard {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 14px 0 0;
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: var(--ink-soft);
}
.scoreboard b {
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  margin-left: 4px;
}
.scoreboard .msg {
  margin-left: auto;
  font-style: italic;
  color: var(--accent);
}

.strokes {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.stroke-pip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Hiragino Mincho ProN", serif;
  font-size: 13px;
  color: var(--rule);
  transition: all 200ms ease;
}
.stroke-pip.lit {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.08);
}

.controls {
  margin-top: 16px;
}
button.btn {
  font-family: inherit;
  font-size: 14px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 1px;
}
button.btn:hover { background: var(--accent); }

.notes {
  margin-top: 32px;
  font-size: 15px;
  color: var(--ink-soft);
}
.notes p { margin: 0 0 10px; }

/* ====================================================================
   Index page — arcade theme. Scoped to body.index so post pages keep
   their paper feel.
   ==================================================================== */

body.index {
  background:
    radial-gradient(ellipse at 50% -10%, var(--night-3), transparent 60%),
    linear-gradient(180deg, var(--night-2) 0%, var(--night) 100%);
  background-attachment: fixed;
  color: var(--cream);
  min-height: 100vh;
}

body.index .mast h1 {
  color: var(--neon-yellow);
  text-shadow:
    3px 0 0 var(--neon-pink),
    0 4px 0 rgba(0, 0, 0, 0.45);
}

body.index .mast .stamp {
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  background: rgba(255, 58, 161, 0.08);
}

body.index .tagline {
  color: var(--cream);
}
body.index .kb-link {
  color: var(--neon-yellow);
}

body.index .rule {
  border-top: 2px dashed var(--neon-pink);
  opacity: 0.7;
}

body.index .post-list li {
  color: var(--night);
  box-shadow:
    5px 6px 0 rgba(0, 0, 0, 0.45),
    inset 0 0 0 2px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
}
body.index .post-list li:nth-child(6n+1) { background: var(--neon-pink); }
body.index .post-list li:nth-child(6n+2) { background: var(--neon-yellow); }
body.index .post-list li:nth-child(6n+3) { background: var(--neon-green); }
body.index .post-list li:nth-child(6n+4) { background: var(--neon-blue); }
body.index .post-list li:nth-child(6n+5) { background: var(--neon-orange); }
body.index .post-list li:nth-child(6n)   { background: var(--neon-magenta); }

body.index .post-list .date {
  color: rgba(0, 0, 0, 0.55);
}
body.index .post-list h2 a {
  color: var(--night);
  background-image: linear-gradient(transparent 65%, rgba(0, 0, 0, 0.18) 65%);
}
body.index .post-list h2 a:hover {
  background-image: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.18) 0%);
}
body.index .post-list .blurb {
  color: rgba(0, 0, 0, 0.78);
}

body.index .post-list .action.play {
  background: var(--night);
  color: var(--cream);
  border-color: var(--night);
}
body.index .post-list .action.play:hover {
  background: var(--cream);
  color: var(--night);
  border-color: var(--cream);
}
body.index .post-list .action.read {
  color: var(--night);
  border-color: rgba(0, 0, 0, 0.45);
}
body.index .post-list .action.read:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--night);
  border-color: var(--night);
}
