/* Chowka-Bhara — Setup screen controls. */

  /* ============================= SETUP SCREEN ============================= */
  #setup-screen .mat-panel { max-width: 640px; margin: 0 auto; }
  /* Outside the tab panels — the lobby, mostly — sections still space
     themselves. Inside them the panel does it, see below. */
  .setup-section { margin-bottom: 24px; }
  .setup-section:last-of-type { margin-bottom: 0; }
  .setup-label {
    display:block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #5c4a2e;
    margin-bottom: 10px;
    font-weight: 600;
  }

  .segmented { display:flex; gap:8px; flex-wrap:wrap; }
  .segmented input { position:absolute; opacity:0; pointer-events:none; }
  .segmented label {
    flex: 1 1 auto;
    min-width: 120px;
    text-align:center;
    padding: 12px 14px;
    border: 1.5px solid var(--mat-edge);
    border-radius: 8px;
    background: rgba(255,255,255,0.25);
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
    font-size: 0.95rem;
  }
  .segmented label .sub { display:block; font-size:0.74rem; opacity:0.7; font-family: var(--font-mono); margin-top:2px; }
  .segmented input:checked + label {
    background: var(--ink-0);
    border-color: var(--ink-0);
    color: var(--khaki-text);
  }
  .segmented input:focus-visible + label { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
  .segmented label:hover { transform: translateY(-1px); }

  /* An option can be ruled out by another one — three computers need at least
     three seats. Without this it looked exactly like every other choice and
     simply did nothing when pressed, which reads as a broken button rather
     than an unavailable one. */
  .segmented input:disabled + label {
    opacity: 0.38;
    cursor: not-allowed;
    background: transparent;
    border-style: dashed;
  }
  .segmented input:disabled + label:hover { transform: none; }

  .rules-preview {
    font-size: 0.88rem;
    line-height:1.55;
    background: rgba(255,255,255,0.3);
    border: 1px dashed var(--mat-edge);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 24px;
  }
  .rules-preview strong { color: #4a3a22; }

  .begin-btn {
    display:block;
    width:100%;
    padding: 14px;
    background: var(--home-ring);
    border: 1.5px solid #8a6420;
    border-radius: 8px;
    color: #2b1e0a;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: 0 3px 0 #8a6420;
    transition: transform .08s ease, box-shadow .08s ease;
  }
  .begin-btn:hover { background: var(--accent-hover); }
  .begin-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6420; }

/* ============================= SETUP TABS ============================= */

/* Three ways to start a game, each showing only what it needs. The board and
   player controls are shared and moved between panels, so nothing is duplicated
   and nothing can disagree. */
.setup-tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  margin-bottom: 22px;
  background: rgba(0,0,0,0.09);
  border: 1px solid var(--mat-edge);
  border-radius: 12px;
}
.setup-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 11px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #5c4a2e;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.setup-tab:hover { color: var(--ink-text); background: rgba(255,255,255,0.35); }
.setup-tab.on {
  background: var(--ink-0);
  color: var(--khaki-text);
  box-shadow: 0 2px 8px -2px rgba(51,65,90,0.5);
}

/* The panel owns the spacing, so every block is the same distance from the
   next no matter how it is nested. Leaving it to margins meant :last-of-type
   zeroed whichever block happened to be last inside each wrapper, which is why
   some gaps closed up and others did not. */
.setup-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.setup-panel[hidden] { display: none; }

/* The shared settings are moved between panels, so they must not introduce a
   box of their own — their sections need to be direct children of the panel
   for one gap to govern all of them. */
.panel-slot,
#game-settings { display: contents; }

.setup-panel .setup-section,
.setup-panel .setup-note { margin-bottom: 0; }

.setup-note {
  font-size: 0.86rem;
  line-height: 1.55;
  color: #5c4a2e;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 2px solid var(--mat-edge);
}

/* A hidden panel must stay hidden even though its wrappers are display:contents. */
.setup-panel[hidden] .panel-slot,
.setup-panel[hidden] #game-settings { display: none; }

/* The accessibility button sits apart from the game settings, since it is not
   one of them. */
#setup-screen .a11y-btn { margin-top: 22px; margin-bottom: 0; }
