/* Shared Live / History player-gate chrome. Page-specific rules stay in play.css / history.css. */

.play-page,
.history-page {
  padding: 0.5rem 0 2rem;
}

/* Live overrides width/padding in play.css; login card stays narrow there. */
.play-page {
  margin: 0 auto;
  max-width: 28rem;
}

.history-page {
  margin: 0;
  max-width: none;
}

.play-header,
.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

.play-header-text,
.history-header-text {
  min-width: 0;
  flex: 1 1 12rem;
}

.player-points-balance {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-shrink: 0;
  text-align: right;
}

.player-points-all-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.player-points-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.player-points-label,
.player-points-today-label {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
}

.player-points-today-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.player-points-today {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  padding-left: 0.85rem;
  border-left: 1px solid #e2e8f0;
}

.player-points-today-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #334155;
  font-variant-numeric: tabular-nums;
}

.play-title,
.history-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
}

.play-sub,
.history-sub {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: #475569;
}

.play-link,
.history-link {
  margin-left: 0.5rem;
  border: 0;
  background: none;
  color: #4f46e5;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

.play-name-card,
.play-question,
.play-empty,
.history-card,
.history-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 1rem;
}

.play-label,
.history-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

.play-name-form,
.history-name-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.play-input,
.history-input,
.history-select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.85rem 0.9rem;
  font-size: 1.05rem;
  background: #fff;
}

.play-btn,
.history-btn {
  border: 0;
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
}

.play-btn:disabled,
.history-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.play-btn-primary,
.history-btn-primary {
  background: #4f46e5;
  color: #fff;
}

.play-error,
.history-error {
  margin: 0.75rem 0 0;
  color: #dc2626;
  font-size: 0.9rem;
}

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

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

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

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

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

.play-match,
.history-match {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

a.play-match-link {
  color: inherit;
  text-decoration: none;
}

a.play-match-link:hover {
  color: #4338ca;
  text-decoration: underline;
}

.play-follow-bar-value.play-match-link {
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
  letter-spacing: inherit;
  color: #0f172a;
}

.play-follow-bar-value.play-match-link:hover {
  color: #4338ca;
}

.play-follow-meta {
  color: #64748b;
  font-weight: 400;
}

/* Shared answer-history cards (Live recent + History page). */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.history-item {
  padding: 0;
  overflow: hidden;
}

.history-item-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  user-select: none;
}

.history-item-summary::-webkit-details-marker {
  display: none;
}

.history-item-summary::before {
  content: "▸";
  flex-shrink: 0;
  color: #64748b;
  margin-top: 0.15rem;
  width: 0.85rem;
}

.history-item[open] > .history-item-summary::before {
  content: "▾";
}

.history-item-summary-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.history-question-summary {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: #0f172a;
}

.history-answer-summary {
  font-size: 0.9rem;
  color: #334155;
}

.history-item-summary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.history-issuance-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.history-issuance-wrap .admin-copy-icon-btn {
  width: 1.25rem;
  height: 1.25rem;
}

.history-issuance-wrap .admin-copy-icon-btn svg {
  width: 0.75rem;
  height: 0.75rem;
}

.history-meta-id {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.history-item-sponsors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.history-sponsors-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  font-size: 0.7rem;
}

.history-sponsor-part {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.history-sponsor-kind {
  font-weight: 600;
  color: #475569;
}

.history-sponsor-logo {
  width: 1.1rem;
  height: 1.1rem;
  object-fit: contain;
  border-radius: 0.15rem;
  background: #fff;
  flex-shrink: 0;
}

.history-sponsor-detail {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.history-item-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.85rem;
}

.history-points {
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: #e2e8f0;
  color: #334155;
}

.history-points-ok {
  background: #dcfce7;
  color: #166534;
}

.history-points-no {
  background: #fee2e2;
  color: #991b1b;
}

.history-points-pending {
  background: #fef3c7;
  color: #92400e;
}

.history-question {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  color: #0f172a;
}

.history-answer {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #334155;
}

.history-meta {
  margin: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.8rem;
}

.history-meta dt {
  color: #64748b;
  font-weight: 600;
}

.history-meta dd {
  margin: 0.1rem 0 0;
  color: #0f172a;
  word-break: break-all;
}

.history-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
}

.history-shortcode {
  font-size: 0.75rem;
  color: #475569;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.history-empty {
  margin: 0;
  color: #64748b;
}

/* Shared resolution field / condition chrome (History, Play, Debug). */

.lr-fields {
  display: grid;
  gap: 0.35rem;
}

.lr-field-row {
  display: grid;
  grid-template-columns: minmax(8rem, 40%) minmax(0, 1fr);
  gap: 0.5rem;
  font-size: 12px;
  line-height: 1.35;
}

.lr-field-key {
  margin: 0;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.lr-field-val {
  margin: 0;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-word;
}

.lr-cond-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  padding: 0.15rem 0.45rem;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lr-cond-badge-true {
  background: #d1fae5;
  color: #065f46;
}

.lr-cond-badge-false {
  background: #ffe4e6;
  color: #9f1239;
}

.lr-cond-badge-error {
  background: #fef3c7;
  color: #92400e;
}

.lr-cond-expr {
  word-break: break-word;
}

.lr-cond-path {
  display: inline;
  white-space: normal;
}

.lr-cond-path-token {
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 0.2rem;
  padding: 0.05rem 0.25rem;
}

.lr-cond-path-value {
  background: #ecfdf5;
  color: #047857;
  border-radius: 0.2rem;
  padding: 0.05rem 0.25rem;
  margin-left: 0.15rem;
  font-weight: 600;
}

.lr-question-details > summary {
  list-style: none;
}

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

.lr-question-details > summary::before {
  content: "▸";
  display: inline-block;
  width: 1rem;
  color: #64748b;
}

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

.history-match-group {
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden;
}

.history-match-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
}

.history-match-group > summary::-webkit-details-marker {
  display: none;
}

.history-match-group > summary::before {
  content: "▸";
  color: #64748b;
  margin-right: 0.35rem;
}

.history-match-group[open] > summary::before {
  content: "▾";
}

.history-match-group-body {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid #e2e8f0;
}

.history-match-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
}

.history-lookup-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.history-lookup-tab {
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.history-lookup-tab-active {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #3730a3;
}
