/* ============================================================
   席次表ページ
   会場のテーブル配置図（円卓）＋ 全テーブルの詳細
   ============================================================ */

:root {
  --s-groom: #5b7fa6;
  --s-bride: #c17b91;
  --s-both: #a68a5b;
}

#seating-root {
  max-width: 640px;
  margin: 0 auto;
}

.sv-lead {
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
  text-align: center;
  padding: 24px min(8vw, 38px) 0;
}

/* ---- 凡例 ---- */
.sv-legend {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 16px 0 4px;
  padding: 0 min(8vw, 38px);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.sv-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sv-legend i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.sv-legend i.is-groom { background: var(--s-groom); }
.sv-legend i.is-bride { background: var(--s-bride); }
.sv-legend i.is-both { background: var(--s-both); }

/* ============================================================
   会場図
   前方に新郎新婦のソファ、右手に出入口を添える
   ============================================================ */
.hall {
  /* 卓の並びの左右に均等に空ける余白。出入口はこの右側に置く */
  --door-gutter: 30px;
  padding: 22px min(8vw, 38px) 0;
}

/* ---- 新郎新婦のソファ（B と C の間の前あたり） ---- */
.hall__front {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.hall__sofa {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--accent);
  /* 背もたれ側（前方）を丸くしてソファに見せる */
  border-radius: 17px 17px 6px 6px;
  background: #fdf3ee;
}

/* 新郎・新婦もゲスト卓と同じく丸で表す */
.hall__seat {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* ---- 卓の並び＋出入口 ----
   左右に同じ余白を取ることで、出入口があっても卓の並びは画面の中央に来る */
.hall__floor {
  position: relative;
  padding-inline: var(--door-gutter);
}

/* 3行のうち真ん中の行（H のある行）の高さに合わせる。
   ラベルのぶんは外側のパディングにはみ出させ、卓の並びを狭めずに済ませる */
.hall__door {
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

.hall__door-mark {
  width: 3px;
  height: 46px;
  border-radius: 2px;
  background: var(--accent);
}

.hall__door-text {
  writing-mode: vertical-rl;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

/* ---- テーブルの並び ----
   行ごとにグリッドを組み、列幅は固定して justify-content で中央寄せする。
   こうすると卓が4つに満たない行（最終行）が行の中央に並ぶ */
.layout {
  display: grid;
}

.layout__row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--col);
  gap: var(--gap);
  justify-content: center;
}

.layout--mini {
  --gap: 10px;
  --col: calc((100% - 3 * var(--gap)) / 4);
  gap: var(--gap);
}

/* ============================================================
   円卓
   席は JS が left/top を % で打ち込む。中心から等間隔に並ぶ
   ============================================================ */
.rt {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
  aspect-ratio: 1;
}

/* テーブル本体 */
.rt__table {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 33%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #faf7f5;
  border: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.rt.is-groom .rt__table { border-color: var(--s-groom); }
.rt.is-bride .rt__table { border-color: var(--s-bride); }
.rt.is-both .rt__table { border-color: var(--s-both); }

.rt__letter {
  font-family: var(--font-en);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.rt__cnt {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* 席
   幅は器に対する％。px 固定にすると画面幅によって席どうしが
   重なったり枠からはみ出したりするため。
   お名前5文字＋「様」が1行に収まる幅を確保している */
.rt__seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 26%;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 2px solid var(--line);
  border-radius: 7px;
  padding: 5px 2px;
}

.rt__seat.is-groom { border-top-color: var(--s-groom); }
.rt__seat.is-bride { border-top-color: var(--s-bride); }
.rt__seat.is-both { border-top-color: var(--s-both); }

.rt__title {
  display: block;
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.rt__name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.rt__name small {
  font-size: 7px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 1px;
}

/* ---- あなたのお席 ---- */
.rt__seat.is-me {
  border: 2px solid var(--accent);
  background: #fdf3ee;
  box-shadow: 0 0 0 3px rgba(201, 111, 74, 0.16);
  z-index: 2;
}

.rt__seat.is-me::after {
  content: "あなた";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  padding: 3px 6px;
  border-radius: 3px;
}

/* ============================================================
   配置図の小さな円卓
   ============================================================ */
.mini {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
}

/* 席をあらわす点 */
.mini i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--line);
}

.mini.is-groom i { background: var(--s-groom); }
.mini.is-bride i { background: var(--s-bride); }
.mini.is-both i { background: var(--s-both); }

.mini__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mini__letter {
  font-family: var(--font-en);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.mini__cnt {
  font-size: 8px;
  color: var(--ink-soft);
}

.mini:hover .mini__ring {
  transform: translate(-50%, -50%) scale(1.06);
}

.mini:active .mini__ring,
.mini:focus-visible .mini__ring {
  background: var(--ink);
  color: #fff;
}

.mini:active .mini__cnt,
.mini:focus-visible .mini__cnt {
  color: #fff;
}

/* ---- 配置図のなかの「あなたのテーブル」 ---- */
.mini.is-me .mini__ring {
  border: 2px solid var(--accent);
  background: #fdf3ee;
  animation: me-ring 1.8s ease-in-out infinite;
}

.mini.is-me .mini__letter {
  color: var(--accent);
}

/* 自分の席の点だけ、ぴこぴこ光らせる */
.mini i.is-me {
  background: var(--accent);
  z-index: 1;
  animation: me-dot 1.8s ease-in-out infinite;
}

/* 点は translate で位置合わせしているので、拡大にも同じ移動を含める */
@keyframes me-dot {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0 rgba(201, 111, 74, 0.6);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.45);
    box-shadow: 0 0 0 6px rgba(201, 111, 74, 0);
  }
}

@keyframes me-ring {
  0%, 100% { box-shadow: 0 0 0 3px rgba(201, 111, 74, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(201, 111, 74, 0.05); }
}

/* ============================================================
   あなたのお席のご案内（先頭に出るカード）
   ============================================================ */
/* 他のセクションと左右の余白をそろえる */
#me-slot:not(:empty) {
  padding: 20px min(8vw, 38px) 0;
}

.me-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 2px solid var(--accent);
  background: #fdf3ee;
  color: var(--ink);
  font-family: inherit;
  padding: 14px 16px;
  cursor: pointer;
  animation: sv-in 0.5s ease both;
}

.me-card__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent);
}

.me-card__body {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.me-card__letter {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: #fff;
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.me-card__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.me-card__name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.me-card__name small {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 4px;
}

.me-card__go {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

/* 新郎新婦ご本人（前方のソファ席）。飛び先が無いのでボタンにしない */
.me-card--sofa {
  cursor: default;
}

.me-card__letter--sofa {
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.hall__seat.is-me {
  border-width: 2px;
  background: var(--accent);
  color: #fff;
  animation: me-ring 1.8s ease-in-out infinite;
}

@keyframes sv-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   テーブルごとの詳細
   ============================================================ */
.sv-map__tables {
  display: grid;
  gap: 10px;
  padding: 20px min(8vw, 38px) 0;
}

/* 席札が円の外側にはみ出すぶん、左右の余白は詰めておく */
.tblock {
  border: 1px solid var(--ink);
  padding: 16px 6px 8px;
  transition: background 0.5s ease;
}

.tblock.is-flash {
  animation: tblock-flash 1.4s ease;
}

@keyframes tblock-flash {
  0%, 60% { background: #fdf3ee; }
  100% { background: transparent; }
}

.tblock__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--line);
}

.tblock__letter {
  font-family: var(--font-en);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
}

.tblock__meta {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.tblock__meta small {
  display: block;
  font-size: 10px;
}

/* ---- 動きを減らす設定のときはアニメーションを止める ----
   点滅は止めるが、色による強調はそのまま残す */
@media (prefers-reduced-motion: reduce) {
  .tblock.is-flash,
  .me-card {
    animation: none;
  }

  .mini i.is-me,
  .mini.is-me .mini__ring,
  .hall__seat.is-me {
    animation: none;
    box-shadow: 0 0 0 3px rgba(201, 111, 74, 0.2);
  }
}
