/* Kahoot! 問題集：/kahoot/（使い方・一覧）と /<slug>/kahoot/（問題・Excel・ChatGPT・BGM） */
:root {
  --kh-red: #e21b3c;
  --kh-blue: #1368ce;
  --kh-yellow: #d89e00;
  --kh-green: #26890c;
  --kh-purple: #46178f;
}
.kh-hero .kicker {
  color: var(--kh-purple);
}
:root[data-theme='dark'] .kh-hero .kicker {
  color: #c9a8ff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .kh-hero .kicker {
    color: #c9a8ff;
  }
}

/* ---------- 操作する箱（真ん中） ---------- */
.kh-tool {
  max-width: 860px;
  margin: 0 auto;
  padding: 18px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
}
.kh-sw {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.kh-seg {
  display: inline-flex;
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper2);
}
.kh-seg button {
  border: 0;
  background: none;
  padding: 8px 14px;
  font: inherit;
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  line-height: 1.25;
  min-width: 64px;
}
.kh-seg button + button {
  border-left: 2px solid var(--line2);
}
.kh-seg button small {
  font-family: var(--f-en);
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
}
.kh-seg button[aria-pressed='true'] {
  background: var(--kh-purple);
  color: #fff;
}
.kh-seg-l button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
.kh-meta {
  text-align: center;
  margin: 14px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: center;
  align-items: baseline;
}
.kh-meta b {
  font-size: 18px;
}
.kh-meta span {
  font-size: 13px;
  color: var(--ink2);
}
.kh-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 6px 0;
}
.kh-acts .btn {
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
}
.kh-dl {
  background: var(--kh-purple);
  color: #fff;
}
.kh-hint {
  font-size: 13px;
  color: var(--ink2);
  text-align: center;
  margin: 8px auto 0;
  max-width: 640px;
}
.kh-view {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  justify-content: center;
  margin: 16px 0 10px;
  padding-top: 14px;
  border-top: 2px dashed var(--line2);
}
.kh-view small {
  font-size: 12px;
  color: var(--ink3);
}
.kh-view .tgl {
  cursor: pointer;
  font-family: inherit;
}

/* ---------- 問題カード ---------- */
.kh-qs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.kh-qs[hidden] {
  display: none;
}
.kh-tool:not(.kh-all) .kh-more {
  display: none;
}
.kh-q {
  border: 2px solid var(--line2);
  border-radius: 14px;
  padding: 10px 12px 12px;
  background: var(--paper2);
}
.kh-q-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.kh-no {
  font-family: var(--f-en);
  font-weight: 700;
  background: var(--kh-purple);
  color: #fff;
  border-radius: 8px;
  padding: 0 8px;
}
.kh-sec {
  color: var(--ink2);
  font-weight: 700;
}
.kh-img {
  margin-left: auto;
  border: 1.5px solid var(--line2);
  border-radius: 999px;
  background: var(--card);
  padding: 1px 10px;
  font: inherit;
  font-size: 12px;
  color: var(--ink2);
  cursor: pointer;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.kh-qt {
  margin: 8px 0 10px;
  font-weight: 900;
  font-size: 16.5px;
  line-height: 1.5;
  cursor: copy;
  overflow-wrap: anywhere;
}
.kh-qs[lang='en'] .kh-qt,
.kh-qs[lang='en'] .kh-a span {
  font-family: var(--f-body);
}
.kh-as {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.kh-a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
  cursor: copy;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
  overflow-wrap: anywhere;
  transition: opacity 0.2s, transform 0.2s;
}
.kh-a i {
  font-style: normal;
  font-size: 13px;
  flex: none;
}
.kh-a1 { background: var(--kh-red); }
.kh-a2 { background: var(--kh-blue); }
.kh-a3 { background: var(--kh-yellow); }
.kh-a4 { background: var(--kh-green); }
.kh-show .kh-a:not(.ok) {
  opacity: 0.35;
}
.kh-show .kh-a.ok {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}
.kh-show .kh-a.ok::after {
  content: '✔';
  margin-left: auto;
  font-size: 16px;
}
.kh-note {
  display: none;
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--ink2);
}
.kh-show .kh-note {
  display: block;
}
.kh-morebtn {
  text-align: center;
  margin: 12px 0 0;
}
.kh-morebtn button {
  cursor: pointer;
  font-family: inherit;
}

/* ---------- 3ステップ ---------- */
.kh-steps {
  list-style: none;
  counter-reset: s;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.kh-steps li {
  counter-increment: s;
  position: relative;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--card);
  padding: 14px 14px 14px 52px;
  display: grid;
  gap: 4px;
}
.kh-steps li::before {
  content: counter(s);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--kh-purple);
  color: #fff;
  font-family: var(--f-display);
}
.kh-steps small {
  color: var(--ink2);
  font-size: 13.5px;
}
.kh-hub-link {
  margin: 14px 0 0;
  font-weight: 700;
}

/* ---------- ChatGPT ---------- */
.kh-gpt {
  max-width: 860px;
  margin: 0 auto;
}
.kh-gpt .sec-lead {
  text-align: left;
}
.kh-gpt-b {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.kh-gpt-b button {
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  padding: 6px 14px;
  font: inherit;
  font-weight: 900;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.kh-gpt-b button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
.kh-gpt-t {
  width: 100%;
  box-sizing: border-box;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--paper2);
  color: var(--ink);
  padding: 12px;
  font: 13px/1.6 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  resize: vertical;
  margin-bottom: 8px;
}

/* ---------- BGM ---------- */
.kh-bgm-f {
  justify-content: center;
}
.kh-bgm-f button {
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}
.kh-bgm {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.kh-bgm li {
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--card);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kh-bgm li[hidden] {
  display: none;
}
.kh-bgm-h b {
  display: block;
  font-family: var(--f-en);
  font-size: 17px;
  line-height: 1.3;
}
.kh-bgm-h small {
  color: var(--ink2);
  font-size: 13px;
}
.kh-bgm p {
  margin: 0;
  font-size: 14px;
  flex: 1;
}
.kh-bgm-f2 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.kh-use,
.kh-pd {
  border-radius: 999px;
  padding: 1px 9px;
  font-weight: 700;
  background: var(--t-purple);
  color: #2b1660;
}
.kh-pd {
  background: var(--t-green);
  color: #0f4a30;
}
.kh-yt {
  margin-left: auto;
  font-weight: 900;
  color: #c4001a;
  text-decoration: none;
  white-space: nowrap;
}
:root[data-theme='dark'] .kh-yt {
  color: #ff8a99;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .kh-yt {
    color: #ff8a99;
  }
}
.kh-bgm-more {
  display: none;
  text-align: center;
  margin: 12px 0 0;
}
.kh-bgm-more button {
  cursor: pointer;
  font-family: inherit;
}
@media (max-width: 760px) {
  .kh-bgm-more {
    display: block;
  }
}
.kh-more-d {
  margin-top: 16px;
  border: 2px solid var(--line2);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  background: var(--card);
}
.kh-more-d summary {
  cursor: pointer;
  font-weight: 900;
}
.kh-tips {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.kh-tips > div {
  border-left: 4px solid var(--kh-purple);
  padding: 2px 0 2px 12px;
}
.kh-tips p {
  margin: 4px 0 0;
  font-size: 14px;
}

.kh-tm {
  font-size: 12px;
  color: var(--ink3);
  text-align: center;
  margin: 24px 0 0;
}

/* ---------- 一覧（/kahoot/） ---------- */
.kh-3 {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.kh-3 > div {
  flex: 1 1 140px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--card);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 10px;
  align-items: center;
}
.kh-3 span {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--kh-purple);
  color: #fff;
  font-family: var(--f-display);
}
.kh-3 small {
  color: var(--ink2);
  font-size: 12.5px;
}
.kh-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.kh-card {
  display: flex;
  flex-direction: column;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s var(--ease);
}
.kh-card:hover {
  transform: translate(-2px, -2px);
}
.kh-card-img {
  aspect-ratio: 3 / 2;
  background: var(--soft);
  display: grid;
  place-items: center;
  border-bottom: var(--bw) solid var(--ink);
}
.kh-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kh-card-img em {
  font-style: normal;
  font-size: 48px;
}
.kh-card-t {
  padding: 10px 14px 14px;
  display: grid;
  gap: 2px;
}
.kh-card-t b {
  font-size: 18px;
}
.kh-card-t small {
  font-family: var(--f-en);
  color: var(--ink2);
}
.kh-card-c {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.kh-card-c i {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--t-purple);
  color: #2b1660;
}
.kh-th {
  font-size: 20px;
  margin: 6px 0 12px;
}
.kh-howto {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  gap: 10px;
}
.kh-howto li b {
  display: block;
}
.kh-howto small {
  color: var(--ink2);
  font-size: 14px;
}
.kh-note2 {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--t-yellow);
  color: #2a2208;
  font-size: 14px;
}
.kh-note2 a {
  color: #1d3f8f;
}
.kh-routes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.kh-routes > div {
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--card);
  padding: 12px 14px;
}
.kh-routes b {
  display: block;
  font-size: 16px;
  margin: 4px 0 6px;
}
.kh-routes ol {
  margin: 0;
  padding-left: 1.3em;
  font-size: 14px;
  display: grid;
  gap: 4px;
}
.kh-r {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--kh-purple);
  color: #fff;
}
.kh-gpt-l {
  display: grid;
  gap: 8px;
  padding-left: 1.2em;
}
.kh-gpt-l small {
  display: block;
  color: var(--ink2);
  font-size: 13.5px;
}

/* ---------- スマホ ---------- */
@media (max-width: 760px) {
  .kh-tool {
    padding: 12px 10px;
  }
  .kh-seg button {
    padding: 7px 10px;
    font-size: 14px;
    min-width: 0;
  }
  .kh-acts .btn {
    flex: 1 1 140px;
    justify-content: center;
    padding: 9px 12px;
    font-size: 14px;
  }
  .kh-qt {
    font-size: 15.5px;
  }
  .kh-a {
    font-size: 13.5px;
    min-height: 40px;
    padding: 5px 8px;
  }
  .kh-steps,
  .kh-routes {
    grid-template-columns: 1fr;
  }
  .kh-bgm {
    grid-template-columns: 1fr;
  }
  .kh-bgm:not(.open) > li:nth-child(n + 5) {
    display: none;
  }
  .kh-gpt-t {
    height: 9.5em;
  }
  .kh-img {
    margin-left: 0;
  }
}

/* ---------- ガイド（/kahoot/<id>/） ---------- */
.kg-date {
  font-size: 13px !important;
  color: var(--ink3) !important;
  margin: 4px 0 0;
}
.kg-hero-img {
  display: block;
  max-width: 900px;
  margin: 6px auto 18px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 3 / 2;
}
.kg-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kh-hub-img {
  max-width: 760px;
  margin: 10px auto 18px;
}
.kh-hubpage .kh-hero .hero-cta {
  justify-content: center;
}
.kg-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 22px;
}
.kg-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  background: var(--card);
  color: var(--ink);
  font-weight: 900;
  font-size: 14px;
  text-decoration: none;
}
.kg-nav a[aria-current='page'] {
  background: var(--kh-purple);
  color: #fff;
}
.kg-toc {
  max-width: 760px;
  margin: 0 auto 36px;
  border: 2px solid var(--line2);
  border-radius: var(--r-sm);
  background: var(--card);
  padding: 12px 18px;
}
.kg-toc ol {
  margin: 6px 0 0;
  padding-left: 1.4em;
  columns: 2;
  column-gap: 28px;
  font-size: 14.5px;
}
.kg-toc li {
  break-inside: avoid;
  margin: 2px 0;
}
.kg-body {
  max-width: 860px;
}
.kg-body > p {
  font-size: 16px;
  line-height: 1.85;
}
.kg-tbl {
  overflow-x: visible;
  margin: 8px 0;
}
.kg-tbl table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--card);
  font-size: 14.5px;
}
.kg-tbl th,
.kg-tbl td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1.5px solid var(--line);
  overflow-wrap: anywhere;
}
.kg-tbl thead th {
  background: var(--kh-purple);
  color: #fff;
  font-size: 13.5px;
}
.kg-tbl tbody th {
  background: var(--paper2);
  white-space: normal;
  min-width: 7em;
}
.kg-tbl tr:last-child > * {
  border-bottom: 0;
}
.kg-list,
.kg-check,
.kg-tips {
  display: grid;
  gap: 8px;
  padding-left: 1.4em;
  font-size: 15.5px;
  line-height: 1.75;
}
.kg-check {
  list-style: none;
  padding-left: 0;
}
.kg-check li {
  position: relative;
  padding-left: 30px;
}
.kg-check li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--card);
}
.kg-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--paper2);
  border: 2px solid var(--line2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font: 13.5px/1.7 ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
.kg-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.kg-card {
  display: flex;
  flex-direction: column;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.15s var(--ease);
}
.kg-card:hover {
  transform: translate(-2px, -2px);
}
.kg-card-img {
  aspect-ratio: 3 / 2;
  border-bottom: var(--bw) solid var(--ink);
}
.kg-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kg-card-t {
  padding: 10px 14px 14px;
  display: grid;
  gap: 4px;
}
.kg-card-t b {
  font-size: 16.5px;
}
.kg-card-t small {
  color: var(--ink2);
  font-size: 13px;
  line-height: 1.55;
}
@media (max-width: 760px) {
  .kg-toc ol {
    columns: 1;
  }
  .kg-tbl table {
    font-size: 13.5px;
  }
  .kg-tbl th,
  .kg-tbl td {
    padding: 7px 8px;
  }
  .kg-tbl tbody th {
    min-width: 5.5em;
  }
  .kg-nav a {
    font-size: 13px;
    padding: 4px 11px;
  }
  .kg-hero-img {
    margin-bottom: 14px;
  }
}
@media (max-width: 760px) {
  .kh-cards,
  .kg-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .kh-card,
  .kg-card {
    flex-direction: row;
    box-shadow: 3px 3px 0 var(--sh);
  }
  .kh-card-img,
  .kg-card-img {
    flex: 0 0 112px;
    aspect-ratio: auto;
    border-bottom: 0;
    border-right: var(--bw) solid var(--ink);
  }
  .kh-card-t,
  .kg-card-t {
    padding: 8px 10px;
    align-content: center;
  }
  .kh-card-t b,
  .kg-card-t b {
    font-size: 15.5px;
  }
  .kg-card-t small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12.5px;
  }
}
