/* iroha-karuta 固有の微調整のみ（ik-）。共通スタイルは /_shared/shirugear.css。 */
#setup[hidden], #solo[hidden], #duel[hidden], #end[hidden], #duel-help[hidden], .ik-panel[hidden] { display: none; }

.ik-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.ik-tab { flex: 1; padding: 10px; border: 1px solid var(--sg-border); border-radius: 10px; background: var(--sg-surface); color: var(--sg-fg); font-weight: 600; cursor: pointer; }
.ik-tab.is-active { background: var(--sg-primary); border-color: var(--sg-primary); color: #fff; }

.ik-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ik-seg__item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--sg-border); border-radius: 10px; background: var(--sg-surface); cursor: pointer; }
.ik-check { display: flex; align-items: center; gap: 8px; }

.ik-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-weight: 600; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.ik-reader { position: sticky; top: 8px; z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.08); min-height: 4.6em; padding: 12px 14px; border: 1px solid var(--sg-border); border-radius: 12px; background: var(--sg-surface); }
.ik-yomi { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: 0.06em; line-height: 1.5; min-height: 1.5em; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.ik-yomi--small { font-size: 1.1rem; }
.ik-sub { margin: 6px 0 0; color: var(--sg-muted); font-size: 0.9rem; min-height: 1.4em; line-height: 1.6; }
.ik-sub.is-ok { color: #2f9e44; }
.ik-sub.is-ng { color: #e03131; }
.ik-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ik-actions .sg-btn { padding: 6px 12px; font-size: 0.88rem; }

.ik-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.ik-board[data-size="24"] { grid-template-columns: repeat(6, 1fr); }
.ik-board[data-size="48"] { grid-template-columns: repeat(8, 1fr); gap: 5px; }
@media (max-width: 560px) {
  .ik-board[data-size="24"] { grid-template-columns: repeat(4, 1fr); }
  .ik-board[data-size="48"] { grid-template-columns: repeat(6, 1fr); }
}

.ik-card {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 4px;
  border: 2px solid #c9a96e;
  border-radius: 6px;
  background: #fffaf0;
  color: #222;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}
.ik-card__h {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 1.7em;
  height: 1.7em;
  border: 2px solid #c92a2a;
  border-radius: 50%;
  color: #c92a2a;
  background: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.5em;
  text-align: center;
}
.ik-card__w {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 1.2em;
  max-height: 100%;
  overflow: hidden;
}
.ik-board[data-size="48"] .ik-card__h { font-size: 0.85rem; top: 2px; left: 2px; }
.ik-board[data-size="48"] .ik-card__w { font-size: 0.72rem; }
.ik-card:hover:not(:disabled) { border-color: var(--sg-primary); }
.ik-card.is-right, .ik-card.is-p1 { border-color: #2f9e44; background: #ebfbee; box-shadow: 0 0 0 2px #2f9e44; }
.ik-card.is-p2 { border-color: #1971c2; background: #e7f5ff; box-shadow: 0 0 0 2px #1971c2; }
.ik-card.is-reveal { border-color: #f08c00; background: #fff4e6; box-shadow: 0 0 0 2px #f08c00; }
.ik-card.is-wrong { border-color: #e03131; background: #fff5f5; }
.ik-card.is-taken { visibility: hidden; }
.ik-card:disabled { cursor: default; }

/* ふたりで: 上下に分け、上の側は逆さま（向かい合って遊ぶ）。広い画面では左右に並べ、逆さまにしない。 */
.ik-side { padding: 8px; border: 1px solid var(--sg-border); border-radius: 12px; background: var(--sg-surface); }
.ik-side.is-locked { opacity: 0.55; }
.ik-side__head { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.ik-pname--p1 { color: #2f9e44; }
.ik-pname--p2 { color: #1971c2; }
.ik-side--p2 { transform: rotate(180deg); }
.ik-center { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--sg-border); border-radius: 12px; background: var(--sg-surface); }
.ik-board--duel { margin-top: 6px; gap: 5px; }
.ik-board--duel[data-size="24"] { grid-template-columns: repeat(6, 1fr); }
.ik-board--duel .ik-card__h { font-size: 0.85rem; top: 2px; left: 2px; }
.ik-board--duel .ik-card__w { font-size: 0.75rem; }
@media (min-width: 760px) {
  #duel:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ik-center { grid-column: 1 / -1; grid-row: 1; margin: 0; }
  .ik-side--p2 { transform: none; }
  #d-text2 { display: none; }
}

.ik-end-title { margin: 0; color: var(--sg-muted); }
.ik-end-score { margin: 4px 0; font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.ik-list { list-style: none; margin: 10px 0 0; padding: 0; }
.ik-item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sg-border); }
.ik-item__h { flex: none; width: 2em; height: 2em; border: 2px solid #c92a2a; border-radius: 50%; color: #c92a2a; font-weight: 800; text-align: center; line-height: 1.8em; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.ik-item__body { min-width: 0; }
.ik-item__t { margin: 0; font-weight: 700; line-height: 1.6; }
.ik-item__r { margin: 0; font-size: 0.82rem; color: var(--sg-muted); }
.ik-item__m { margin: 4px 0 0; font-size: 0.9rem; line-height: 1.6; }
.ik-item__v { margin: 4px 0 0; font-size: 0.82rem; color: var(--sg-muted); line-height: 1.6; }
