/* 座席表の画面: 席番号の入力・いつもの席・推し席診断（入口の半券とダイアログ）・座席表の図と凡例・
   座席表を重ねて開くシート */

/* ---- 席番号の入力 */
.seat-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seat-form label {
  color: var(--sub);
  font-size: 13px;
  font-weight: 500;
}

.seat-form .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.seat-form input {
  min-width: 0;
  height: 50px;
  padding: 0 20px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font-family: var(--font-num);
  font-size: 21px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.seat-form input::placeholder {
  color: var(--sub);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.seat-form input:focus {
  border-color: var(--sky-ink);
  outline: 0;
  box-shadow: 0 0 0 4px var(--sky-soft);
}

.seat-form .btn {
  height: 50px;
  min-width: 84px;
  font-weight: 500;
}

.err {
  margin: 0;
  color: var(--error);
  font-size: 13px;
  line-height: 1.6;
}

/* ---- いつもの見え方に近い席（淡い空色の帯。席は座席番号の札） */
.usual-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 14px 12px 16px;
  border-radius: var(--radius-xl);
  background: var(--sky-soft);
}

.usual-box > span {
  grid-column: 1;
  color: var(--sky-ink);
  font-size: 12px;
  font-weight: 500;
}

.usual-box .seat-badge {
  grid-column: 1;
  justify-self: start;
  background: var(--paper);
  color: var(--sky-ink);
  font-size: 15px;
}

.usual-box small {
  grid-column: 1;
  color: var(--sub);
  font-size: 12px;
}

.usual-box .btn {
  grid-row: 1 / span 3;
  grid-column: 2;
  height: 40px;
  padding: 0 16px;
  background: var(--paper);
  font-size: 13.5px;
  font-weight: 500;
}

/* ---- 推し席診断の入口（黄色い半券: 左の札に星、真ん中に名前と説明、右に矢印） */
.quiz-btn {
  --notch: 9px;
  display: flex;
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  transition: transform 0.25s var(--ease-pop);
}

.quiz-btn:hover {
  transform: translateY(-2px) rotate(-0.5deg);
}

.quiz-btn:active {
  transform: scale(0.98);
}

.quiz-btn-tag {
  padding: 0 12px 0 16px;
}

.quiz-btn-tag svg,
.quiz-ticket .ticket-tag svg {
  width: 22px;
  height: 22px;
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.quiz-btn-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 12px 6px 12px 14px;
}

.quiz-btn-body b {
  font-family: var(--font-head);
  letter-spacing: var(--head-tracking);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
}

.quiz-btn-body span {
  font-size: 12.5px;
  line-height: 1.55;
}

.quiz-btn-go {
  display: grid;
  flex: none;
  place-items: center;
  align-self: center;
  width: 34px;
  height: 34px;
  margin-right: 18px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--red-ink);
  font-size: 16px;
  transition: transform 0.25s var(--ease-pop);
}

.quiz-btn:hover .quiz-btn-go {
  transform: translateX(3px);
}

/* ---- 推し席診断のダイアログ: 上の帯（名前・進み具合・何問目）、質問、大きな答えのボタン */
.quiz-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.quiz-label {
  color: var(--red-ink);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

/* 進み具合: 座席の点を1問ずつ赤く（いまの問いは少し弾む） */
.quiz-progress {
  display: flex;
  gap: 5px;
}

.quiz-progress i {
  width: 14px;
  height: 12px;
  border-radius: 6px 6px 2px 2px;
  background: var(--line);
  transition: background 0.2s;
}

.quiz-progress i.done {
  background: var(--red);
}

.quiz-progress i.now {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
  animation: quiz-seat-hop 0.5s var(--ease-pop);
}

.quiz-count {
  margin-left: auto;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.quiz-count small {
  color: var(--sub);
  font-size: 12px;
  font-weight: 500;
}

.modal-body .quiz-q {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.45;
  animation: quiz-in 0.3s var(--ease-out);
}

.quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 16px 10px 11px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-2xl);
  background: var(--paper);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  animation: quiz-in 0.3s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 50ms + 60ms);
  transition:
    transform 0.2s var(--ease-pop),
    border-color 0.15s,
    background 0.15s;
}

.quiz-opt:hover {
  border-color: var(--red);
  background: var(--red-soft);
  transform: translateY(-2px);
}

.quiz-opt:active {
  transform: scale(0.98);
}

.quiz-opt-key {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--yellow-soft);
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}

.quiz-opt:hover .quiz-opt-key {
  background: var(--yellow);
}

/* 結果: 黄色い半券（左の札に星、右にタイプと推し席の札・スクリーンの名前） */
.quiz-ticket {
  --notch: 11px;
  display: flex;
  width: 100%;
  animation: quiz-ticket-in 0.45s var(--ease-pop);
}

.quiz-ticket .ticket-tag {
  padding: 0 12px 0 18px;
}

.quiz-ticket-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 16px 22px 16px 16px;
}

.quiz-cap {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.modal-body .quiz-type {
  margin: 0 0 10px;
  padding: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
}

.quiz-seat {
  margin-top: 4px;
  padding: 6px 16px 4px;
  border-radius: 16px 16px 6px 6px;
  font-size: 20px;
  white-space: normal;
}

.quiz-where {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.quiz-note {
  font-size: 13px;
}

@keyframes quiz-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes quiz-seat-hop {
  40% {
    transform: translateY(-4px);
  }
}

@keyframes quiz-ticket-in {
  from {
    opacity: 0;
    transform: rotate(-4deg) scale(0.9);
  }
}

/* ---- 座席表の図（淡い面の上に。PC は座席表の列が淡い面なので白い面） */
.mapbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px 10px 14px;
  border-radius: var(--radius-xl);
  background: var(--tint);
}

/* 席の種類 / 見やすさで色分け の切り替え（真ん中に、中身の幅で） */
.map-mode {
  align-self: center;
  max-width: 100%;
  background: var(--paper);
}

.map-mode button {
  padding: 6px 14px;
  font-size: 13px;
}

.map-mode button.on {
  background: var(--ink);
  color: var(--text-on-dark);
  box-shadow: none;
}

/* スクリーンを表す弧 */
.arc {
  position: relative;
  height: 28px;
  margin-top: 4px;
  color: var(--sub);
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}

.arc::before {
  content: '';
  position: absolute;
  top: 0;
  right: 8%;
  left: 8%;
  height: 22px;
  border-top: 4px solid var(--red);
  border-radius: 50% / 100% 100% 0 0;
  filter: drop-shadow(0 3px 4px rgba(224, 33, 63, 0.25));
}

.arc span {
  position: relative;
  top: 8px;
}

.map-scroll {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  padding-block: 4px 6px;
}

/*
  座席は JS が --u（横の位置）・--w（幅）・--y（縦の位置）・--rh（列の高さ）・--h（席の高さ）を、
  図全体には --pitch（座席1つ分の px）と --gap（席のすき間）を入れる
*/
#map {
  position: relative;
  margin: 0 auto;
}

#map .rl {
  position: absolute;
  top: calc(var(--y) * var(--pitch));
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: calc(var(--h) * var(--pitch) - var(--gap));
  color: var(--sub);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

#map .rl.r {
  right: 0;
  left: auto;
}

/* 席: 上辺を背もたれのように丸く。触れると少しふくらむ */
#map .s {
  position: absolute;
  top: calc((var(--y) + (var(--rh) - var(--h)) / 2) * var(--pitch));
  left: calc(16px + var(--gap) + (var(--u) + 0.5 - var(--w) / 2) * var(--pitch));
  width: calc(var(--w) * var(--pitch) - var(--gap));
  height: calc(var(--h) * var(--pitch) - var(--gap));
  padding: 0;
  border: 0;
  border-radius: 40% 40% 2px 2px / 50% 50% 2px 2px;
  background: var(--seat);
  font-size: 0;
  transition: transform 0.15s var(--ease-pop);
}

#map .s.p {
  border-radius: 5px 5px 3px 3px;
  background: var(--seat-premium);
  box-shadow: var(--shadow-premium-seat);
}

/* ペア席は2席をくっつけて描く */
#map .s.pl {
  width: calc(var(--w) * var(--pitch));
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

#map .s.pr {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

#map .s.d {
  background: var(--seat-pair);
}

#map .s.w {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--seat-wheelchair);
}

#map .s:hover {
  z-index: 1;
  outline: 2px solid var(--ink);
  outline-offset: 0;
  transform: scale(1.25);
}

#map .s.on {
  z-index: 1;
  background: var(--red);
  box-shadow:
    0 0 0 2px var(--paper),
    0 0 0 4px var(--red);
  transform: scale(1.15);
}

/* 印の重なり: ゴールデンシート → 推し席 → いつもの席 の順に上書き */
#map .s.gold {
  background: var(--gold);
  box-shadow:
    0 0 0 2px var(--gold-weak),
    0 0 12px 3px var(--gold-glow);
  animation: gold-pulse 1.2s ease-in-out infinite;
}

#map .s.oshi {
  outline: 3px solid var(--yellow);
  outline-offset: 1px;
}

#map .s.usual {
  outline: 3px solid var(--sky-ink);
  outline-offset: 1px;
}

/* 見やすさで色分け（JS が data-heat に視野角の段階 0〜4 を入れる） */
#map.heat .s[data-heat='0']:not(.w, .on) {
  background: var(--heat-0);
}

#map.heat .s[data-heat='1']:not(.w, .on) {
  background: var(--heat-1);
}

#map.heat .s[data-heat='2']:not(.w, .on) {
  background: var(--heat-2);
}

#map.heat .s[data-heat='3']:not(.w, .on) {
  background: var(--heat-3);
}

#map.heat .s[data-heat='4']:not(.w, .on) {
  background: var(--heat-4);
}

/* 色分けのあいだは、選んだ席を墨にして色の段階と見分ける */
#map.heat .s.on {
  background: var(--ink);
  box-shadow:
    0 0 0 2px var(--paper),
    0 0 0 4px var(--ink);
}

/* ---- 凡例（席の形の小さな見本） */
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  color: var(--sub);
  font-size: 12px;
}

.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend i {
  display: inline-block;
  flex: none;
  width: 12px;
  height: 11px;
  border-radius: 5px 5px 2px 2px;
  background: var(--seat);
}

.legend i.p {
  background: var(--seat-premium);
}

.legend i.d {
  background: var(--seat-pair);
}

.legend i.w {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--seat-wheelchair);
}

.legend i.on {
  background: var(--red);
}

.legend i.heat-0 {
  background: var(--heat-0);
}

.legend i.heat-1 {
  background: var(--heat-1);
}

.legend i.heat-2 {
  background: var(--heat-2);
}

.legend i.heat-3 {
  background: var(--heat-3);
}

.legend i.heat-4 {
  background: var(--heat-4);
}

/* スマホ: 下に貼りつく「この席から見る」 */
#goView {
  position: sticky;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 2;
  height: 52px;
  font-weight: 500;
  box-shadow: var(--shadow-accent-strong);
}

@media (min-width: 960px) {
  #seat .mapbox {
    background: var(--paper);
    box-shadow: var(--shadow-paper);
  }
}

/* ---- 同じ館のスクリーンの切り替え（座席表と見え方の両方。.seg.scr-switch の面をなくし、1つずつ丸いチップにする）。
   右端を薄くして、横に流れることを示す */
.scr-switch[data-scr-switch] {
  gap: 6px;
  padding: 2px 28px 4px 0;
  border-radius: 0;
  background: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}

.scr-switch[data-scr-switch] button {
  min-width: 44px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--tint);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.scr-switch[data-scr-switch] button:hover {
  background: var(--line);
}

.scr-switch[data-scr-switch] button.on {
  background: var(--red-soft);
  color: var(--red-ink);
  font-weight: 500;
  box-shadow: inset 0 0 0 1.5px var(--red);
}

.scr-switch[data-scr-switch] small {
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 500;
}

.scr-switch[data-scr-switch] button.on small {
  color: var(--red-ink);
}

/* ---- 内側の画面とダイアログ（推し席診断・シェア）のボタンの文字は少し軽く */
:is(#seat, #view, #modal) .btn {
  font-weight: 500;
}

/* シェアの画像（縦長のカード） */
.share-shot {
  margin: 0;
}

.share-shot .share-img {
  box-shadow: var(--shadow-paper);
}

@media (min-width: 960px) {
  /* PC の座席表の列は淡い面なので、チップは白 */
  #seat .scr-switch[data-scr-switch] button:not(.on) {
    background: var(--paper);
  }
}

/* ---- スマホの席の画面: スクリーンの名前はヘッダーに出ているので、ここでは種類と席数の行だけ残す
   （並び順は layout.css） */
@media (max-width: 959.98px) {
  #seat .page-head h2 {
    display: none;
  }
}
