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

:root {
  --bg: #0a0a0f;
  --surface: #14141f;
  --border: #2a2a3a;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.5);
  --accent: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.3);
  --pink: #f472b6;
  --blue: #60a5fa;
}

body {
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 900px;
  padding: 2rem;
}

.hidden { display: none !important; }

.btn {
  padding: 0.75rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-small {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Player Screen */

#player-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

#video-container {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

#video {
  display: block;
  width: 100%;
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#peck-counter {
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(10, 10, 15, 0.6);
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  transition: transform 0.15s;
}

#peck-counter.pulse {
  transform: scale(1.15);
}

#status-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  background: rgba(10, 10, 15, 0.75);
  padding: 8px 18px;
  border-radius: 8px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

#controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.5rem;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slider-group label {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.key-group {
  display: flex;
  align-items: center;
}

.api-key-input {
  width: 160px;
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.api-key-input::placeholder {
  color: var(--text-dim);
}

.api-key-input:focus {
  border-color: var(--accent);
}

#description {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  max-width: 480px;
  line-height: 1.5;
}

#credit {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
}

#credit a {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  transition: color 0.2s;
}

#credit a:hover {
  color: var(--text-dim);
}

@media (max-width: 600px) {
  #controls {
    gap: 0.6rem;
  }

  .api-key-input {
    width: 130px;
  }
}
