/* Livestream player – colours from www.lkgchemnitz.de (template rt_corvus),
   text darker than on the website for better contrast (senior-friendly). */

:root {
  --green: #517901;       /* website accent / links */
  --green-dark: #406001;
  --slate: #414550;       /* website header and menu */
  --slate-dark: #363942;
  --live: #9d0736;        /* dark red, also used on the website */
  --page: #f2f0f0;        /* website page background */
  --card: #ffffff;
  --text: #1e1e1e;
  --muted: #444444;
  --line: #d5d5d5;
  --focus: #1e1e1e;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font-family: Arial, Helvetica, system-ui, sans-serif;
  font-size: 1.25rem;     /* 20 px */
  line-height: 1.5;
}

.top {
  background: var(--slate);
  background-image: linear-gradient(var(--slate), var(--slate-dark));
  color: #ffffff;
  padding: 1rem 16px 1.1rem;
  text-align: center;
  border-bottom: 6px solid var(--green);
}

.brand {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.top h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

main {
  flex: 1;
  padding: 1.5rem 16px 2rem;
}

.card {
  max-width: 34rem;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem 1.25rem 1.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  text-align: center;
}

/* Status */

.status {
  min-height: 9.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  padding: 0.2rem 0.9rem;
  border-radius: 999px;
  background: var(--live);
  color: #ffffff;
  font-weight: bold;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.badge::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #ffffff;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.badge[hidden] {
  display: none;
}

.status h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  line-height: 1.25;
}

.card[data-view="live"] .status h2 {
  color: var(--live);
}

.card[data-view="waiting"] .status h2 {
  color: var(--green-dark);
}

.status-text {
  margin: 0;
  color: var(--muted);
}

/* Play / Stop – hidden while the server is offline */

.controls[hidden] {
  display: none;
}

.play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 22rem;
  min-height: 5.5rem;
  margin: 1.5rem 0 0.75rem;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 16px;
  background: var(--green);
  color: #ffffff;
  font: inherit;
  font-size: 1.9rem;
  font-weight: bold;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 0 var(--green-dark);
}

.play:hover {
  background: var(--green-dark);
}

.play:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--green-dark);
}

.play[data-mode="stop"] {
  background: var(--slate);
  box-shadow: 0 3px 0 #23262d;
}

.play[data-mode="stop"]:hover {
  background: var(--slate-dark);
}

.play:disabled {
  opacity: 0.55;
  cursor: default;
}

.play:focus-visible,
input[type="range"]:focus-visible,
a:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

.icon {
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
}

.play[data-mode="play"] .icon-stop,
.play[data-mode="stop"] .icon-play {
  display: none;
}

.hint {
  min-height: 1.5em;
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.hint:empty {
  min-height: 0;
}

.card[data-blocked] .hint {
  color: var(--text);
  font-weight: bold;
}

/* Listening time */

.time {
  margin: 0.5rem 0 0;
  font-size: 1.3rem;
}

.time-value {
  display: inline-block;
  min-width: 5.5ch;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

/* Volume (desktop only) */

.volume {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.volume[hidden],
.volume-hint[hidden] {
  display: none;
}

.volume label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.volume output {
  font-weight: normal;
  font-variant-numeric: tabular-nums;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.volume-icon {
  width: 2rem;
  height: 2rem;
  flex: none;
  color: var(--slate);
}

input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 3rem;
  margin: 0;
  background: transparent;
  accent-color: var(--green);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 0.75rem;
  border-radius: 999px;
  background: linear-gradient(to right, var(--green) var(--fill, 100%), var(--line) var(--fill, 100%));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 2.25rem;
  height: 2.25rem;
  margin-top: -0.75rem;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green-dark);
}

input[type="range"]::-moz-range-track {
  height: 0.75rem;
  border-radius: 999px;
  background: var(--line);
}

input[type="range"]::-moz-range-progress {
  height: 0.75rem;
  border-radius: 999px;
  background: var(--green);
}

input[type="range"]::-moz-range-thumb {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green-dark);
}

.volume-hint {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.noscript {
  margin: 1.5rem 0 0;
  font-weight: bold;
}

/* Reload button (small, above the footer) */

.reload {
  display: flex;
  justify-content: center;
  padding: 0 16px;
}

.reload-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;    /* 44 px touch target */
  padding: 0.4rem 1.1rem;
  border: 2px solid var(--slate);
  border-radius: 10px;
  background: var(--card);
  color: var(--slate);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
  touch-action: manipulation;
}

.reload-button:hover {
  background: var(--slate);
  color: #ffffff;
}

.reload-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.reload-button:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

.reload-button[hidden] {
  display: none;
}

.reload-icon {
  width: 1.4rem;
  height: 1.4rem;
  flex: none;
}

/* Footer */

.bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;
  padding: 1.25rem 16px 1.75rem;
  font-size: 1.05rem;
}

.bottom a {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.bottom a:hover {
  color: var(--text);
}

@media (max-width: 400px) {
  body { font-size: 1.15rem; }
  .top h1 { font-size: 1.75rem; }
  .status h2 { font-size: 1.5rem; }
  .play { font-size: 1.7rem; min-height: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .badge::before { animation: none; }
  .play:active { transform: none; }
}

@media (forced-colors: active) {
  .play { border: 3px solid ButtonText; }
  .badge::before { background: CanvasText; }
}
