/* はつめいロボバトルDX — naming.css：ロボの名前をつける画面（2026-12-02 新規・js/naming.js と対） */
.naming-backdrop { z-index: 60; }

.naming-box {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden; /* 札の欄だけを流し、名札と「これにする」は常に見せる */
}

.naming-box > .modal-head,
.naming-plate,
.naming-tabs,
.naming-foot { flex: none; }

.naming-box > .modal-head { margin-bottom: 0; }

.naming-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 2px 4px;
}

.naming-close {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

/* 名札：ブリキ看板のような金属板に名前を出す */
.naming-plate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff6c9 0%, var(--accent-yellow) 100%);
  box-shadow: inset 0 -4px 0 rgba(25, 32, 56, 0.18);
}

.naming-preview {
  flex: 1;
  min-width: 0;
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.naming-preview.is-default { color: rgba(25, 32, 56, 0.55); }

.naming-plate.roll .naming-preview { animation: namingRoll 0.32s ease-out; }

@keyframes namingRoll {
  0% { transform: translateY(-40%); opacity: 0; }
  60% { transform: translateY(6%); opacity: 1; }
  100% { transform: translateY(0); }
}

.naming-dice {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

.naming-dice:active { transform: translateY(3px); box-shadow: none; }

.naming-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.naming-tab {
  min-height: 40px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.naming-tab.on {
  background: var(--ink);
  color: #fff;
}

.naming-row + .naming-row { margin-top: 8px; }

.naming-row-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  margin: 0 0 4px 2px;
}

.naming-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.naming-chip {
  min-height: 40px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.naming-chip.on {
  background: var(--accent-orange);
  color: #fff;
}

.naming-input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  font-size: 18px; /* 16px 以上にして iOS の自動拡大を止める */
  font-weight: 800;
  color: var(--ink);
  background: #fff;
}

.naming-input:focus { outline: 3px solid var(--accent-cyan); outline-offset: 2px; }

.naming-count {
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 4px;
}

.naming-note {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.naming-foot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
}

.naming-reset,
.naming-ok {
  min-height: 48px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.naming-reset {
  padding: 0 14px;
  background: #fff;
  color: var(--ink-soft);
}

.naming-ok {
  background: var(--accent-green);
  color: #fff;
  box-shadow: 0 4px 0 var(--ink);
}

.naming-ok:active { transform: translateY(4px); box-shadow: none; }

/* スマホの低い画面：札の欄だけ縦に流す */
@media (max-height: 700px) {
  .naming-box { gap: 8px; padding: 12px; }
  .naming-chip { min-height: 44px; font-size: 14px; padding: 0 10px; }
}

/* HUD・VS・結果で長い名前を1行に収める */
.robo-name-fit {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

/* ガレージの号機の札（押すと名前をつける・2026-12-03 つなぎこみ）。上に「1号機」、下に名前 */
#workshop-hud .g-slot-name {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: min(200px, 52vw);
  padding: 3px 14px;
  font: inherit;
  line-height: 1.15;
  cursor: pointer;
  touch-action: pan-y;
}
#workshop-hud .g-slot-name:disabled { cursor: default; }
#workshop-hud .g-slot-name .g-slot-no { font-size: 15px; font-weight: 900; }
#workshop-hud .g-slot-name.has-name .g-slot-no,
#workshop-hud .g-slot-name:not(.is-p2) .g-slot-no { font-size: 11px; font-weight: 800; color: #475569; }
#workshop-hud .g-slot-name .g-slot-robo {
  display: block;
  max-width: 100%;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  word-break: keep-all;
}
#workshop-hud .g-slot-name .g-slot-robo.is-empty { font-size: 12px; font-weight: 800; color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
#workshop-hud .g-slot-name:active { transform: translateY(1px); }

/* HUD の名前：縮めて測れるよう、行の中で幅を持たせる（main.js updateBattleHUD が fitText で字を小さくする） */
#battle-hud #p1-name-lbl { display: block; min-width: 0; flex: 1 1 auto; overflow: hidden; white-space: nowrap; }
