/* ══════════════════════════════════════════════════════════════════════════
   TEMPORARY PROTOTYPE — Room Creator "Royal Tactile Light" visual concept
   ══════════════════════════════════════════════════════════════════════════
   Activation: opt-in only, via the URL query param `?prototype=royal-tactile`.
           The synchronous <head> script in lobby.html reads that param and sets
           `<html data-rc-proto="royal-tactile">` — this file never applies on
           its own, and no query param means neither prototype is active.
           Mutually exclusive with `?prototype=steampunk-room-creator`.

   Scope:  every rule below is prefixed with
           `html[data-rc-proto="royal-tactile"] #screen-join #create-options`
           (or a descendant of it). It touches NOTHING outside the Room Creator's
           "create-options" panel — no other screen, modal, or shared component
           is targeted, styled, or overridden by this file.

   Status: presentation-only prototype for design review. No JavaScript in this
           project reads any class or selector introduced here. Every control
           keeps its original id, name, value, and event binding from lobby.html
           / lobby.js — this file only repaints them.

   Revert: delete the <link rel="stylesheet" href="room-creator-prototype.css">
           tag in lobby.html, remove the `royal-tactile` branch from the
           activation script, remove the inert "Game Mode" row markup, and
           delete this file. Nothing else references it.

   Reference: Frontend_redesign/room-creator/Gpt-output/
              concept-1-royal-tactile-light-cascade-menus.png
   Companion doc: Frontend_redesign/02-room-creator-prototype.md
   ═══════════════════════════════════════════════════════════════════════════ */

html[data-rc-proto="royal-tactile"] #screen-join #create-options {
  /* Local palette — scoped custom properties, never written to :root, so
     nothing outside this panel can see or inherit them. */
  --rc-navy:        #16233f;
  --rc-navy-soft:   #223454;
  --rc-gold:        #caa04a;
  --rc-gold-light:  #ecd48a;
  --rc-gold-deep:   #9c7328;
  --rc-ivory:       #f6efe0;
  --rc-ivory-deep:  #ece2c8;
  --rc-input-bg:    #fbf7ec;
  --rc-ink:         #1c2740;
  --rc-ink-soft:    rgba(28, 39, 64, .64);
  --rc-ink-faint:   rgba(28, 39, 64, .38);
  --rc-error:       #a3271a;
  --rc-focus:       #16233f;
  /* Chamfered ("cut-corner") shapes shared by the card and its inner rows. */
  --rc-clip-card: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px),
                           calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px);
  --rc-clip-chip: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%,
                           0 100%, 0 10px);

  background: var(--rc-ivory);
  border: 3px solid var(--rc-navy);
  border-radius: 0;
  box-shadow:
    inset 0 0 0 2px var(--rc-gold),
    0 14px 30px rgba(20, 16, 8, .28);
  clip-path: var(--rc-clip-card);
  padding: 22px 20px 24px;
  gap: 16px;
  color: var(--rc-ink);
}

/* ── Explainer paragraph — kept (not shown in the reference crop) so the
   short "what is this panel" copy isn't silently dropped; recoloured to sit
   on the ivory ground. ─────────────────────────────────────────────────── */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .panel-explain {
  color: var(--rc-ink-soft);
}

/* ── Field labels — reference uses plain-case navy labels, not the app's
   uppercase/letter-spaced default. Quicksand is already loaded by this page
   (used elsewhere for headline text), reused here rather than adding a font. */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .field-label {
  display: block;
  color: var(--rc-ink);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

/* "Required" caption under Number of Players — reference shows it as a small
   blue caption on its own line, not an inline amber pill. */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .field-group:has(#create-np-btns) .field-label {
  color: var(--rc-ink);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .field-group:has(#create-np-btns) .field-label::after {
  content: "Required";
  display: block;
  margin: 2px 0 0;
  padding: 0;
  background: none;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
  color: #2b5aa3;
}

/* ── Prototype-only "Game Mode" row ───────────────────────────────────────
   Purely decorative: no <select>, no name/value, not read by any script, not
   part of _validateCreateRoom() or the CREATE_GAME payload. Styled to match
   the other cascade rows so it previews correctly, but it is inert (see the
   role="presentation"/aria-hidden/tabindex=-1 on the element in lobby.html). */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .rc-gamemode-group {
  /* Base markup ships `style="display:none"` (invisible with no prototype
     active); !important is required because a class-selector rule cannot
     outrank an inline style otherwise, however specific the selector. */
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 2px;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .rc-fake-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--rc-input-bg);
  border: 1.5px solid var(--rc-gold-deep);
  clip-path: var(--rc-clip-chip);
  color: var(--rc-ink);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: .98rem;
  cursor: default;
  /* Inert: no pointer affordance, no focus ring — this row cannot be
     activated (see markup: role="presentation", aria-hidden, tabindex="-1"). */
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .rc-fake-select-chevron {
  color: var(--rc-gold-deep);
  font-size: 1rem;
  line-height: 1;
}

/* ── Pace (existing radios, restyled as a connected cascade row) ─────────
   Behaviour is untouched: two radio inputs named "create-mode", each still
   toggles the same underlying state via the unchanged lobby.js listener. */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-toggle-group {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  border: 1.5px solid var(--rc-gold-deep);
  clip-path: var(--rc-clip-chip);
  background: var(--rc-input-bg);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-toggle-opt {
  flex: 1 1 0;
  gap: 2px;
  padding: 11px 30px 11px 14px;
  border: none;
  border-right: 1px solid rgba(28, 39, 64, .18);
  border-radius: 0;
  background: transparent;
  color: var(--rc-ink-soft);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-toggle-opt:last-child {
  border-right: none;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-toggle-opt:has(input:checked) {
  background: linear-gradient(180deg, var(--rc-gold-light), var(--rc-gold) 70%);
  color: var(--rc-navy);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-toggle-opt span {
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: .92rem;
  color: inherit;
}
/* Decorative clock / hourglass glyphs — CSS-generated content only, no markup
   change, so the existing <span>Real-Time</span> / <span>Turn-Based</span>
   text nodes (and the radios/info buttons around them) are untouched. */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-toggle-opt:has(#create-mode-realtime) span::before {
  content: "🕐 ";
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-toggle-opt:has(#create-mode-async) span::before {
  content: "⏳ ";
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-info-btn {
  border-color: var(--rc-ink-faint);
  color: var(--rc-ink-soft);
  background: transparent;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-info-btn:hover {
  border-color: var(--rc-navy);
  color: var(--rc-navy);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .mode-toggle-opt:has(input:focus-visible) {
  outline: 2px solid var(--rc-focus);
  outline-offset: 2px;
}

/* ── Number of Players — connected segmented control ─────────────────────
   Same 4 buttons, same ids/data-np/click handlers; only the visual treatment
   changes to the reference's single connected bar with a gold active tile. */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .np-pref-btns {
  gap: 0;
  border: 1.5px solid var(--rc-gold-deep);
  clip-path: var(--rc-clip-chip);
  background: var(--rc-input-bg);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-np-pref {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border: none;
  border-right: 1px solid rgba(28, 39, 64, .18);
  border-radius: 0;
  background: transparent;
  color: var(--rc-ink);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 13px 8px;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-np-pref:last-child {
  border-right: none;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-np-pref:hover {
  background: rgba(28, 39, 64, .07);
  color: var(--rc-ink);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-np-pref.np-pref-active {
  background: linear-gradient(180deg, var(--rc-gold-light), var(--rc-gold) 75%);
  color: var(--rc-navy);
  font-weight: 800;
}
/* Selected-state checkmark badge — decorative ::after, kept inside the
   button's own box (not overhanging the segmented bar) so it can never be
   clipped by the bar's chamfered-corner clip-path. */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-np-pref.np-pref-active::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--rc-navy);
  color: var(--rc-ivory);
  font-size: .6rem;
  line-height: 15px;
  text-align: center;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-np-pref:focus-visible {
  outline: 2px solid var(--rc-focus);
  outline-offset: 2px;
}

/* ── Room Name (existing input, dir="auto" untouched — RTL/Persian typing
   keeps working; no text-align override here so the browser's own bidi
   handling for dir="auto" is left alone). ────────────────────────────────*/
html[data-rc-proto="royal-tactile"] #screen-join #create-options .field-input {
  background: var(--rc-input-bg);
  border: 1.5px solid var(--rc-gold-deep);
  clip-path: var(--rc-clip-chip);
  border-radius: 0;
  color: var(--rc-ink);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .field-input::placeholder {
  color: var(--rc-ink-faint);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .field-input:focus {
  border-color: var(--rc-navy);
  background: var(--rc-input-bg);
  outline: 2px solid var(--rc-focus);
  outline-offset: 1px;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options [aria-invalid="true"].field-input {
  border-color: var(--rc-error);
}

/* ── Game Setup summary row ───────────────────────────────────────────── */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .game-setup-summary {
  background: var(--rc-input-bg);
  border: 1.5px solid var(--rc-gold-deep);
  clip-path: var(--rc-clip-chip);
  border-radius: 0;
  padding: 10px 14px 10px 10px;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .game-setup-summary:hover {
  background: var(--rc-ivory-deep);
  border-color: var(--rc-navy);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .game-setup-summary:focus-visible {
  outline: 2px solid var(--rc-focus);
  outline-offset: 2px;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .gss-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--rc-navy);
  color: var(--rc-gold-light);
  border-radius: 4px;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .gss-title {
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  color: var(--rc-ink);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .gss-digest {
  color: var(--rc-ink-soft);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .gss-arrow {
  color: var(--rc-gold-deep);
}

/* ── Field validation messages — same markup/logic, recoloured for the
   ivory ground; contrast checked (~7.5:1 on --rc-ivory). ────────────────── */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .field-error {
  color: var(--rc-error);
}

/* ── Create Room ──────────────────────────────────────────────────────── */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-create-confirm {
  background: linear-gradient(180deg, var(--rc-gold-light) 0%, var(--rc-gold) 55%, var(--rc-gold-deep) 100%);
  border: 1.5px solid var(--rc-navy);
  clip-path: var(--rc-clip-chip);
  color: var(--rc-navy);
  font-family: 'Cinzel', 'Quicksand', serif;
  font-weight: 900;
  letter-spacing: .06em;
  font-size: .92rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-create-confirm:hover:not(:disabled) {
  filter: brightness(1.04);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-create-confirm:focus-visible {
  outline: 2px solid var(--rc-focus);
  outline-offset: 2px;
}

/* ── Back ──────────────────────────────────────────────────────────────── */
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-back {
  color: var(--rc-ink-soft);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  font-weight: 700;
  align-self: center;
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-back:hover {
  color: var(--rc-navy);
}
html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-back:focus-visible {
  outline: 2px solid var(--rc-focus);
  outline-offset: 2px;
}

/* ── Small-viewport safety: keep tap targets comfortable and let the
   chamfer scale down gracefully; no layout/behaviour change. ─────────────*/
@media (max-width: 380px) {
  html[data-rc-proto="royal-tactile"] #screen-join #create-options {
    padding: 18px 14px 20px;
  }
}

/* Player-count labels ("2 Players" etc.) at phone widths: the base stylesheet
   already shrinks these to a single-line 4-column grid at ≤540px (lobby.css
   ~4990-5002), but this file's higher (double-ID) specificity was also
   overriding its font-size/white-space, so the now-larger nowrap text no
   longer fit and overlapped between cells. Restoring wrapping (rather than
   trying to out-shrink it) is the same safe fix used at the desktop width,
   just re-asserted here since our selector otherwise wins that fight. */
@media (max-width: 540px) {
  html[data-rc-proto="royal-tactile"] #screen-join #create-options .btn-np-pref {
    white-space: normal;
    font-size: .78rem;
    line-height: 1.15;
    padding: 10px 3px;
  }
}
