:root,
[data-theme="light"] {
  --bg: #0b1020;
  --surface: rgba(18, 24, 42, 0.72);
  --surface-2: rgba(20, 28, 49, 0.94);
  --surface-3: #19233d;
  --text: #ecf2ff;
  --muted: #98a4bf;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #ab663c;
  --primary-2: #ab663c;
  --accent: rgba(93, 210, 199, 0.12);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --clock-glass: rgba(255, 255, 255, 0.055);
  --clock-digits: #f3f7ff;
  --clock-bg-color: #070b16;
  --clock-text-color: #f3f7ff;
  --weather-bg-color: rgba(20, 28, 49, 0.94);
  --weather-text-color: #ecf2ff;
  --player-bg-color: rgba(18, 24, 42, 0.9);
  --player-text-color: #ecf2ff;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  font-family: "Satoshi", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(93, 210, 199, 0.08), transparent 20%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.08), transparent 18%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.list-item.active {
  border-color: rgba(93, 210, 199, 0.45);
  background: rgba(93, 210, 199, 0.12);
}

.sw-update-toast[hidden] {
  display: none !important;
}

.sw-update-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(92vw, 460px);
  z-index: 120;
  padding: 0;
}

.sw-update-toast__content {
  display: grid;
  gap: 10px;
  background: rgba(20, 28, 49, 0.96);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  padding: 12px;
}

.sw-update-toast__text {
  font-size: 0.92rem;
  line-height: 1.35;
  font-weight: 600;
}

.sw-update-toast__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .sw-update-toast {
    bottom: 12px;
    width: min(94vw, 420px);
  }

  .sw-update-toast__actions {
    justify-content: stretch;
  }

  .sw-update-toast__actions .selector-btn {
    flex: 1 1 140px;
  }
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(260px, 0.3fr);
  min-height: 100vh;
  height: auto;
  overflow: hidden;
  width: 100%;
}

.clock-panel,
.side-panel {
  min-height: 0;
  position: relative;
}

.clock-panel {
  background: var(--clock-bg-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-right: 1px solid var(--border);
  isolation: isolate;
}

.clock-panel::before,
.clock-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

.clock-panel::before {
  width: 260px;
  height: 260px;
  top: -80px;
  left: -50px;
  background: rgba(93, 210, 199, 0.14);
}

.clock-panel::after {
  width: 300px;
  height: 300px;
  bottom: -120px;
  right: -80px;
  background: rgba(59, 130, 246, 0.12);
}

.topbar {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-copy strong {
  display: block;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  outline: none;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  text-align: center;
  padding: 64px 16px 24px;
  min-height: 0;
  flex: 1;
}

.hero[data-tv="true"] {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
  padding: 44px 0 0;
}

.clock-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  flex: 1;
}

.hero[data-tv="true"] .clock-stack {
  display: none;
}

.clock-frame {
  width: 94%;
  max-width: 840px;
  padding: 14px 10px 16px;
  border-radius: 24px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  margin-inline: auto;
}

.clock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.digit-group {
  display: flex;
  gap: 4px;
}

.digit-card {
  min-width: 70px;
  padding: 6px 4px;
  border-radius: 14px;
  background: var(--clock-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.digit-card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.digit-card span {
  position: relative;
  z-index: 1;
  display: block;
  font-family: "DSEG7 Classic", monospace;
  font-weight: bold;
  font-size: clamp(2.4rem, 7vw, 3.2rem);
  line-height: 1;
  color: var(--clock-digits);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.colon,
.period {
  font-family: "DSEG7 Classic", monospace;
  font-weight: bold;
  color: var(--clock-digits);
}

.colon {
  font-size: clamp(2.4rem, 5.5vw, 3.2rem);
  opacity: 0.75;
  animation: blink 1.2s infinite;
}

.period {
  font-size: clamp(1.2rem, 2.3vw, 1.7rem);
  align-self: flex-end;
  opacity: 0.85;
  min-width: 3ch;
  text-align: left;
  padding-bottom: 6px;
}

@keyframes blink {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.15; }
}

.clock-meta {
  display: grid;
  gap: 4px;
  justify-items: center;
  margin-top: 12px;
}

.clock-date {
  font-size: 3.2vh;
  color: rgba(255, 255, 255, 0.92);
  text-transform: capitalize;
  text-wrap: balance;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-stage {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: none;
  position: relative;
  z-index: 1;
}

.tv-stage.active {
  display: block;
}

.hero[data-tv="true"] .tv-stage {
  flex: 1;
  width: 100%;
  max-width: 100%;
}

.tv-stage iframe,
.tv-stage video {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  object-fit: contain;
}

.footer-note {
  position: absolute;
  right: 18px;
  bottom: 12px;
  z-index: 10;
  font-size: 0.90rem;
  color: rgba(255, 255, 255, 0.56);
  text-decoration: none;
}

.side-panel {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-rows: 1fr 1fr;
  padding: 14px 14px 18px;
  gap: 0;
  overflow: hidden;
  min-height: 0;
  width: 100%;
}

.weather-card,
.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.weather-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  background: var(--weather-bg-color);
  color: var(--weather-text-color);
  border: 1px solid var(--border);
  border-radius: 22px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 14px 16px;
  text-align: left;
}

.weather-card::before {
  content: "";
  position: absolute;
  inset: auto -30px -40px auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(93, 210, 199, 0.22), transparent 65%);
  pointer-events: none;
}

.weather-top {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.weather-left {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.weather-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.weather-texts {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.weather-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.weather-place {
  font-size: 0.9rem;
  font-weight: 700;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.2;
  overflow-wrap: break-word;
  word-break: break-word;
}

.weather-temp {
  flex-shrink: 0;
  text-align: right;
  line-height: 1;
  font-size: clamp(2.2rem, 6.0vw, 5.0rem);
  font-weight: 450;
}

.weather-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-transform: capitalize;
  margin-bottom: 0;
}

.weather-moon {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

#miniClock {
  align-self: flex-end;
  font-size: 0.9rem;
  opacity: 0.9;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  width: 100%;
  margin-top: 4px;
}

.player-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
  overflow: hidden;
  background: var(--player-bg-color);
  color: var(--player-text-color);
  align-items: center;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding-right: 4px;
}

.player-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  margin-right: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
  white-space: normal;
}

.player-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.mode-badge {
  display: none;
}

.selector-grid {
  display: flex;
  gap: 6px;
  margin-bottom: 2px;
  width: 100%;
}

.selector-btn {
  flex: 1;
  min-height: 32px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}

.selector-btn:hover,
.selector-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(93, 210, 199, 0.35);
  background: var(--accent);
  outline: none;
}

.selector-btn.active {
  background: linear-gradient(135deg, rgba(93, 210, 199, 0.18), rgba(93, 210, 199, 0.08));
  border-color: rgba(93, 210, 199, 0.36);
}

.media-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 2px;
  width: 100%;
}

.media-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 9px;
  transition: transform 0.18s ease, opacity 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}

.media-btn:hover {
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0.82;
  transform: translateY(-1px);
}

.media-btn:active {
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0.72;
  transform: translateY(0);
}

.media-btn:focus {
  outline: none;
}

.media-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.media-btn.primary {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.volume-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  width: 100%;
  min-height: 44px;
}

.volume-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.volume-chip {
  min-width: 38px;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.empty-state {
  min-height: 100px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 28px 16px;
}

.list-item {
  width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  margin: 0;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  line-height: 1.4;
}

.list-item strong {
  display: block;
  margin-bottom: 2px;
}

.list-item small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.list-item:hover,
.list-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(93, 210, 199, 0.28);
  background: var(--accent);
  outline: none;
}

.list-item:focus-visible {
  box-shadow: 0 0 0 2px rgba(93, 210, 199, 0.7);
}

.list-section-title {
  margin: 10px 2px 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.popup-backdrop.active {
  display: flex;
}

.popup-panel {
  width: min(780px, 94vw);
  max-height: 80vh;
  background: var(--surface-2);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.popup-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.popup-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.18);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.popup-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.popup-body .search-box input {
  width: 100%;
  min-height: 34px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text);
  padding: 0 10px;
  outline: none;
  font-size: 0.85rem;
}

.list-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.settings-backdrop.active {
  display: flex;
}

.settings-panel {
  width: min(520px, 94vw);
  max-height: 82vh;
  background: var(--surface-2);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 14px 14px;
  gap: 8px;
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.settings-row strong {
  color: var(--text);
}

.swatch-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.color-input {
  width: 34px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 0;
}

.label {
  font-size: 0.72rem;
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.segmented button {
  border: 0;
  padding: 4px 10px;
  font-size: 0.8rem;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--accent);
  color: var(--text);
}

/* Popup compartir */
.share-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 55;
}

.share-backdrop.active {
  display: flex;
}

.share-panel {
  width: min(360px, 92vw);
  background: var(--surface-2);
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.share-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.share-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.18);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.share-body {
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.share-body img {
  max-width: 180px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.share-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.share-actions a:hover,
.share-actions a:focus-visible {
  background: var(--accent);
  border-color: rgba(93, 210, 199, 0.4);
  transform: translateY(-1px);
  outline: none;
}

.share-note {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

@media screen and (min-width: 768px) and (max-width: 1180px) and (orientation: landscape) {
  .clock-frame {
    max-width: none;
    width: 96%;
    padding: 20px 18px 22px;
  }

  .clock-row {
    gap: 18px;
  }

  .digit-card {
    min-width: 90px;
    padding: 10px 8px;
    border-radius: 18px;
  }

  .digit-card span {
    font-size: clamp(3.2rem, 4.6vw, 4.4rem);
  }

  .colon {
    font-size: clamp(2.6rem, 4.2vw, 3.4rem);
  }

  .period {
    font-size: clamp(1.4rem, 2.1vw, 1.8rem);
    padding-bottom: 6px;
  }
}

@media screen and (min-width: 1181px) and (orientation: landscape) {
  .clock-frame {
    width: 96%;
    max-width: none;
    padding: 22px 20px 24px;
  }

  .clock-row {
    gap: 20px;
  }

  .digit-card {
    min-width: 100px;
    padding: 10px 8px;
    border-radius: 20px;
  }

  .digit-card span {
    font-size: clamp(3.8rem, 5.4vw, 6.2rem);
  }

  .colon {
    font-size: clamp(3rem, 4.8vw, 4rem);
  }

  .period {
    font-size: clamp(1.6rem, 2.3vw, 2.1rem);
    padding-bottom: 8px;
  }
}

/* Reloj grande en pantallas grandes */
@media screen and (orientation: landscape) and (min-width: 1024px) and (min-height: 700px) {
  .clock-frame {
    width: 92%;
    max-width: 1100px;
    padding: 22px 18px 24px;
  }

  .clock-row {
    gap: 18px;
  }

  .digit-card {
    min-width: 100px;
    padding: 10px 8px;
    border-radius: 20px;
  }

  .digit-card span {
    font-size: 25vh;
    line-height: 1;
  }

  .colon {
    font-size: 20vh;
  }

  .period {
    font-size: 7vh;
    padding-bottom: 8px;
  }
}

/* Reloj grande en tablets medianas */
@media screen and (orientation: landscape) and (min-width: 800px) and (max-width: 1023px) and (min-height: 600px) {
  .clock-frame {
    width: 94%;
    max-width: 1000px;
    padding: 20px 16px 22px;
  }

  .clock-row {
    gap: 14px;
  }

  .digit-card {
    min-width: 90px;
    padding: 8px 6px;
    border-radius: 18px;
  }

  .digit-card span {
    font-size: 22vh;
  }

  .colon {
    font-size: 18vh;
  }

  .period {
    font-size: 6vh;
    padding-bottom: 6px;
  }
}

@media (orientation: landscape) {
  html,
  body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.3fr);
    width: 100vw;
    height: 100svh;
  }

  .clock-panel,
  .side-panel {
    height: 100%;
  }

  .clock-frame {
    width: 94%;
    max-width: none;
    padding: 22px 20px 24px;
  }

  .hero[data-tv="true"] {
    padding-top: 40px;
  }

  .tv-stage {
    border-radius: 12px;
  }

  .clock-date {
    font-size: 4vh;
  }
}

@media (orientation: landscape) and (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.3fr);
    height: 100svh;
  }

  .side-panel {
    padding: 8px 8px 10px;
    gap: 6px;
  }

  .weather-card {
    padding: 6px 8px;
    border-radius: 14px;
  }

  .weather-desc,
  .weather-moon {
    font-size: 0.72rem;
  }

  .weather-temp {
    font-size: clamp(3.1rem, 5.4vw, 5.8rem);
  }

  #miniClock {
    font-size: 0.7rem;
  }

  .weather-card::before {
    width: 90px;
    height: 90px;
    bottom: -30px;
    right: -20px;
  }

  .weather-label,
  .player-kicker,
  .selector-btn {
    font-size: 0.75rem;
  }

  .weather-place {
    font-size: 0.75rem;
  }

  .player-card {
    border-radius: 14px;
    padding: 6px 8px;
    box-shadow: none;
  }

  .player-title {
    font-size: 0.8rem;
  }

  .selector-grid {
    gap: 4px;
    margin-bottom: 0;
  }

  .selector-btn {
    min-height: 28px;
    border-radius: 10px;
  }

  .media-controls {
    gap: 4px;
    margin-top: 2px;
  }

  
  .volume-row {
    grid-template-columns: auto 1fr;
    column-gap: 4px;
    row-gap: 2px;
  }

  .volume-chip {
    display: none;
  }
  
  .media-btn,
  .media-btn.primary {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 9px;
    padding: 0;
  }
  .control-icon {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
  }
}

@media (orientation: portrait) {
  .app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
  }

  .clock-panel {
    flex: 0 0 46vh;
    max-height: 46vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .side-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .weather-card {
    flex: 0 0 27vh;
    max-height: 27vh;
    justify-content: center;
  }

  .weather-desc,
  .weather-moon {
    font-size: 0.8rem;
  }

  #miniClock {
    font-size: 0.8rem;
  }

  .player-card {
    flex: 0 0 27vh;
    max-height: 27vh;
  }

  .clock-frame {
    width: min(100%, 480px);
    padding: 12px 8px 16px;
    border-radius: 20px;
    margin-top: 10px;
  }

  .clock-row {
    gap: 10px;
  }

  .digit-card {
    min-width: 68px;
    padding: 6px 4px;
    border-radius: 14px;
  }

  .digit-card span {
    font-size: clamp(2.4rem, 7.5vw, 3.1rem);
  }

  .colon {
    font-size: clamp(2.2rem, 6.5vw, 3rem);
  }

  .period {
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    padding-bottom: 4px;
  }

  .clock-date {
    font-size: 2.1vh;
  }
}

@media (orientation: portrait) and (max-width: 480px) {
  .clock-panel {
    flex: 0 0 44vh;
    max-height: 44vh;
  }

  .clock-frame {
    width: 92%;
    max-width: 420px;
    padding: 10px 8px 15px;
    border-radius: 18px;
    margin-top: 8px;
  }

  .clock-row {
    gap: 8px;
  }

  .digit-card {
    min-width: 64px;
    padding: 6px 4px;
    border-radius: 12px;
  }

  .digit-card span {
    font-size: clamp(2rem, 7vw, 2.6rem);
  }

  .colon {
    font-size: clamp(2rem, 6.5vw, 2.4rem);
  }

  .period {
    font-size: clamp(0.9rem, 2.8vw, 1.2rem);
    padding-bottom: 3px;
  }

  .weather-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
  }

  .weather-desc,
  .weather-moon {
    font-size: 0.72rem;
  }
}

@media (max-width: 700px) {
  .hero {
    padding: 60px 10px 18px;
  }

  .clock-frame {
    border-radius: 22px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

#prevBtn,
#stopBtn,
#nextBtn,
#muteBtn,
#playPauseBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  line-height: 1;
}

.media-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 9px;
  transition: transform 0.18s ease, opacity 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}

.media-btn.primary {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.media-btn:hover {
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0.82;
  transform: translateY(-1px);
}

.media-btn:active {
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0.72;
  transform: translateY(0);
}

.media-btn:focus {
  outline: none;
}

.media-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Base común de todos los iconos */
.control-icon {
  display: block;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

/* Iconos del reproductor */
.media-btn .control-icon {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
}

/* Play/Pause ligeramente más visible */
.media-btn .control-icon--playpause {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
}

/* Iconos de la barra superior */
.icon-btn .control-icon {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
}

@media (orientation: landscape) and (max-width: 900px) {
  .media-btn,
  .media-btn.primary {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 9px;
    padding: 0;
  }

  .media-btn .control-icon {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
  }

  .media-btn .control-icon--playpause {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
  }

  .icon-btn .control-icon {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
  }
}