:root {
  --nav-h: 64px;
}

html, body {
  margin: 0;
  background: #000;
  color: #bbb;
  font: 16px/1.4 system-ui, sans-serif;
}

main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.page {
  display: block;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

main img, .soon {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: calc((100vh - var(--nav-h)) * var(--ratio));
  max-width: calc((100svh - var(--nav-h) - env(safe-area-inset-bottom)) * var(--ratio));
  height: auto;
}

.soon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75em;
  aspect-ratio: var(--ratio);
  box-sizing: border-box;
  border: 1px solid #222;
  color: #888;
  font-size: 1.125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.soon .num {
  color: #eee;
  font-size: clamp(1.75rem, 8vw, 3rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: var(--nav-h);
  padding: 0 8px env(safe-area-inset-bottom);
  user-select: none;
}

nav a, nav span {
  box-sizing: border-box;
  min-width: 44px;
  padding: 10px 12px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #111;
  color: #eee;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

nav a:hover, nav a:focus-visible {
  border-color: #666;
  background: #1c1c1c;
}

nav a:active {
  background: #262626;
}

nav span {
  border-color: #1a1a1a;
  background: none;
  color: #3a3a3a;
}

nav span.count {
  min-width: 4.5em;
  padding: 10px 4px;
  border: none;
  color: #888;
}

.notice {
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  text-align: center;
}

.notice h1 {
  margin: 0 0 0.5em;
  color: #eee;
  font-size: clamp(1.75rem, 8vw, 3rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.notice p {
  margin: 0;
  color: #888;
  font-size: 1.125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.notice a {
  color: #ccc;
}

.soon .missed {
  margin-top: 3em;
  color: #444;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.soon .missed:hover, .soon .missed:focus-visible {
  color: #888;
}

.explained {
  max-width: 40rem;
  margin: 0 auto;
  padding: 24px 16px 64px;
  color: #ccc;
}

.explained h1, .explained h2 {
  color: #eee;
  font-weight: 600;
}

.explained a {
  color: #ddd;
}

.explained figure {
  margin: 1.5em 0;
}

.explained figure img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
}

.quality {
  position: relative;
}

.quality summary {
  box-sizing: border-box;
  min-width: 44px;
  padding: 10px 12px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #111;
  color: #888;
  text-align: center;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.quality summary::-webkit-details-marker {
  display: none;
}

.quality[open] summary {
  border-color: #666;
  color: #eee;
}

.quality .menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 15rem;
  padding: 8px;
  border: 1px solid #333;
  border-radius: 12px;
  background: #111;
}

.quality button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 12px;
  border: 1px solid #222;
  border-radius: 8px;
  background: none;
  color: #eee;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.quality button small {
  color: #888;
}

.quality button[aria-pressed="true"] {
  border-color: #888;
  background: #222;
}

.quality .hint {
  margin: 0;
  color: #888;
  font-size: 0.85rem;
}

.quality .hint:empty {
  display: none;
}

iframe.ahead { position: absolute; left: 0; top: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }

nav {
  position: relative;
}

nav a.dev {
  position: absolute;
  bottom: calc(1px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  min-width: 0;
  padding: 0 4px;
  border: none;
  background: none;
  color: #666;
  font-size: 10px;
  line-height: 12px;
}
