/* Smart TV — ES5-safe CSS (2016–2019 TV browsers) */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  color: #f0f0f0;
  background: #0b0b16;
  overflow-x: hidden;
}

# Background art (cheap gradients, legacy safe) */
body {
  position: relative;
}

body:before {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #0b0b16;
  background: linear-gradient(135deg, #0b0b16 0%, #10263a 40%, #2a1e4f 70%, #0b0b16 100%);
}

body:after {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: rgba(0, 0, 0, 0.25);
}

#app, .capability {
  -webkit-text-size-adjust: 100%;
}

#app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 24px 32px 48px 32px;
}

/* Capability / low power banner (very cheap paint) */
.capability {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto 18px auto;
  padding: 14px 16px;
  background: #151523;
  border: 2px solid #333355;
}

.cap-title {
  font-size: 20px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 6px;
}

.cap-sub {
  font-size: 16px;
  color: #cccccc;
  margin-bottom: 8px;
}

.cap-list {
  font-size: 14px;
  color: #bbbbbb;
  margin-bottom: 10px;
}

.cap-item {
  padding: 2px 0;
}

.cap-hint {
  font-size: 14px;
  color: #9aa0b5;
}

.mono {
  font-family: Courier, monospace;
}

/* Header */
.header {
  display: block;
  width: 100%;
  padding-bottom: 20px;
  border-bottom: 2px solid #2d3f57;
  margin-bottom: 24px;
  overflow: hidden;
}

.brand {
  float: left;
}

.brand-mark {
  display: inline-block;
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  background: #3a66ff;
  color: #fff;
  margin-right: 12px;
  vertical-align: middle;
}

.brand-title {
  display: inline-block;
  font-size: 28px;
  font-weight: bold;
  vertical-align: middle;
  color: #ffffff;
}

.header-right {
  float: right;
  margin-top: 8px;
}

.status-pill {
  display: inline-block;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: bold;
  background: rgba(30, 48, 72, 0.8);
  color: #cccccc;
  margin-right: 12px;
  vertical-align: middle;
}

.status-pill.online {
  background: #1a5c2e;
  color: #7dff9a;
}

.status-pill.error {
  background: #5c1a1a;
  color: #ff7d7d;
}

.status-pill.loading {
  background: #4a4a1a;
  color: #ffff99;
}

/* Sections */
.section {
  display: block;
  width: 100%;
  margin-bottom: 32px;
  clear: both;
}

.section-hidden {
  display: none !important;
  visibility: hidden !important;
}

.section-title {
  font-size: 24px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2d3f57;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge {
  font-size: 16px;
  font-weight: normal;
  color: #aaaaaa;
  margin-left: 8px;
}

.nakama-session-banner {
  display: block;
  clear: both;
  width: 100%;
  margin: 12px 0 0;
  padding: 6px 10px;
  font-size: 13px;
  color: #c8e6ff;
  background: rgba(0, 40, 80, 0.55);
  border: 1px solid #336688;
  border-radius: 6px;
  text-align: center;
}

.nakama-banner-label {
  margin-right: 8px;
  color: #88aacc;
}

.nakama-banner-userid {
  font-weight: bold;
  color: #ffffff;
}

.nakama-banner-note {
  margin-left: 6px;
  color: #7fd97f;
  font-size: 12px;
}

.nakama-session-panel {
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(0, 30, 60, 0.5);
  border: 2px solid #2a5577;
  border-radius: 8px;
}

.nakama-panel-title {
  margin: 0 0 10px;
  font-size: 16px;
  color: #9ecfff;
}

.mobile-login-nakama-id {
  font-size: 16px;
  color: #a8d4ff;
  margin-bottom: 12px;
}

.boot-log {
  display: block;
  width: 100%;
  max-height: 140px;
  overflow: auto;
  margin-bottom: 12px;
  padding: 10px;
  font-family: Courier, monospace;
  font-size: 12px;
  line-height: 1.35;
  color: #a8d4ff;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid #334466;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.nakama-server-form {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(0, 30, 60, 0.45);
  border: 2px solid #2a5577;
  border-radius: 8px;
}

.nakama-server-label {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
  color: #9ecfff;
}

.nakama-server-row {
  display: block;
}

.nakama-host-input {
  display: inline-block;
  width: 280px;
  max-width: 100%;
  padding: 14px 16px;
  font-size: 22px;
  font-family: Courier, monospace;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.55);
  border: 3px solid #2d3f57;
  outline: none;
}

.nakama-host-input.focused,
.nakama-host-input:focus {
  border-color: #7aa6ff;
  box-shadow: 0 0 0 2px rgba(47, 108, 255, 0.35);
}

.nakama-host-input:disabled {
  opacity: 0.55;
  color: #aaaaaa;
}

.nakama-server-port {
  display: inline-block;
  margin-left: 8px;
  font-size: 22px;
  font-family: Courier, monospace;
  color: #88bbdd;
  vertical-align: middle;
}

.nakama-server-hint {
  margin: 10px 0 0;
  font-size: 15px;
  color: #888899;
}

.status-text {
  font-size: 20px;
  color: #bbbbbb;
  margin-bottom: 16px;
}

.hint {
  font-size: 16px;
  color: #888899;
  margin-top: 12px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 18px 36px;
  font-size: 22px;
  font-weight: bold;
  color: #ffffff;
  background: rgba(30, 48, 72, 0.75);
  border: 3px solid #2d3f57;
  cursor: pointer;
  outline: none;
  text-align: center;
  min-width: 280px;
}

.btn-primary {
  background: #2f6cff;
  border-color: #7aa6ff;
}

.btn-small {
  font-size: 16px;
  padding: 10px 20px;
  min-width: 120px;
}

.debug-log.hidden {
  display: none;
}

.btn.focused,
.focusable.focused {
  border-color: #ffffff;
  background: #3f7cff;
  color: #ffffff;
}

.btn:active {
  background: #5530a8;
}

.btn-disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  background: #3a3a4a;
  border-color: #555566;
}

.btn-disabled.focused,
.btn:disabled.focused {
  border-color: #888899;
  background: #3a3a4a;
  color: #cccccc;
}

/* Row lists (videos / modes) */
.row-list {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.card {
  display: inline-block;
  vertical-align: top;
  width: 220px;
  margin-right: 16px;
  background: rgba(15, 22, 38, 0.70);
  border: 3px solid rgba(45, 63, 87, 0.95);
  white-space: normal;
  outline: none;
}

.card.focused {
  border-color: #ffff00;
}

.card-img-wrap {
  width: 100%;
  height: 140px;
  background: rgba(45, 63, 87, 0.35);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 140px;
  display: block;
  border: 0;
}

.card-img-placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, rgba(45, 63, 87, 0.85) 0%, rgba(20, 28, 48, 0.95) 100%);
  display: block;
}

.videos-catalog-status {
  display: block;
  width: 100%;
  padding: 24px 16px;
  text-align: center;
  color: #ffffff;
}

.videos-catalog-message {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 10px;
}

.videos-catalog-detail {
  font-size: 14px;
  color: #aaaaaa;
  margin-bottom: 16px;
  word-break: break-all;
}

.videos-catalog-error .videos-catalog-message {
  color: #ff8888;
}

.videos-catalog-status .btn {
  margin-top: 8px;
}

.low-power .card-img-wrap {
  display: none;
}

.low-power .card {
  width: 200px;
}

.low-power .debug-log {
  max-height: 160px;
}

.card-body {
  padding: 12px;
}

.card-title {
  font-size: 18px;
  font-weight: bold;
  color: #ffffff;
  line-height: 1.3;
  max-height: 48px;
  overflow: hidden;
}

.card-sub {
  font-size: 14px;
  color: #999999;
  margin-top: 4px;
}

.card-dl-wrap {
  display: none;
  margin-top: 10px;
  width: 100%;
}

.card-dl-bar {
  width: 100%;
  height: 14px;
  background: #1a1a28;
  border: 2px solid #333355;
  overflow: hidden;
}

.card-dl-fill {
  width: 0%;
  height: 100%;
  background: #3f7cff;
}

.card-dl-text {
  margin-top: 6px;
  font-size: 14px;
  font-weight: bold;
  color: #ffffff;
  text-align: center;
}

.card.card-downloading {
  border-color: #7aa6ff;
}

/* Info box */
.info-box {
  display: block;
  width: 100%;
  background: rgba(15, 22, 38, 0.70);
  border: 2px solid rgba(45, 63, 87, 0.95);
  padding: 16px;
}

.info-row {
  display: block;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid #2a2a3a;
  overflow: hidden;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  display: inline-block;
  width: 180px;
  font-size: 18px;
  color: #999999;
  vertical-align: top;
}

.info-value {
  display: inline-block;
  font-size: 18px;
  color: #eeeeee;
  word-break: break-all;
  max-width: 70%;
}

.info-value.mono {
  font-family: Courier, monospace;
  font-size: 14px;
}

/* Mobile Login — fullscreen centered QR overlay (TV-safe) */
#section-mobile-login {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  margin: 0;
  padding: 0;
  overflow: visible;
  visibility: visible;
  opacity: 1;
}

#section-mobile-login.qr-overlay-active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#qr-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 5vh 5vw;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  -webkit-box-orient: horizontal;
  -webkit-box-pack: center;
  -webkit-box-align: center;
  -webkit-justify-content: center;
  -webkit-align-items: center;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

#qr-overlay.qr-overlay-visible {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
}

#qr-wrapper {
  position: relative;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-flex: 0;
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  -webkit-box-pack: center;
  -webkit-box-align: center;
  -webkit-justify-content: center;
  -webkit-align-items: center;
  justify-content: center;
  align-items: center;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  pointer-events: none;
  z-index: 10000;
}

#qr-wrapper table,
#qr-wrapper .jd-qr-table-wrap,
#qr-wrapper .jd-qr-grid,
#mobile-login-qr,
.mobile-login-qr {
  pointer-events: auto;
}

.qr-meta-bar {
  position: absolute;
  top: 5vh;
  left: 5vw;
  right: 5vw;
  z-index: 10001;
  text-align: center;
  pointer-events: auto;
}

.qr-overlay-title {
  margin: 0 0 10px;
  font-size: 26px;
  color: #ffffff;
}

.qr-overlay-hint {
  margin-bottom: 10px;
}

.mobile-login-nakama-id {
  font-size: 15px;
  color: #a8d4ff;
  margin-bottom: 8px;
}

#mobile-login-qr,
.mobile-login-qr {
  -webkit-box-flex: 0;
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: center;
  -webkit-box-align: center;
  -webkit-justify-content: center;
  -webkit-align-items: center;
  justify-content: center;
  align-items: center;
  width: 240px !important;
  height: 240px !important;
  aspect-ratio: 1 / 1 !important;
  min-width: 180px !important;
  min-height: 180px !important;
  max-width: 320px !important;
  max-height: 320px !important;
  padding: 4px !important;
  margin: 0 !important;
  background: #ffffff !important;
  border: 4px solid #000000 !important;
  overflow: hidden !important;
  visibility: visible !important;
  opacity: 1 !important;
  text-align: center;
  line-height: 0 !important;
  font-size: 0 !important;
  box-sizing: border-box !important;
  float: none !important;
  vertical-align: middle;
  -ms-interpolation-mode: nearest-neighbor;
  image-rendering: -moz-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#mobile-login-qr .jd-qr-table-wrap,
#mobile-login-qr .jd-qr-grid,
.mobile-login-qr .jd-qr-table-wrap,
.mobile-login-qr .jd-qr-grid {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  -webkit-box-flex: 0;
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  background: #ffffff;
  overflow: hidden;
  -webkit-transform: none !important;
  transform: none !important;
}

#mobile-login-qr table,
.mobile-login-qr table {
  display: table !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 auto !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  table-layout: fixed !important;
  visibility: visible;
  opacity: 1;
  -webkit-transform: none !important;
  transform: none !important;
}

#mobile-login-qr td,
.mobile-login-qr td {
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  border: none !important;
  overflow: hidden;
  box-sizing: content-box !important;
}

#mobile-login-qr .jd-qr-grid-row,
.mobile-login-qr .jd-qr-grid-row {
  display: block;
  height: auto;
  font-size: 0 !important;
  line-height: 0 !important;
  white-space: nowrap;
}

#mobile-login-qr .jd-qr-grid-cell,
.mobile-login-qr .jd-qr-grid-cell {
  display: inline-block;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  vertical-align: top;
  border: none !important;
}

.qr-debug-overlay {
  position: absolute;
  top: 6%;
  left: 6%;
  z-index: 10002;
  min-width: 200px;
  max-width: 38%;
  padding: 8px 12px;
  font-family: Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
  color: #cce8ff;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #446688;
  text-align: left;
  visibility: visible;
  opacity: 1;
  pointer-events: none;
}

.qr-debug-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-failed-box {
  display: block;
  min-width: 180px;
  min-height: 100px;
  padding: 14px;
  background: #1a0a0a;
  border: 3px solid #ff6644;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
}

.qr-failed-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: bold;
  color: #ff8866;
}

.qr-failed-msg {
  margin: 0 0 8px;
  font-size: 14px;
  color: #ffccaa;
}

.qr-failed-detail {
  margin: 0 0 8px;
  font-size: 11px;
  color: #aa9988;
  white-space: pre-wrap;
  word-wrap: break-word;
  text-align: left;
}

.qr-failed-hint {
  margin: 0;
  font-size: 12px;
  color: #888899;
}

.qr-diagnostics {
  display: none;
  max-width: 90%;
  margin: 12px auto 0 auto;
  padding: 10px;
  font-family: Courier, monospace;
  font-size: 12px;
  color: #aaccff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #334466;
  white-space: pre-wrap;
  word-wrap: break-word;
  text-align: left;
}

.qr-fallback-msg,
.qr-hint-error {
  font-size: 16px;
  color: #ffaa66;
  padding: 12px;
  text-align: center;
}

.mobile-login-status {
  font-size: 18px;
  color: #ffcc66;
  text-align: center;
  margin-bottom: 12px;
  min-height: 24px;
}

.mobile-login-status.approved {
  color: #66ff99;
  font-weight: bold;
}

#btn-start {
  display: inline-block;
  margin: 8px auto 0 auto;
  min-width: 240px;
  font-size: 20px;
  padding: 14px 28px;
}

.debug-info {
  margin-top: 12px;
  margin-bottom: 12px;
}

.debug-log {
  display: block;
  width: 100%;
  max-height: 240px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(45, 63, 87, 0.95);
  padding: 12px;
  font-family: Courier, monospace;
  font-size: 13px;
  color: #cccccc;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.log-error {
  color: #ff6666;
}

.log-warn {
  color: #ffcc66;
}

.log-info {
  color: #66ccff;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  width: 80%;
  max-width: 800px;
  margin-left: -40%;
  padding: 20px 24px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  color: #ffffff;
  background: #333355;
  border: 3px solid #666688;
  display: none;
  z-index: 9999;
}

.toast.show {
  display: block;
}

.toast.success {
  background: #1a5c2e;
  border-color: #3a9c5e;
}

.toast.error {
  background: #5c1a1a;
  border-color: #9c3a3a;
}

/* =========================
   Video Player Overlay (ES5)
   ========================= */
.player-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
}

.player-chrome {
  width: 100%;
  padding: 16px 18px;
  border-bottom: 2px solid #333355;
  overflow: hidden;
}

.player-title {
  float: left;
  font-size: 20px;
  font-weight: bold;
  color: #ffffff;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-close {
  float: right;
  font-size: 20px;
  font-weight: bold;
  padding: 14px 18px;
  border: 3px solid #ffff00;
  background: #333355;
  color: #ffffff;
  cursor: pointer;
  outline: none;
}

.player-close.focused,
.player-close:active {
  background: #7a50e8;
}

.player-video-wrap {
  position: relative;
  width: 100%;
  height: auto;
  padding: 18px;
}

.player-video {
  display: block;
  width: 100%;
  max-width: 1280px;
  height: 720px;
  margin: 0 auto;
  background: #000000;
  border: 3px solid #333355;
}

.player-download-panel {
  display: none;
  width: 100%;
  padding: 24px 18px;
  text-align: center;
}

.player-download-text {
  font-size: 28px;
  font-weight: bold;
  color: #ffffff;
}

.player-instruction-panel {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  box-sizing: border-box;
  padding: 48px 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.88);
  pointer-events: none;
}

.player-instruction-text {
  max-width: 920px;
  color: #ffffff;
}

.player-instruction-heading {
  font-size: 44px;
  font-weight: bold;
  line-height: 1.25;
  margin-bottom: 28px;
}

.player-instruction-body {
  font-size: 32px;
  line-height: 1.45;
  margin-bottom: 16px;
}

.player-instruction-body.player-instruction-spaced {
  margin-top: 28px;
}

.player-instruction-choice {
  font-size: 36px;
  font-weight: bold;
  line-height: 1.35;
  margin: 8px 0;
}

.player-instruction-or {
  font-size: 30px;
  line-height: 1.35;
  margin: 8px 0;
  color: #cccccc;
}

.player-instruction-footer {
  font-size: 30px;
  font-weight: bold;
  line-height: 1.35;
  margin-top: 32px;
  color: #7fd4ff;
}

.player-play-btn {
  display: none;
  margin: 16px auto 8px auto;
  min-width: 320px;
}

.player-countdown {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  line-height: 720px;
  font-size: 120px;
  font-weight: bold;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.55);
  visibility: hidden;
  opacity: 0;
  z-index: 10002;
  pointer-events: none;
}

/* Synchronized playback — video fills viewport; score overlay stays above (z-index in app.js). */

/* Dual-player score panels — bottom-left / bottom-right, independent updates. */
@keyframes scorePopTv {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-16px) scale(1.4); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.score-overlay-player {
  position: fixed;
  bottom: 40px;
  z-index: 2147483646;
  pointer-events: none;
  font-family: monospace;
  line-height: 1.3;
  padding: 16px 24px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  transform-origin: center bottom;
  display: none;
}

.score-overlay-player1 {
  left: 50px;
  transform-origin: left bottom;
}

.score-overlay-player2 {
  right: 50px;
  transform-origin: right bottom;
  text-align: right;
}

.score-overlay-player .score-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 6px;
}

.score-overlay-player .score-value {
  font-size: 32px;
  font-weight: bold;
}

.score-overlay-player.score-hit {
  color: #00ff00;
}

.score-overlay-player.score-hit .score-value {
  color: #00ff00;
}

.score-overlay-player.score-pop-anim {
  animation: scorePopTv 400ms ease-out;
  animation-fill-mode: none;
}

.player-overlay.player-sync-fullscreen {
  background: #000000;
}

.player-overlay.player-sync-fullscreen .player-chrome,
.player-overlay.player-sync-fullscreen .player-download-panel,
.player-overlay.player-sync-fullscreen .player-instruction-panel,
.player-overlay.player-sync-fullscreen .player-play-btn {
  display: none;
}

.player-overlay.player-sync-fullscreen .player-video-wrap {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding: 0;
}

.player-overlay.player-sync-fullscreen .player-video {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border: none;
  object-fit: cover;
  background: #000000;
}

.player-overlay.player-sync-fullscreen .player-countdown {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  line-height: 100vh;
  z-index: 10002;
}

#app.ui-blocked {
  pointer-events: none;
  opacity: 0.55;
}

@media screen and (min-width: 1280px) {
  .player-title {
    font-size: 22px;
  }
  .player-close {
    font-size: 22px;
  }
  .player-video {
    max-width: 1480px;
    height: 820px;
  }
}

/* Clear floats */
.header:after,
.section:after {
  content: "";
  display: table;
  clear: both;
}

/* Large TV screens */
@media screen and (min-width: 1280px) {
  html, body {
    font-size: 20px;
  }

  .brand-title {
    font-size: 32px;
  }

  .card {
    width: 260px;
  }

  .card-img-wrap,
  .card-img {
    height: 160px;
  }

  .btn {
    font-size: 24px;
    padding: 22px 44px;
  }
}

/* Build version overlay — always on top, non-interactive */
#tv-build-version-overlay {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 2147483647;
  pointer-events: none;
  background: rgba(128, 0, 255, 0.75);
  color: #ffffff;
  font-weight: bold;
  font-size: 12px;
  line-height: 1.5;
  font-family: Arial, Helvetica, sans-serif;
  padding: 8px 12px;
  border-radius: 8px;
  margin: 0;
  text-align: left;
  white-space: pre;
  box-sizing: border-box;
}

/* Dance session result overlay (code 13) — z-index below TV int cap; avoid 2147483647 on Tizen/webOS */
.dance-result-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 100050;
  display: none;
  visibility: visible;
  opacity: 1;
  overflow-y: auto;
  text-align: center;
  background: rgba(8, 8, 20, 0.92);
}

.dance-result-panel {
  display: inline-block;
  width: 88%;
  max-width: 920px;
  margin: 8vh auto 0 auto;
  padding: 36px 40px 32px 40px;
  border-radius: 16px;
  border: 2px solid rgba(127, 212, 255, 0.45);
  background: linear-gradient(160deg, rgba(20, 24, 48, 0.98) 0%, rgba(12, 14, 32, 0.98) 100%);
  box-shadow: 0 0 40px rgba(127, 212, 255, 0.25);
  text-align: center;
  vertical-align: top;
}

.dance-result-artwork-wrap {
  margin-bottom: 20px;
}

.dance-result-artwork {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid rgba(127, 212, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.dance-result-artwork-placeholder {
  display: inline-block;
  width: 220px;
  height: 220px;
  line-height: 220px;
  border-radius: 12px;
  border: 3px solid rgba(127, 212, 255, 0.35);
  background: rgba(127, 212, 255, 0.08);
  color: #7fd4ff;
  font-size: 22px;
  font-weight: bold;
}

.dance-result-title {
  font-size: 36px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 24px;
  text-shadow: 0 0 12px rgba(127, 212, 255, 0.5);
}

.dance-result-scores {
  margin-bottom: 28px;
}

.dance-result-dual {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.dance-result-player-col {
  min-width: 160px;
}

.dance-result-player-label {
  font-size: 22px;
  letter-spacing: 0.08em;
  color: #cccccc;
  margin-bottom: 8px;
}

.dance-result-score-value {
  font-size: 52px;
  font-weight: bold;
  color: #7fd4ff;
  font-family: monospace;
  text-shadow: 0 0 16px rgba(127, 212, 255, 0.65);
}

.dance-result-score-single {
  font-size: 64px;
}

.dance-result-winner {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid rgba(127, 212, 255, 0.35);
}

.dance-result-winner-badge {
  font-size: 32px;
  font-weight: bold;
  color: #ffe27a;
  text-shadow: 0 0 18px rgba(255, 226, 122, 0.75);
  margin-bottom: 6px;
}

.dance-result-winner-name {
  font-size: 40px;
  font-weight: bold;
  color: #ffffff;
}

.dance-result-draw {
  font-size: 48px;
  font-weight: bold;
  letter-spacing: 0.12em;
  color: #7fd4ff;
  border-top: none;
  padding-top: 8px;
}

.dance-result-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.dance-result-btn {
  min-width: 220px;
  font-size: 22px;
  padding: 14px 28px;
}

/* Live frame-index sync HUD — hero JSON Frame (top-left, Unity compare) */
.tv-frame-sync-mount {
  position: fixed;
  left: 8px;
  top: 8px;
  right: auto;
  bottom: auto;
  z-index: 100070;
  pointer-events: none;
}

.tv-frame-sync-live-overlay {
  position: relative;
  width: auto;
  min-width: 320px;
  max-width: 96vw;
  z-index: 100070;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.88);
  color: #ffffff;
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  line-height: 1.3;
  padding: 14px 18px 12px 18px;
  border-radius: 8px;
  border: 2px solid rgba(127, 212, 255, 0.45);
  text-align: left;
}

.frame-sync-hero-block {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.frame-sync-hero-label {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 0.12em;
  color: #7fd4ff;
  margin-bottom: 4px;
}

.frame-sync-hero-value {
  font-size: 96px;
  font-weight: bold;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 0;
}

.frame-sync-hero-ok {
  color: #44ff88;
  text-shadow: 0 0 24px rgba(68, 255, 136, 0.45);
}

.frame-sync-hero-bad {
  color: #ff5555;
  text-shadow: 0 0 24px rgba(255, 85, 85, 0.45);
}

.frame-sync-hero-waiting {
  color: #55aaff;
  text-shadow: 0 0 24px rgba(85, 170, 255, 0.45);
}

.frame-sync-match-line {
  margin-top: 8px;
  font-size: 42px;
  font-weight: bold;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.frame-sync-match-ok {
  color: #44ff88;
}

.frame-sync-match-bad {
  color: #ff5555;
}

.frame-sync-match-waiting {
  color: #55aaff;
}

.frame-sync-details {
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.92;
}

.frame-sync-detail-row {
  margin-bottom: 2px;
}

.frame-sync-overlay-title {
  font-weight: bold;
  font-size: 12px;
  color: #7fd4ff;
  margin-bottom: 6px;
}

.frame-sync-overlay-pre {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: #ffffff;
  background: transparent;
  border: none;
  white-space: pre-wrap;
}

.frame-sync-overlay-grid {
  display: block;
}

.frame-sync-overlay-grid > div {
  margin-bottom: 3px;
}

.frame-sync-label {
  display: inline-block;
  width: 140px;
  color: #aaaaaa;
  font-size: 13px;
}

.frame-sync-value {
  color: #ffffff;
  font-weight: bold;
  font-size: 14px;
}

.frame-sync-status {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: bold;
  font-size: 12px;
}

.frame-sync-match-ok {
  color: #44ff88;
}

.frame-sync-match-bad {
  color: #ff5555;
}
