/* Saved Videos: the warm paper of the other games, a shelf of big picture tiles, and the video filling the screen.
   Calm by design: soft colors, slow smooth motion (0.4 to 0.8 s), nothing loops or flashes. */
:root {
  --bg: #f3eee4;
  --card: #fffdf7;
  --ink: #3b2a1a;
  --soft: #6d6250;
  --blue: #3f7fc4;
  --blue-d: #1f5fa8;
  --green: #3fa34d;
  --green-d: #2a7a36;
  --radius: 20px;
  color-scheme: light;
}
/* Evening: dimmer and warmer (rule 4). */
body.evening { --bg: #e6dcc8; --card: #f6eedc; }
body.evening main, body.evening .top { filter: brightness(.9); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100dvh; background: var(--bg); color: var(--ink); font: 500 18px/1.45 'Fredoka', system-ui, sans-serif; overscroll-behavior: none; overflow-x: hidden; }
h1, h2, h3 { font-family: 'Fredoka', system-ui, sans-serif; font-weight: 700; line-height: 1.1; margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--blue-d); text-decoration: none; font-weight: 600; }

/* top bar */
.top { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 16px 6px; min-height: 64px; }
.grow { flex: 1; }
.brand { display: block; width: 40px; height: 40px; }
.back, .round {
  min-height: 48px; min-width: 48px; border: 3px solid var(--ink); border-radius: 16px; background: var(--card);
  box-shadow: 0 4px 0 var(--ink); font-weight: 700; padding: 6px; display: inline-flex; align-items: center; justify-content: center;
}
.back:active, .round:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#sound .mute { display: none; }
#sound[aria-pressed='false'] .mute { display: inline; }
#sound[aria-pressed='false'] .waves { display: none; }

main { max-width: 1600px; margin: 0 auto; padding: 0 16px calc(28px + env(safe-area-inset-bottom)); }
.screen { display: grid; gap: 18px; min-width: 0; }

/* home */
.hero { text-align: center; display: grid; gap: 8px; padding-top: 4px; }
.hero h1 { font-size: clamp(34px, 10vw, 54px); }
.lede { margin: 0; font-size: 20px; color: var(--soft); text-align: center; }
.big {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 80px;
  border: 3px solid var(--ink); border-radius: 24px; font-size: 30px; font-weight: 700; box-shadow: 0 7px 0 var(--ink); padding: 10px 20px;
}
.big:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.big.go { background: var(--green); color: #fff; text-shadow: 0 2px 0 #0003; }
.big.plain { background: var(--card); font-size: 24px; }

.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 8px 0; animation: arrive .6s ease-in-out both; }
.empty svg { max-width: 60vw; height: auto; }
.empty-line { margin: 0; font-size: 22px; font-weight: 700; }

/* The shelf: big picture tiles, two to a row on a phone, more on wider screens. */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 14px; }
.shelf:empty { display: none; }
.tile {
  display: grid; gap: 6px; align-content: start; min-height: 120px; padding: 8px 8px 12px; border: 3px solid var(--ink); border-radius: 18px;
  background: var(--card); box-shadow: 0 5px 0 var(--ink); text-align: center;
}
.tile:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.tile img, .tile .no-still { display: grid; place-items: center; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: #2b2118; }
.tile .no-still { background: #e7f0fa; }
.tile .no-still svg { width: 70%; height: auto; }
.tile .t { font-weight: 700; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }

.pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; min-width: 0; }
.pick legend { font-weight: 700; font-size: 18px; margin-bottom: 8px; padding: 0; }
.pick button {
  border: 3px solid var(--ink); border-radius: 18px; background: var(--card); box-shadow: 0 4px 0 var(--ink); padding: 10px 4px;
  display: grid; justify-items: center; align-content: center; gap: 4px; font-weight: 700; font-size: 20px; line-height: 1.15; min-height: 88px;
}
.pick button small { font-size: 14px; font-weight: 500; color: var(--soft); }
.pick button[aria-pressed='true'] { background: #dff3e1; border-color: var(--green-d); box-shadow: 0 4px 0 var(--green-d); }
/* Picked shows as a check mark too, not only as green. */
.pick button[aria-pressed='true']::before { content: '\2713'; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { width: 100%; }
.chips button { display: inline-flex; min-height: 48px; padding: 6px 14px; font-size: 18px; align-items: center; }

.grownups, .about { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 5px 0 #3b2a1a33; min-width: 0; }
.grownups summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.grownups p, .about p { margin: 10px 0 0; }
.g-h { font-size: 20px; margin-top: 18px; }
.about h2 { font-size: 22px; margin-top: 14px; }
.about h2:first-child { margin-top: 0; }
.about h3 { font-size: 18px; margin: 12px 0 0; }
.about ul { padding-left: 22px; display: grid; gap: 6px; }
.small, small { font-size: 14px; color: var(--soft); }
.films, .saved { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.film-row, .saved-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 2px dashed #3b2a1a22; }
.ft, .st { min-width: 0; overflow-wrap: anywhere; }
.ft small, .st small { display: block; margin-top: 2px; }
.fp { grid-column: 1; font-size: 15px; color: var(--green-d); font-weight: 600; }
.fp:empty { display: none; }
.film-row > button, .film-row .kept { grid-column: 2; grid-row: 1; }
.save-btn, .del-btn {
  min-height: 52px; min-width: 96px; padding: 6px 14px; border: 3px solid var(--ink); border-radius: 16px; background: var(--card);
  box-shadow: 0 4px 0 var(--ink); font-weight: 700; font-size: 18px;
}
.save-btn { background: #dff3e1; }
.save-btn:disabled { opacity: .5; cursor: default; }
.kept { font-weight: 700; color: var(--green-d); }
.kept::before { content: '\2713\00a0'; }
.confirm { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-weight: 600; cursor: pointer; }
.confirm input { width: 28px; height: 28px; flex: none; margin: 0; accent-color: var(--green-d); }
.add-file {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; margin-top: 12px;
  border: 3px solid var(--ink); border-radius: 20px; background: #e7f0fa; box-shadow: 0 5px 0 var(--ink); font-size: 22px; font-weight: 700; cursor: pointer;
}
.add-file input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.add-file[aria-disabled='true'] { opacity: .5; cursor: default; }
.add-file[aria-disabled='true'] input { cursor: default; }
.status { font-weight: 600; color: var(--green-d); min-height: 1em; }
.status:empty { display: none; }
.yt-note { background: #fff8e6; border: 2px dashed #b98345; border-radius: 16px; padding: 10px 12px; }

/* one video, filling the screen */
#play-screen { gap: 12px; min-height: calc(100dvh - 100px); align-content: center; }
.player-box { width: 100%; background: #000; border-radius: 16px; overflow: hidden; display: grid; place-items: center; }
#video { display: block; width: 100%; height: auto; max-height: calc(100dvh - 230px); min-height: 200px; background: #000; }
.now { margin: 0; color: var(--soft); text-align: center; font-weight: 600; overflow-wrap: anywhere; }

/* finish */
#finish { text-align: center; padding-top: 10px; }
.cheer { font-size: clamp(32px, 9vw, 46px); animation: arrive .6s ease-in-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.talk { margin: 0; background: #f4fbf6; border: 2px dashed var(--green-d); border-radius: 16px; padding: 12px 14px; text-align: left; font-size: 18px; }

@media (min-width: 900px) {
  #finish { max-width: 900px; margin: 0 auto; }
}
/* Phones held sideways: the video takes the whole height it can. */
@media (orientation: landscape) and (max-height: 520px) {
  .top { min-height: 52px; padding-top: max(6px, env(safe-area-inset-top)); }
  #video { max-height: calc(100dvh - 150px); }
}
.find { background: var(--card, #fffdf7); border: 3px solid var(--ink, #3b2a1a); border-radius: 22px; padding: 14px 16px; display: grid; gap: 10px; }
.find h2 { margin: 0; font-size: 22px; }
.find-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.find a { font-weight: 700; text-decoration: none; color: var(--blue-d, #1f5d99); }
.find .big { justify-self: stretch; }
