/* Insider experience shell v2: one coherent salon stage plus one investigation folio. */
body[data-theme="insider-question-salon"] {
  background:
    linear-gradient(110deg, rgba(239,230,211,.95), rgba(221,210,193,.9)),
    repeating-linear-gradient(97deg, transparent 0 46px, rgba(48,39,59,.025) 47px 48px);
}

.room-layout.salon-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 286px;
  align-items: start;
  gap: 14px;
  margin-top: 12px;
}

.salon-stage { min-width: 0; }
.salon-ribbon { margin-bottom: -13px; border-color: rgba(205,169,95,.75); box-shadow: 0 7px 20px rgba(18,17,27,.28); }

.discussion-table.question-salon {
  position: relative;
  min-height: clamp(690px,calc(100vh - 132px),820px);
  padding: 0 0 142px;
  overflow: hidden;
  border: 5px solid #2a2030;
  border-radius: 32px;
  background:
    linear-gradient(rgba(10,14,26,.16),rgba(10,14,26,.31)),
    url("assets/question-salon-board.png") center / cover no-repeat,
    #171b2d;
  box-shadow: inset 0 0 90px rgba(0,0,0,.5),0 20px 48px rgba(37,25,30,.27);
}

.discussion-table.question-salon::before {
  inset: 13px;
  z-index: 1;
  border: 1px solid rgba(229,197,125,.48);
  border-radius: 23px;
}

.discussion-table.question-salon::after {
  content: "ASK  ·  LISTEN  ·  DOUBT  ·  DISCOVER";
  bottom: 151px;
  z-index: 2;
  color: rgba(240,214,153,.5);
}

.salon-mark { display: none; }
.table-title { top: 23px; color: #fff5df; text-shadow: 0 2px 12px #000; }
.table-title .eyebrow { color: #e7c570; }
.table-title > span { color: rgba(255,245,223,.72); }

/* All player cards share one fixed reference frame and never participate in document flow. */
.discussion-table .players {
  position: absolute;
  inset: 82px 24px 154px;
  z-index: 5;
  display: grid;
  grid-template-columns: 158px minmax(250px,1fr) 158px;
  grid-template-rows: 78px minmax(210px,1fr) 78px;
  gap: 10px 16px;
  pointer-events: none;
}

.discussion-table .player-seat,
.discussion-table .player-seat[data-seat-slot] {
  position: relative;
  width: 158px;
  min-width: 0;
  min-height: 0;
  height: 74px;
  padding: 8px 9px 7px 12px;
  overflow: visible;
  border: 1px solid rgba(229,197,125,.72);
  border-radius: 5px 14px 14px 5px;
  color: #252337;
  background: linear-gradient(145deg,rgba(255,252,238,.98),rgba(239,225,193,.96));
  box-shadow: 0 10px 24px rgba(0,0,0,.32);
  place-self: auto;
  pointer-events: auto;
}

.discussion-table .player-seat[data-seat-slot="northwest"] { grid-column:1; grid-row:1; align-self:start; justify-self:start; }
.discussion-table .player-seat[data-seat-slot="north"] { grid-column:2; grid-row:1; align-self:start; justify-self:center; }
.discussion-table .player-seat[data-seat-slot="northeast"] { grid-column:3; grid-row:1; align-self:start; justify-self:end; }
.discussion-table .player-seat[data-seat-slot="west"] { grid-column:1; grid-row:2; align-self:center; justify-self:start; }
.discussion-table .player-seat[data-seat-slot="east"] { grid-column:3; grid-row:2; align-self:center; justify-self:end; }
.discussion-table .player-seat[data-seat-slot="southwest"] { grid-column:1; grid-row:3; align-self:end; justify-self:start; }
.discussion-table .player-seat[data-seat-slot="south"] { grid-column:2; grid-row:3; align-self:end; justify-self:center; }
.discussion-table .player-seat[data-seat-slot="southeast"] { grid-column:3; grid-row:3; align-self:end; justify-self:end; }

.discussion-table .player-seat::before { width: 4px; background: #778f84; }
.discussion-table .player-seat.self { border-color: #dfb94f; box-shadow: 0 0 0 3px rgba(223,185,79,.2),0 10px 24px rgba(0,0,0,.34); }
.discussion-table .player-seat.self::before { background: #dfb94f; }
.discussion-table .player-seat.master { color: #fff8e8; border-color: #e2bf67; background: linear-gradient(145deg,#773447,#44253a); }
.discussion-table .seat-head { align-items: flex-start; }
.discussion-table .seat-head > div { min-width: 0; }
.discussion-table .seat-head b { display: block; max-width: 9em; font-size: .77rem; }
.discussion-table .seat-head small { margin-top: 1px; font-size: .56rem; }
.discussion-table .seat-head > button { min-width: 23px; width: 23px; height: 22px; padding: 0; font-size: 0; }
.discussion-table .seat-head > button::after { content: "•••"; font-size: .55rem; letter-spacing: -.04em; }
.discussion-table .seat-badges { flex-wrap: nowrap; gap: 3px; margin-top: 5px; overflow: hidden; }
.discussion-table .badge { flex: 0 1 auto; max-width: 100%; padding: 2px 5px; overflow: hidden; font-size: .5rem; text-overflow: ellipsis; white-space: nowrap; }

/* A sealed answer card is the semantic center; it opens only for public round results. */
.discussion-table .public-focus {
  top: 47%;
  width: clamp(238px,28vw,310px);
  aspect-ratio: 1.35;
  padding: 42px 26px 27px;
  border: 2px solid #dabb6c;
  border-radius: 14px;
  background:
    linear-gradient(135deg,rgba(255,255,255,.05),transparent 48%),
    linear-gradient(150deg,#303753,#181c32);
  box-shadow: inset 0 0 0 7px rgba(255,255,255,.025),0 18px 45px rgba(0,0,0,.48);
}
.discussion-table .public-focus::before {
  content: "?";
  top: -24px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 3px double #e1c16e;
  border-radius: 50%;
  color: #f0d58b;
  background: #7e3145;
  font: 900 1.55rem/1 Georgia,serif;
  transform: translateX(-50%) rotate(-7deg);
  box-shadow: 0 7px 17px rgba(0,0,0,.35);
}
.discussion-table .public-focus strong { font-size: clamp(1rem,1.9vw,1.38rem); }
.discussion-table .public-focus small { font-size: .7rem; }
.discussion-table[data-phase="roundEnd"] .public-focus { animation: answer-card-reveal .7s ease both; }

/* The speaking console is physically attached to the bottom edge of the table. */
.discussion-table .control-dock {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  z-index: 18;
  grid-template-columns: minmax(280px,1.45fr) minmax(210px,.55fr);
  width: auto;
  min-height: 112px;
  max-height: 126px;
  margin: 0;
  padding: 11px 14px;
  overflow: auto;
  border-color: rgba(223,185,79,.6);
  border-radius: 7px 20px 7px 20px;
  background: rgba(250,242,220,.96);
  box-shadow: 0 12px 32px rgba(0,0,0,.42);
}
.discussion-table .control-dock[data-role="spectator"] { position: absolute; bottom: 14px; }
.discussion-table .timer { border-color: #b48b3d; background: #fff4cf; }
.discussion-table .timer i { background: #9b4051; }

/* One continuous folio replaces four unrelated cards. */
.salon-archive {
  position: sticky;
  top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(72,46,48,.25);
  border-radius: 9px 24px 9px 24px;
  background: #f7edd7;
  box-shadow: 0 16px 38px rgba(52,36,39,.18);
}
.archive-heading { padding: 17px 16px 14px; color: #fff7e5; background: linear-gradient(145deg,#59283b,#2f2638); }
.archive-heading h2 { margin: 0; font: 800 1.2rem Georgia,"Noto Serif SC",serif; }
.archive-heading span { display: block; margin-top: 4px; color: rgba(255,247,229,.65); font-size: .66rem; }
.salon-archive > .panel { margin: 0; border: 0; border-top: 1px solid rgba(88,58,57,.16); border-radius: 0; box-shadow: none; background: rgba(255,250,237,.82); }
.salon-archive .stats-card,.salon-archive .log-card { padding: 13px 14px; }
.salon-archive .stats { grid-template-columns: 1fr; gap: 4px; }
.salon-archive .stats span { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border: 0; border-left: 3px solid #a14052; text-align: left; }
.salon-archive .stats b { font-size: 1rem; }
.salon-archive .log { max-height: 230px; }
.salon-archive .spectator-list { max-height: 140px; }

.presentation-token { border-color: #f0d27f; background: #8b354a; box-shadow: 0 0 21px rgba(238,196,103,.72); }
.presentation-token[data-presentation-kind="master-answer"] { color: #2e2533; background: #f2d98f; }
.presentation-token[data-presentation-kind="vote-sealed"] { border-style: double; background: #8b354a; transform-origin: center; }
.presentation-token[data-presentation-kind="correct-guess"] { color: #173f32; background: #b7dfc7; }
.presentation-token[data-presentation-kind="round-result"] { border-radius: 7px; background: #272d49; }
.presentation-announcement { top: 15%; border-color: rgba(235,203,128,.82); background: rgba(30,27,45,.96); }

@keyframes answer-card-reveal {
  0% { opacity: .35; transform: translate(-50%,-50%) rotateY(82deg) scale(.92); }
  70% { transform: translate(-50%,-50%) rotateY(-5deg) scale(1.03); }
  100% { opacity: 1; transform: translate(-50%,-50%) rotateY(0) scale(1); }
}

@media (max-width: 1180px) {
  .room-layout.salon-layout { grid-template-columns: 1fr; }
  .salon-archive { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); border-radius: 10px; }
  .archive-heading { grid-column: 1 / -1; }
  .salon-archive > .panel { border-left: 1px solid rgba(88,58,57,.12); }
  .salon-archive .stats { grid-template-columns: repeat(3,1fr); }
  .salon-archive .stats span { display: grid; justify-content: center; text-align: center; }
}

@media (max-width: 820px) {
  .discussion-table .players { inset-inline: 12px; grid-template-columns: 132px minmax(210px,1fr) 132px; }
  .discussion-table .player-seat,.discussion-table .player-seat[data-seat-slot] { width: 132px; }
  .discussion-table .seat-head b { max-width: 7em; }
}

@media (max-width: 720px) {
  .discussion-table.question-salon {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 0;
    padding: 52px 8px 12px;
    overflow: visible;
    border-radius: 20px;
    background-position: center top;
  }
  .discussion-table.question-salon::after { display: none; }
  .discussion-table .public-focus { position: relative; order: 1; top: auto; left: auto; width: min(310px,88%); min-height: 180px; margin: 18px auto 4px; transform: none; }
  .discussion-table[data-phase="roundEnd"] .public-focus { animation: answer-card-reveal-mobile .55s ease both; }
  .discussion-table .players { position: relative; inset: auto; order: 2; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: none; gap: 7px; }
  .discussion-table .player-seat,.discussion-table .player-seat[data-seat-slot] { grid-column: auto; grid-row: auto; place-self: stretch; width: auto; height: 68px; }
  .discussion-table .control-dock,.discussion-table .control-dock[data-role="spectator"] { position: sticky; right: auto; bottom: max(5px,env(safe-area-inset-bottom)); left: auto; order: 3; grid-template-columns: 1fr; width: 100%; max-height: 58vh; margin: 0; }
  .presentation-effects { position: absolute; }
  .salon-archive { grid-template-columns: 1fr; }
  .archive-heading { grid-column: auto; }
  .salon-archive .stats { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 430px) {
  .discussion-table .players { grid-template-columns: 1fr; }
  .discussion-table .player-seat,.discussion-table .player-seat[data-seat-slot] { height: 62px; }
  .discussion-table .seat-badges { justify-content: flex-start; }
  .archive-heading { padding: 13px; }
}

@keyframes answer-card-reveal-mobile {
  from { opacity: .35; transform: rotateY(78deg) scale(.94); }
  to { opacity: 1; transform: rotateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .discussion-table[data-phase="roundEnd"] .public-focus { animation: none; }
}
