:root {
  --win-gray: #c0c0c0;
  --win-dark: #7f7f7f;
  --win-light: #dfdfdf;
  --win-white: #ffffff;
  --win-black: #000000;
  --win-blue: #000080;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #008080;
  color: var(--win-black);
  font-family: "W95FA", "MS Sans Serif", "Tahoma", system-ui, sans-serif;
}

.window {
  width: min(860px, 92vw);
  max-height: 96dvh;
  background: var(--win-gray);
  border-radius: 0;
  padding: 0;
  box-shadow: inset -1px -1px 0 0 var(--win-black), inset 1px 1px 0 0 var(--win-white),
    inset -2px -2px 0 0 var(--win-dark), inset 2px 2px 0 0 var(--win-light);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.titlebar {
  background: var(--win-blue);
  color: var(--win-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 2px 2px 4px;
  font-size: 12px;
  line-height: 13px;
  letter-spacing: 0.24px;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.title-icon {
  width: 16px;
  height: 16px;
  background: url("https://www.figma.com/api/mcp/asset/bf8ee316-c2b7-435c-9e71-7b9a58e5b805")
    center / cover no-repeat;
  box-shadow: inset -1px -1px 0 0 var(--win-black), inset 1px 1px 0 0 var(--win-white),
    inset -2px -2px 0 0 var(--win-dark), inset 2px 2px 0 0 var(--win-light);
}

.title-text {
  font-size: 12px;
  line-height: 13px;
}

.titlebar-right {
  display: flex;
  gap: 2px;
  align-items: center;
}

.window-btn {
  width: 16px;
  height: 16px;
  background: var(--win-gray);
  position: relative;
  box-shadow: inset -1px -1px 0 0 var(--win-black), inset 1px 1px 0 0 var(--win-white),
    inset -2px -2px 0 0 var(--win-dark), inset 2px 2px 0 0 var(--win-light);
}

.window-btn--min::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 4px;
  height: 2px;
  background: var(--win-black);
}

.window-btn--max::after {
  content: "";
  position: absolute;
  inset: 4px 4px 6px 4px;
  border: 1px solid var(--win-black);
  background: transparent;
}

.window-btn--close {
  background: var(--win-gray)
    url("https://www.figma.com/api/mcp/asset/2f25e817-7969-4125-96a3-bd8b7a532371")
    center / 8px 8px no-repeat;
}

.window-body {
  padding: 12px;
  overflow: auto;
  flex: 1;
}

.display {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: center;
}

.win-panel {
  background: var(--win-gray);
  border-radius: 0;
  padding: 12px;
  box-shadow: inset -1px -1px 0 0 var(--win-black), inset 1px 1px 0 0 var(--win-white),
    inset -2px -2px 0 0 var(--win-dark), inset 2px 2px 0 0 var(--win-light);
}

.artwork-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0;
  overflow: hidden;
  box-shadow: inset -1px -1px 0 0 var(--win-black), inset 1px 1px 0 0 var(--win-white),
    inset -2px -2px 0 0 var(--win-dark), inset 2px 2px 0 0 var(--win-light);
}

.artwork-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.now {
  display: grid;
  gap: 12px;
}

.now-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.station {
  font-size: 18px;
  font-weight: 700;
}

.track {
  flex: 1;
  font-size: 12px;
  line-height: 1.35;
  color: var(--win-black);
}

.controls {
  margin-top: 16px;
}

.dial {
  border-radius: 0;
  padding: 10px;
}

.dial-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--win-black);
  margin-bottom: 8px;
}

.station-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.station-btn {
  appearance: none;
  border: 0;
  background: var(--win-gray);
  color: var(--win-black);
  padding: 6px 12px;
  border-radius: 0;
  text-align: center;
  cursor: pointer;
  box-shadow: inset -1px -1px 0 0 var(--win-black), inset 1px 1px 0 0 var(--win-white),
    inset -2px -2px 0 0 var(--win-dark), inset 2px 2px 0 0 var(--win-light);
  font-size: 11px;
  line-height: 10px;
}

.station-btn:active {
  box-shadow: inset 1px 1px 0 0 var(--win-black), inset -1px -1px 0 0 var(--win-white),
    inset 2px 2px 0 0 var(--win-dark), inset -2px -2px 0 0 var(--win-light);
}

.station-btn.active {
  box-shadow: inset 1px 1px 0 0 var(--win-black), inset -1px -1px 0 0 var(--win-white),
    inset 2px 2px 0 0 var(--win-dark), inset -2px -2px 0 0 var(--win-light);
}

.statusbar {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--win-gray);
  box-shadow: inset -1px -1px 0 0 var(--win-black), inset 1px 1px 0 0 var(--win-white),
    inset -2px -2px 0 0 var(--win-dark), inset 2px 2px 0 0 var(--win-light);
}

.status-field {
  flex: 1;
  min-height: 18px;
  padding: 3px 16px 3px 4px;
  font-size: 11px;
  line-height: 10px;
  background: var(--win-gray);
  box-shadow: inset -1px -1px 0 0 var(--win-white), inset 1px 1px 0 0 #808080;
  position: relative;
}

.mute-btn {
  border: 0;
  flex-shrink: 0;
  min-width: 84px;
  min-height: 32px;
  padding: 6px 12px;
  white-space: nowrap;
  background: var(--win-gray);
  color: var(--win-black);
  font-family: inherit;
  font-size: 11px;
  line-height: 10px;
  cursor: pointer;
  box-shadow: inset -1px -1px 0 0 var(--win-black), inset 1px 1px 0 0 var(--win-white),
    inset -2px -2px 0 0 var(--win-dark), inset 2px 2px 0 0 var(--win-light);
}

.mute-btn:active,
.mute-btn.active {
  box-shadow: inset 1px 1px 0 0 var(--win-black), inset -1px -1px 0 0 var(--win-white),
    inset 2px 2px 0 0 var(--win-dark), inset -2px -2px 0 0 var(--win-light);
}

.status-field--clock {
  flex: 0 0 180px;
  white-space: nowrap;
}

.status-field--news {
  flex: 1 1 auto;
  overflow: hidden;
  padding-right: 4px;
}

.ticker {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker-scroll 28s linear infinite;
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.status-field::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 13px;
  height: 13px;
  background: linear-gradient(135deg, transparent 50%, var(--win-dark) 50%);
}

@media (max-width: 720px) {
  body {
    place-items: stretch;
  }

  .window {
    width: 100vw;
    min-height: 100dvh;
    max-height: 100dvh;
  }

  .titlebar {
    padding-top: calc(2px + env(safe-area-inset-top));
  }

  .window-body {
    padding: 8px;
  }

  .display {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .station {
    font-size: 16px;
  }

  .track {
    font-size: 11px;
    line-height: 1.35;
  }

  .controls {
    margin-top: 10px;
  }

  .dial {
    padding: 8px;
  }

  .station-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .station-btn {
    min-height: 36px;
    font-size: 12px;
    line-height: 1.1;
  }

  .statusbar {
    gap: 4px;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    flex-direction: column;
  }

  .status-field--clock {
    flex: 0 0 auto;
  }

  .mute-btn {
    min-height: 36px;
    font-size: 12px;
    line-height: 1.1;
  }

  .status-field--news {
    min-height: 22px;
  }
}
