/* =====================================================================
   style.css — 10パズル ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる。
   ===================================================================== */

.tp-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
}
.tp-level {
  margin: 0;
  min-width: 0;
  flex: 1 1 220px;
}
.tp-level .sg-select {
  width: 100%;
}
.tp-stats {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--sg-muted, #777);
}

/* 4つの数字 */
.tp-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px auto 14px;
  max-width: 360px;
}
.tp-card {
  aspect-ratio: 1 / 1;
  border: 2px solid var(--sg-primary, #3b5bdb);
  border-radius: 14px;
  background: var(--sg-surface, #fff);
  color: var(--sg-primary, #3b5bdb);
  font: inherit;
  font-size: clamp(1.8rem, 9vw, 2.6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: var(--sg-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.08));
  transition: transform 0.08s, opacity 0.15s;
}
.tp-card:active {
  transform: scale(0.95);
}
.tp-card.is-used,
.tp-card:disabled {
  opacity: 0.3;
  cursor: default;
  box-shadow: none;
}

/* 式 */
.tp-expr {
  min-height: 2.4em;
  padding: 10px 12px;
  border: 1px solid var(--sg-border, #e2e6ee);
  border-radius: 10px;
  background: var(--sg-surface-2, #f4f6fb);
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.tp-expr__placeholder {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--sg-muted, #777);
}
.tp-now {
  margin: 4px 0 10px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--sg-muted, #777);
  min-height: 1.5em;
}

/* 記号のボタン */
.tp-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}
.tp-key {
  min-height: 48px;
  border: 1px solid var(--sg-border, #e2e6ee);
  border-radius: 10px;
  background: var(--sg-surface, #fff);
  color: var(--sg-fg, #222);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
}
.tp-key:active {
  background: var(--sg-surface-2, #f4f6fb);
}
.tp-key--sub {
  font-size: 1rem;
  color: var(--sg-muted, #777);
}

.tp-msg {
  min-height: 1.5em;
  margin: 12px 0 4px;
  text-align: center;
  font-weight: 600;
  line-height: 1.6;
}
.tp-msg.is-ok {
  color: var(--sg-success, #2f9e44);
}
.tp-msg.is-ng {
  color: var(--sg-danger, #d64545);
}
#tp-check-msg[hidden] {
  display: none;
}

.tp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.tp-actions .sg-btn {
  flex: 1 1 auto;
}
.tp-kbd {
  margin-top: 10px;
}

/* 答えの一覧 */
.tp-sols {
  margin: 12px 0 0;
  padding-left: 1.6em;
  text-align: left;
  max-height: 22em;
  overflow-y: auto;
}
.tp-sols li {
  margin: 4px 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.tp-sol {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tp-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--sg-surface-2, #f4f6fb);
  color: var(--sg-muted, #777);
  border: 1px solid var(--sg-border, #e2e6ee);
  vertical-align: 1px;
}
.tp-tag--ok {
  color: var(--sg-success, #2f9e44);
  border-color: currentColor;
}
.tp-play {
  margin: 12px 0 0;
}

/* 調べる */
.tp-inputrow {
  display: flex;
  gap: 8px;
}
.tp-inputrow .sg-input {
  flex: 1 1 auto;
  min-width: 0;
}
.tp-inputrow .sg-btn {
  flex: 0 0 auto;
}

.tp-list {
  margin: 0 0 12px;
  padding-left: 1.3em;
  line-height: 1.8;
}
.tp-wide {
  overflow-x: auto;
}
.tp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.tp-table th,
.tp-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--sg-border, #e2e6ee);
  text-align: left;
  vertical-align: top;
}
.tp-table td:last-child {
  white-space: nowrap;
}
