:root {
  --bg-color: #f8f8f8;
  --surface: #ffffff;
  --text-main: #111111;
  --text-sub: #666666;
  --text-faint: #999999;
  --accent: #000000;
  --border: #dddddd;
  --border-dark: #bcbcbc;
  --ok: #1c6b3c;
  --bad: #a82f2f;
  --max-width: 910px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg-color); }
body {
  min-height: 100vh;
  background: var(--bg-color);
  color: var(--text-main);
  font-family: 'Helvetica Neue', Helvetica, Arial, 'Noto Sans JP', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
input:focus { outline: none; }

.site-shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 36px 0 calc(30px + env(safe-area-inset-bottom));
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 14px;
}

.eyebrow,
.section-index {
  color: var(--text-sub);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1.5;
}

h1 {
  margin-top: 5px;
  font-size: clamp(1.75rem, 5.5vw, 2.45rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.55rem, 5vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.18;
}

.text-button {
  border: 0;
  background: none;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  padding: 7px 0;
  transition: color .18s ease;
}
.text-button:hover { color: var(--text-main); }

.mode-tabs {
  display: flex;
  width: 100%;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.mode-tabs::-webkit-scrollbar { display: none; }
.mode-tab {
  position: relative;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  padding: 11px 0 10px;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.mode-tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
}
.mode-tab:hover { color: var(--text-main); }
.mode-tab.active { color: var(--text-main); font-weight: 500; }
.mode-tab.active::after { background: var(--accent); }

main { min-height: 520px; }
.view { display: none; padding-top: 30px; }
.view.active { display: block; animation: viewIn .22s ease-out both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-copy {
  max-width: 640px;
  padding: 18px 0 30px;
}
.hero-copy h2 { margin-top: 9px; }
.lead {
  max-width: 600px;
  margin-top: 20px;
  color: var(--text-sub);
  font-size: 0.92rem;
  line-height: 1.9;
  letter-spacing: 0.01em;
}

.section-head {
  border-bottom: 1px solid var(--accent);
  padding-bottom: 16px;
  margin-bottom: 27px;
}
.section-head h2 { margin-top: 7px; }

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  column-gap: 38px;
  row-gap: 26px;
  align-items: start;
}
.profile-table { border-top: 1px solid var(--border-dark); }
.profile-table > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.profile-table dt {
  color: var(--text-sub);
  font-size: .78rem;
  letter-spacing: .02em;
}
.profile-table dd { font-size: .95rem; line-height: 1.55; }
.subtle { color: var(--text-sub); }
.profile-side { min-width: 0; }
.profile-image-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ededed;
  overflow: hidden;
}
.profile-image-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.profile-links a {
  color: var(--text-sub);
  font-size: .78rem;
  text-decoration: none;
}
.profile-links a:hover { color: var(--text-main); text-decoration: underline; text-underline-offset: 3px; }
.profile-note {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-dark);
  padding-top: 13px;
  max-width: 720px;
}
.profile-note p { color: var(--text-sub); font-size: .88rem; line-height: 1.9; margin-bottom: 14px; }
.profile-note .mono-line { color: var(--text-faint); font-size: .74rem; letter-spacing: .01em; }

.game-shell { max-width: 680px; margin: 0 auto; }
.game-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0 0 9px;
  color: var(--text-sub);
  font-size: .78rem;
  letter-spacing: .01em;
}

.wadokai-board {
  display: grid;
  grid-template-columns: 1fr 84px 1fr;
  grid-template-rows: 92px 84px 92px;
  grid-template-areas:
    ". top ."
    "left center right"
    ". bottom .";
  align-items: center;
  justify-items: center;
  margin: 27px auto 25px;
  max-width: 380px;
}
.center-cell {
  grid-area: center;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  background: var(--accent);
  color: #fff;
  font-size: 2rem;
  font-weight: 500;
}
.arm { display: flex; align-items: center; gap: 8px; font-size: 1.75rem; }
.arm strong { font-weight: 500; }
.direction { color: var(--text-faint); font-size: .9rem; font-weight: 400; }
.arm-top { grid-area: top; flex-direction: column-reverse; gap: 2px; }
.arm-left { grid-area: left; }
.arm-right { grid-area: right; }
.arm-bottom { grid-area: bottom; flex-direction: column; gap: 2px; }

.answer-form { border-top: 1px solid var(--border-dark); padding-top: 13px; }
.answer-form label {
  display: block;
  color: var(--text-sub);
  font-size: .76rem;
  letter-spacing: .015em;
  margin-bottom: 8px;
}
.answer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--border-dark);
  background: #fff;
  transition: box-shadow .12s ease, border-color .12s ease;
}
.answer-row:focus-within {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.answer-row input {
  min-width: 0;
  height: 48px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--text-main);
  padding: 0 14px;
  font-size: 1rem;
  appearance: none;
}
.answer-row input::placeholder { color: #aaa; }
.answer-row .btn-solid {
  border: 0;
  border-left: 1px solid var(--accent);
}
.answer-row .btn-solid:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px #fff;
}
.btn-solid,
.btn-outline {
  border-radius: 0;
  cursor: pointer;
  padding: 0 21px;
  min-height: 42px;
  font-size: .84rem;
  font-weight: 500;
  letter-spacing: .01em;
  transition: opacity .18s ease, background .18s ease, color .18s ease;
}
.btn-solid { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.btn-solid:hover { opacity: .72; }
.btn-outline { border: 1px solid var(--border-dark); background: transparent; color: var(--text-sub); }
.btn-outline:hover { background: #fff; color: var(--text-main); }

.feedback {
  min-height: 68px;
  padding: 13px 0 8px;
  color: var(--text-sub);
  font-size: .86rem;
  line-height: 1.65;
}
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }
.feedback strong { color: var(--text-main); font-weight: 500; }
.game-actions { display: flex; gap: 9px; flex-wrap: wrap; }


.scrap-list { border-top: 1px solid var(--border-dark); min-height: 1px; }
.scrap-row {
  width: 100%;
  display: grid;
  grid-template-columns: 45px 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 62px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.scrap-row:hover { background: #fff; }
.scrap-row span,
.scrap-row em { color: var(--text-faint); font-size: .72rem; font-style: normal; }
.scrap-row strong { font-size: .9rem; font-weight: 400; }
.scrap-output { min-height: 80px; padding: 22px 14px; color: var(--text-sub); font-size: .82rem; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 56px;
  padding-top: 10px;
  border-top: 1px solid var(--accent);
  color: var(--text-faint);
  font-size: .7rem;
  letter-spacing: .01em;
}


@media (max-width: 700px) {
  .site-shell { width: min(calc(100% - 28px), var(--max-width)); padding-top: 23px; }
  .site-header { align-items: flex-end; }
  .mode-tabs { margin-left: -14px; width: calc(100% + 28px); padding-left: 14px; gap: 20px; }
  .mode-tabs::after { content: ''; flex: 0 0 14px; }
  .profile-layout { grid-template-columns: minmax(0, 1fr) 150px; column-gap: 22px; row-gap: 24px; }
  .profile-table > div { grid-template-columns: 82px 1fr; }
  .view { padding-top: 23px; }
  .hero-copy { padding-top: 8px; }
  .wadokai-board { grid-template-columns: 1fr 74px 1fr; grid-template-rows: 82px 74px 82px; max-width: 324px; }
  .center-cell { width: 74px; height: 74px; font-size: 1.85rem; }
  .arm { font-size: 1.55rem; }
  .scrap-row { grid-template-columns: 34px 1fr; padding: 10px 8px; }
  .scrap-row em { grid-column: 2; }
}

@media (max-width: 520px) {
  .site-header { align-items: flex-start; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-side { width: min(220px, 68vw); }
  .profile-note { grid-column: 1; }
  .site-header .text-button { flex: 0 0 auto; margin-top: 20px; }
}

@media (max-width: 420px) {
  .site-shell { width: calc(100% - 24px); }
  .mode-tabs { margin-left: -12px; width: calc(100% + 24px); padding-left: 12px; }
  .mode-tabs::after { flex-basis: 12px; }
  .wadokai-board { grid-template-columns: 1fr 66px 1fr; grid-template-rows: 74px 66px 74px; }
  .center-cell { width: 66px; height: 66px; }
  .answer-row input { height: 46px; }
  .btn-solid, .btn-outline { padding-left: 16px; padding-right: 16px; }
  .footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 語感ガチャ */
.word-gacha-shell {
  width: 100%;
}

.word-gacha-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 14px;
}

.word-gacha-description {
  color: var(--text-sub);
  font-size: .82rem;
  line-height: 1.65;
  letter-spacing: .01em;
  padding-top: 3px;
}

#wordCount {
  color: var(--text-main);
  font-weight: 500;
}

.word-gacha-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.word-gacha-controls .btn-solid,
.word-gacha-controls .btn-outline {
  min-height: 38px;
}

.word-gacha-controls .btn-outline.active {
  background: var(--border);
  border-color: var(--border-dark);
  color: var(--text-main);
}

.word-gacha-list {
  width: 100%;
  list-style: none;
  border-top: 1px solid var(--border-dark);
}

.word-gacha-list li {
  display: grid;
  grid-template-columns: 50px minmax(220px, 350px) minmax(0, 1fr);
  align-items: center;
  min-height: 70px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transition: background .18s ease;
}

.word-gacha-list li:hover {
  background: var(--surface);
}

.word-gacha-number {
  color: var(--text-sub);
  font-size: .92rem;
}

.word-gacha-word {
  min-width: 0;
  padding-right: 24px;
  overflow: hidden;
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: .035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-gacha-word .latin {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.word-gacha-meaning {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-sub);
  font-size: .88rem;
  font-weight: 400;
  line-height: 1.55;
  opacity: 0;
  transform: translateX(-7px);
  transition: opacity .22s ease, transform .22s ease;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.word-gacha-list li:hover .word-gacha-meaning,
.word-gacha-shell.show-meanings .word-gacha-meaning {
  opacity: 1;
  transform: translateX(0);
}

@keyframes wordGachaSlideUpFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .word-gacha-list li {
    grid-template-columns: 42px minmax(150px, .85fr) minmax(0, 1fr);
    padding-left: 10px;
    padding-right: 10px;
  }

  .word-gacha-word {
    padding-right: 14px;
    font-size: 1.08rem;
  }

  .word-gacha-meaning {
    font-size: .8rem;
  }
}

@media (max-width: 520px) {
  .word-gacha-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .word-gacha-controls {
    align-self: flex-end;
  }

  .word-gacha-list li {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 60px;
    padding: 11px 6px;
  }

  .word-gacha-number {
    grid-column: 1;
    grid-row: 1;
    padding-top: 2px;
    font-size: .78rem;
  }

  .word-gacha-word {
    grid-column: 2;
    grid-row: 1;
    padding-right: 0;
    white-space: normal;
  }

  .word-gacha-meaning {
    display: block;
    grid-column: 2;
    grid-row: 2;
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    transform: none;
    transition: max-height .2s ease, margin-top .2s ease, opacity .2s ease;
  }

  .word-gacha-list li:hover .word-gacha-meaning,
  .word-gacha-shell.show-meanings .word-gacha-meaning {
    max-height: 8em;
    margin-top: 5px;
    opacity: 1;
  }
}



/* 2026夏合宿: responsive header / tabs / word collection */
.site-header > div { min-width: 0; }
.site-header h1 {
  white-space: nowrap;
  text-wrap: nowrap;
}

.word-collection {
  margin-top: 38px;
  border-top: 1px solid var(--accent);
}

.word-collection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0 11px;
  border-bottom: 1px solid var(--border-dark);
}

.word-collection-head h3 {
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .01em;
}

.word-collection-head span {
  color: var(--text-sub);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}

.word-collection-description {
  padding: 9px 0 10px;
  color: var(--text-sub);
  font-size: .76rem;
  line-height: 1.6;
}

.word-collection-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  border-left: 1px solid var(--border);
}

.word-collection-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 7px 9px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.word-collection-id {
  color: var(--text-faint);
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
}

.word-collection-word {
  min-width: 0;
  overflow: hidden;
  font-size: .78rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-collection-item.locked {
  color: #b7b7b7;
  background: #f3f3f3;
}

.word-collection-item.locked .word-collection-id {
  color: #c4c4c4;
}

@media (max-width: 900px) {
  .mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 18px;
    overflow: visible;
    margin-left: 0;
    width: 100%;
    padding-left: 0;
    border-bottom: 0;
  }

  .mode-tabs::after { display: none; }

  .mode-tab {
    width: 100%;
    padding: 10px 4px 9px;
    border-bottom: 1px solid var(--border);
    text-align: center;
  }

  .word-collection-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px 10px;
  }

  .site-header h1 {
    font-size: clamp(1.22rem, 5.9vw, 1.8rem);
    letter-spacing: -0.04em;
  }

  .site-header .eyebrow {
    font-size: clamp(.68rem, 3.1vw, .78rem);
  }

  .site-header .text-button {
    margin-top: 0;
  }

  .mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
  }

  .word-collection-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .site-header h1 {
    font-size: clamp(1.16rem, 6.2vw, 1.45rem);
  }

  .site-header .text-button {
    justify-self: start;
    padding-top: 1px;
  }

  .mode-tabs {
    gap: 0 10px;
  }

  .mode-tab {
    font-size: .76rem;
  }

  .word-collection-item {
    grid-template-columns: 34px minmax(0, 1fr);
    padding-left: 7px;
    padding-right: 7px;
  }
}


/* 語感ガチャ: 収集詳細 / New表示 / リセット */
.word-gacha-new {
  display: inline-block;
  margin-left: 9px;
  padding: 2px 5px 1px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .015em;
  vertical-align: .18em;
  white-space: nowrap;
}

.word-collection-item {
  display: block;
  min-height: 38px;
  padding: 0;
}

.word-collection-entry {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.word-collection-item.collected .word-collection-entry {
  cursor: pointer;
}

.word-collection-item.collected .word-collection-entry:hover {
  background: var(--surface);
}

.word-collection-entry:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -2px;
}

.word-collection-item.locked .word-collection-entry {
  cursor: default;
  background: #f3f3f3;
  color: #b7b7b7;
}

.word-collection-reset {
  display: flex;
  justify-content: flex-end;
  padding-top: 18px;
}

.word-collection-reset-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: .76rem;
}

.word-detail-dialog {
  width: min(calc(100% - 32px), 560px);
  max-height: min(78vh, 620px);
  margin: auto;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--bg-color);
  color: var(--text-main);
  overflow: auto;
}

.word-detail-dialog::backdrop {
  background: rgba(0, 0, 0, .28);
}

.word-detail-inner {
  padding: 20px;
}

.word-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}

.word-detail-id {
  color: var(--text-faint);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

.word-detail-word {
  margin-top: 20px;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .015em;
  overflow-wrap: anywhere;
}

.word-detail-meaning {
  margin-top: 14px;
  color: var(--text-sub);
  font-size: .9rem;
  line-height: 1.8;
}

.word-detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.word-detail-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  text-decoration: none;
}

@media (max-width: 520px) {
  .word-gacha-new {
    margin-left: 7px;
    font-size: .56rem;
  }

  .word-collection-entry {
    grid-template-columns: 34px minmax(0, 1fr);
    padding-left: 7px;
    padding-right: 7px;
  }

  .word-detail-inner {
    padding: 17px;
  }
}

/* 語感ガチャ: New表示を控えめに */
.word-gacha-new {
  border-width: .5px;
  border-color: var(--text-sub);
  color: var(--text-sub);
  font-weight: 400;
  letter-spacing: 0;
}

/* 和同開珎: 問題一覧 + 個別問題 */
.wadokai-shell {
  width: min(100%, 680px);
  margin: 0 auto;
}

.wadokai-score-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 0 24px;
  border-bottom: 1px solid var(--border-dark);
}

.wadokai-score {
  font-size: clamp(2.15rem, 7vw, 3.25rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .045em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.wadokai-score-block > span {
  color: var(--text-sub);
  font-size: .78rem;
}

.wadokai-complete {
  margin-left: auto;
  color: var(--text-main);
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1;
}

.wadokai-problem-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-left: 1px solid var(--border);
  margin-top: 18px;
}

.wadokai-problem-tab {
  position: relative;
  min-width: 0;
  min-height: 170px;
  padding: 10px 9px 9px;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.wadokai-problem-tab:nth-child(-n + 4) {
  border-top: 1px solid var(--border);
}

.wadokai-problem-tab:hover { background: var(--surface); }

.wadokai-problem-tab.solved {
  background: transparent;
}

.wadokai-problem-tab.solved:hover { background: var(--surface); }

/*
 * 正解済みカードは薄いグレーを重ねるが、チェックマーク部分だけをマスクで抜く。
 * そのためチェックの内側では下の盤面・文字が本来の色のまま見える。
 */
.wadokai-solved-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: rgba(17, 17, 17, .085);

  -webkit-mask-image: linear-gradient(#fff 0 0), url('/checkmark.svg');
  -webkit-mask-position: center, center;
  -webkit-mask-size: 100% 100%, clamp(54px, 48%, 82px) clamp(54px, 48%, 82px);
  -webkit-mask-repeat: no-repeat, no-repeat;
  -webkit-mask-composite: xor;

  mask-image: linear-gradient(#fff 0 0), url('/checkmark.svg');
  mask-position: center, center;
  mask-size: 100% 100%, clamp(54px, 48%, 82px) clamp(54px, 48%, 82px);
  mask-repeat: no-repeat, no-repeat;
  mask-composite: exclude;
}

.wadokai-tab-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
}

.wadokai-tab-number {
  display: block;
  font-size: .86rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.wadokai-tab-difficulty {
  display: block;
  margin-top: auto;
  padding-top: 5px;
  color: var(--text-faint);
  font-size: .61rem;
  letter-spacing: .035em;
  text-align: center;
  white-space: nowrap;
}

.wadokai-index-feedback {
  min-height: 42px;
  padding-top: 12px;
  color: var(--bad);
  font-size: .78rem;
}

.wadokai-problem-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.wadokai-difficulty {
  margin-top: 13px;
  color: var(--text-sub);
  font-size: .78rem;
  letter-spacing: .025em;
}

.wadokai-board {
  --wadokai-track: clamp(42px, 10vw, 52px);
  display: grid;
  grid-template-columns: repeat(5, var(--wadokai-track));
  grid-template-rows: repeat(5, var(--wadokai-track));
  grid-template-areas: none;
  width: calc(var(--wadokai-track) * 5);
  height: calc(var(--wadokai-track) * 5);
  margin: 24px auto 28px;
  align-items: center;
  justify-items: center;
}

.wadokai-kanji,
.wadokai-board .center-cell {
  font-size: clamp(1.5rem, 5.2vw, 1.8rem);
  line-height: 1;
}

.wadokai-kanji {
  font-weight: 500;
}

.wadokai-board .center-cell {
  grid-column: 3;
  grid-row: 3;
  display: grid;
  place-items: center;
  width: calc(var(--wadokai-track) * .78);
  height: calc(var(--wadokai-track) * .78);
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 500;
}

.wadokai-kanji-top { grid-column: 3; grid-row: 1; }
.wadokai-arrow-top { grid-column: 3; grid-row: 2; }
.wadokai-kanji-left { grid-column: 1; grid-row: 3; }
.wadokai-arrow-left { grid-column: 2; grid-row: 3; }
.wadokai-arrow-right { grid-column: 4; grid-row: 3; }
.wadokai-kanji-right { grid-column: 5; grid-row: 3; }
.wadokai-arrow-bottom { grid-column: 3; grid-row: 4; }
.wadokai-kanji-bottom { grid-column: 3; grid-row: 5; }

.wadokai-arrow {
  /*
   * 矢じりを45°回転した正方形の隣接2辺とし、軸はその正方形の対角線と同じ長さにした形。
   * 図形全体の幾何学中心をviewBox中央に置いているため、
   * 各漢字と中央マスのちょうど中間に矢印の中央が来る。
   */
  width: calc(var(--wadokai-track) * .64);
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M11.3 30H48.7M48.7 30L31.7 13M48.7 30L31.7 47' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M11.3 30H48.7M48.7 30L31.7 13M48.7 30L31.7 47' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
  transform-origin: 50% 50%;
}

.wadokai-arrow.dir-right { transform: rotate(0deg); }
.wadokai-arrow.dir-down { transform: rotate(90deg); }
.wadokai-arrow.dir-left { transform: rotate(180deg); }
.wadokai-arrow.dir-up { transform: rotate(-90deg); }

.wadokai-mini-board {
  --mini-track: 22px;
  display: grid;
  grid-template-columns: repeat(5, var(--mini-track));
  grid-template-rows: repeat(5, var(--mini-track));
  width: calc(var(--mini-track) * 5);
  height: calc(var(--mini-track) * 5);
  margin: 5px auto 2px;
  align-items: center;
  justify-items: center;
  color: currentColor;
}

.wadokai-mini-kanji,
.wadokai-mini-center {
  font-size: .82rem;
  line-height: 1;
  font-weight: 500;
}

.wadokai-mini-center {
  grid-column: 3;
  grid-row: 3;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  font-size: .72rem;
}

.wadokai-mini-kanji-top { grid-column: 3; grid-row: 1; }
.wadokai-mini-arrow-top { grid-column: 3; grid-row: 2; }
.wadokai-mini-kanji-left { grid-column: 1; grid-row: 3; }
.wadokai-mini-arrow-left { grid-column: 2; grid-row: 3; }
.wadokai-mini-arrow-right { grid-column: 4; grid-row: 3; }
.wadokai-mini-kanji-right { grid-column: 5; grid-row: 3; }
.wadokai-mini-arrow-bottom { grid-column: 3; grid-row: 4; }
.wadokai-mini-kanji-bottom { grid-column: 3; grid-row: 5; }

.wadokai-mini-arrow {
  width: 15px;
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M11.3 30H48.7M48.7 30L31.7 13M48.7 30L31.7 47' fill='none' stroke='black' stroke-width='4' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M11.3 30H48.7M48.7 30L31.7 13M48.7 30L31.7 47' fill='none' stroke='black' stroke-width='4' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
  transform-origin: 50% 50%;
}

.wadokai-mini-arrow.dir-right { transform: rotate(0deg); }
.wadokai-mini-arrow.dir-down { transform: rotate(90deg); }
.wadokai-mini-arrow.dir-left { transform: rotate(180deg); }
.wadokai-mini-arrow.dir-up { transform: rotate(-90deg); }

/* 正解時：盤面中央から細い円だけを表示する */
.wadokai-board { position: relative; }

.wadokai-correct-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  width: calc(var(--wadokai-track) * 4.55);
  aspect-ratio: 1;
  border: 2px solid rgba(17, 17, 17, .72);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.wadokai-correct-label {
  display: block;
  margin: 2px 0 8px;
  color: var(--ok);
  font-size: clamp(1.8rem, 7vw, 2.65rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: .025em;
}

.wadokai-correct-detail {
  display: block;
  color: var(--text-sub);
  font-size: .84rem;
  line-height: 1.7;
}

.wadokai-answer-form {
  max-width: 520px;
  margin: 0 auto;
}

.wadokai-answer-form .answer-row.is-locked {
  border-color: var(--border);
  background: #ededed;
  box-shadow: none;
}

.wadokai-answer-form .answer-row.is-locked input {
  background: transparent;
  color: var(--text-sub);
  cursor: default;
}

.wadokai-answer-form .answer-row.is-locked input::placeholder {
  color: var(--text-sub);
  opacity: 1;
}

.wadokai-answer-form .answer-row.is-locked .btn-solid,
.wadokai-answer-form .answer-row.is-locked .btn-solid:hover {
  background: #cfcfcf;
  border-left-color: #c4c4c4;
  color: #777;
  opacity: 1;
  cursor: default;
}

.wadokai-problem .feedback {
  max-width: 520px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .wadokai-problem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wadokai-problem-tab { min-height: 166px; padding: 9px 7px 8px; }
  .wadokai-problem-tab:nth-child(-n + 4) { border-top: 0; }
  .wadokai-problem-tab:nth-child(-n + 2) { border-top: 1px solid var(--border); }
}

@media (max-width: 520px) {
  .wadokai-problem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wadokai-tab-difficulty { font-size: .59rem; }
  .wadokai-mini-board { --mini-track: 20px; }
  .wadokai-board { --wadokai-track: clamp(40px, 16vw, 50px); }
}


/* ミニ企画お知らせ */
.mini-events-shell {
  max-width: 760px;
  margin: 0 auto;
}

.mini-events-list {
  display: grid;
  gap: 28px;
}

.mini-event {
  padding: 0 0 28px;
  border-bottom: 1px solid var(--border-dark);
}

.mini-event:first-child {
  border-top: 1px solid var(--border-dark);
  padding-top: 20px;
}

.mini-event-date {
  color: var(--text-main);
  font-size: clamp(1.16rem, 3.6vw, 1.5rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.015em;
  line-height: 1.35;
}

.mini-event-title {
  margin-top: 5px;
  font-size: clamp(1.2rem, 3.7vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.4;
}

.mini-event-location {
  margin-top: 9px;
  color: var(--text-sub);
  font-size: .8rem;
  line-height: 1.5;
}

.mini-event-detail {
  max-width: 680px;
  margin-top: 10px;
  color: var(--text-sub);
  font-size: .88rem;
  line-height: 1.85;
}

.mini-event-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 420px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.mini-countdown-part {
  min-width: 0;
  padding: 9px 10px 8px;
  border-right: 1px solid var(--border);
}

.mini-countdown-part:first-child {
  padding-left: 0;
}

.mini-countdown-part:last-child {
  border-right: 0;
}

.mini-countdown-part strong {
  display: block;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: .035em;
  line-height: 1;
}

.mini-countdown-part span {
  display: block;
  margin-top: 4px;
  color: var(--text-faint);
  font-size: .63rem;
  line-height: 1;
}

.mini-event-countdown.started {
  display: block;
  padding: 17px 0;
}

.mini-event-started {
  font-size: 1rem;
  font-weight: 500;
}

@media (max-width: 520px) {
  .mini-events-list { gap: 24px; }
  .mini-event { padding-bottom: 24px; }
  .mini-event:first-child { padding-top: 16px; }
  .mini-event-countdown { margin-top: 12px; max-width: 100%; }
  .mini-countdown-part { padding: 8px 6px 7px; }
  .mini-countdown-part:first-child { padding-left: 0; }
  .mini-countdown-part strong { font-size: clamp(1.2rem, 6vw, 1.55rem); }
}
