:root {
  color-scheme: dark;
  font: 1rem/1.4 system-ui, sans-serif;
  background: #101113;
  color: #eee;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }

button, a { color: inherit; }
button {
  font: inherit;
  border: 1px solid #44474d;
  border-radius: .45rem;
  padding: .6rem .8rem;
  background: #222429;
  cursor: pointer;
}
button:disabled, button[aria-disabled="true"] { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid #a9c8ff; outline-offset: 3px; }

#history, .load-error {
  max-width: 38rem;
  margin: 2rem auto;
  padding: 0 1rem;
}
.load-error:empty, #save-error:empty { margin: 0; padding: 0; }
#albums {
  list-style: none;
  margin: 0;
  padding: 0;
}
#albums a {
  display: block;
  border-bottom: 1px solid #44474d;
  padding: .85rem 0;
  overflow-wrap: anywhere;
}

.player {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #08090a;
  touch-action: manipulation;
}
.stage:disabled { opacity: 1; }
.stage:focus-visible { outline-offset: -3px; }
.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
#photo-status { pointer-events: none; }

.toolbar, .chooser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
}
.toolbar {
  flex-wrap: wrap;
  padding: .65rem 1rem max(.65rem, env(safe-area-inset-bottom));
}
.caption { min-width: 0; overflow-wrap: anywhere; }
.caption h1, .chooser-header h2 {
  font-size: 1rem;
  margin: 0;
}
#position { font-size: .85rem; color: #b6b8bf; }
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

dialog {
  width: min(45rem, calc(100% - 1.5rem));
  padding: 1rem;
  border: 1px solid #44474d;
  border-radius: .65rem;
  background: #18191c;
  color: inherit;
}
dialog::backdrop { background: rgb(0 0 0 / 75%); }
#save-error { color: #ffc0b7; }
.thumbnails {
  display: flex;
  gap: .55rem;
  overflow-x: auto;
  padding: .55rem .35rem;
  margin-top: .5rem;
}
.thumbnails button {
  flex: 0 0 7.5rem;
  height: 6rem;
  padding: 0;
  overflow: hidden;
}
.thumbnails img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 32rem) {
  .toolbar { padding-inline: .65rem; }
  .controls button { padding-inline: .55rem; }
}
