@font-face {
  font-family: "LcdDest";
  src: url("../assets/font/dest.ttf") format("truetype");
  font-display: block;
}

:root {
  --bg: #f4f5f7;
  --fg: #1c1f24;
  --card: #ffffff;
  --border: #d8dce2;
  --blue: #1e90ff;
  --royal: #4169e1;
  --red: #ff6a6a;
  --orange: #ff4500;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --fg: #e8eaed;
    --card: #1e2127;
    --border: #343a44;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}

/* ---- 표시화면 ---- */
.screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  container-type: size;
}
.screen-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill; /* 원본처럼 화면 크기에 맞춰 늘림 */
  display: block;
}
.screen-dest {
  position: absolute;
  color: #fff;
  font-family: "LcdDest", "Malgun Gothic", sans-serif;
  font-size: calc(60 / 1080 * 100cqh);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

/* ---- 조작 화면 ---- */
.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 16px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 20px; margin: 0; }
.topbar .tools { display: flex; gap: 8px; flex-wrap: wrap; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
}
.status { grid-column: 1 / 3; font-size: 18px; margin: 0; }
.status b { font-size: 22px; }
.dest { text-align: right; font-size: 20px; font-weight: 700; color: var(--blue); }

button {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
button:hover { filter: brightness(1.08); }
button:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
button.royal { background: var(--royal); }
button.red { background: var(--red); }
button.stop { background: var(--orange); }
button.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-weight: 500;
}
.span2 { grid-column: span 2; }
.big { font-size: 20px; padding: 18px 12px; }

.hint { font-size: 13px; opacity: .75; line-height: 1.6; margin: 0; }
.hint kbd {
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 12px;
}
.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--border);
  margin-left: 6px;
}
.badge.on { background: #2ea043; color: #fff; }

@media (max-width: 640px) {
  .panel-grid { grid-template-columns: 1fr 1fr; }
  .status { grid-column: 1 / -1; }
  .dest { grid-column: 1; text-align: left; }
}

/* ---- 별도 표시화면 창 ---- */
body.display-page { background: #000; overflow: hidden; }
body.display-page .screen { width: 100vw; height: 100vh; aspect-ratio: auto; }
.wait {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #aaa; font-size: 20px; text-align: center; padding: 24px;
  background: #000; z-index: 2;
}
.wait.hidden { display: none; }
