/* Additive display: pure black is transparent, so black is the canvas and
   light pixels are the only thing the wearer sees. */
:root {
  --fg: #f4f4f4;
  --dim: #a9adb3;
  --surface: #1b1e23;
  --accent: #e5a00d;
  --row: 100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000;
  color: var(--fg);
  font: 22px/1.25 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#root { width: 600px; height: 600px; }

.screen {
  width: 600px;
  height: 600px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.head {
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.head .pos { color: var(--dim); font-size: 18px; white-space: nowrap; }

/* ---------- focusable things ---------- */
.f {
  font: inherit;
  color: inherit;
  border: 3px solid transparent;
  border-radius: 18px;
  background: var(--surface);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.f:focus {
  background: var(--accent);
  border-color: #fff;
  color: #000;
}
.f:focus .sub { color: #000; }

/* ---------- lists ---------- */
.rows { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 0; }

.row {
  height: calc(var(--row) - 4px);
  flex: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px 0 10px;
  text-align: left;
}
.row.plain { padding-left: 20px; }
.row img, .row .ph {
  width: 56px;
  height: 84px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
  background: #2a2e35;
}
.row .txt { flex: 1; min-width: 0; }
.row .t {
  font-size: 23px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .sub {
  margin-top: 4px;
  font-size: 18px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .chev { flex: none; font-size: 26px; opacity: .7; }

input.row {
  padding: 0 20px;
  font-size: 23px;
  font-weight: 600;
}
input.row::placeholder { color: var(--dim); }
input.row:focus::placeholder { color: #000; }

.bar { height: 5px; margin-top: 7px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.f:focus .bar { background: rgba(0, 0, 0, .3); }
.f:focus .bar i { background: #000; }

/* ---------- message / sign-in ---------- */
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
}
.center p { margin: 0; color: var(--dim); max-width: 500px; }
.center .big { color: var(--fg); font-size: 26px; font-weight: 700; }
.code {
  font: 700 92px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 14px;
  padding-left: 14px;
  color: var(--accent);
}
.btn {
  min-height: 88px;
  width: 100%;
  padding: 0 22px;
  font-size: 23px;
  font-weight: 600;
  text-align: center;
}
.stack { width: 100%; display: flex; flex-direction: column; gap: 6px; flex: none; }

.spin {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, .2);
  border-top-color: var(--accent);
  animation: spin 1s steps(12) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- detail ---------- */
.detail .top { display: flex; gap: 18px; height: 210px; flex: none; }
.detail .top img { width: 140px; height: 210px; border-radius: 12px; object-fit: cover; background: #2a2e35; flex: none; }
.detail .info { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.detail h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail .meta { color: var(--dim); font-size: 19px; }
.detail .summary {
  flex: none;
  max-height: 104px;
  margin: 12px 0;
  font-size: 20px;
  line-height: 26px;
  color: #d6d8db;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.detail.one .summary { -webkit-line-clamp: 7; max-height: 182px; }
.detail .stack { margin-top: auto; }

/* ---------- player ---------- */
.player { padding: 0; position: relative; background: #000; }
/* The box is sized to the picture's own shape in app.js. The glasses' video
   layer ignores object-fit and crops the sides of a square box. */
.player video {
  position: absolute;
  left: 0;
  top: 131px;
  width: 600px;
  height: 338px;
  background: #000;
}
.player .hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px;
  transition: opacity .25s;
}
.player.idle .hud { opacity: 0; }
.player .title {
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 6px #000;
}
.player .state {
  position: absolute;
  left: 0;
  right: 0;
  top: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 0 30px;
  color: var(--fg);
  text-shadow: 0 0 6px #000;
}
.player .state:empty { display: none; }
.player .times { display: flex; justify-content: space-between; font-size: 18px; margin: 6px 2px 10px; text-shadow: 0 0 6px #000; }
.player .bar { height: 8px; margin: 0; }
.player .ctl { display: flex; gap: 8px; }
.player .ctl .btn { flex: 1; padding: 0; }
.player .ctl .btn.main { flex: 1.3; }

/* ---------- toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: 540px;
  padding: 12px 20px;
  border-radius: 16px;
  background: #33373e;
  color: #fff;
  font-size: 20px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#toast.on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2s; }
  .player .hud, #toast { transition: none; }
}
