/* Site header/footer — visible in All / Show; overlay fills viewport beneath */

#site-header,
#site-footer {
  display: none;
  box-sizing: border-box;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #fff;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 400;
  max-width: 100vw;
}

body.site-chrome-visible #site-header,
body.site-chrome-visible #site-footer {
  display: block;
}

#site-header {
  top: 0;
  background: var(--panel, rgba(0, 0, 0, 0.92));
  border-bottom: 1px solid rgba(243, 206, 19, 0.35);
  padding: 4px 10px;
}

#site-footer {
  bottom: 0;
  background: var(--panel, rgba(0, 0, 0, 0.92));
  border-top: 1px solid rgba(243, 206, 19, 0.35);
  padding: 0;
}

/* Pinned chrome: header + overlay + footer fill viewport (nav/footer always visible) */
body.site-chrome-visible {
  overflow: hidden;
}

body.site-chrome-visible #app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
}

body.site-chrome-visible #site-header,
body.site-chrome-visible #site-footer {
  position: relative;
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 100%;
  max-height: 120px;
}

body.site-chrome-visible #site-header {
  overflow: visible;
  z-index: 410;
}

body.site-chrome-visible #site-footer {
  overflow: hidden;
  z-index: 410;
}

body.site-chrome-visible .site-header-bar {
  overflow: visible;
}

body.site-chrome-visible #onscreen-status-options-bar {
  display: none !important;
}

body.transparent #app-shell {
  min-height: 100vh;
}

body.transparent #app-overlay-region {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

body.transparent #app-overlay-region > * {
  pointer-events: auto;
}

/* Must follow body.transparent #app-overlay-region — same specificity, later wins */
body.site-chrome-visible #app-overlay-region {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  inset: auto;
  width: 100%;
  height: auto;
  z-index: 1;
  pointer-events: none;
}

body.site-chrome-visible #app-overlay-region > * {
  pointer-events: auto;
}

body.site-chrome-visible #wheel-stage {
  min-height: 100%;
  height: 100%;
}

#wheel-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Card-only: hide wheel entirely so it cannot show through the card panel */
body.preview-only #wheel-main,
body.preview-only #wheel-stack,
body.preview-only #wheelCanvas,
body.preview-only #spin-hub-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.preview-only #site-header,
body.preview-only #site-footer,
body.preview-only #onscreen-status-options-bar {
  display: none !important;
}

body.preview-only #onscreen-status {
  background: rgba(0, 0, 0, 0.96);
}

body.preview-only #card-restore-btn {
  display: none !important;
}

/* Full chrome: wheel, card, and restore control sit below the site header */
body.site-chrome-visible #onscreen-status.pos-tl,
body.site-chrome-visible #onscreen-status.pos-tc,
body.site-chrome-visible #onscreen-status.pos-tr,
body.site-chrome-visible #wheel-main.pos-tl,
body.site-chrome-visible #wheel-main.pos-tc,
body.site-chrome-visible #wheel-main.pos-tr {
  top: calc(var(--site-header-bottom, 44px) + 8px);
}

body.site-chrome-visible #card-restore-btn.pos-tl,
body.site-chrome-visible #card-restore-btn.pos-tc,
body.site-chrome-visible #card-restore-btn.pos-tr {
  top: calc(var(--site-header-bottom, 44px) + 8px);
}

/* Full chrome: keep bottom-placed overlay above the site footer */
body.site-chrome-visible #onscreen-status.pos-bl,
body.site-chrome-visible #onscreen-status.pos-bc,
body.site-chrome-visible #onscreen-status.pos-br,
body.site-chrome-visible #wheel-main.pos-bl,
body.site-chrome-visible #wheel-main.pos-bc,
body.site-chrome-visible #wheel-main.pos-br {
  bottom: calc(var(--site-footer-height, 40px) + 12px);
}

body.site-chrome-visible #card-restore-btn.pos-bl,
body.site-chrome-visible #card-restore-btn.pos-bc,
body.site-chrome-visible #card-restore-btn.pos-br {
  bottom: calc(var(--site-footer-height, 40px) + 12px);
}

/* Card-only: restore control in top-right corner of the card */
body.preview-only #onscreen-status .card-show-chrome-btn {
  display: inline-flex;
}

body.preview-only #onscreen-status-title-row {
  padding-right: 30px;
}

.card-show-chrome-btn {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 6;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: 1px solid rgba(243, 206, 19, 0.55);
  background: rgba(0, 0, 0, 0.88);
  color: #f3ce13;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.card-show-chrome-btn:hover {
  background: rgba(243, 206, 19, 0.15);
}

#onscreen-status {
  position: fixed;
}

#site-header .page-mode-toggle .mode-toggle-segment[data-overlay-view] {
  cursor: pointer;
}

.site-header-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 8px;
  min-height: 32px;
}

.site-header-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
  text-decoration: none;
  margin-right: 4px;
  flex-shrink: 0;
  max-width: min(11rem, 34vw);
}

.site-header-brand:hover .site-header-brand-name {
  text-decoration: underline;
}

.site-header-brand-name {
  font-weight: 700;
  color: #f3ce13;
  font-size: 0.78rem;
  white-space: nowrap;
}

.site-header-brand-tagline {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#site-header #game-select,
#site-header-challenge-set {
  height: 28px;
  padding: 2px 24px 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(243, 206, 19, 0.45);
  background: rgba(0, 0, 0, 0.55);
  color: #f3ce13;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}

#site-header #game-select {
  min-width: 108px;
  max-width: none;
  width: max-content;
  white-space: nowrap;
}

#site-header #game-select:hover,
#site-header-challenge-set:hover:not(:disabled) {
  background-color: rgba(243, 206, 19, 0.12);
}

/* Longest game name in manifest (Slay the Spire 2) — OBS custom select */
#site-header .obs-select-wrap {
  min-width: 13.75rem;
  max-width: none;
  width: max-content;
}

#site-header .obs-select-btn {
  font-size: 0.72rem;
  width: max-content;
  min-width: 100%;
  overflow: visible;
  text-overflow: clip;
}

#site-header-challenge-set {
  min-width: 120px;
  max-width: 180px;
}

.site-header-daily-note {
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  border: 1px solid rgba(243, 206, 19, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(243, 206, 19, 0.75);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-dropdown {
  position: relative;
  flex-shrink: 0;
}

.site-dropdown-summary {
  list-style: none;
  height: 28px;
  padding: 0 22px 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  border: 1px solid rgba(243, 206, 19, 0.45);
  background: rgba(0, 0, 0, 0.55);
  color: #f3ce13;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  position: relative;
  box-sizing: border-box;
}

.site-dropdown-summary::after {
  content: '';
  position: absolute;
  right: 9px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(243, 206, 19, 0.9);
  transform: translateY(-35%);
  pointer-events: none;
}

.site-dropdown-summary::-webkit-details-marker {
  display: none;
}

.site-dropdown-summary:hover {
  background-color: rgba(243, 206, 19, 0.12);
}

.site-dropdown[open] .site-dropdown-summary {
  background: rgba(243, 206, 19, 0.18);
  border-color: rgba(243, 206, 19, 0.75);
}

.site-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 500;
  padding: 6px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(243, 206, 19, 0.5);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.site-dropdown-panel--fit {
  width: max-content;
  min-width: 100%;
  max-width: min(420px, calc(100vw - 24px));
}

.site-dropdown-panel--menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
}

.site-dropdown-panel--scroll {
  max-height: min(50vh, 320px);
  overflow-y: auto;
}

.site-dropdown-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}

.site-dropdown-option:hover {
  background: rgba(243, 206, 19, 0.12);
  color: #fff;
}

.site-dropdown-option.is-selected,
.site-dropdown-option[aria-pressed='true'] {
  background: rgba(243, 206, 19, 0.2);
  color: #f3ce13;
}

/* Placement panel: compact wheel/card row + tight grid */
.site-dropdown-panel--placement.site-dropdown-panel--fit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.site-dropdown-panel--placement .layout-object-toggle {
  display: inline-flex;
  width: max-content;
  max-width: none;
  margin-bottom: 6px;
  border: 1px solid rgba(243, 206, 19, 0.45);
  border-radius: 6px;
  overflow: hidden;
  flex: 0 0 auto;
  align-self: flex-start;
}

.site-dropdown-panel--placement .layout-object-toggle .mode-toggle-segment {
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 0;
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.site-dropdown-panel--placement .layout-object-toggle .mode-toggle-segment:hover {
  background: rgba(243, 206, 19, 0.12);
}

.site-dropdown-panel--placement .layout-object-toggle .mode-toggle-segment.is-current {
  background: rgba(243, 206, 19, 0.25);
  color: #f3ce13;
}

.site-dropdown-panel--placement .layout-pos-grid,
.site-dropdown-panel--placement .layout-pos-grid--compact {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px;
  width: max-content;
  max-width: none;
}

.site-dropdown-panel--placement .layout-pos-cell {
  min-width: 32px;
  min-height: 28px;
  padding: 4px 6px;
  font-size: 0.68rem;
  font-weight: 800;
}

.site-dropdown-panel--placement .layout-pos-cell:hover {
  background: rgba(243, 206, 19, 0.12);
}

.site-dropdown-panel--card-only .layout-object-toggle {
  display: none !important;
}

#site-header-categories label,
.site-dropdown-panel [data-category-filters-host] label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}

#site-header-categories label:hover,
.site-dropdown-panel [data-category-filters-host] label:hover {
  background: rgba(243, 206, 19, 0.12);
}

.site-header-spacer {
  flex: 1;
  min-width: 4px;
}

.site-header-nav-groups {
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
  flex-shrink: 0;
}

#site-header .page-mode-toggle {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgba(243, 206, 19, 0.45);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

#site-header .mode-toggle-segment,
#site-header button.mode-toggle-segment {
  box-sizing: border-box;
  padding: 5px 10px;
  border: 0;
  background: rgba(0, 0, 0, 0.4);
  color: #f3ce13;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#site-header .mode-toggle-segment:hover {
  background: rgba(243, 206, 19, 0.12);
}

#site-header .mode-toggle-segment.is-current {
  background: rgba(243, 206, 19, 0.25);
  color: #f3ce13;
}

#site-footer .site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 14px;
  font-size: 0.78rem;
  margin-left: auto;
}

#site-footer .site-footer-links a {
  color: #f3ce13;
  text-decoration: none;
}

#site-footer .site-footer-links a:hover {
  text-decoration: underline;
}

#site-footer .site-footer-links a.is-muted {
  color: rgba(255, 255, 255, 0.55);
  cursor: default;
  pointer-events: none;
}

body.site-chrome-visible .card-chrome-dropdowns {
  display: none !important;
}

.card-chrome-dropdowns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

#onscreen-status-options-bar.card-toolbar-compact {
  flex-wrap: nowrap;
  padding: 6px 8px;
  gap: 6px;
}

#onscreen-status-options-bar .site-dropdown-summary {
  height: 26px;
  font-size: 0.68rem;
  padding: 0 20px 0 8px;
}

#onscreen-status-options-bar .site-dropdown-option {
  font-size: 0.76rem;
  padding: 6px 8px;
}

#onscreen-status-options-bar .page-mode-toggle .mode-toggle-segment:hover,
#onscreen-status-options-bar .page-mode-toggle button.mode-toggle-segment:hover {
  background: rgba(243, 206, 19, 0.12);
}

.players-filter-sync {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
