:root {
  --ink: #1a1a1a;
  --muted: #666;
  --border: #222;
  --bg: #faf9f6;
  --box-bg: #fff;
  --highlight: #fff3bf;
  --netflix: #e50914;
  --high: #2e7d32;
  --medium: #ed6c02;
  --low: #9e9e9e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.label,
.title {
  font-family: "Caveat", cursive;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

.label {
  font-size: 1.75rem;
}

.title {
  font-size: 2.25rem;
}

.subtitle {
  margin: -0.5rem 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.box {
  width: 100%;
  border: 2.5px solid var(--border);
  border-radius: 28px;
  background: var(--box-bg);
  padding: 1.25rem 1.5rem;
  font-size: 1.05rem;
  line-height: 1.5;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.06);
}

.input-box {
  resize: vertical;
  min-height: 72px;
  font-family: "Inter", sans-serif;
  outline: none;
}

.input-box:focus {
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.status {
  width: 100%;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.status.error {
  color: #b00020;
}

.results {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  border: 2.5px solid var(--border);
  border-radius: 24px;
  background: var(--box-bg);
  padding: 1rem 1.25rem 1.1rem;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.06);
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.rank {
  font-weight: 600;
  font-size: 0.95rem;
}

.ep-badge {
  font-size: 0.8rem;
  font-weight: 600;
  background: #eee;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.timestamp {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.score-pill {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.confidence {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  color: #fff;
}

.confidence.high {
  background: var(--high);
}
.confidence.medium {
  background: var(--medium);
}
.confidence.low {
  background: var(--low);
}

.context {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #333;
}

.context .ctx-line {
  margin: 0.15rem 0;
  opacity: 0.72;
}

.context .ctx-target {
  margin: 0.35rem 0;
  padding: 0.35rem 0.5rem;
  background: var(--highlight);
  border-radius: 8px;
  font-weight: 500;
  opacity: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.feedback {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.feedback-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 0.2rem 0.45rem;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}

.feedback-btn:hover:not(:disabled) {
  background: #f5f5f5;
  transform: translateY(-1px);
}

.feedback-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.feedback-btn.selected {
  background: #eee;
  box-shadow: inset 0 0 0 1px var(--border);
}

.feedback-msg {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 0.15rem;
}

.guardrail-note {
  font-size: 0.72rem;
  color: var(--muted);
  flex: 1;
}

.stream-btn,
.netflix-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
  white-space: nowrap;
}

.stream-btn--netflix,
.netflix-btn {
  background: var(--netflix);
}

.stream-btn--hotstar {
  background: linear-gradient(135deg, #0084ff 0%, #0052cc 100%);
}

.stream-btn:hover,
.netflix-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.stream-btn svg,
.netflix-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.placeholder-card {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 2rem 1rem;
}

@media (max-width: 480px) {
  .page {
    padding-top: 1.5rem;
  }
  .box,
  .card {
    border-radius: 20px;
  }
  .score-pill {
    margin-left: 0;
    width: 100%;
  }
  .card-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}
