:root {
  --bg: #ffffff;
  --fg: #111111;
  --accent: #7b2d5f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "BIZ UDPMincho", serif;
}

.viewport {
  width: 100vw;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.viewport:active { cursor: grabbing; }

.canvas {
  position: relative;
  width: 7600px;
  height: 100vh;
}

.word {
  position: absolute;
  margin: 0;
  white-space: nowrap;
  line-height: 1;
  user-select: none;
}

.kanji {
  font-size: clamp(32px, 4vw, 64px);
  letter-spacing: 0.08em;
  font-weight: 600;
}

.hira {
  font-size: clamp(20px, 2vw, 34px);
  letter-spacing: 0.18em;
}

.kata {
  font-size: clamp(28px, 3vw, 48px);
  letter-spacing: 0.22em;
  color: var(--accent);
}

.roma {
  font-size: clamp(18px, 1.7vw, 28px);
  letter-spacing: 0.2em;
  opacity: 0.72;
}

.ending {
  position: absolute;
  min-width: 320px;
}

.ending p {
  margin: 0 0 12px;
  font-size: 16px;
}

.ending a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
}

.hint {
  position: fixed;
  right: 16px;
  bottom: 16px;
  border: none;
  background: rgba(255,255,255,0.9);
  color: #111;
  padding: 10px 14px;
  font-size: 14px;
  letter-spacing: 0.08em;
}