/* Live play — mobile-first; question cards are the primary surface. */

.play-page {
  max-width: none;
  padding: 0.25rem 0 1.5rem;
}

/* Compact points on Live only (History keeps shared sizing). */
.play-page .player-points-balance {
  gap: 0.65rem;
}

.play-page .player-points-value {
  font-size: 1.4rem;
}

.play-page .player-points-today-value {
  font-size: 1rem;
}

.play-page .player-points-today {
  padding-left: 0.65rem;
}

.play-page .player-points-label,
.play-page .player-points-today-label {
  font-size: 0.65rem;
}

/* —— Header —— */

.play-header {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.play-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.play-header-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
}

.play-logo {
  display: block;
  height: 2.25rem;
  width: auto;
  flex-shrink: 0;
  /* Same dark surface as .admin-header / nav (logo is light-on-transparent). */
  background: rgba(15, 23, 42, 0.96);
  border-radius: 0.45rem;
  padding: 0.25rem 0.4rem;
  box-sizing: content-box;
}

.play-page .play-title {
  font-size: 1.35rem;
  margin: 0;
}

.play-page .play-sub {
  margin: 0;
  font-size: 0.85rem;
}

.play-page .play-link {
  margin-left: 0.35rem;
  font-size: 0.85rem;
}

.play-page .play-sound-toggle[aria-pressed="true"] {
  opacity: 0.65;
}

.play-name-card {
  max-width: 28rem;
  margin: 0 auto;
}

/* —— Following bar —— */

.play-follow-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.play-follow-bar-main {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.9rem;
  color: #0f172a;
}

.play-follow-bar-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.play-follow-bar-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
  color: #64748b;
}

.play-follow-bar-empty {
  color: #64748b;
  font-size: 0.85rem;
}

.play-follow-bar-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.1rem;
}

.play-follow-bar-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 14rem;
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border: 1px solid #c7d2fe;
  border-radius: 9999px;
  background: #eef2ff;
  color: #312e81;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  /* Do not set overflow:hidden here — it clips the delayed shortcode tooltip. */
}

.play-follow-bar-tag > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Delayed shortcode tooltip on Following bar tags */
.play-follow-bar-tag[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  transform: translateX(-50%);
  z-index: 30;
  max-width: 18rem;
  padding: 0.3rem 0.5rem;
  border-radius: 0.375rem;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.7rem;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease 0.55s, visibility 0s linear 0.55s;
}

.play-follow-bar-tag[data-tooltip]:hover::after,
.play-follow-bar-tag[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transition-delay: 0.55s, 0.55s;
}

.play-follow-bar-tag-test {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #78350f;
}

.play-follow-bar-tag-test-mark {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #92400e;
}

.play-follow-bar-quota {
  color: #64748b;
  font-size: 0.78rem;
  white-space: nowrap;
}

.play-follow-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.play-follow-btn {
  flex: 1 1 auto;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  min-height: 2.75rem;
}

.play-follow-clear {
  flex-shrink: 0;
}

.play-follow-hint {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

/* —— Following modal —— */

.play-follow-modal {
  max-height: min(92dvh, 40rem);
}

.play-follow-modal-body {
  min-height: 0;
  flex: 1 1 auto;
}

.play-follow-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.play-follow-league {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.play-follow-league-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.play-follow-league-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: #64748b;
}

.play-follow-league-toggle:hover {
  color: #334155;
}

.play-follow-league-chevron {
  display: inline-block;
  width: 0.9rem;
  font-size: 0.7rem;
  line-height: 1;
  transition: transform 0.12s ease;
}

.play-follow-league-chevron.is-collapsed {
  transform: rotate(-90deg);
}

.play-follow-league-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.play-follow-league-count {
  margin-left: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
}

.play-follow-league-bulk {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.play-follow-league-bulk-btn {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0;
}

.play-follow-league-bulk-btn:disabled {
  opacity: 0.35;
  cursor: default;
  text-decoration: none;
}

.play-follow-league-matches {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.play-follow-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  color: #0f172a;
  min-height: 2.75rem;
}

.play-follow-chip-busy,
.play-follow-chip-locked {
  cursor: default;
  opacity: 0.85;
}

.play-follow-chip-busy {
  pointer-events: none;
}

.play-follow-chip-active {
  border-color: #4f46e5;
  background: #eef2ff;
}

.play-follow-chip-test {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #f59e0b;
}

.play-follow-chip-test.play-follow-chip-active {
  background: #fef3c7;
  border-color: #d97706;
}

.play-follow-check {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
}

.play-follow-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  line-height: 1.3;
  word-break: break-word;
  min-width: 0;
}

.play-follow-label-main {
  min-width: 0;
}

.play-follow-shortcode {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8em;
  color: #475569;
  word-break: break-all;
}

.play-follow-test-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #fde68a;
  padding: 0.1rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #78350f;
  white-space: nowrap;
}

.play-follow-sponsor {
  font-weight: 500;
  color: #64748b;
}

.play-follow-sponsor-link {
  color: inherit;
  text-decoration: none;
}

.play-follow-sponsor-link:hover {
  text-decoration: underline;
}

/* —— Watch layout (single column by default) —— */

.play-watch-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.play-watch-main {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  order: 1;
}

.play-history {
  order: 2;
  margin: 0;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  overflow: hidden;
}

.play-history-title {
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: #0f172a;
  user-select: none;
}

.play-history-title::-webkit-details-marker {
  display: none;
}

.play-history-title::before {
  content: "▸";
  display: inline-block;
  width: 1rem;
  color: #64748b;
  font-weight: 500;
}

.play-history[open] > .play-history-title::before {
  content: "▾";
}

.play-history .history-list,
.play-history .history-empty {
  padding: 0 0.85rem 0.9rem;
}

.play-history .history-item {
  background: #fff;
}

/* —— Empty state (quiet) —— */

.play-empty {
  border-style: dashed;
  background: #fafbfc;
  padding: 1.1rem 1rem;
  text-align: center;
}

.play-empty-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 550;
  color: #64748b;
}

.play-empty-sub {
  margin: 0.35rem 0 0;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* —— Question cards (hero) —— */

@keyframes play-question-enter {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.play-question {
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  background: #fff;
  padding: 1rem 0.95rem 1.05rem;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
  animation: play-question-enter 0.2s ease-out;
}

.play-question-answered {
  border-color: #e2e8f0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  opacity: 0.92;
}

.play-question-pivotal {
  border-color: #fdba74;
  box-shadow: 0 4px 18px rgba(154, 52, 18, 0.12);
  background: linear-gradient(180deg, #fff7ed 0%, #fff 2.5rem);
}

.play-pivotal-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #ffedd5;
  border: 1px solid #fdba74;
  color: #9a3412;
  padding: 0.1rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .play-question {
    animation: none;
  }
}

.play-question-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.play-question-meta-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.play-page .play-match {
  font-size: 0.75rem;
}

.play-countdown {
  font-variant-numeric: tabular-nums;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1;
  flex-shrink: 0;
}

.play-countdown-urgent {
  color: #dc2626;
}

.play-question-situation {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #64748b;
}

.play-question-text {
  margin: 0 0 0.9rem;
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 650;
  color: #0f172a;
}

.play-choices {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.play-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 2px solid #cbd5e1;
  border-radius: 0.7rem;
  background: #fff;
  padding: 1rem 1.05rem;
  font-size: 1.08rem;
  font-weight: 550;
  color: #0f172a;
  cursor: pointer;
  min-height: 3.4rem;
}

.play-choice-text {
  flex: 1 1 auto;
  min-width: 0;
}

.play-choice-points {
  flex: 0 0 auto;
  font-size: 0.92rem;
  font-weight: 650;
  color: #475569;
  white-space: nowrap;
}

.play-choice-selected .play-choice-points {
  color: #4338ca;
}

.play-choice-selected {
  border-color: #4f46e5;
  background: #eef2ff;
}

.play-choice:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.play-choice-selected:disabled {
  opacity: 1;
  cursor: default;
}

.play-choice-busy:not(.play-choice-selected) {
  opacity: 0.7;
}

.play-saved {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  color: #475569;
}

.play-question-sponsors {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.play-sponsor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin: 0;
  padding: 0.3rem 0.45rem;
  border-radius: 0.4rem;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--sponsor-primary, #64748b);
  background: #f8fafc;
}

.play-sponsor-logo {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
  border-radius: 0.2rem;
  background: #fff;
}

.play-sponsor-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.play-sponsor-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
}

.play-sponsor-name:hover {
  text-decoration: underline;
}

.play-question-details {
  margin-top: 0.65rem;
}

.play-question-details-summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  user-select: none;
}

.play-question-details-summary::-webkit-details-marker {
  display: none;
}

.play-question-details-summary::before {
  content: "▸ ";
}

.play-question-details[open] > .play-question-details-summary::before {
  content: "▾ ";
}

.play-question-ids {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.play-id-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 0.35rem;
}

.play-id-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  color: #475569;
  word-break: break-all;
}

/* —— Desktop enhancements —— */

@media (min-width: 900px) {
  .play-page {
    padding: 0.5rem 0 2rem;
  }

  .play-logo {
    height: 2.75rem;
    padding: 0.3rem 0.5rem;
  }

  .play-page .play-title {
    font-size: 1.55rem;
  }

  .play-follow-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.6rem 0.9rem;
  }

  .play-follow-bar-main {
    flex: 1 1 12rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
  }

  .play-follow-bar-heading {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .play-follow-bar-tags {
    flex-wrap: wrap;
    overflow: visible;
  }

  .play-follow-bar-actions {
    flex-shrink: 0;
  }

  .play-follow-btn {
    flex: 0 0 auto;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    min-height: 0;
  }

  .play-follow-modal {
    max-height: 85vh;
  }

  .play-watch-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr);
    gap: 1.5rem 1.75rem;
  }

  .play-watch-main {
    order: 0;
  }

  .play-history {
    order: 0;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    padding: 0 0 0.25rem;
  }

  .play-history-title {
    cursor: default;
    pointer-events: none;
    padding: 1rem 1.1rem 0.65rem;
    font-size: 1.05rem;
  }

  .play-history-title::before {
    content: none;
  }

  .play-history .history-list,
  .play-history .history-empty {
    padding: 0 1.1rem 1rem;
  }

  .play-question {
    padding: 1.15rem 1.2rem 1.2rem;
  }

  .play-question-text {
    font-size: 1.35rem;
  }

  .play-countdown {
    font-size: 1.55rem;
  }

  .play-question-sponsors {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
}

.history-feedback-action {
  margin-top: 0.35rem;
}

.play-feedback-btn {
  padding: 0;
  font-size: 0.8125rem;
}

.history-feedback-sent {
  font-size: 0.75rem;
}

.play-feedback-modal textarea.play-input {
  resize: vertical;
  min-height: 4.5rem;
}
