*,
::before,
::after {
  box-sizing: border-box;
}

* {
  border: 0;
  border-radius: 0;
  margin: 0;
  outline: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1;
}

button {
  -webkit-appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1;
}

svg {
  display: block;
  border: 0;
}

::-webkit-scrollbar {
  display: none;
}

@keyframes wordmap-word-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 4px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}
@keyframes wordmap-panel-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.WordMap {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: floralwhite;
  color: #1c2228;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  cursor: grab;
  touch-action: none;
}
.WordMap-World {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-origin: 0 0;
  will-change: transform;
}
.WordMap-Lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}
.WordMap-Connector {
  fill: none;
  stroke: rgba(28, 34, 40, 0.3);
  stroke-width: 1;
  stroke-dasharray: 2, 5;
}
.WordMap-Words {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.WordMap-Word {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 4px 8px;
  color: #ccc;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: grab;
  user-select: none;
  touch-action: none;
  pointer-events: auto;
  animation: wordmap-word-in 0.45s ease-out;
  transition: color 0.15s ease;
}
.WordMap-Word[data-selected], .WordMap-Word[data-match] {
  color: #252525;
}
.WordMap-Center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  color: #252525;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.WordMap-Panels {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.WordMap-Panel {
  position: absolute;
  width: 320px;
  background-color: #fffdf7;
  border: 1px solid rgba(28, 34, 40, 0.14);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(20, 30, 25, 0.2), 0 2px 6px rgba(20, 30, 25, 0.1);
  pointer-events: auto;
  cursor: auto;
  animation: wordmap-panel-in 0.22s ease-out;
}
.WordMap-Panel-Header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.WordMap-Panel-Title {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 32px;
  padding: 0 16px;
  background-color: floralwhite;
  border-bottom-right-radius: 12px;
  color: #1c2228;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
}
.WordMap-Panel-CloseIcon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #6a7077;
  cursor: pointer;
}
.WordMap-Panel-CloseIcon svg {
  width: 9px;
}
.WordMap-Panel-CloseIcon:hover {
  color: #1c2228;
}
.WordMap-Panel-Body {
  padding: 14px 16px 16px;
}
.WordMap-Panel-Meaning {
  color: #3a4148;
  font-size: 15px;
  line-height: 1.6;
}
.WordMap-Panel-Meaning + .WordMap-Panel-Meaning {
  margin-top: 10px;
}
.WordMap-Panel-Body[data-kanji] {
  padding: 0 0 8px;
}
.WordMap-Panel-Glyph {
  margin: 14px 0 12px;
  color: #1c2228;
  font-family: "YuKyokasho Yoko", YuKyokasho, "Hiragino Mincho ProN", "Yu Mincho", YuMincho, serif;
  font-size: 56px;
  line-height: 1.1;
  text-align: center;
}
.WordMap-Panel-Facts {
  margin: 0 16px;
  border: 1px solid rgba(28, 34, 40, 0.08);
  border-radius: 2px;
}
.WordMap-Panel-Facts li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
}
.WordMap-Panel-Facts li + li {
  border-top: 1px solid rgba(28, 34, 40, 0.08);
}
.WordMap-Panel-Facts a {
  color: #1c2228;
  font-weight: 600;
  text-decoration: none;
}
.WordMap-Panel-Facts p {
  color: #1c2228;
  font-weight: 600;
}
.WordMap-Panel-Facts-Label {
  flex-shrink: 0;
  width: 40px;
  color: #6a7077;
  font-size: 12px;
}
.WordMap-Panel-Facts-Value {
  font-size: 14px;
}
.WordMap-Panel-Section {
  padding: 14px 16px 0;
}
.WordMap-Panel-Section-Head {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 8px;
  background-color: rgba(28, 34, 40, 0.045);
  border-radius: 2px;
  color: #6a7077;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.WordMap-Panel-Section-Body {
  position: relative;
  margin-left: 6px;
  padding-left: 14px;
}
.WordMap-Panel-Section-Body::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 1px;
  background-color: rgba(28, 34, 40, 0.14);
}
.WordMap-Panel-Reading + .WordMap-Panel-Reading {
  margin-top: 10px;
}
.WordMap-Panel-Reading-Name {
  color: #6a7077;
  font-size: 18px;
  text-decoration: none;
}
.WordMap-Panel-Reading-Name[data-tier=strong] {
  color: #c4574a;
  font-weight: 700;
}
.WordMap-Panel-Reading-Name[data-tier=mid] {
  color: #1c2228;
  font-weight: 700;
}
.WordMap-Panel-Reading-Stage {
  margin-left: 8px;
  padding: 3px 6px;
  background-color: rgba(28, 34, 40, 0.045);
  border-radius: 2px;
  color: #3a4148;
  font-size: 11px;
}
.WordMap-Panel-English {
  color: #3a4148;
  font-size: 15px;
  line-height: 1.6;
}

.CanvasSwitch {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 20;
  background: #fffdf7;
  border: 1px solid rgba(37, 37, 37, 0.12);
  border-radius: 2px;
  overflow: hidden;
  cursor: default;
  user-select: none;
}
.CanvasSwitch-Header {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  color: #6a7077;
  font-size: 11px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(37, 37, 37, 0.08);
}
.CanvasSwitch-List {
  padding: 4px;
}
.CanvasSwitch-Item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  color: #252525;
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
}
.CanvasSwitch-Item[data-selected] {
  background: rgba(37, 37, 37, 0.06);
}
.CanvasSwitch-Item-Check {
  display: flex;
  align-items: center;
  width: 14px;
  color: #252525;
  visibility: hidden;
}
.CanvasSwitch-Item[data-selected] .CanvasSwitch-Item-Check {
  visibility: visible;
}
.CanvasSwitch-Item-Label {
  white-space: nowrap;
}

.KanjiFilters {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 20;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.WordMap[data-canvas=kanji] .KanjiFilters {
  display: flex;
}

.KanjiFilter {
  width: 168px;
  background: #fffdf7;
  border: 1px solid rgba(37, 37, 37, 0.12);
  border-radius: 2px;
  overflow: hidden;
  cursor: default;
  user-select: none;
}
.KanjiFilter-Header {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  color: #6a7077;
  font-size: 11px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(37, 37, 37, 0.08);
}
.KanjiFilter-Grid {
  display: grid;
  gap: 2px;
  padding: 4px;
}
.KanjiFilter[data-kind=stroke] .KanjiFilter-Grid {
  grid-template-columns: repeat(6, 1fr);
}
.KanjiFilter[data-kind=grade] .KanjiFilter-Grid {
  grid-template-columns: repeat(3, 1fr);
}
.KanjiFilter[data-kind=test] .KanjiFilter-Grid {
  grid-template-columns: repeat(2, 1fr);
}
.KanjiFilter-Item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
}
.KanjiFilter-Item[data-selected] {
  background: rgba(37, 37, 37, 0.06);
  color: #252525;
}