:root {
  color-scheme: dark;
  --bg: #101318;
  --panel: #1a2028;
  --panel-strong: #242c36;
  --text: #f7f9fc;
  --muted: #aab4c2;
  --line: rgba(255, 255, 255, 0.14);
  
  --accent: #1f8bff;
  
  --accent-2: #79c2ff;
  --danger: #ffd15d;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px;
  display: block;
  background: #101318;
}

.player-panel,
.browse-panel,
.chat-panel {
  width: 100%;
  display: block;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.player-panel {
  position: relative;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-right: 132px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-strong);
}

.brand-mark span {
  width: 21px;
  height: 21px;
  border: 4px solid var(--accent);
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-28deg);
}

.flag-row {
  position: absolute;
  top: 5px;
  right: 12px;
  display: flex;
  gap: 8px;
  margin-bottom: 0;
}

.flag-button {
  width: 56px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.greek-flag {
  position: relative;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  background:
    linear-gradient(
      180deg,
      #0d5eaf 0 11.111%,
      #fff 11.111% 22.222%,
      #0d5eaf 22.222% 33.333%,
      #fff 33.333% 44.444%,
      #0d5eaf 44.444% 55.555%,
      #fff 55.555% 66.666%,
      #0d5eaf 66.666% 77.777%,
      #fff 77.777% 88.888%,
      #0d5eaf 88.888% 100%
    );
  color: transparent;
  text-shadow: none;
}

.greek-flag::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 44%;
  height: 55.555%;
  background:
    linear-gradient(90deg, transparent 0 38%, #fff 38% 62%, transparent 62%),
    linear-gradient(180deg, transparent 0 38%, #fff 38% 62%, transparent 62%),
    #0d5eaf;
  pointer-events: none;
  z-index: 0;
}

.greek-flag {
  z-index: 0;
}

.greek-flag::after {
  content: "GR";
  position: relative;
  z-index: 1;
  top: -5px;
  color: #07101e;
  font-size: 14px;
  font-weight: 900;
  text-shadow: 0 1px 0 #fff;
}

.uk-flag {
  background:
    linear-gradient(135deg, transparent 0 42%, #fff 42% 47%, #c8102e 47% 53%, #fff 53% 58%, transparent 58%),
    linear-gradient(45deg, transparent 0 42%, #fff 42% 47%, #c8102e 47% 53%, #fff 53% 58%, transparent 58%),
    linear-gradient(90deg, transparent 0 42%, #fff 42% 47%, #c8102e 47% 53%, #fff 53% 58%, transparent 58%),
    linear-gradient(0deg, transparent 0 40%, #fff 40% 46%, #c8102e 46% 54%, #fff 54% 60%, transparent 60%),
    #012169;
}

.flag-button.is-active {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.color-row {
  position: absolute;
  top: 54px;
  right: 5px;
  display: grid;
  gap: 8px;
  z-index: 2;
}

.color-button {
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.color-button[data-accent-option="#1f8bff"] {
  background: #1f8bff;
}

.color-button[data-accent-option="#0f8a3b"] {
  background: #0f8a3b;
}

.color-button[data-accent-option="#f28c13"] {
  background: #f28c13;
}

.color-button[data-accent-option="#ea1414"] {
  background: #ea1414;
}

.color-button.is-active {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.eyebrow,
.label {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1;
}

.dial-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-top: 6px;
}

.dial {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  align-content: center;
  flex: 0 0 104px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 52%, var(--danger) 100%);
  box-shadow: inset 0 0 0 11px rgba(26, 32, 40, 0.72);
}

.frequency {
  font-size: 42px;
  font-weight: 800;
  line-height: 0.9;
}

.band {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
}

.now {
  min-width: 0;
}

.now h2 {
  margin-bottom: 7px;
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.now p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.control-row {
  display: block;
  margin-bottom: 12px;
}

.play-button {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  cursor: pointer;
}

.play-button {
  width: 100%;
  height: 48px;
  border-radius: 8px;
}

.play-button {
  background: var(--accent);
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
}

.volume-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

input[type="range"] {
  min-width: 0;
  accent-color: var(--accent);
}

.channel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.channel-tab {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.channel-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.live-note {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.chat-panel h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
}

.chat-list {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.chat-empty,
.chat-row,
.chat-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.chat-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.chat-user {
  margin-bottom: 3px;
  color: var(--text);
  font-weight: 800;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.chat-form input,
.chat-form button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--panel-strong);
  color: var(--text);
}

.chat-form button {
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.chat-status {
  min-height: 18px;
  margin: 8px 0 0;
}

@media (max-width: 370px) {
  .app-shell {
    padding: 8px;
  }

  .dial {
    width: 94px;
    height: 94px;
    flex-basis: 94px;
  }

  .frequency {
    font-size: 36px;
  }

  .now h2 {
    font-size: 24px;
  }

}

@media (orientation: landscape) and (max-width: 980px) {
  html,
  body {
    min-height: auto;
    overflow: auto;
  }

  .app-shell {
    max-width: none;
    width: 100%;
    min-height: 0;
    height: auto;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
    grid-template-rows: auto 1fr;
    gap: 8px;
    padding: 6px 8px 8px;
    overflow: visible;
    align-items: start;
  }

  .player-panel,
  .browse-panel,
  .chat-panel {
    min-height: 0;
    margin-bottom: 0;
    padding: 10px;
  }

  .player-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .browse-panel {
    grid-column: 1;
    grid-row: 2;
  }

  .chat-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .browse-panel {
    overflow: visible;
  }

  .brand-row {
    margin-bottom: 5px;
  }

  h1 {
    font-size: 18px;
  }

  .eyebrow,
  .label {
    font-size: 9px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .brand-mark span {
    width: 16px;
    height: 16px;
    border-width: 3px;
  }

  .flag-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  .flag-button {
    width: 48px;
    height: 30px;
    border-radius: 7px;
    font-size: 12px;
  }

  .color-row {
    top: 54px;
    right: 22px;
    gap: 6px;
  }

  .color-button {
    width: 24px;
    height: 24px;
  }

  .dial-wrap {
    gap: 10px;
    margin-bottom: 10px;
  }

  .dial {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
    box-shadow: inset 0 0 0 7px rgba(26, 32, 40, 0.72);
  }

  .frequency {
    font-size: 25px;
  }

  .band {
    font-size: 10px;
  }

  .now h2 {
    font-size: 18px;
  }

  .play-button {
    height: 36px;
  }

  .play-button {
    font-size: 19px;
  }

  .control-row {
    margin-bottom: 9px;
  }

  .volume-row {
    font-size: 11px;
  }

  .channel-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  .channel-tab {
    min-height: 34px;
  }

  .live-note {
    padding: 8px 10px;
  }

  .chat-panel h2 {
    flex: 0 0 auto;
    margin-bottom: 8px;
    font-size: 16px;
  }

  .chat-list {
    flex: 0 1 auto;
    max-height: 122px;
    min-height: 0;
    margin-bottom: 8px;
  }

  .chat-form {
    flex: 0 0 auto;
    gap: 7px;
  }

  .chat-form input,
  .chat-form button {
    min-height: 34px;
  }

}
