:root {
  --bg: #09090b;
  --surface: #121215;
  --border: #27272a;
  --border-focus: #52525b;
  --text: #fafafa;
  --muted: #71717a;
  --accent: #22c55e;
  --accent-dim: rgba(34, 197, 94, 0.12);
  --error: #ef4444;
  --font: 'JetBrains Mono', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-size: 14px;
}

.app {
  width: 100%;
  max-width: 640px;
}

header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.05em;
  color: var(--muted);
}

.logo span {
  color: var(--text);
}

.search-box {
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  transition: border-color 0.15s;
}

.search-box:focus-within {
  border-color: var(--border-focus);
}

input[type="url"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
}

input::placeholder {
  color: var(--muted);
}

button[type="submit"] {
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

button[type="submit"]:hover {
  opacity: 0.9;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  color: var(--error);
  font-size: 0.85rem;
}

.results {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.thumb-box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.thumb-box img {
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.streams {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stream-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.stream-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.stream-format {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: #1c1c22;
  padding: 2px 6px;
  border-radius: 4px;
}

.stream-url {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn {
  font-family: inherit;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  transition: all 0.15s;
}

.btn:hover {
  background: #1c1c22;
  border-color: var(--border-focus);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  opacity: 0.9;
  background: var(--text);
}

.hidden {
  display: none !important;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
