@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;600;700&family=Orbitron:wght@400;700;900&display=swap');

:root {
  --bg-deep: #050818;
  --bg-panel: #0a0e1a;
  --bg-metal: #1a1f2e;
  --neon-purple: #b537f2;
  --neon-magenta: #ff2d9b;
  --neon-cyan: #00d4ff;
  --text: #e8f4ff;
  --text-dim: rgba(232, 244, 255, 0.55);
  --border: rgba(181, 55, 242, 0.25);
  --glow-purple: 0 0 20px rgba(181, 55, 242, 0.45);
  --glow-cyan: 0 0 16px rgba(0, 212, 255, 0.35);
  --radius: 12px;
  --font-display: 'Orbitron', monospace;
  --font-body: 'Exo 2', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

a { color: var(--neon-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(181, 55, 242, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
    var(--bg-deep);
}

.topnav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 8, 24, 0.92);
  backdrop-filter: blur(10px);
}

.topnav-logo { height: 36px; max-width: 180px; object-fit: contain; }

.nav-links { display: flex; gap: 0.35rem; margin-left: auto; flex-wrap: wrap; }

.nav-link {
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--neon-cyan);
  border-color: rgba(0, 212, 255, 0.35);
  background: rgba(0, 212, 255, 0.08);
  text-decoration: none;
}

.page { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* Console player frame */
.console-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem;
  background: linear-gradient(145deg, #12182a, #0a0e18);
  border: 2px solid var(--neon-purple);
  border-radius: 16px;
  box-shadow: var(--glow-purple), inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.console-screen {
  position: relative;
  aspect-ratio: 16/9;
  max-height: 360px;
  background: #000;
  border: 3px solid var(--neon-purple);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(181, 55, 242, 0.2);
}

.console-screen img,
.console-screen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.console-screen .yt-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.console-screen video {
  transition: opacity 0.4s;
}

.yt-watch-link {
  display: inline-block;
  margin-top: 0.5rem;
}

.yt-audio-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
}

.console-meta { padding: 1rem 0.5rem 0.5rem; }

.track-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.track-artist { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.25rem; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--neon-magenta);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-magenta);
  box-shadow: 0 0 8px var(--neon-magenta);
  animation: pulse 1.2s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.75rem 0 0.35rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
  transition: width 0.3s linear;
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--neon-cyan);
  opacity: 0.8;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: 0.2s;
}

.btn:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

.btn-primary {
  background: rgba(181, 55, 242, 0.2);
  border-color: var(--neon-purple);
  color: var(--neon-cyan);
}

.btn-power {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  background: rgba(0, 212, 255, 0.1);
  color: var(--neon-cyan);
  font-size: 1.5rem;
  cursor: pointer;
}

.btn-power.off { border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.3); }

.viz-box {
  height: 56px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  margin: 0.75rem 0;
}

.viz-bar {
  width: 4px;
  min-height: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
  transition: height 0.05s;
}

.stats-pill {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--neon-cyan);
  opacity: 0.85;
}

/* Ad slots */
.ad-slot {
  margin: 1rem auto;
  text-align: center;
  min-height: 50px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot[data-empty="true"] { display: none; }
.ad-slot img { max-width: 100%; height: auto; display: block; }
.ad-slot-banner-top { max-width: 728px; min-height: 90px; }
.ad-slot-sidebar { max-width: 300px; min-height: 250px; }
.ad-slot-footer { max-width: 728px; min-height: 90px; margin-top: 2rem; }

/* Admin login icon */
.admin-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(10, 14, 26, 0.9);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--glow-purple);
  transition: 0.2s;
}

.admin-fab:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  text-decoration: none;
}

/* Landing */
.hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
}

.hero-img {
  max-width: min(420px, 90vw);
  border-radius: 16px;
  box-shadow: var(--glow-purple);
  margin: 1rem auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.nav-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: 0.2s;
  color: var(--text);
}

.nav-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
  text-decoration: none;
}

.nav-card-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.nav-card-title { font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.1em; }
.nav-card-desc { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.35rem; line-height: 1.35; }

.queue-list { margin-top: 1.5rem; }
.queue-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .nav-link { font-size: 0.55rem; padding: 0.25rem 0.4rem; }
  .console-wrap { padding: 0.5rem; }
}

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .layout-with-sidebar { grid-template-columns: 1fr; }
}

.watermark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 64px;
  opacity: 0.5;
  pointer-events: none;
}

.console-screen { transition: opacity 0.4s; }
#tv-video { transition: opacity 0.4s; width: 100%; height: 100%; object-fit: contain; }

.panel-box {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.input-field {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
}

.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.podium-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.podium-item.rank-1 { border-color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.podium-rank { font-family: var(--font-display); font-size: 1.5rem; color: var(--neon-purple); }
.podium-title { font-weight: 600; margin: 0.5rem 0; }
.podium-votes { color: var(--text-dim); font-size: 0.85rem; }

.chat-messages {
  max-height: 360px;
  overflow-y: auto;
  font-size: 0.9rem;
}

.chat-line { padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }

/* Admin */
.admin-body .admin-fab { display: none; }

.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.admin-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 8, 24, 0.95);
}

.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: calc(100vh - 52px);
  position: relative;
  z-index: 2;
}

.admin-nav {
  border-right: 1px solid var(--border);
  padding: 0.5rem;
  background: rgba(10, 14, 26, 0.9);
  overflow-y: auto;
}

.admin-nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.5rem;
  margin-bottom: 0.25rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.72rem;
  cursor: pointer;
}

.admin-nav button:hover,
.admin-nav button.active {
  color: var(--neon-cyan);
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.06);
}

.admin-main {
  padding: 1rem;
  overflow-y: auto;
}

.admin-section h2 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-val { font-family: var(--font-display); font-size: 1.4rem; color: var(--neon-cyan); }
.stat-label { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.25rem; }
.hint { color: var(--text-dim); font-size: 0.8rem; margin-bottom: 0.5rem; }

.upload-contact-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.contact-thread-btn.active {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.contact-msg {
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.45;
}

.contact-msg.user {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  margin-right: 1.5rem;
}

.contact-msg.admin {
  background: rgba(157, 78, 221, 0.1);
  border: 1px solid rgba(157, 78, 221, 0.25);
  margin-left: 1.5rem;
}

.contact-msg-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.user-new-badge {
  font-size: 0.72rem;
  color: var(--neon-magenta);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.new-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b5c;
  box-shadow: 0 0 6px #ff3b5c;
  flex-shrink: 0;
}

.chat-coming-soon {
  max-width: 640px;
  margin: 0 auto;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.social-link:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 212, 255, 0.08);
  color: var(--neon-cyan);
  text-decoration: none;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-purple);
  flex-shrink: 0;
}

.social-link:hover .social-icon {
  color: var(--neon-cyan);
}

.legal-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.legal-scroll h3 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--neon-cyan);
  margin: 1rem 0 0.35rem;
}

.legal-scroll h3:first-child {
  margin-top: 0;
}

.legal-scroll p {
  margin: 0.35rem 0;
}

.legal-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  cursor: pointer;
}

.legal-check input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.statement-form-grid {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Homepage visitor counter */
.topnav-home { flex-wrap: wrap; }
.visitor-greeting {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--neon-cyan);
  margin: 0;
  min-width: 140px;
}

/* Site footer */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 2.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.social-grid-footer { margin-bottom: 1.25rem; }
.site-footer-copy {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

.coming-soon-note { color: var(--neon-cyan); }
.coming-soon-panel { text-align: center; padding: 2rem 1rem; }

/* Radio page — styl odbiornika */
body.radio-page { overflow-x: hidden; }
.radio-page-main {
  max-width: 720px;
  padding-top: 1rem;
}
.radio-page-main:fullscreen {
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  padding: 2rem;
}
.radio-unit {
  background: linear-gradient(160deg, #1a1f35 0%, #0d111f 45%, #151a2e 100%);
  border: 2px solid var(--neon-purple);
  border-radius: 20px;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: var(--glow-purple), inset 0 0 60px rgba(0, 0, 0, 0.45);
}
.radio-unit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.radio-display-panel {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.06);
}
.radio-brand {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--neon-magenta);
  margin-bottom: 0.35rem;
}
.radio-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.65rem;
}
.yt-stream-link { font-size: 0.82rem; }
.radio-vu-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0.5rem;
  align-items: end;
  margin: 1rem 0;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.vu-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--neon-cyan);
  align-self: center;
}
.vu-meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 72px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  border: 1px solid rgba(0, 212, 255, 0.15);
}
.vu-bar {
  flex: 1;
  min-width: 4px;
  max-width: 12px;
  height: 12%;
  background: linear-gradient(180deg, #7dff9a, var(--neon-cyan) 55%, var(--neon-magenta));
  border-radius: 2px 2px 0 0;
  transition: height 0.08s linear;
}
.radio-dial-deco {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
}
.radio-dial-ring {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(181, 55, 242, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(181, 55, 242, 0.35);
}
.radio-dial-knob {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a4568, #12182a);
  border: 2px solid rgba(0, 212, 255, 0.3);
}
.radio-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-radio {
  min-width: 52px;
  font-size: 1.1rem;
  padding: 0.55rem 0.85rem;
}
.btn-radio-power { font-size: 1.25rem; }
.radio-progress-block { margin-top: 1rem; }

/* TV fullscreen stage */
body.tv-page { overflow: hidden; }
.topnav-tv { flex-shrink: 0; }
.tv-page-main {
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100dvh - 53px);
  display: flex;
  flex-direction: column;
}
.tv-stage {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #000;
}
.tv-screen {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.tv-screen .yt-embed,
.tv-screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.tv-screen .watermark {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  height: 48px;
  opacity: 0.35;
  pointer-events: none;
}
.tv-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, rgba(0,0,0,0.75), transparent);
}
.tv-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 1rem 1.25rem 1.25rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent);
}
.tv-overlay-top-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tv-fs-btn {
  position: static;
  margin: 0;
}
.tv-stage:fullscreen {
  height: 100vh;
  width: 100vw;
}
.tv-stage:fullscreen .tv-screen {
  height: 100%;
}

@media (max-width: 768px) {
  .upload-contact-layout { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { display: flex; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-nav button { width: auto; flex: 1 1 45%; }
  .topnav-home .visitor-greeting {
    order: 3;
    width: 100%;
    flex: none;
    padding: 0.25rem 0 0.15rem;
  }
  .radio-vu-wrap { grid-template-columns: auto 1fr; }
  .radio-vu-wrap .vu-meter:nth-child(4) { grid-column: 2; }
  .radio-vu-wrap .vu-label:nth-child(3) { grid-column: 1; grid-row: 2; }
  .vu-meter { height: 56px; }
  .tv-page-main { height: calc(100dvh - 96px); }
  .tv-overlay-bottom .track-title { font-size: 0.95rem; }
}
