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

:root {
  --page-background: #f5f5dd;
  --panel-background: rgba(255, 255, 255, 0.72);
  --text-color: #6c757d;
  --border-color: rgba(108, 117, 125, 0.3);
  --control-background: rgba(255, 255, 255, 0.95);
  --focus-ring: rgba(13, 110, 253, 0.22);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text-color);
  background: var(--page-background);
}

.site-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.site-main {
  display: grid;
  flex: 1 0 auto;
  place-items: center;
  width: 100%;
  min-width: 0;
  padding: clamp(1rem, 5vw, 4rem) 1rem;
}

.player-panel {
  width: min(100%, 42rem);
  min-width: 0;
  margin-inline: auto;
  overflow: hidden;
  padding: clamp(1.1rem, 4vw, 2.25rem);
  text-align: center;
  background: var(--panel-background);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.06);
}

.player-panel h1 {
  margin: 0 0 1.4rem;
  color: var(--text-color);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.2;
}

.genre-form {
  display: grid;
  grid-template-columns: auto minmax(10rem, 18rem);
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 1.2rem;
}

.genre-form label {
  font-size: 0.875rem;
  font-weight: 600;
}

.genre-form .form-select {
  min-width: 0;
  height: 2.15rem;
  padding: 0.25rem 2rem 0.25rem 0.6rem;
  color: var(--text-color);
  font-size: 0.875rem;
  background-color: var(--control-background);
  border-color: var(--border-color);
}

.radio-player {
  width: min(100%, 32.5rem);
  min-width: 0;
  margin-inline: auto;
}

.server-controls {
  display: grid;
  min-width: 0;
  grid-template-columns: 1.9rem minmax(0, 1fr) 1.9rem;
  align-items: center;
  gap: 0.35rem;
  width: min(100%, 23rem);
  margin: 0 auto 0.55rem;
}

.server-select {
  width: 100%;
  min-width: 0;
  height: 1.9rem;
  padding: 0.1rem 1.7rem 0.1rem 0.45rem;
  overflow: hidden;
  color: var(--text-color);
  font-size: 0.76rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--control-background);
  border: 1px solid var(--border-color);
  border-radius: 0.4rem;
}

.server-button {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  color: var(--text-color);
  font-size: 1.15rem;
  line-height: 1;
  background: var(--control-background);
  border: 1px solid var(--border-color);
  border-radius: 0.4rem;
}

.server-button:hover:not(:disabled),
.server-button:focus-visible {
  color: #fff;
  background: #495057;
}

.server-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.genre-form .form-select:focus-visible,
.server-select:focus-visible,
.server-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.player-status {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 3.35rem;
  margin: 0 0 0.45rem;
  padding-inline: 0.25rem;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.1rem;
  text-align: center;
}

.player-status__meta,
.player-status__title,
.player-status__message {
  display: block;
  max-width: 100%;
}

.player-status__meta {
  line-height: 1.1rem;
  white-space: nowrap;
}

.player-status__title {
  display: -webkit-box;
  max-height: 2.2rem;
  margin-top: 0.05rem;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.player-status__message {
  padding-top: 0.55rem;
  overflow-wrap: anywhere;
  white-space: normal;
}

.player-status[data-state="warning"] .player-status__meta,
.player-status[data-state="warning"] .player-status__message {
  color: #8a6116;
}

.player-status[data-state="error"] .player-status__meta,
.player-status[data-state="error"] .player-status__message {
  color: #a52834;
  font-weight: 600;
}

.radio-player__media {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 32.5rem;
  margin-inline: auto;
}

.policy-main {
  flex: 1 0 auto;
  width: 100%;
}

.site-footer {
  flex: 0 0 auto;
  width: 100%;
  padding: 1rem;
  color: var(--text-color);
  text-align: center;
}

.site-footer a {
  color: inherit;
}

.playlist-credit,
.site-footer__meta {
  margin: 0;
}

.playlist-credit {
  max-width: 42rem;
  margin-inline: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.site-footer__meta {
  margin-top: 0.45rem;
}

@media (max-width: 30rem) {
  .site-main {
    place-items: center;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.5rem max(0.75rem, env(safe-area-inset-bottom));
  }

  .player-panel {
    width: 100%;
    padding: 1.1rem 0.8rem;
  }

  .genre-form {
    grid-template-columns: 1fr;
    width: min(100%, 18rem);
  }

  .genre-form label {
    text-align: left;
  }

  .server-controls {
    width: 100%;
  }

  .player-status {
    min-height: 3.15rem;
    font-size: 0.7rem;
    line-height: 1.05rem;
  }

  .player-status__meta {
    line-height: 1.05rem;
  }

  .player-status__title {
    max-height: 2.1rem;
  }
}


/* Privacy Policy
 * Reuses the same shell, panel, colors, and footer as the radio player.
 */

.site-main.policy-main {
  place-items: start center;
  padding-block: clamp(1rem, 4vw, 3rem);
}

.policy-panel {
  width: min(100%, 58rem);
  text-align: left;
}

.policy-panel__header {
  margin-bottom: 2rem;
  text-align: center;
}

.policy-panel__header h1 {
  margin-bottom: 0.35rem;
}

.policy-panel__subtitle {
  margin: 0;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 600;
}

.policy-summary {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.52);
  border-left: 0.3rem solid var(--border-color);
  border-radius: 0.35rem;
}

.policy-updated {
  margin: 0 0 2rem;
  font-size: 0.85rem;
  text-align: center;
}

.policy-section {
  margin-top: 2.2rem;
}

.policy-section:first-of-type {
  margin-top: 0;
}

.policy-section h2 {
  margin: 0 0 0.8rem;
  padding-bottom: 0.45rem;
  color: var(--text-color);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  line-height: 1.35;
  border-bottom: 1px solid var(--border-color);
}

.policy-section p,
.policy-section li {
  line-height: 1.7;
}

.policy-section ul {
  margin-bottom: 1rem;
  padding-left: 1.35rem;
}

.policy-section a {
  overflow-wrap: anywhere;
}

.policy-actions {
  margin-top: 2.75rem;
  text-align: center;
}

.policy-actions .btn {
  max-width: 100%;
  white-space: normal;
}

@media (max-width: 30rem) {
  .site-main.policy-main {
    padding-inline: 0.5rem;
  }

  .policy-panel {
    padding: 1.1rem 0.8rem;
  }

  .policy-summary {
    padding: 0.8rem;
  }

  .policy-section {
    margin-top: 1.8rem;
  }

  .policy-section ul {
    padding-left: 1.15rem;
  }
}
