:root {
  color-scheme: light;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #12103c url("assets/stars.png") repeat;
  color: #20203e;
  font-family: "Times New Roman", "Noto Serif TC", "PMingLiU", serif;
  font-size: 17px;
  line-height: 1.55;
}

.page { width: min(880px, calc(100% - 30px)); margin: 25px auto 35px; }
p { margin: 10px 0; }
a { color: #001fc5; text-decoration: underline; }
a:visited { color: #94149f; }
a:hover { color: #d60045; background: #fff4a9; }
a:focus-visible, button:focus-visible { outline: 3px solid #ff3d99; outline-offset: 4px; }

.masthead { text-align: center; color: #fff; }
.web-ring { color: #fff8a9; font-size: 13px; letter-spacing: 2px; }
.title-row { display: flex; align-items: center; justify-content: center; gap: 22px; }
h1 { margin: 0; max-width: 710px; color: #effbff; font-size: clamp(29px, 5vw, 49px); line-height: 1.18; font-style: italic; letter-spacing: -1px; text-shadow: 2px 2px 0 #319cd5, 4px 4px 0 #7634b2, 6px 6px 0 #000; }
.sparkle, .pixel-cat, .construction-line img, .photo-window img { image-rendering: pixelated; }
.subtitle { color: #f1c8ff; font-size: 18px; letter-spacing: 2px; margin: 12px 0 17px; }
.language-links { margin: 0 0 15px; font-size: 14px; line-height: 1.8; color: #bba5e5; }
.language-links a { white-space: nowrap; padding: 2px; color: #80eaff; }
.language-links a:visited { color: #f0bbff; }
.language-links a:nth-of-type(2) { color: #ffec8f; }
.language-links a:nth-of-type(3) { color: #ff9bc0; }
.language-links a:nth-of-type(4) { color: #a6ffad; }
.language-links a:nth-of-type(5) { color: #dbc4ff; }
.language-links a[aria-current="page"] { font-weight: bold; border: 1px dotted currentColor; }
.language-links a:hover { color: #d60045; }
.welcome-strip { margin: 0 auto 14px; max-width: 610px; overflow: hidden; border: 2px ridge #b4b4d2; padding: 4px 12px; background: #08091f; color: #81ffe5; font-size: 15px; }
.welcome-message { display: inline-block; animation: drift 7s ease-in-out infinite alternate; }
.controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 2px 7px; color: #ddd5ff; font-size: 13px; }
button { border: 2px outset #eee; padding: 2px 9px; background: #d6d6d6; color: #111; font-family: inherit; font-size: 13px; cursor: pointer; }
button:active { border-style: inset; }

.outer-table { width: 100%; table-layout: fixed; border: 5px ridge #fff; border-spacing: 6px; background: #3e2a75; box-shadow: 6px 6px 0 #07071a; }
.outer-table td { border: 3px ridge #fff; padding: 18px; vertical-align: top; }
.main-cell { width: 66%; background: #fffbdf; }
.side-cell { background: #e8e1ff; }
.photo-cell { background: #e0f1f4; }
.section-title { margin: 0 0 16px; border: 2px inset #eee; padding: 5px 8px; background: #372068; color: #fff; text-align: center; font-size: 21px; font-weight: bold; }
.intro { min-height: 145px; }
.pixel-cat { float: right; margin: 4px 0 10px 14px; }
.intro strong { color: #872044; }
.small-note { font-size: 14px; color: #66537b; }
.center { text-align: center; }
.rainbow-rule { height: 5px; margin: 17px 0 14px; border: 0; background: linear-gradient(to right, #ee5f86 0 16.6%, #ffa156 16.6% 33.2%, #f5d459 33.2% 49.8%, #69b977 49.8% 66.4%, #5faadf 66.4% 83%, #ab71cf 83% 100%); }
.construction-line { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; color: #9d2417; }
.construction-line img { flex-shrink: 0; }
.construction-line strong { min-width: 0; text-align: center; }
.blinking { animation: blink 1.2s steps(1, end) infinite; }
.link-list { padding: 0 0 0 20px; margin: 15px 0 25px; }
.link-list li { padding: 5px 0; }
.new-label { display: inline-block; margin-left: 3px; color: #d5163b; font-size: 12px; font-style: italic; font-weight: bold; animation: blink 1.2s steps(1, end) infinite; }
.est-box { margin-top: 22px; border: 2px inset #fff; padding: 5px; background: #d0c8e1; text-align: center; }
.est-box p { margin: 4px 0; font-size: 13px; }
.counter { display: inline-flex; padding: 3px; gap: 2px; border: 2px inset #a4a4a4; background: #0d0f0f; }
.counter span { min-width: 24px; border: 1px solid #5c635c; padding: 1px 4px; background: linear-gradient(#0c100e 47%, #6f786e 49%, #161c18 51%); color: #a2ff8e; font-family: "Courier New", monospace; font-weight: bold; font-size: 26px; line-height: 1.1; text-shadow: 1px 1px #000; }
.counter-label { letter-spacing: 3px; color: #534464; }
.visits-box { margin-top: 12px; }
.visits-box button { margin: 6px 0; }
.visits-counter { max-width: 100%; gap: 1px; overflow-x: auto; }
.visits-counter span { min-width: 19px; padding: 1px 3px; color: #fff49a; font-size: 22px; }
.tiny-badge { border: 2px outset #fff; padding: 3px; background: #fff9d6; color: #52216e; text-align: center; font-family: "Courier New", monospace; font-size: 10px; font-weight: bold; line-height: 1.5; }
.tiny-badge span { color: #e84477; }
.html-badge { background: #263158; color: #c4eaff; }

.portrait-slot { display: flex; align-items: center; justify-content: center; gap: 14px; width: max-content; max-width: 100%; margin: 16px auto 23px; padding: 6px 18px; border: 3px ridge #fff; background: #dfdbcf; color: #6b655e; font-size: 13px; }
.portrait-slot .photo-symbol { font-size: 39px; }
.photo-album { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 18px 0 20px; }
.film-frame { min-width: 0; margin: 0; padding: 17px 14px 9px; background-color: #1c1b20; background-image: repeating-linear-gradient(to bottom, transparent 0 10px, #e0f1f4 10px 20px, transparent 20px 30px), repeating-linear-gradient(to bottom, transparent 0 10px, #e0f1f4 10px 20px, transparent 20px 30px); background-position: 3px 0, calc(100% - 3px) 0; background-size: 6px 100%; background-repeat: no-repeat; border: 1px solid #000; box-shadow: 4px 4px 0 #869b9f; }
.photo-window { aspect-ratio: 4 / 5; border: 2px inset #ccc; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 13px; background: #dfdbcf; color: #6b655e; font-size: 17px; }
.photo-symbol { font-size: 59px; line-height: 1.2; color: #999183; }
.photo-window img { opacity: .7; }
.photo-window.has-photo { display: block; position: relative; overflow: hidden; background: #1c1b20; }
.photo-window .real-photo { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; opacity: 1; }
.film-frame figcaption { display: flex; justify-content: space-between; padding: 7px 5px 0; color: #f0e2b4; font-size: 14px; }
.film-frame figcaption a { color: #9cdeff; font-size: 11px; text-align: right; }
.film-frame figcaption a:visited { color: #efb7fa; }
.film-frame figcaption a:hover { color: #d60045; }
.film-number { font-family: "Courier New", monospace; font-size: 12px; color: #d6ae64; }
.photo-note { color: #506570; font-size: 14px; text-align: center; }
footer { padding-top: 17px; color: #e4dcff; text-align: center; font-size: 14px; }
footer a { color: #8cefff; }
footer a:visited { color: #f7c4ff; }
.footer-stars { color: #fff4a6; letter-spacing: 4px; }
.footer-note { font-size: 12px; color: #bcb1d6; }

body.is-paused *, body.is-paused *::before, body.is-paused *::after { animation-play-state: paused !important; }
@keyframes blink { 0%, 100% { opacity: 1; } 55% { opacity: .3; } }
@keyframes drift { from { transform: translateX(-14px); } to { transform: translateX(14px); } }

@media (max-width: 600px) {
  .page { width: calc(100% - 18px); margin-top: 18px; }
  .web-ring { font-size: 10px; letter-spacing: 1px; }
  .title-row { gap: 12px; }
  .sparkle { width: 28px; height: 28px; }
  .subtitle { font-size: 15px; letter-spacing: 1px; }
  .welcome-strip { font-size: 12px; }
  .outer-table { border-width: 4px; border-spacing: 4px; }
  .outer-table > tbody, .outer-table > tbody > tr { display: block; }
  .outer-table > tbody > tr > td { display: block; width: auto; margin: 4px; padding: 14px 12px; }
  .section-title { font-size: 19px; }
  .side-cell { text-align: center; }
  .link-list { display: flex; flex-wrap: wrap; gap: 7px 15px; justify-content: center; margin: 0 0 17px; padding: 0; list-style: none; }
  .est-box { margin: 12px auto; max-width: 210px; }
  .tiny-badge { display: inline-block; margin: 4px; }
  .photo-album { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
  .film-frame { padding: 13px 12px 8px; }
  .photo-window { font-size: 14px; }
  .photo-symbol { font-size: 44px; }
  .photo-window .real-photo { width: 100%; height: 100%; }
  .photo-note { font-size: 12px; }
  .construction-line { gap: 6px; font-size: 12px; }
  .construction-line img { width: 27px; height: 27px; }
}

@media (max-width: 350px) {
  .photo-album { grid-template-columns: 1fr; margin-left: 22px; margin-right: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; }
}
