/* Same look as the projects.shams.to start page: flat tiles with a hard shadow, blue and yellow. */
:root {
  --bg: #f6f6f3;
  --text: #15161a;
  --muted: #6b6e76;
  --tile: #ffffff;
  --edge: #15161a;
  --blue: #1c6bd9;
  --yellow: #ffdd33;
  --danger: #c62f2f;
  --focus: #1c6bd9;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --text: #f1f1ee;
    --muted: #9a9ca3;
    --tile: #1c1d21;
    --edge: #3a3c42;
    --blue: #4d8ef0;
    --danger: #f06a6a;
    --focus: #7fb0ff;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
main { width: 100%; max-width: 820px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 28px; letter-spacing: -0.01em; margin: 0; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.tile {
  background: var(--tile);
  border: 2px solid var(--edge);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--edge);
  padding: 20px;
}
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700;
  padding: 10px 18px;
  border-radius: 14px;
  border: 2px solid var(--edge);
  background: var(--tile);
  color: var(--text);
  box-shadow: 0 3px 0 var(--edge);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.btn.primary { background: var(--yellow); color: #15161a; }
.btn.danger { color: var(--danger); }
.btn.link { border: 0; box-shadow: none; background: none; color: var(--muted); font-weight: 500; padding: 6px 8px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* --- start page: enter a code (big, for TVs) -------------------------------------------------------------------- */
.home { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px 16px; }
.home .logo { width: 96px; height: 96px; margin: 0 auto 16px; display: block; }
.home h1 { font-size: clamp(28px, 5vw, 48px); }
.home p { font-size: clamp(16px, 2.4vw, 24px); margin: 8px 0 28px; }
.code-form { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.code-form input {
  font: inherit; font-size: clamp(28px, 5vw, 48px); font-weight: 700; letter-spacing: 0.25em; text-transform: lowercase;
  width: 6.4em; max-width: 100%; padding: 10px 12px; text-align: center;
  border: 2px solid var(--edge); border-radius: 18px; background: var(--tile); color: var(--text);
  box-shadow: inset 0 3px 0 rgba(0,0,0,0.06);
}
.code-form .btn { font-size: clamp(20px, 3.5vw, 32px); padding: 12px 28px; border-radius: 18px; }
.error { color: var(--danger); font-weight: 600; min-height: 1.5em; margin-top: 16px; }
.owner { margin-top: 48px; }

/* --- owner page ---------------------------------------------------------------------------------------------- */
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
header .brand { display: flex; align-items: center; gap: 12px; }
header .brand img { width: 40px; height: 40px; }
.drop {
  display: block; text-align: center; padding: 36px 20px; cursor: pointer;
  border-style: dashed; box-shadow: none;
}
.drop.over { background: color-mix(in srgb, var(--yellow) 25%, var(--tile)); }
.drop strong { font-size: 20px; display: block; margin-bottom: 4px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.disk { margin: 16px 2px 28px; font-size: 14px; color: var(--muted); }
.list { display: grid; gap: 16px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.video { display: grid; gap: 12px; }
.video .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.video .title { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.video .meta { font-size: 14px; color: var(--muted); }
.video .share { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.video .share code {
  font: 600 18px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--blue) 12%, var(--tile)); overflow-wrap: anywhere; flex: 1 1 260px;
}
.video .share code b { color: var(--blue); }
.video .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bar { height: 10px; border-radius: 6px; border: 2px solid var(--edge); overflow: hidden; background: var(--bg); }
.bar > i { display: block; height: 100%; background: var(--blue); width: 0; transition: width 300ms; }
.status { font-size: 14px; font-weight: 600; }
.status.failed { color: var(--danger); }

/* --- watch page: the video fills the screen ------------------------------------------------------------------ */
body.watch { background: #000; color: #fff; overflow: hidden; }
.watch video { position: fixed; inset: 0; width: 100vw; height: 100vh; background: #000; object-fit: contain; }
.watch .overlay {
  position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background: rgba(0, 0, 0, 0.55);
}
.watch .overlay[hidden] { display: none; }
.watch .overlay h1 { font-size: clamp(24px, 4vw, 48px); margin: 0 0 28px; overflow-wrap: anywhere; }
.watch .overlay .row { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.watch .overlay .btn { font-size: clamp(20px, 3vw, 34px); padding: 16px 36px; border-radius: 22px; border-color: #fff; box-shadow: 0 4px 0 #fff; }
.watch .overlay .btn:not(.primary) { background: #15161a; color: #fff; }
.watch .overlay .btn:focus-visible { outline: 5px solid var(--yellow); outline-offset: 5px; }
.watch .overlay p { font-size: clamp(16px, 2.2vw, 26px); color: #ddd; margin-top: 24px; }
