﻿/* platform-shell shell-play-chrome.css — top-bar, sound strip, spectator, play dock */
.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  font-size: 0.85rem;
  line-height: 1.25;
  color: var(--muted);
  margin-bottom: 0.5rem;
  gap: 0.4rem 0.5rem;
  min-height: 1.5rem;
}

#play-round {
  justify-self: start;
  min-width: 0;
}

.top-bar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  justify-self: end;
  min-width: 0;
}

#play-round.is-final-round {
  color: #f0c14b;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* All-time high for current round length (risk target) */
.record-high-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  margin: 0 0 0.55rem;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    rgba(240, 193, 75, 0.14),
    rgba(240, 193, 75, 0.05)
  );
  border: 1px solid rgba(240, 193, 75, 0.28);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
  text-align: center;
}

.record-high-banner.is-empty {
  opacity: 0.85;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.record-high-banner--inline {
  margin: 0 0 0.85rem;
}

.record-high-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.68rem;
  color: var(--bank-gold-dim);
}

.record-high-score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--bank-gold);
  font-size: 0.95rem;
}

.record-high-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.record-high-banner.is-beating .record-high-score {
  color: var(--success);
}

.record-high-banner.is-beating {
  border-color: rgba(62, 207, 142, 0.4);
  background: linear-gradient(
    135deg,
    rgba(62, 207, 142, 0.12),
    rgba(62, 207, 142, 0.04)
  );
}

.record-high-banner.is-beating .record-high-label {
  color: var(--success);
}

.play-code-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

#play-code {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.btn-copy-link {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  padding: 0.22rem 0.45rem;
  border-radius: 7px;
  background: rgba(61, 156, 240, 0.15);
  border: 1px solid rgba(61, 156, 240, 0.35);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy-link:hover {
  background: rgba(61, 156, 240, 0.28);
  border-color: rgba(61, 156, 240, 0.55);
}

/* Compact control: same visual height as Round / room code row */
.sound-control {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  justify-self: center;
  flex-shrink: 0;
  height: 1.5rem;
  box-sizing: border-box;
  padding: 0 0.3rem 0 0.1rem;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: min(8.5rem, 36vw);
  max-width: 9rem;
}

.btn-sound {
  width: 1.3rem;
  height: 1.3rem;
  padding: 0;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
}

.btn-sound:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.sound-control.is-muted .btn-sound,
.btn-sound.is-muted {
  opacity: 0.75;
  filter: grayscale(0.45);
}

.btn-sound-icon {
  pointer-events: none;
  font-size: 0.85rem;
  line-height: 1;
}

.sound-volume {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.sound-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  cursor: pointer;
}

.sound-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent, #3d9cf0);
  border: 1.5px solid #0f1419;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.sound-volume-slider::-moz-range-thumb {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent, #3d9cf0);
  border: 1.5px solid #0f1419;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.sound-control.is-muted .sound-volume-slider {
  opacity: 0.55;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-checkbox {
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
}

.checkbox-label input {
  margin-top: 0.2rem;
  width: auto;
}

.spectator-banner {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #d4c4fc;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.spectator-banner strong {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #c4b5fd;
}

/* Subtle in-game spectator list (above table so dock never covers it) */
.spectators-strip {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.55rem;
  padding: 0.3rem 0.15rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
  opacity: 0.9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.spectators-strip-label {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.65rem;
  color: rgba(167, 139, 250, 0.75);
  flex-shrink: 0;
}

.spectators-strip-names {
  color: rgba(200, 210, 225, 0.7);
  font-weight: 500;
  word-break: break-word;
}

.spectators-strip-names .is-you-spec {
  color: rgba(196, 181, 253, 0.95);
  font-weight: 600;
}

.seat.is-vacant .seat-avatar {
  background: #4a5568 !important;
  opacity: 0.75;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.25);
}

.seat.is-vacant .seat-name {
  color: var(--muted);
  font-style: italic;
}

.sit-down-panel {
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  border-radius: 12px;
  background: rgba(36, 48, 68, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 5.5rem;
  overflow-y: auto;
}

.sit-down-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  gap: 0.5rem;
  margin: 1rem 0;
}

/* â€”â€” Fixed play action dock â€”â€” */
#screen-play:not(.hidden) {
  display: block;
}

.play-scroll {
  /* Extra room for dock + optional Stand up / sit panel */
  padding-bottom: calc(var(--play-actions-h) + 4.5rem + env(safe-area-inset-bottom, 0px));
}

.play-actions {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  margin: 0;
  padding: 0.45rem 0.85rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  /* Above BANK celebration overlay so BANK stays tappable */
  z-index: 320;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  /* Cap height on small phones so primary row stays on-screen */
  max-height: min(42dvh, 16rem);
  background: linear-gradient(
    to top,
    var(--bg) 0%,
    var(--bg) 78%,
    rgba(15, 20, 25, 0.92) 92%,
    transparent 100%
  );
}

.play-actions-secondary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Chat Â· Stand up Â· End game on one row */
.play-actions-tools {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
}

.play-actions-tools .play-tool-btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 0.45rem 0.4rem;
  font-size: 0.82rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.play-actions-tools .play-tool-btn .chat-unread {
  /* Slightly smaller in the dock tools row */
  min-width: 1.1rem;
  height: 1.1rem;
  font-size: 0.65rem;
}

.play-actions-row {
  display: flex;
  flex-direction: row;
  gap: 0.55rem;
  width: 100%;
  flex: 0 0 auto;
  /* Always the bottom-most control strip */
  margin-top: auto;
}

.play-actions-row .btn-roll,
.play-actions-row .btn-bank {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  padding: 0.85rem 0.45rem;
}

/* Clearer â€œnot your action right nowâ€ state during BANK celebrations */
.play-actions-row .btn-roll:disabled,
.play-actions-row .btn-roll.is-locked,
.play-actions-row .btn-bank:disabled,
.play-actions-row .btn-bank.is-locked {
  background: linear-gradient(160deg, #4a5560, #2f363d);
  color: #9aa3ad;
  opacity: 0.9;
  filter: none;
}

/* Hidden secondary controls must not reserve vertical space */
.play-actions .is-ghost,
.play-actions .hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}
