/* FarmTube — void black / bone / copper — Tesla fat taps */

:root {
  --void: #000000;
  --bone: #e8e4d9;
  --copper: #b87333;
  --copper-dim: #8a5524;
  --surface: #0a0a0a;
  --tap: 48px;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--font);
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  overscroll-behavior: none;
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tap {
  min-height: var(--tap);
  min-width: var(--tap);
  touch-action: manipulation;
  cursor: pointer;
  border: none;
  font: inherit;
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.home-btn {
  background: var(--copper);
  color: var(--void);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0 22px;
  border-radius: var(--radius);
}

.home-btn:active {
  background: var(--copper-dim);
}

.clock {
  flex: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--bone);
}

.ingest-status {
  font-size: 0.75rem;
  color: var(--copper);
  opacity: 0.85;
  max-width: 140px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ingest-status.offline {
  color: #c44;
}

.ingest-status.online {
  color: #6a9;
}

.search-panel {
  width: 100%;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--copper);
  border-radius: var(--radius);
  color: var(--bone);
  font-size: 1.15rem;
  padding: 0 16px;
  outline: none;
}

.search-input::placeholder {
  color: rgba(232, 228, 217, 0.45);
}

.search-input:focus {
  border-color: var(--bone);
}

.search-btn {
  background: var(--copper);
  color: var(--void);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0 24px;
  border-radius: var(--radius);
}

.search-btn:active {
  background: var(--copper-dim);
}

.section-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--copper);
  font-weight: 600;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid rgba(184, 115, 51, 0.35);
  border-radius: var(--radius);
  padding: 10px;
  color: var(--bone);
  min-height: var(--tap);
}

.result-card:active,
.result-card:focus-within {
  border-color: var(--copper);
  background: #111;
}

.result-thumb {
  width: 120px;
  min-width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
}

.result-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.result-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-channel {
  font-size: 0.85rem;
  color: rgba(232, 228, 217, 0.65);
}

.player {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-stage {
  position: relative;
  width: 100%;
  background: var(--void);
  border: 1px solid rgba(184, 115, 51, 0.4);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video-canvas,
.mjpeg-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: transparent;
}

.player-overlay.hidden {
  display: none;
}

.player-status {
  margin: 0;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--copper);
  border-radius: var(--radius);
  color: var(--bone);
  font-size: 1.1rem;
  text-align: center;
  max-width: 90%;
}

.player-meta {
  padding: 0 4px;
}

.now-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bone);
}

.now-channel {
  margin: 4px 0 0;
  color: rgba(232, 228, 217, 0.7);
  font-size: 0.95rem;
}

.player-controls {
  display: flex;
  gap: 12px;
}

.ctrl-btn {
  flex: 1;
  background: transparent;
  border: 2px solid var(--copper);
  border-radius: var(--radius);
  color: var(--bone);
  font-weight: 600;
  font-size: 1.05rem;
}

.ctrl-btn:active {
  background: rgba(184, 115, 51, 0.2);
}

.foot {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(232, 228, 217, 0.4);
}

.foot .sep {
  margin: 0 6px;
}

[hidden] {
  display: none !important;
}

@media (min-width: 800px) {
  .result-thumb {
    width: 160px;
    min-width: 160px;
    height: 90px;
  }
}

.scrub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.scrub {
  flex: 1;
  height: var(--tap);
  accent-color: var(--copper);
  background: transparent;
}

.scrub-btn {
  background: var(--surface);
  border: 1px solid var(--copper-dim);
  border-radius: var(--radius);
  color: var(--bone);
  font-weight: 700;
  padding: 0 14px;
  flex-shrink: 0;
}

.scrub-btn:active {
  background: var(--copper);
  color: var(--void);
}

.time-label {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--bone);
  min-width: 7ch;
  text-align: right;
  opacity: 0.85;
}


.result-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.result-action-btn {
  background: var(--copper);
  color: var(--void);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 14px;
  border-radius: var(--radius);
  min-height: var(--tap);
  white-space: nowrap;
  border: none;
}

.result-action-btn.queue-btn {
  background: transparent;
  border: 2px solid var(--copper);
  color: var(--bone);
}

.result-action-btn.queue-btn:active {
  background: rgba(184, 115, 51, 0.2);
}

.result-action-btn.play-btn:active {
  background: var(--copper-dim);
}

.queue .result-channel {
  color: var(--copper);
}
