/* The paired TV workflow keeps its own visual system and leaves Cast untouched. */
body:has(.tv-control-shell) {
  background: #080807;
}

.tv-control-shell {
  --line: #4c3d28;
  --text: #f5eee1;
  --muted: #b7a995;
  --gold: #e0bc79;
  --green: #e0bc79;
  color-scheme: dark;
  color: #f5eee1;
  background: radial-gradient(circle at 100% 1%, #a77b3219, transparent 29%),
    linear-gradient(180deg, #100f0c, #090908 48%);
}

.tv-control-shell .tv-control-top {
  min-height: 83px;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #5b482d;
  background: linear-gradient(110deg, #191611, #0d0d0b 72%);
}

.tv-control-shell .control-tv-back {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border-color: #655135;
  background: #221b12;
  color: #edc985 !important;
}

.tv-control-shell .tv-control-logo {
  flex: none;
  display: block;
  width: 44px;
  height: 44px;
  padding: 2px;
  object-fit: contain;
  border: 1px solid #977542;
  border-radius: 10px;
  background: #414649;
  box-shadow: 0 0 0 2px #d3a75917;
}

.tv-control-shell .tv-control-heading {
  min-width: 0;
}

.tv-control-shell .tv-control-heading small {
  color: #d2b279;
  font-size: 10px;
  letter-spacing: 1.2px;
}

.tv-control-shell .tv-control-heading h1 {
  margin-top: 3px;
  color: #fff3df;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.tv-control-shell .tv-control-event-name {
  margin: 5px 0 0;
  overflow: hidden;
  color: #bbae99;
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-control-shell .mobile-top-action {
  min-height: 38px;
  padding: 7px 9px;
  border-color: #755d3b;
  border-radius: 9px;
  background: #251e14;
  color: #f0d19a;
  font-size: 11px;
}

/* The device picker is supplied by the gateway, outside the page's main node. */
body:has(.tv-control-shell) .poker-device-bar {
  max-width: 560px !important;
  border-color: #79613d !important;
  background: #19150f !important;
  box-shadow: 0 7px 25px #0007;
}

body:has(.tv-control-shell) .poker-device-sheet {
  border-color: #806944 !important;
  background: #17140f !important;
}

body:has(.tv-control-shell) .poker-device-row {
  background: #211b13 !important;
}

.tv-control-shell .tv-control-intro {
  margin: 20px 16px 0;
  padding: 22px 21px 21px;
  border: 1px solid #866b41;
  border-radius: 17px;
  background: radial-gradient(circle at 100% 0, #9a722f30, transparent 48%),
    linear-gradient(145deg, #241e14, #13110e 75%);
  box-shadow: inset 0 1px #f7d89d2b, 0 15px 30px #0005;
}

.tv-control-shell .tv-control-intro > span {
  color: #e1bd7d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

.tv-control-shell .tv-control-intro h2 {
  margin: 11px 0 8px;
  color: #fff0d9;
  font-size: 22px;
  line-height: 1.32;
}

.tv-control-shell .tv-control-intro p {
  margin: 0;
  color: #c6b9a3;
  font-size: 13px;
  line-height: 1.7;
}

.tv-control-shell .tv-control-create-panel {
  margin: 15px 16px 26px;
  padding: 18px 16px 8px;
  border-color: #57472f;
  background: #17140f;
}

.tv-control-shell .tv-control-create-panel .mobile-branding-heading h2 {
  margin: 0 0 6px;
  color: #e8c486;
  font-size: 15px;
  letter-spacing: 1px;
}

.tv-control-shell .tv-control-create-panel .mobile-branding-heading p {
  color: #bcae97;
  font-size: 12px;
}

/* Show the current TV page itself at its native 1920 × 1080 layout. */
.tv-control-shell .tv-live-preview {
  position: relative;
  width: auto;
  aspect-ratio: 16 / 9;
  margin: 12px 14px 10px;
  overflow: hidden;
  border-radius: 13px;
  background: #050504;
  box-shadow: 0 0 0 1px #8c7148a8, 0 11px 30px #0009;
  isolation: isolate;
}

.tv-control-shell .tv-live-preview iframe {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 1920px;
  height: 1080px;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #050504;
  pointer-events: none;
  transform-origin: top left;
}

/* Keep the live clock prominent while bringing the common controls above the fold. */
.tv-control-shell .mobile-scoreboard {
  margin: 12px 14px 10px;
  padding: 15px 18px 13px;
  border-color: #8c7148a8;
  border-radius: 15px;
  background: radial-gradient(circle at 92% 0, #88632a35, transparent 42%),
    linear-gradient(145deg, #211b12, #11100d 75%);
  box-shadow: inset 0 1px #ffe3ad18, 0 11px 30px #0007;
}

.tv-control-shell .mobile-board-top {
  color: #beaf99;
  font-size: 11px;
}

.tv-control-shell .mobile-live-indicator {
  color: #ebcb8e;
  font-size: 12px;
}

.tv-control-shell .mobile-board-main {
  margin-top: 12px;
}

.tv-control-shell .mobile-clock-caption {
  color: #bcae97;
  font-size: 11px;
}

.tv-control-shell .mobile-board-clock {
  color: #fff2d9;
  font-size: clamp(56px, 15vw, 74px);
  line-height: 1.06;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.075em;
}

.tv-control-shell .mobile-board-blinds {
  margin-top: 9px;
  border-color: #8a6d403d;
}

.tv-control-shell .mobile-board-blinds > div {
  padding-top: 9px;
  padding-bottom: 9px;
}

.tv-control-shell .mobile-board-blinds > div + div {
  border-color: #8a6d403d;
}

.tv-control-shell .mobile-board-blinds small {
  color: #b8a990;
}

.tv-control-shell .mobile-board-blinds strong {
  margin-top: 4px;
  color: #fff5e6;
  font-size: clamp(15px, 3.7vw, 19px);
}

.tv-control-shell .mobile-board-blinds > div + div strong {
  color: #e7c585;
  font-size: clamp(14px, 3.3vw, 17px);
}

.tv-control-shell .mobile-board-strip {
  gap: 7px;
  padding-top: 10px;
  color: #b8a990;
  font-size: 10px;
}

.tv-control-shell .mobile-board-strip b {
  color: #f8e9cd;
  font-size: 13px;
}

.tv-control-shell .tv-quick-controls {
  margin: 0 14px 11px;
  padding: 13px 14px 14px;
  border: 1px solid #59472f;
  border-radius: 13px;
  background: #181510;
}

.tv-control-shell .tv-quick-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.tv-control-shell .tv-quick-head strong {
  color: #ead0a0;
  font-size: 12px;
  letter-spacing: .6px;
}

.tv-control-shell .tv-quick-head span {
  color: #9c8d76;
  font-size: 10px;
}

.tv-control-shell .tv-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1.22fr 1fr;
  gap: 8px;
}

.tv-control-shell .tv-quick-actions button {
  min-width: 0;
  min-height: 47px;
  padding: 8px 5px;
  border: 1px solid #6c5636;
  border-radius: 10px;
  background: #292116;
  color: #e9d9bd;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.tv-control-shell .tv-quick-actions .tv-quick-primary {
  border-color: #e3bd79;
  background: linear-gradient(100deg, #c69b59, #e8c888);
  color: #21170c;
  box-shadow: inset 0 1px #fff4d858;
  font-size: 13px;
  font-weight: 850;
}

.tv-control-shell .tv-quick-actions button:hover {
  border-color: #e4bc78;
  filter: brightness(1.08);
}

.tv-control-shell .tv-quick-actions button:disabled {
  border-color: #514532;
  background: #30291e;
  color: #ab9d84;
  box-shadow: none;
  cursor: default;
  filter: none;
}

.tv-control-shell .tv-control-tabs {
  gap: 5px;
  margin: 0;
  padding: 0 14px 10px;
  border-color: #463722;
  background: transparent;
}

.tv-control-shell .tv-control-tabs button {
  min-height: 42px;
  border-bottom-width: 2px;
  color: #aa9a81;
  font-size: 11px;
}

.tv-control-shell .tv-control-tabs button.active {
  border-color: #e2bf82;
  color: #f0d29a;
}

.tv-control-shell .tv-control-panel {
  padding: 17px 18px 27px;
}

.tv-control-shell .mobile-section-head {
  margin: 2px 0 12px;
}

.tv-control-shell .mobile-section-head small {
  color: #d2ae70;
}

.tv-control-shell .mobile-section-head h2 {
  color: #f4e9d4;
  font-size: 19px;
}

.tv-control-shell .mobile-section-head > span {
  color: #9f927e;
}

.tv-control-shell .orange-action {
  border-color: #7b6240;
  background: #241d13;
  color: #f0dfc0;
}

.tv-control-shell .orange-action:hover {
  border-color: #d9b475;
  background: #302618;
}

.tv-control-shell .mobile-break-controls {
  border-color: #675239 !important;
  background: #1c1710 !important;
}

.tv-control-shell .mobile-break-form label,
.tv-control-shell .mobile-break-controls .muted {
  color: #b9a994 !important;
}

.tv-control-shell :is(input:not([type=checkbox]), select, textarea) {
  border-color: #675237;
  background: #100e0b;
  color: #f8edda;
}

.tv-control-shell input[type=checkbox] {
  accent-color: #dbb976;
}

.tv-control-shell .mobile-form-section {
  border-color: #56452d;
}

.tv-control-shell .mobile-section-title {
  color: #e8c98f;
}

.tv-control-shell .mobile-structure-row,
.tv-control-shell .mobile-preset-card {
  border-color: #5a482e;
  background: #1d1912;
}

.tv-control-shell .mobile-structure-row.is-break {
  background: #2a2114;
}

.tv-control-shell .mobile-more-controls {
  border-color: #6b5435;
  background: #19150f;
}

.tv-control-shell .mobile-more-controls[open] summary {
  border-color: #6b5435;
}

.tv-control-shell .mobile-new-back button {
  color: #eac78a;
}

@media (max-width: 390px) {
  .tv-control-shell .tv-control-top {
    gap: 8px;
    padding: 12px 11px;
  }

  .tv-control-shell .tv-control-logo {
    width: 40px;
    height: 40px;
  }

  .tv-control-shell .tv-control-heading small {
    font-size: 9px;
    letter-spacing: .55px;
  }

  .tv-control-shell .tv-control-heading h1 {
    font-size: 17px;
  }

  .tv-control-shell .mobile-top-action {
    padding: 6px;
    font-size: 10px;
  }

  .tv-control-shell .mobile-scoreboard {
    margin: 10px 10px 8px;
    padding: 13px 13px 11px;
  }

  .tv-control-shell .tv-live-preview {
    margin: 10px 10px 8px;
    border-radius: 10px;
  }

  .tv-control-shell .mobile-board-clock {
    font-size: clamp(50px, 15vw, 65px);
  }

  .tv-control-shell .mobile-board-blinds strong {
    font-size: 14px;
  }

  .tv-control-shell .mobile-board-blinds > div + div strong {
    font-size: 13px;
  }

  .tv-control-shell .tv-quick-controls {
    margin-right: 10px;
    margin-left: 10px;
    padding: 11px;
  }

  .tv-control-shell .tv-quick-actions {
    gap: 5px;
  }

  .tv-control-shell .tv-quick-actions button {
    font-size: 11px;
  }

  .tv-control-shell .tv-control-tabs {
    gap: 2px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .tv-control-shell .tv-control-tabs button {
    font-size: 10px;
  }

  .tv-control-shell .tv-control-panel {
    padding: 16px 14px 23px;
  }
}
