/* "Convene the board" — the live session screen.
   Laptops and desktops (1000px+): a full-screen session room sized to the screen.
     header ─────────────────────────────────────────────
     the question            │ session (phase, timer, steps)
     the table: four         │ The Crown's recommendation
     executives + The Crown  │ (preview shimmer until it is ready)
   Phones keep the stacked layout from boardroom.css / dashboard.css.
   Loaded after the page's other boardroom styles (app.html and index.html). */

/* the question line in the app (the landing page styles its own) */
.board-panel .st-board-q { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); color: #fff; font-size: 14px; font-weight: 500; }
.board-panel .st-board-q:empty { display: none; }

/* "View decision" lights up once The Crown has given its decision */
.board-btn.ready {
  border-color: var(--orange, #d9541e); background: var(--orange, #d9541e); color: #fff; font-weight: 700;
  box-shadow: 0 0 0 1px rgba(217, 84, 30, 0.35), 0 0 22px rgba(217, 84, 30, 0.45);
  animation: board-ready 1.6s ease-in-out 3;
}
@media (hover: hover) and (pointer: fine) { .board-btn.ready:hover { background: #e8622a; } }
@keyframes board-ready { 0%, 100% { box-shadow: 0 0 0 1px rgba(217, 84, 30, 0.35), 0 0 14px rgba(217, 84, 30, 0.3); } 50% { box-shadow: 0 0 0 4px rgba(217, 84, 30, 0.25), 0 0 38px rgba(217, 84, 30, 0.7); } }
@keyframes board-shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) { .board-btn.ready { animation: none; } }

@media (min-width: 1000px) {
  .board-overlay { padding: 0; background: #0b0b0b; }
  .board-overlay .board-panel,
  .board-overlay .board-panel.st-board {
    --gap: clamp(14px, 2vh, 24px);
    width: 100vw; max-width: none; height: 100dvh; max-height: none; border: 0; border-radius: 0; overflow: hidden;
    padding: clamp(14px, 2.2vh, 26px) clamp(24px, 3vw, 52px) clamp(10px, 1.6vh, 18px);
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 30vw, 520px);
    grid-template-rows: auto auto minmax(0, 1fr) auto; column-gap: var(--gap); row-gap: var(--gap);
    background:
      radial-gradient(70% 60% at 32% 62%, rgba(217, 84, 30, 0.07), transparent 70%),
      radial-gradient(40% 40% at 90% 0%, rgba(255, 255, 255, 0.035), transparent 70%),
      #0b0b0b;
  }

  /* ---- header ---- */
  .board-panel .board-bar { grid-column: 1 / -1; grid-row: 1; padding: 0 0 clamp(10px, 1.6vh, 16px); border-bottom-color: rgba(255, 255, 255, 0.07); }
  .board-panel .board-status {
    padding: 8px 14px 8px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04);
    font-size: 12px; letter-spacing: 0.12em;
  }
  .board-panel .board-btn { min-height: 40px; padding: 0 20px; border-radius: 999px; font-size: 14px; }

  /* ---- the question ---- */
  .board-panel .st-board-q {
    grid-column: 1; grid-row: 2; align-self: stretch; margin: 0; padding: clamp(14px, 2vh, 20px) 22px;
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.035);
    color: #fff; font-size: clamp(16px, 1.25vw, 20px); font-weight: 600; line-height: 1.35; letter-spacing: -0.01em;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  }
  .board-panel .st-board-q::before {
    content: "On the table"; display: block; margin-bottom: 6px;
    color: #a1998b; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  }
  .board-panel .st-board-q:empty ~ .board-stage { grid-row: 2 / 4; }

  /* ---- the table ---- */
  .board-panel .board-stage {
    grid-column: 1; grid-row: 3; min-height: 0; margin: 0; isolation: isolate;
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(160px, 13vw, 230px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(20px, 3vw, 56px); row-gap: var(--gap);
    padding: clamp(16px, 2.4vh, 28px) clamp(16px, 2vw, 28px);
    border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
  }
  /* the oval boardroom table behind The Crown */
  .board-panel .board-stage::before {
    content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 58%; height: 62%; transform: translate(-50%, -50%);
    border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.07);
    background: radial-gradient(closest-side, rgba(217, 84, 30, 0.1), rgba(217, 84, 30, 0.03) 60%, transparent);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
  }
  .board-panel .bc-wires { z-index: 1; }

  /* The Crown, at the head of the table */
  .board-panel .board-crown {
    grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: center; z-index: 2;
    width: 100%; padding: clamp(14px, 2vh, 22px) 12px clamp(14px, 2vh, 20px); border-radius: 22px;
    background: rgba(18, 16, 14, 0.92); border-color: rgba(255, 255, 255, 0.1);
  }
  .board-panel .board-crown svg { width: min(70%, 150px); }
  .board-panel .board-crown strong { margin-top: 10px; font-size: 13px; letter-spacing: 0.18em; }
  .board-panel .board-crown small { margin-top: 2px; font-size: 11px; }
  .board-panel .board-crown.lit { background: rgba(38, 20, 12, 0.95); }

  /* the four executives, one at each corner of the table */
  .board-panel .seat {
    z-index: 2; width: 100%; max-width: 360px; min-height: 0; margin: 0;
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; align-content: start;
    padding: clamp(12px, 1.8vh, 18px) clamp(14px, 1.3vw, 20px); border-radius: 18px;
    background: rgba(20, 20, 20, 0.9); border-color: rgba(255, 255, 255, 0.09);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
  .board-panel .seat:nth-child(1) { grid-column: 1; grid-row: 1; align-self: start; justify-self: start; }
  .board-panel .seat:nth-child(2) { grid-column: 3; grid-row: 1; align-self: start; justify-self: end; }
  .board-panel .seat:nth-child(3) { grid-column: 1; grid-row: 2; align-self: end; justify-self: start; }
  .board-panel .seat:nth-child(4) { grid-column: 3; grid-row: 2; align-self: end; justify-self: end; }
  .board-panel .seat > b { grid-column: 1; grid-row: 1 / span 2; width: 42px; height: 42px; border-radius: 12px; font-size: 12.5px; }
  .board-panel .seat > p { grid-column: 2; grid-row: 1; margin: 0; font-size: 14.5px; line-height: 1.25; }
  .board-panel .seat > small:nth-of-type(1) { grid-column: 2; grid-row: 2; margin: 2px 0 0; font-size: 12px; }
  .board-panel .seat > .bar { grid-column: 1 / -1; margin-top: clamp(10px, 1.5vh, 14px); height: 3px; }
  .board-panel .seat > small:nth-of-type(2) { grid-column: 1 / -1; margin-top: 8px; font-size: 12px; color: #9a9389; }
  .board-panel .seat > .finding-wrap { grid-column: 1 / -1; min-width: 0; }
  .board-panel .seat .finding { margin-top: 0; font-size: 13px; font-weight: 500; line-height: 1.5; color: #ebe4d6; }
  .board-panel .seat .finding.shown {
    max-height: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.07);
    max-height: calc(13px * 1.5 * 4 + 21px); overflow: hidden;
  }
  .board-panel .seat.on { border-color: rgba(217, 84, 30, 0.55); background: rgba(34, 22, 15, 0.95); box-shadow: 0 0 0 1px rgba(217, 84, 30, 0.18), 0 12px 34px rgba(217, 84, 30, 0.14); }
  .board-panel .seat.on > b, .board-panel .seat.done > b { border-color: rgba(217, 84, 30, 0.45); background: rgba(217, 84, 30, 0.14); color: #f2a27d; }

  /* ---- the session panel: activity, then the recommendation ---- */
  .board-panel .board-activity {
    grid-column: 2; grid-row: 2; align-self: stretch; margin: 0; padding: clamp(14px, 2vh, 20px) 22px;
    border-radius: 18px; border-color: rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.035);
  }
  .board-panel .board-activity .h3 { font-size: 16px; }
  .board-panel .board-activity #board-timer {
    padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: #cfc8bb; font-size: 12px;
  }
  .board-panel .board-activity .faint { font-size: 13px; line-height: 1.45; }
  .board-panel .board-steps { margin-top: clamp(10px, 1.6vh, 16px); gap: 6px; }
  .board-panel .board-steps span { height: 3px; transition: background-color 400ms ease; }

  .board-panel .board-output,
  .board-panel .board-output.hidden {
    grid-column: 2; grid-row: 3; min-height: 0; margin: 0; padding: 20px 22px;
    overflow-y: auto; overscroll-behavior: contain; border-radius: 18px;
  }
  .board-panel .board-output {
    border-color: rgba(217, 84, 30, 0.4);
    background: linear-gradient(180deg, rgba(217, 84, 30, 0.07), rgba(255, 255, 255, 0.03) 30%);
  }
  .board-panel .board-output-text { font-size: 14.5px; line-height: 1.7; }

  /* before the decision: a quiet preview of where it will appear */
  .board-panel .board-output.hidden {
    display: flex !important; flex-direction: column; justify-content: flex-start; gap: 16px; animation: none;
    border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.02);
  }
  .board-panel .board-output.hidden > * { display: none; }
  .board-panel .board-output.hidden::before {
    content: "The Crown's recommendation"; color: #a1998b; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  }
  .board-panel .board-output.hidden::after {
    content: ""; display: block; height: min(220px, 70%);
    -webkit-mask: linear-gradient(#000 0 0) top / 92% 12px no-repeat, linear-gradient(#000 0 0) 0 34px / 100% 10px no-repeat,
                  linear-gradient(#000 0 0) 0 58px / 84% 10px no-repeat, linear-gradient(#000 0 0) 0 82px / 95% 10px no-repeat,
                  linear-gradient(#000 0 0) 0 124px / 40% 10px no-repeat, linear-gradient(#000 0 0) 0 148px / 88% 10px no-repeat,
                  linear-gradient(#000 0 0) 0 172px / 70% 10px no-repeat;
            mask: linear-gradient(#000 0 0) top / 92% 12px no-repeat, linear-gradient(#000 0 0) 0 34px / 100% 10px no-repeat,
                  linear-gradient(#000 0 0) 0 58px / 84% 10px no-repeat, linear-gradient(#000 0 0) 0 82px / 95% 10px no-repeat,
                  linear-gradient(#000 0 0) 0 124px / 40% 10px no-repeat, linear-gradient(#000 0 0) 0 148px / 88% 10px no-repeat,
                  linear-gradient(#000 0 0) 0 172px / 70% 10px no-repeat;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 75%) 0 0 / 200% 100%;
    animation: board-shimmer 2.2s linear infinite;
  }

  .board-panel .board-note { grid-column: 1 / -1; grid-row: 4; margin: 0; text-align: left; font-size: 11px; color: #6f6a62; }
}

/* smaller laptops: a narrower session panel and crown */
@media (min-width: 1000px) and (max-width: 1279px) {
  .board-overlay .board-panel,
  .board-overlay .board-panel.st-board { grid-template-columns: minmax(0, 1fr) clamp(300px, 31vw, 360px); }
  .board-panel .board-stage { grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); column-gap: 18px; padding: 16px; }
  .board-panel .seat > b { width: 36px; height: 36px; font-size: 11.5px; }
  .board-panel .seat > p { font-size: 13.5px; }
}
/* short screens: keep everything on one screen */
@media (min-width: 1000px) and (max-height: 820px) {
  .board-panel .seat .finding.shown ~ *, .board-panel .seat:has(.finding.shown) > small:nth-of-type(2) { display: none; }
  .board-panel .board-crown svg { width: min(60%, 110px); }
  .board-panel .st-board-q { -webkit-line-clamp: 3; }
}
@media (prefers-reduced-motion: reduce) { .board-panel .board-output.hidden::after { animation: none; } }

/* big monitors: scale the room up so the table is not sparse */
@media (min-width: 1600px) and (min-height: 900px) {
  .board-panel .board-stage { grid-template-columns: minmax(0, 1fr) clamp(220px, 14vw, 280px) minmax(0, 1fr); padding: 32px 36px; }
  .board-panel .board-stage::before { width: 62%; height: 66%; }
  .board-panel .seat { max-width: 440px; padding: 22px 24px; border-radius: 20px; }
  .board-panel .seat > b { width: 50px; height: 50px; font-size: 14px; border-radius: 14px; }
  .board-panel .seat > p { font-size: 17px; }
  .board-panel .seat > small:nth-of-type(1), .board-panel .seat > small:nth-of-type(2) { font-size: 13.5px; }
  .board-panel .seat .finding { font-size: 15px; }
  .board-panel .seat .finding.shown { max-height: calc(15px * 1.5 * 5 + 21px); }
  .board-panel .board-crown strong { font-size: 15px; }
  .board-panel .board-crown small { font-size: 12.5px; }
  .board-panel .st-board-q { font-size: 22px; }
  .board-panel .board-activity .h3 { font-size: 18px; }
  .board-panel .board-activity .faint { font-size: 14.5px; }
  .board-panel .board-output-text { font-size: 16px; }
}
