/* 「自分のルーム」の表示と設定のポップアップ（room-chip.js）。GAIP GAME CENTER と同じネオンの語法。置く画面の色に頼らない */
.room-chip {
  --rc-ink: #05050a;
  --rc-panel: #141522;
  --rc-line: #3a3e58;
  --rc-text: #f6f7fb;
  --rc-dim: #b1b5c9;
  --rc-yellow: #ffe63b;
  --rc-magenta: #ff45e6;
  --rc-lime: #7dff5a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  color: var(--rc-text);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
}
.room-chip-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--rc-magenta);
  color: var(--rc-ink);
  font: 900 .66rem/1.6 "Arial Black", "Segoe UI Black", Arial, sans-serif;
  letter-spacing: .06em;
}
.room-chip-name {
  position: relative;
  flex: none;
  color: var(--rc-yellow);
  font: 900 1.02rem/1 "Arial Black", "Segoe UI Black", Arial, sans-serif;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
}
.room-chip-name:hover { text-decoration: underline; text-underline-offset: 4px; }
.room-chip[data-state="live"] .room-chip-name::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--rc-lime);
  box-shadow: 0 0 8px var(--rc-lime);
  vertical-align: middle;
}
.room-chip-btn {
  flex: none;
  min-height: 36px;
  padding: 4px 12px;
  border: 2px solid var(--rc-line);
  border-radius: 8px;
  background: rgba(20, 21, 34, .85);
  color: var(--rc-text);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.room-chip-btn:hover { border-color: var(--rc-magenta); }
.room-chip-btn--set { border-color: var(--rc-magenta); box-shadow: 0 0 12px rgba(255, 69, 230, .35); }

/* ポップアップ */
.room-dialog {
  width: min(400px, calc(100vw - 28px));
  max-height: calc(100% - 28px);
  padding: 0;
  border: 3px solid #0a0a10;
  border-radius: 16px;
  background: #0c0d16;
  color: #f6f7fb;
  box-shadow: 0 0 0 2px #ff45e6, 8px 8px 0 #0a0a10, 0 0 40px rgba(255, 69, 230, .4);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
}
.room-dialog::backdrop { background: rgba(5, 5, 10, .72); }
.room-dialog-box { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 22px 22px 18px; }
.room-dialog-title { margin: 0; font-size: 1.35rem; font-weight: 900; }
.room-dialog-lead { margin: 0; color: #b1b5c9; font-size: .9rem; line-height: 1.6; }
/* 入れた名前（6マス）。入力欄ではないので、日本語キーボード・日本語入力に変わらない */
.room-dialog-value {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 8px;
  border: 3px solid #0a0a10;
  border-radius: 12px;
  background: #141522;
  box-shadow: 0 0 0 2px #3a3e58;
  cursor: text;
}
.room-dialog-value:focus { outline: none; box-shadow: 0 0 0 3px #ffe63b, 0 0 20px rgba(255, 230, 59, .35); }
.room-dialog-slot {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-bottom: 3px solid #3a3e58;
  color: #ffe63b;
  font: 900 1.8rem/1 "Arial Black", "Segoe UI Black", Arial, sans-serif;
}
.room-dialog-slot.is-next { border-bottom-color: #ffe63b; }
.room-dialog-value:focus .room-dialog-slot.is-next { animation: room-dialog-blink 1s steps(2, start) infinite; }
@keyframes room-dialog-blink { to { border-bottom-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .room-dialog-value:focus .room-dialog-slot.is-next { animation: none; } }
.room-dialog-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.room-dialog-keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.room-dialog-key {
  min-height: 42px;
  padding: 0;
  border: 2px solid #3a3e58;
  border-radius: 8px;
  background: #141522;
  color: #f6f7fb;
  font: 900 1.05rem/1 "Arial Black", "Segoe UI Black", Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.room-dialog-key:active { background: #ffe63b; color: #0a0a10; border-color: #ffe63b; }
.room-dialog-key:disabled { opacity: .35; cursor: default; }
.room-dialog-key--wide { grid-column: span 3; font-family: inherit; font-size: .9rem; }
.room-dialog-status { min-height: 1.6em; margin: 0; font-size: .88rem; font-weight: 700; color: #b1b5c9; }
.room-dialog-status[data-kind="error"] { color: #ff8aa0; }
.room-dialog-status[data-kind="live"] { color: #7dff5a; }
.room-dialog-status[data-kind="new"] { color: #19e3ff; }
.room-dialog-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.room-dialog-btn {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transform: skewX(-8deg);
}
.room-dialog-btn--ok { background: #ffe63b; color: #0a0a10; box-shadow: 0 0 0 3px #0a0a10, 4px 4px 0 #0a0a10; }
.room-dialog-btn--enter { background: #7dff5a; color: #0a0a10; box-shadow: 0 0 0 3px #0a0a10, 4px 4px 0 #0a0a10; }
.room-dialog-btn--cancel { flex: 0 1 auto; background: #141522; color: #f6f7fb; box-shadow: 0 0 0 2px #3a3e58; }
.room-dialog-btn[hidden] { display: none; }
.room-dialog-link {
  align-self: flex-start;
  margin-top: 2px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: #b1b5c9;
  font: inherit;
  font-size: .84rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.room-dialog-link[hidden] { display: none; }
.room-dialog :focus-visible { outline: 3px solid #f6f7fb; outline-offset: 3px; }
@media (max-width: 380px), (max-height: 680px) {
  .room-dialog-box { gap: 8px; padding: 16px 14px 12px; }
  .room-dialog-lead { font-size: .82rem; }
  .room-dialog-slot { min-height: 42px; font-size: 1.55rem; }
  .room-dialog-key { min-height: 40px; }
}
/* Safari のバーで見える高さが少ないとき（iPhone SE など）：説明を省いて、ボタンを低くする */
@media (max-height: 600px) {
  .room-dialog-lead { display: none; }
  .room-dialog-slot { min-height: 36px; font-size: 1.4rem; }
  .room-dialog-key { min-height: 36px; }
  .room-dialog-btn { min-height: 44px; }
}
