/* ONDA7RADIO v0.9.4.1 — Responsive stylesheet with server-driven theme layers. */
:root {
  color-scheme: dark;
  --bg: #07112a;
  --gold: #ffc928;
  --orange: #ff7a18;
  --pink: #f12c82;
  --white: #fbfcff;
  --muted: #aab7d0;
  --card-border: #ffffff20;
  --app-background: radial-gradient(ellipse at 50% 8%, #1a3261 0, #0b1836 44%, #050c20 100%);
  --player-background: linear-gradient(145deg, #14264aee, #0a1733f5);
  --panel-blur: 14px;
  --app-bg-blur: 0px;
  --player-bg-blur: 0px;
  --control-start: #ffe57b;
  --control-end: #ff8a24;
  --control-active-outer: #ffc928;
  --control-active-center: #ed174c;
}
* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}
body {
  min-width: 280px;
  color: var(--white);
  font-family: Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell {
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr) max-content max-content;
  align-items: center;
  justify-items: center;
  gap: clamp(4px, .8vh, 10px);
  padding:
    max(6px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
}
.app-shell::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -2;
  filter: blur(var(--app-bg-blur, 0px));
  background: var(--app-background);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.app-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 65vw;
  height: 65vw;
  right: -35vw;
  bottom: -45vw;
  border: 1px solid #f12c8226;
  border-radius: 50%;
  box-shadow: 0 0 110px #f12c8212;
  pointer-events: none;
}
.brand-area {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, .4vh, 5px);
}
.station-logo {
  display: block;
  width: auto;
  height: clamp(42px, 9vh, 78px);
  max-width: min(76vw, 510px);
  object-fit: contain;
  filter: drop-shadow(0 5px 15px #0005);
}
.live-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ffe6a0;
  font-size: clamp(7px, 1vh, 9px);
  font-weight: 800;
  letter-spacing: .18em;
  white-space: nowrap;
}
.live-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #ed3e58;
  box-shadow: 0 0 10px #ed3e58;
}
.player-card {
  width: min(100%, 560px);
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(4px, .8vh, 9px);
  padding: clamp(8px, 1.2vh, 14px) clamp(10px, 2vw, 18px);
  border: 1px solid var(--card-border);
  border-radius: clamp(16px, 2.5vh, 26px);
  position: relative;
  isolation: isolate;
  background: transparent;
  box-shadow: 0 15px 50px #0006, inset 0 1px #ffffff12;
  backdrop-filter: blur(var(--panel-blur, 14px));
  -webkit-backdrop-filter: blur(var(--panel-blur, 14px));
  overflow: hidden;
}
.player-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--player-background);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(var(--player-bg-blur, 0px));
  transform: scale(1.04);
  pointer-events: none;
}
.player-card > * {
  position: relative;
  z-index: 1;
}
.album-art {
  position: relative;
  flex: none;
  width: clamp(112px, 25vh, 212px);
  height: clamp(112px, 25vh, 212px);
  margin: 0;
  transform: none;
  border-radius: clamp(14px, 2.5vh, 21px);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 20%, #315a91, #132b55 58%, #07142e);
  border: 1px solid #ffc92888;
  box-shadow: 0 8px 25px #0006;
  transition: border-radius .25s ease;
}
.album-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-image.hidden { display: none !important; }
.album-art.is-vinyl {
  border-radius: 50%;
  background: #0a0c12;
  border-color: #d5ad53;
  box-shadow: 0 8px 25px #0008, 0 0 24px #d5ad5320;
}
.album-art.is-cover {
  border-radius: clamp(14px, 2.5vh, 21px);
  background: #101a30;
}
.album-art.is-loading {
  background: linear-gradient(135deg, #101a30 0%, #142242 45%, #0f1a31 100%);
  border-color: #ffc92866;
  box-shadow: 0 8px 25px #0007, 0 0 18px #ffc92818;
}
.album-art.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, #ffffff10 40%, #ffffff22 50%, transparent 60%);
  transform: translateX(-120%);
  animation: album-loading-shimmer 1.4s ease-in-out infinite;
}
.album-art.is-loading .album-image,
.album-art.is-loading .vinyl-record { display: none !important; }
@keyframes album-loading-shimmer {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}
.vinyl-record {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center, #17191e 0, #17191e 2px, #292b30 3px, #111318 5px, #22242a 6px, #101116 8px);
  box-shadow: inset 0 0 16px #000, 0 0 12px #0009;
  animation: vinyl-spin 5s linear infinite;
}
.vinyl-record::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid #ffffff18;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #ffffff05, 0 0 0 9px #ffffff06, 0 0 0 14px #ffffff05;
}
.vinyl-record::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 20deg, transparent, #ffffff12 12deg, transparent 34deg, transparent 170deg, #ffffff0b 195deg, transparent 220deg);
}
.vinyl-groove {
  position: absolute;
  inset: 16%;
  border: 1px solid #ffffff12;
  border-radius: 50%;
}
.groove-b { inset: 23%; border-color: #ffffff0d; }
.groove-c { inset: 30%; border-color: #ffffff10; }
.vinyl-label {
  position: relative;
  z-index: 2;
  width: 35%;
  height: 35%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe69a, #c58b27 70%, #714b16);
  color: #111a2d;
  font-size: clamp(25px, 5vh, 39px);
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 3px #15171c, 0 0 0 4px #d7ad58, 0 3px 8px #000b;
  text-shadow: 0 1px 0 #fff6;
}
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
.album-art.is-vinyl .album-gloss {
  border-radius: 50%;
  background: radial-gradient(circle at 33% 25%, #ffffff12, transparent 42%, #0005 100%);
}
.album-gloss {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(135deg, #ffffff1d, transparent 48%, #0002);
}
.dj-overlay {
  position: absolute;
  z-index: 4;
  left: 4px;
  right: 4px;
  bottom: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  border: 1px solid #ffffff45;
  border-radius: 9px;
  background: #07142de8;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
}
.dj-overlay.hidden { display: none !important; }
.dj-live-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffe39a;
  font-size: 6px;
  font-weight: 900;
  letter-spacing: .12em;
  white-space: nowrap;
}
.dj-live-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ed3e58;
  box-shadow: 0 0 6px #ed3e58;
}
.dj-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: clamp(8.4px, 1.32vh, 10.8px);
  font-weight: 800;
  line-height: 1.2;
}
#sonic_dj, #sonic_dj * {
  max-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  white-space: nowrap;
}
.track-info {
  width: 100%;
  max-width: 500px;
  min-width: 0;
  min-height: 0;
  padding: clamp(4px, .8vh, 8px) 8px;
  border-top: 1px solid #ffffff15;
  border-bottom: 1px solid #ffffff15;
  text-align: center;
}
.track-label, .kicker {
  margin: 0 0 4px;
  color: #9eacc5;
  font-size: clamp(6px, .9vh, 8px);
  font-weight: 800;
  letter-spacing: .2em;
}
.sonic-title, .track-title, #sonic_title {
  display: -webkit-box;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #fbfcff;
  font-size: clamp(13px, 1.9vh, 19px);
  font-weight: 600;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
#sonic_title, #sonic_title * {
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  max-width: 100%;
}
.track-artist {
  margin-top: 3px;
  overflow: hidden;
  color: #b9c6dd;
  font-size: clamp(9px, 1.2vh, 11px);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.station-info, .track-artist, .status-row, .visualizer-label {
  display: none !important;
}
.status-row {
  display: none;
}
.visualizer {
  appearance: none;
  -webkit-appearance: none;
  width: min(100%, 460px);
  height: clamp(58px, 10vh, 92px);
  min-width: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #d9e4f6;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s ease, border-color .18s ease;
}
.visualizer:hover, .visualizer:focus-visible {
  background: #ffffff08;
  border-color: #ffffff20;
  outline: none;
}
.visualizer:active { transform: scale(.99); }
#visualizer-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  pointer-events: none;
}
.visualizer-label { display: none !important; }
.controls {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 16px);
}
.control-button {
  position: relative;
  isolation: isolate;
  width: clamp(42px, 6.8vh, 54px);
  height: clamp(42px, 6.8vh, 54px);
  display: grid;
  place-items: center;
  border: 1px solid #ffffff55;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--control-start) 0%, var(--control-end) 100%);
  color: #10172a;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, color .18s ease, background .18s ease, border-color .18s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: 0 6px 22px #ff9b2445;
}
.control-button.main-control {
  width: clamp(50px, 8vh, 64px);
  height: clamp(50px, 8vh, 64px);
}
.control-button svg {
  width: clamp(18px, 2.8vh, 23px);
  height: clamp(18px, 2.8vh, 23px);
  fill: currentColor;
}
.control-button.main-control svg { width: 27px; height: 27px; }
.control-button::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid transparent;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.control-button.is-active {
  color: #fff;
  border: 1px solid var(--control-active-outer);
  background: radial-gradient(circle at 50% 50%, var(--control-active-center) 0%, var(--control-active-center) 34%, var(--control-active-outer) 100%);
  box-shadow: 0 0 0 1px var(--control-active-center), 0 0 13px 3px var(--control-active-center), 0 0 21px 5px var(--control-active-outer), inset 0 1px #ffffff55;
}
.control-button.is-active::after {
  opacity: 1;
  border-color: var(--control-active-outer);
  box-shadow: 0 0 12px 2px var(--control-active-center);
}
.control-button:active { transform: scale(.94); }
.control-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
  box-shadow: 0 0 0 3px var(--gold), 0 0 18px 5px var(--gold);
}
@media (hover: hover) and (pointer: fine) {
  .control-button:hover:not(.is-active) {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold), 0 0 13px 4px var(--gold), 0 0 25px 5px var(--gold);
    filter: brightness(1.16);
    transform: translateY(-1px);
  }
  .control-button.is-active:hover {
    box-shadow: 0 0 0 2px var(--control-active-center), 0 0 16px 5px var(--control-active-center), 0 0 29px 7px var(--control-active-outer);
    filter: brightness(1.12);
  }
}
@media (hover: none), (pointer: coarse) {
  .control-button:active, .control-button:focus-visible {
    border-color: #ffe08a;
    box-shadow: 0 0 0 2px #ffc92835, 0 0 17px 5px #ffc92880;
    filter: brightness(1.14);
  }
  .control-button.is-active:active, .control-button.is-active:focus-visible {
    box-shadow: 0 0 0 2px #ff364a44, 0 0 17px 5px #ff263d99;
  }
}
.volume-row {
  width: min(100%, 360px);
  min-width: 0;
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 10px;
}
.volume-row input {
  flex: 1;
  min-width: 0;
  height: 18px;
  accent-color: #ffb52b;
  cursor: pointer;
  touch-action: pan-x;
}
.volume-value {
  width: 34px;
  flex: none;
  color: #c4cee0;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.recent-history {
  width: min(100%, 420px);
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, .55vh, 7px);
  margin-top: clamp(3px, .5vh, 7px);
}
.recent-history[hidden] { display: none !important; }
.recent-history-heading {
  margin: 0;
  color: #aab8d0;
  font-size: clamp(7px, .9vh, 9px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .18em;
  text-align: left;
}
.recent-history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, .55vh, 7px);
  padding: 0;
  margin: 0;
  min-height: 0;
}
.recent-history-item {
  display: grid;
  grid-template-columns: clamp(48px, 7.8vh, 62.4px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(8px, 1.4vw, 11px);
  min-width: 0;
  min-height: clamp(48px, 7.8vh, 62.4px);
  padding: 1px 0;
}
.recent-history-cover {
  display: block;
  width: clamp(48px, 7.8vh, 62.4px);
  height: clamp(48px, 7.8vh, 62.4px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid #ffc92866;
  border-radius: 8px;
  background: #101a30;
  box-shadow: 0 3px 10px #0005;
}
.recent-history-vinyl {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #d5a94b 0 17%, #151923 18% 23%, transparent 24%),
    repeating-radial-gradient(circle at center, #111318 0 2px, #292b30 3px, #101116 5px);
  color: #10172a;
  font-size: clamp(15px, 2.5vh, 20px);
  font-weight: 900;
  text-shadow: 0 1px 0 #fff7;
}
.recent-history-title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: #e8edf8;
  font-size: clamp(12px, 1.5vh, 14.4px);
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.sonic-history-source {
  position: fixed !important;
  left: -10000px !important;
  top: 0 !important;
  width: 2px !important;
  height: 2px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.social-links {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 16px);
  width: auto;
  max-width: 100%;
  padding: 2px 0;
  margin: 0;
}
.social-button {
  flex: none;
  min-width: 38px;
  width: auto;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid #ffffff30;
  border-radius: 99px;
  background: #132447ef;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px #0005;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.social-button svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.social-button.facebook { background: #1877f2; }
.social-button.tiktok { background: #111; border-color: #ffffff55; }
.social-button.instagram { background: linear-gradient(135deg, #7b36b8, #e1306c, #ff9a3d); }
.social-button span { display: inline; font-size: 10px; font-weight: 800; white-space: nowrap; }
.social-button.install-app {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #ffc85a88;
  border-radius: 50%;
  background: linear-gradient(145deg, #1f2f55, #15264a);
  color: #ffd56a;
  box-shadow: 0 0 0 1px #0b1430, 0 3px 10px #0006;
  opacity: .94;
}
.social-button.install-app svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }
.social-button.install-app span { display: none; }
.social-button.install-app[hidden] { display: none !important; }
.social-button:focus-visible {
  outline: 2px solid #ffe08a;
  outline-offset: 3px;
}
.social-button:active { transform: scale(.96); }
.footer-note {
  display: block;
  color: #7f91b3;
  font-size: clamp(6px, .75vh, 8px);
  letter-spacing: .15em;
  text-align: center;
  white-space: nowrap;
}
.footer-copy { white-space: nowrap; }
.footer-copy i { padding: 0 4px; color: var(--gold); font-style: normal; }
.install-dialog {
  width: min(calc(100% - 36px), 390px);
  padding: 0;
  border: 1px solid #ffc92888;
  border-radius: 20px;
  color: #fff;
  background: #0c1934;
  box-shadow: 0 20px 70px #000b;
}
.install-dialog::backdrop { background: #020817bb; backdrop-filter: blur(4px); }
.install-dialog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
}
.install-dialog-card h2 { margin: 0; color: #ffe08a; font-size: 18px; }
.install-dialog-card p { margin: 0; color: #e4eaf5; font-size: 13px; line-height: 1.55; }
.install-dialog-close {
  align-self: flex-end;
  border: 1px solid #ffe08a;
  border-radius: 999px;
  padding: 8px 16px;
  color: #10172a;
  background: linear-gradient(140deg, #ffe57b, #ff9c20 65%, #f12c82);
  font-weight: 800;
}
.hidden, .vinyl-record.hidden, #vinyl-fallback.hidden,
#album-image.hidden, #dj-image.hidden { display: none !important; }

/* Portrait phones: single-column player with all actions in the lower area. */
@media (max-width: 600px) and (orientation: portrait) {
  .app-shell {
    gap: clamp(3px, .55vh, 7px);
    padding:
      max(4px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(4px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .station-logo {
    height: clamp(40px, 8.5vh, 70px);
    max-width: min(76vw, 480px);
  }
  .live-indicator { font-size: clamp(6px, .95vh, 8px); letter-spacing: .15em; }
  .player-card {
    width: 100%;
    max-width: 540px;
    padding: clamp(6px, .9vh, 10px) 7px;
    gap: clamp(3px, .65vh, 7px);
    border-radius: 17px;
  }
  .album-art {
    width: clamp(112px, 25vh, 212px);
    height: clamp(112px, 25vh, 212px);
  }
  .track-info { width: 100%; max-width: 100%; padding: clamp(3px, .6vh, 6px) 5px; }
  .sonic-title, .track-title, #sonic_title { font-size: clamp(11px, 1.7vh, 16px); }
  .visualizer {
    width: min(100%, 440px);
    height: clamp(54px, 9.5vh, 84px);
  }
  .controls { gap: clamp(7px, 2vw, 12px); }
  .control-button { width: clamp(40px, 6.2vh, 48px); height: clamp(40px, 6.2vh, 48px); }
  .control-button.main-control { width: clamp(46px, 7.2vh, 56px); height: clamp(46px, 7.2vh, 56px); }
  .control-button svg { width: 19px; height: 19px; }
  .control-button.main-control svg { width: 25px; height: 25px; }
  .volume-row { width: min(100%, 330px); gap: 6px; font-size: 9px; }
  .volume-row input { height: 18px; }
  .volume-value { font-size: 9px; }
  .recent-history { width: min(100%, 360px); margin-top: 2px; gap: 4px; }
  .recent-history-heading { font-size: clamp(6px, .85vh, 8px); }
  .recent-history-list { gap: clamp(3px, .45vh, 5px); }
  .recent-history-item {
    grid-template-columns: clamp(45.6px, 6.72vh, 55.2px) minmax(0, 1fr);
    min-height: clamp(45.6px, 6.72vh, 55.2px);
    gap: 8px;
  }
  .recent-history-cover { width: clamp(45.6px, 6.72vh, 55.2px); height: clamp(45.6px, 6.72vh, 55.2px); border-radius: 7px; }
  .recent-history-title { font-size: clamp(10.8px, 1.32vh, 13.2px); }
  .social-links { gap: clamp(10px, 3vw, 16px); }
  .social-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
  }
  .social-button span { display: none; }
  .social-button svg { width: 16px; height: 16px; }
  .social-button.install-app { width: 30px; min-width: 30px; height: 30px; }
  .footer-note { font-size: clamp(5px, .7vh, 7px); letter-spacing: .08em; }
}

/* Short portrait screens: reduce decoration before shrinking the essential controls. */
@media (max-width: 600px) and (orientation: portrait) and (max-height: 700px) {
  .app-shell { gap: 2px; }
  .station-logo { height: clamp(34px, 7.5vh, 52px); }
  .live-indicator { font-size: 6px; gap: 4px; }
  .live-dot { width: 5px; height: 5px; }
  .player-card { gap: 3px; padding: 4px 6px; }
  .album-art { width: clamp(88px, 18vh, 128px); height: clamp(88px, 18vh, 128px); }
  .track-info { padding: 2px 4px; }
  .sonic-title, .track-title, #sonic_title { font-size: clamp(10px, 1.5vh, 13px); }
  .visualizer { height: clamp(42px, 8vh, 56px); padding: 0 5px; }
  .control-button { width: 38px; height: 38px; }
  .control-button.main-control { width: 44px; height: 44px; }
  .control-button svg { width: 17px; height: 17px; }
  .control-button.main-control svg { width: 22px; height: 22px; }
  .volume-row { width: min(100%, 300px); font-size: 8px; }
  .volume-row input { height: 16px; }
  .recent-history { gap: 2px; margin-top: 1px; }
  .recent-history-heading { font-size: 6px; }
  .recent-history-list { gap: 2px; }
  .recent-history-item { grid-template-columns: 39.6px minmax(0, 1fr); min-height: 39.6px; gap: 7px; }
  .recent-history-cover { width: 39.6px; height: 39.6px; border-radius: 6px; }
  .recent-history-title { font-size: 9.6px; }
  .social-button { width: 31px; min-width: 31px; height: 31px; }
  .social-button.install-app { width: 27px; min-width: 27px; height: 27px; }
  .footer-note { font-size: 5px; }
}

/* Portrait tablets and portrait desktop windows. */
@media (min-width: 601px) and (orientation: portrait) {
  .app-shell {
    gap: clamp(8px, 1.2vh, 14px);
    padding:
      max(12px, env(safe-area-inset-top))
      max(22px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(22px, env(safe-area-inset-left));
  }
  .station-logo { height: clamp(66px, 9vh, 96px); max-width: min(70vw, 520px); }
  .live-indicator { font-size: 9px; }
  .player-card {
    width: min(100%, 760px);
    padding: clamp(14px, 2vh, 22px) clamp(18px, 3vw, 30px);
    gap: clamp(8px, 1.2vh, 14px);
    border-radius: 24px;
    justify-content: center;
  }
  .album-art { width: clamp(170px, 22vh, 230px); height: clamp(170px, 22vh, 230px); }
  .track-info { width: min(100%, 620px); padding: 9px 12px; }
  .sonic-title, .track-title, #sonic_title { font-size: clamp(16px, 2vh, 22px); }
  .visualizer { width: min(100%, 560px); height: clamp(82px, 10vh, 112px); }
  .controls { gap: clamp(12px, 2vw, 20px); }
  .control-button { width: 56px; height: 56px; }
  .control-button.main-control { width: 66px; height: 66px; }
  .control-button svg { width: 23px; height: 23px; }
  .control-button.main-control svg { width: 29px; height: 29px; }
  .volume-row { width: min(100%, 470px); font-size: 11px; }
  .recent-history { width: min(100%, 500px); gap: 6px; }
  .recent-history-item { grid-template-columns: 60px minmax(0, 1fr); min-height: 60px; }
  .recent-history-cover { width: 60px; height: 60px; border-radius: 9px; }
  .recent-history-title { font-size: 14.4px; }
  .social-button { height: 40px; }
}

/* Landscape layout: two-column composition, with the artwork/history at left
   and the track, wide sound visualizer and playback controls at right. */
@media (orientation: landscape) {
  .app-shell {
    grid-template-rows: max-content minmax(0, 1fr) max-content max-content;
    gap: clamp(4px, .8vh, 10px);
    padding:
      max(5px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(5px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }
  .brand-area { gap: 2px; }
  .station-logo { height: clamp(36px, 8vh, 78px); max-width: min(55vw, 480px); }
  .live-indicator { font-size: clamp(6px, .9vh, 8px); letter-spacing: .16em; }
  .player-card {
    width: min(100%, 1320px);
    height: min(68vh, 740px);
    min-height: 0;
    max-height: 78vh;
    display: grid;
    grid-template-columns: minmax(110px, .68fr) minmax(0, 1.75fr);
    grid-template-rows:
      minmax(clamp(80px, 20vh, 205px), 1.1fr)
      minmax(clamp(50px, 10vh, 110px), 1fr)
      auto
      auto;
    grid-template-areas:
      "art track"
      "history visualizer"
      "history controls"
      "history volume";
    align-self: center;
    align-items: center;
    justify-items: stretch;
    align-content: center;
    gap: clamp(6px, 1.2vh, 14px) clamp(14px, 3vw, 44px);
    padding: clamp(10px, 1.8vh, 22px) clamp(14px, 2.5vw, 38px);
    border-radius: 22px;
  }
  .album-art {
    grid-area: art;
    justify-self: center;
    align-self: center;
    width: clamp(84px, 22vh, 220px);
    height: clamp(84px, 22vh, 220px);
    margin: 0;
    transform: none;
  }
  .track-info {
    grid-area: track;
    width: 100%;
    max-width: none;
    align-self: center;
    padding: 0 0 clamp(5px, .9vh, 10px);
    text-align: left;
  }
  .sonic-title, .track-title, #sonic_title {
    font-size: clamp(14px, 2.2vh, 25px);
    line-height: 1.2;
    -webkit-line-clamp: 2;
  }
  .visualizer {
    grid-area: visualizer;
    justify-self: stretch;
    align-self: stretch;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 52px;
    padding: 2px 8px;
  }
  .controls {
    grid-area: controls;
    justify-self: center;
    align-self: center;
    gap: clamp(9px, 1.8vw, 20px);
  }
  .control-button { width: clamp(40px, 7.2vh, 62px); height: clamp(40px, 7.2vh, 62px); }
  .control-button.main-control { width: clamp(46px, 8.4vh, 72px); height: clamp(46px, 8.4vh, 72px); }
  .control-button svg { width: clamp(17px, 2.8vh, 23px); height: clamp(17px, 2.8vh, 23px); }
  .control-button.main-control svg { width: clamp(22px, 3.2vh, 28px); height: clamp(22px, 3.2vh, 28px); }
  .volume-row {
    grid-area: volume;
    justify-self: center;
    width: min(100%, 520px);
    font-size: clamp(8px, 1vh, 11px);
  }
  .recent-history {
    grid-area: history;
    justify-self: stretch;
    align-self: center;
    width: 100%;
    max-width: 270px;
    margin: 0;
    gap: clamp(3px, .7vh, 8px);
  }
  .recent-history-heading { font-size: clamp(6px, .9vh, 9px); }
  .recent-history-list { gap: clamp(3px, .65vh, 7px); }
  .recent-history-item {
    grid-template-columns: clamp(36px, 8.4vh, 62.4px) minmax(0, 1fr);
    min-height: clamp(36px, 8.4vh, 62.4px);
    gap: clamp(6px, 1vw, 10px);
  }
  .recent-history-cover {
    width: clamp(36px, 8.4vh, 62.4px);
    height: clamp(36px, 8.4vh, 62.4px);
    border-radius: clamp(5px, .9vh, 9px);
  }
  .recent-history-title { font-size: clamp(9.6px, 1.32vh, 14.4px); }
  .social-button { height: clamp(30px, 4.5vh, 38px); }
}

/* Short landscape displays: compact head units and phones, no side-scrolling. */
@media (orientation: landscape) and (max-height: 700px) {
  .app-shell {
    gap: 3px;
    padding:
      max(2px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(2px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .station-logo { height: clamp(28px, 8vh, 54px); max-width: min(52vw, 360px); }
  .live-indicator { font-size: 6px; gap: 4px; letter-spacing: .12em; }
  .live-dot { width: 5px; height: 5px; }
  .player-card {
    height: min(68vh, 500px);
    min-height: 0;
    max-height: 78vh;
    grid-template-columns: minmax(88px, .55fr) minmax(0, 1.8fr);
    grid-template-rows:
      minmax(clamp(76px, 20vh, 130px), 1.1fr)
      minmax(clamp(46px, 10vh, 68px), 1fr)
      auto
      auto;
    gap: clamp(4px, 1vh, 8px) clamp(8px, 2vw, 22px);
    padding: clamp(6px, 1.2vh, 12px) clamp(8px, 2vw, 22px);
    border-radius: 16px;
  }
  .album-art { width: clamp(76px, 21vh, 136px); height: clamp(76px, 21vh, 136px); }
  .track-info { padding-bottom: 4px; }
  .sonic-title, .track-title, #sonic_title { font-size: clamp(11px, 2.2vh, 16px); }
  .visualizer { min-height: 44px; padding: 0 4px; }
  .controls { gap: clamp(6px, 1.6vw, 12px); }
  .control-button { width: clamp(34px, 8vh, 44px); height: clamp(34px, 8vh, 44px); }
  .control-button.main-control { width: clamp(40px, 9vh, 50px); height: clamp(40px, 9vh, 50px); }
  .control-button svg { width: 16px; height: 16px; }
  .control-button.main-control svg { width: 21px; height: 21px; }
  .volume-row { gap: 5px; font-size: 7px; }
  .volume-row input { height: 14px; }
  .volume-value { width: 28px; font-size: 8px; }
  .recent-history { gap: 2px; max-width: 230px; }
  .recent-history-heading { font-size: 6px; }
  .recent-history-list { gap: 2px; }
  .recent-history-item { grid-template-columns: clamp(33.6px, 7.8vh, 45.6px) minmax(0, 1fr); min-height: clamp(33.6px, 7.8vh, 45.6px); gap: 6px; }
  .recent-history-cover { width: clamp(33.6px, 7.8vh, 45.6px); height: clamp(33.6px, 7.8vh, 45.6px); border-radius: 5px; }
  .recent-history-title { font-size: clamp(8.4px, 1.32vh, 10.8px); }
  .social-links { gap: 7px; }
  .social-button { width: 29px; min-width: 29px; height: 29px; padding: 0; border-radius: 50%; }
  .social-button svg { width: 14px; height: 14px; }
  .social-button span { display: none; }
  .social-button.install-app { width: 26px; min-width: 26px; height: 26px; }
  .footer-note { font-size: 5px; letter-spacing: .08em; }
}

/* Extra-wide desktop windows get a broader, balanced card. */
@media (orientation: landscape) and (min-width: 1500px) and (min-height: 800px) {
  .player-card { width: min(100%, 1380px); }
  .recent-history { max-width: 300px; }
}

/* Accessibility and resilient touch behavior. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .vinyl-record { animation: none !important; }
  .album-art.is-loading::after { animation: none !important; }
}


/* Landscape with no SonicPanel history: keep artwork centered in the left column. */
@media (orientation: landscape) {
  .player-card:not(.has-history) {
    grid-template-areas:
      "art track"
      "art visualizer"
      "art controls"
      "art volume";
  }
}


/* Smart TV browser mode: larger, clearer visualizer and remote-control focus. */
html.tv-browser .visualizer {
  width: min(100%, 760px);
  height: clamp(84px, 13vh, 140px);
  min-height: 84px;
  padding: 4px 10px;
}
html.tv-browser .control-button,
html.tv-browser .visualizer {
  cursor: pointer;
}
html.tv-browser button:focus,
html.tv-browser button:focus-visible {
  outline: 3px solid rgba(255, 211, 55, .95);
  outline-offset: 5px;
  box-shadow: 0 0 0 7px rgba(255, 89, 64, .20);
}
@media (min-width: 1700px) and (orientation: landscape) {
  html.tv-browser .visualizer {
    width: min(100%, 900px);
    height: clamp(104px, 14vh, 168px);
    min-height: 104px;
  }
}

/* ONDA7RADIO v0.9.4.1: redes sociales opcionales desde el panel */
.social-button[hidden] { display: none !important; }
.social-button.youtube { background: #e62117; }
