:root {
  color-scheme: light;
  font-family: "Microsoft JhengHei", system-ui, sans-serif;
  background: #d92323;
  color: #fff9e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #e72b2b 0%, #c91818 62%, #a90f16 100%);
}

.remote-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 12px 24px;
}

.remote-header { margin-bottom: 10px; }

.header-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.remote-header h1 {
  margin: 0 0 6px;
  color: #fff4bf;
  font-size: 32px;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(119, 0, 0, 0.28);
}

.remote-header p {
  min-height: 24px;
  margin: 0;
  color: #fff4d6;
  font-size: 17px;
}

.version-panel {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
  padding-top: 4px;
}

#versionText {
  max-width: 122px;
  color: #fff4bf;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  word-break: break-word;
}

button {
  min-height: 60px;
  border: 2px solid #ffd36a;
  border-radius: 3px;
  background: #fff4c7;
  color: #8d1116;
  box-shadow: 0 3px 0 #b87913;
  font-size: 19px;
  font-weight: 800;
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #b87913;
  background: #ffe59c;
}

button:disabled { opacity: 0.55; }
button.primary { background: #ffd24d; color: #7a0d12; }
button.danger { border-color: #fff0b8; background: #9f1017; color: #fff4c7; }
button.wide { grid-column: span 3; }
button.mini-button {
  min-height: 34px;
  padding: 0 10px;
  border-width: 1px;
  font-size: 15px;
  box-shadow: 0 2px 0 #b87913;
}

.now-playing,
.library-panel {
  border: 1px solid #ffd36a;
  border-radius: 3px;
  background: rgba(255, 244, 199, 0.96);
  color: #8d1116;
  margin-bottom: 10px;
  padding: 10px;
}

.now-playing {
  display: grid;
  gap: 4px;
  font-weight: 800;
}

#playbackStateText {
  color: #a84216;
  font-size: 15px;
}

.library-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.library-toolbar strong {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-list {
  display: grid;
  gap: 8px;
  max-height: 40vh;
  overflow: auto;
  padding-right: 2px;
}

.library-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  min-height: 58px;
  width: 100%;
  padding: 0 10px;
  text-align: left;
}

.library-item span {
  font-size: 14px;
}

.library-item strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.library-item.folder {
  background: #ffe59c;
}

.library-empty {
  padding: 12px;
  color: #8d1116;
  font-weight: 800;
  text-align: center;
}

.remote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.compact-controls button {
  min-height: 56px;
  font-size: 17px;
}

.diagnostics {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.diagnostic-row {
  border: 1px solid #ffd36a;
  border-radius: 3px;
  background: #fff4c7;
  color: #8d1116;
  padding: 10px;
  font-size: 16px;
  font-weight: 700;
}

.diagnostic-row.bad { background: #ffe1df; }

@media (max-width: 380px) {
  .remote-shell { padding-inline: 10px; }
  .remote-header h1 { font-size: 29px; }
  button { min-height: 54px; font-size: 17px; }
  .compact-controls button { min-height: 52px; font-size: 16px; }
}

.player-panel {
  border: 1px solid #ffd36a;
  border-radius: 3px;
  background: rgba(255, 244, 199, 0.96);
  color: #8d1116;
  margin-bottom: 10px;
  padding: 10px;
}

.player-list {
  display: grid;
  gap: 8px;
}

.player-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 50px;
  padding: 0 10px;
  text-align: left;
}

.player-item span {
  font-size: 14px;
}
