* { box-sizing: border-box; }

body {
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 16px;
  background: #f7f7fb;
  color: #1c1c28;
}

main { width: 100%; max-width: 640px; }

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #f7f7fb;
}
.age-gate[hidden] { display: none; }

/* While the banner is up, the content behind it must not be reachable with
   the keyboard. */
body.gated main { visibility: hidden; }

.age-box {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(20, 20, 40, 0.12);
  text-align: center;
}
.age-box h2 { font-size: 18px; margin: 0 0 12px; }
.age-box p { font-size: 13px; color: #55556a; margin: 0 0 12px; }
.age-box .age-note { font-size: 12px; color: #8a8a9c; }
.age-box .submit-btn { margin-top: 4px; }

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.head-btn {
  padding: 3px 10px;
  border: 1px solid #dcdce8;
  border-radius: 6px;
  background: #fff;
  color: #55556a;
  font-size: 12px;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
}
.head-btn:hover {
  border-color: #b9b9cc;
  color: #33334a;
}
.head-btn:active {
  background: #f2f2f8;
}
.lang {
  padding: 3px 6px;
  border: 1px solid #dcdce8;
  border-radius: 6px;
  background: #fff;
  color: #55556a;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
h1 { font-size: 20px; margin: 0; }

#card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 24px rgba(20, 20, 40, 0.08);
}

/* The picture area is a square that uses the whole width of the card. That
   way the frame looks the same on a phone and on a desktop, and the border
   around the picture is spread evenly. The picture keeps its full size and
   is only letterboxed, never cropped. */
#imgwrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
}
#imgwrap img { width: 100%; height: 100%; object-fit: contain; display: block; }

#image.enter { animation: pop 220ms ease-out; }
@keyframes pop {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #image.enter { animation: none; }
  #score.bump-up, #score.bump-down { animation: none; }
  .status.fading { transition: none; }
}

#vote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 16px 0 12px;
}

/* The captcha sits above the vote buttons so the layout does not jump. */
#captcha-row {
  display: flex;
  justify-content: center;
  margin: 12px 0 0;
  min-height: 0;
}
#captcha-row:empty { display: none; }

.vote-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid #e2e2ec;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.vote-btn.up:hover { background: #e8f7ee; border-color: #35b96a; }
.vote-btn.down:hover { background: #fdeaea; border-color: #e05a5a; }
.vote-btn:active { transform: scale(0.92); }
.vote-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.scorebox { display: flex; flex-direction: column; align-items: center; min-width: 74px; }
#score { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.scorebox small { font-size: 11px; color: #8a8a9c; text-transform: uppercase; letter-spacing: .08em; }

#score.bump-up { animation: bumpUp 500ms ease-out; }
#score.bump-down { animation: bumpDown 500ms ease-out; }
@keyframes bumpUp {
  0% { transform: scale(1); color: #1c1c28; }
  35% { transform: scale(1.35); color: #35b96a; }
  100% { transform: scale(1); color: #1c1c28; }
}
@keyframes bumpDown {
  0% { transform: scale(1); color: #1c1c28; }
  35% { transform: scale(1.35); color: #e05a5a; }
  100% { transform: scale(1); color: #1c1c28; }
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
}

.ghost {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #e2e2ec;
  background: #fafaff;
  color: #55556a;
  font-size: 13px;
  cursor: pointer;
}
.ghost:hover { background: #f0f0f8; }
.ghost:disabled {
  opacity: 0.5;
  cursor: default;
}
.ghost:disabled:hover { background: #fafaff; }

.ghost-small {
  padding: 3px 8px;
  font-size: 11px;
  color: #9a9aac;
}

.report-row {
  justify-content: center;
  margin-top: 8px;
}

.report-form {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #e2e2ec;
  border-radius: 10px;
  background: #fafaff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-form[hidden] { display: none; }

.status { font-size: 12px; color: #a05050; }
.status.fading {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.idline {
  margin-top: 10px;
  font-size: 11px;
  color: #a0a0b0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

.idline-label { color: #8a8a9c; }
.idline-link { color: #7a8ab0; text-decoration: none; }
.idline-link:hover { color: #5a6a90; text-decoration: underline; }

.idline-row { margin-top: 2px; }
.idline-tag { color: #8a8a9c; }

/* The post of a picture stands above the addresses of the pictures. The gap
   keeps the two apart, so the eye finds the post first. */
.idline-row + .idline-row { margin-top: 5px; }
.idline-row.idline-post { margin-bottom: 9px; }

.idline-more { margin-top: 4px; }
.idline-summary {
  color: #8a8a9c;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
}
.idline-summary:hover { color: #55556a; }
.idline-more .idline-link { display: block; margin-top: 2px; }

.submit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e8e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.submit-label {
  font-size: 12px;
  color: #8a8a9c;
}

.submit-row {
  display: flex;
  gap: 6px;
}

.submit-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #e2e2ec;
  background: #fafaff;
  color: #33334a;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.submit-input:focus {
  outline: none;
  border-color: #b8b8d0;
}

.submit-btn {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #e2e2ec;
  background: #f0f0f8;
  color: #55556a;
  font-size: 13px;
  cursor: pointer;
}
.submit-btn:hover:not(:disabled) { background: #e6e6f2; }
.submit-btn:disabled { opacity: 0.55; cursor: default; }

/* The spinner that stands in for the button while the picture is taken. */
.submit-btn.submitting {
  color: transparent;
  position: relative;
  pointer-events: none;
}

/* The site gives the button its own colour, and its rules are more specific
   than the ones above, so the word has to be hidden from them as well. */
html body .submit-btn.submitting {
  color: transparent;
}

/* The width of the button is set by its word, so the spinner stands in the
   middle of that space and the button does not jump when it appears. */
.submit-btn.submitting {
  min-width: 72px;
}

.submit-btn.submitting::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  margin: -7px 0 0 -7px;
  border: 2px solid #c8c8dc;
  border-top-color: #66668a;
  border-radius: 50%;
  animation: submit-spin 0.7s linear infinite;
}

@keyframes submit-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .submit-btn.submitting::after { animation-duration: 2s; }
}

.submit-status { font-size: 11px; color: #a05050; }
.submit-status:empty { display: none; }

/* ------------------------------------------------------------ leaderboard */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tab {
  padding: 4px 10px;
  border: 1px solid #e2e2ec;
  border-radius: 8px;
  background: #fff;
  color: #55556a;
  font-size: 12px;
  cursor: pointer;
}
.tab:hover { background: #f0f0f8; }
.tab.active {
  background: #f0f0f8;
  border-color: #d0d0e0;
  color: #33334a;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.board-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #e8e8f0;
  border-radius: 12px;
  background: #fff;
}

/* The picture the visitor clicked on the main page. */
.board-item-highlight {
  border-color: #b9b9e0;
  box-shadow: 0 0 0 2px rgba(120, 120, 200, 0.18);
}

.board-rank {
  flex: 0 0 auto;
  width: 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #a0a0b0;
}

.board-pic {
  flex: 0 0 auto;
  width: 90px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
}

.board-info {
  flex: 1 1 auto;
  min-width: 0;
}

.board-score {
  font-size: 13px;
  color: #33334a;
}

.hint { margin-top: 12px; font-size: 12px; color: #8a8a9c; text-align: center; }

/* The teaser under the voting area. It shows the best pictures in two
   columns so the page invites people to look at them. */
.teaser {
  margin-top: 20px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(20, 20, 40, 0.08);
}

.teaser-title {
  margin: 0 0 10px;
  font-size: 15px;
  color: #33334a;
}

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.teaser-item {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  aspect-ratio: 1 / 1;
}

.teaser-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.teaser-score {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
}

.teaser-item:hover img { opacity: 0.85; }

.teaser-more {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
}
.teaser-more a { color: #7a7a8c; text-decoration: none; }
.teaser-more a:hover { color: #55556a; text-decoration: underline; }

@media (max-width: 420px) {
  .teaser-grid { gap: 6px; }
}

/* The gallery wall. It fills the screen with tiles of the best pictures. */
.gallery-body {
  display: block;
  padding: 16px;
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto 12px;
}

.gallery-body .tabs {
  max-width: 1400px;
  margin: 0 auto 16px;
}

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-width: 1400px;
  margin: 0 auto;
}

.wall-tile {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  aspect-ratio: 1 / 1;
}

.wall-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wall-score {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
}

.wall-tile:hover img { opacity: 0.85; }

.gallery-body .status {
  max-width: 1400px;
  margin: 12px auto 0;
}

@media (max-width: 600px) {
  .wall { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #d8d8e4;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  font-family: inherit;
  font-size: 11px;
  color: #55556a;
}

.legal-links {
  margin-top: 8px;
  font-size: 12px;
  color: #8a8a9c;
  text-align: center;
}
.legal-links a { color: #8a8a9c; text-decoration: none; }
.legal-links a:hover { color: #55556a; text-decoration: underline; }

.back {
  font-size: 13px;
  color: #7a7a8c;
  text-decoration: none;
}
.back:hover { color: #55556a; }

.legal { font-size: 14px; line-height: 1.6; color: #33334a; }
.legal h2 { font-size: 15px; margin: 18px 0 6px; }
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0 0 10px; }
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: #f2f2f8;
  padding: 1px 4px;
  border-radius: 4px;
}

.turnstile-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.turnstile-wrap[hidden] { display: none; }
.turnstile-wrap small { font-size: 11px; color: #8a8a9c; }

/* The library brings the shape of the site, this file brings the colours.
   These rules come after the library stylesheet, so they win. */

html body {
  background: #faf7f9;
  color: #29262a;
}

html body .age-gate {
  background: #faf7f9;
}

html body .age-box {
  background: #fffafa;
  box-shadow: 0 6px 24px rgba(50, 30, 40, 0.12);
}

html body .age-box h2 { color: #29262a; }
html body .age-box p { color: #665d62; }
html body .age-box .age-note { color: #93878e; }

html body .head-btn {
  border-color: #e7dfe3;
  background: #fffafa;
  color: #665d62;
}
html body .head-btn:hover {
  border-color: #d7cbd1;
  color: #453b41;
}
html body .head-btn:active { background: #f4edf1; }

html body .lang {
  border-color: #e7dfe3;
  background: #fffafa;
  color: #665d62;
}

html body #card {
  background: #fffafa;
  box-shadow: 0 6px 24px rgba(50, 30, 40, 0.08);
}
html body #imgwrap { background: #111; }

html body .vote-btn {
  border-color: #e7dfe3;
  background: #fffafa;
}
html body .vote-btn.up:hover { background: #e8f7ee; border-color: #35b96a; }
html body .vote-btn.down:hover { background: #fdeaea; border-color: #e05a5a; }

html body .scorebox small { color: #93878e; }
html body #score.bump-up { color: #29262a; }
html body #score.bump-down { color: #29262a; }
@keyframes bumpUp {
  0% { transform: scale(1); color: #29262a; }
  35% { transform: scale(1.35); color: #35b96a; }
  100% { transform: scale(1); color: #29262a; }
}
@keyframes bumpDown {
  0% { transform: scale(1); color: #29262a; }
  35% { transform: scale(1.35); color: #e05a5a; }
  100% { transform: scale(1); color: #29262a; }
}

html body .ghost {
  border-color: #e7dfe3;
  background: #fcf9fb;
  color: #665d62;
}
html body .ghost:hover { background: #f4edf1; }
html body .ghost:disabled:hover { background: #fcf9fb; }
html body .ghost-small { color: #93878e; }

html body .report-form {
  border-color: #e7dfe3;
  background: #fcf9fb;
}

html body .status { color: #9b596b; }

html body .idline { color: #93878e; }
html body .idline-label { color: #93878e; }
html body .idline-link { color: #986f81; }
html body .idline-link:hover { color: #704d5d; }
html body .idline-summary { color: #93878e; }
html body .idline-summary:hover { color: #665d62; }

html body .submit { border-top-color: #e9e1e5; }
html body .submit-label { color: #93878e; }
html body .submit-input {
  border-color: #e7dfe3;
  background: #fcf9fb;
  color: #453b41;
}
html body .submit-input:focus { border-color: #cdbdc5; }
html body .submit-btn {
  border-color: #e7dfe3;
  background: #f4edf1;
  color: #665d62;
}
html body .submit-btn:hover:not(:disabled) { background: #ece2e8; }
html body .submit-status { color: #9b596b; }

html body .tab {
  border-color: #e7dfe3;
  background: #fffafa;
  color: #665d62;
}
html body .tab:hover { background: #f4edf1; }
html body .tab.active {
  background: #f4edf1;
  border-color: #d7cbd1;
  color: #453b41;
}

html body .board-item {
  border-color: #e9e1e5;
  background: #fffafa;
}
html body .board-item-highlight {
  border-color: #d0bdc7;
  box-shadow: 0 0 0 2px rgba(140, 100, 120, 0.14);
}
html body .board-rank { color: #93878e; }
html body .board-pic { background: #111; }
html body .board-score { color: #453b41; }
html body .hint { color: #93878e; }

html body .teaser {
  background: #fffafa;
  box-shadow: 0 6px 24px rgba(50, 30, 40, 0.08);
}
html body .teaser-title { color: #453b41; }
html body .teaser-item { background: #111; }
html body .teaser-score {
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
}
html body .teaser-more a { color: #81767c; }
html body .teaser-more a:hover { color: #665d62; }

html body .wall-tile { background: #111; }
html body .wall-score {
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
}

html body kbd {
  border-color: #e3dbe0;
  background: #fffafa;
  color: #665d62;
}

html body .legal-links,
html body .legal-links a { color: #93878e; }
html body .legal-links a:hover { color: #665d62; }
html body .back { color: #81767c; }
html body .back:hover { color: #665d62; }
html body .legal { color: #453b41; }
html body .legal code { background: #f4edf1; }

html body .turnstile-wrap small { color: #93878e; }
