/* 고운바탕(OFL). 이 사이트가 쓰는 글자만 추린 파일이다(scripts/build-font.js). */
@font-face { font-family: 'Gowun Batang'; font-weight: 400; font-display: swap; src: url('/fonts/gowun-batang-400.woff2?v=campfire-18') format('woff2'); }
@font-face { font-family: 'Gowun Batang'; font-weight: 700; font-display: swap; src: url('/fonts/gowun-batang-700.woff2?v=campfire-18') format('woff2'); }
/* 번체 중국어 화면용. 그 화면에서 쓰는 글자만 들어 있다(scripts/build-font-tc.js). */
@font-face { font-family: 'LXGW WenKai TC'; font-weight: 400; font-display: swap; src: url('/fonts/wenkai-tc-400.woff2?v=8') format('woff2'); }
@font-face { font-family: 'LXGW WenKai TC'; font-weight: 700; font-display: swap; src: url('/fonts/wenkai-tc-700.woff2?v=8') format('woff2'); }
:root { color-scheme: dark; --text: #f4e9d7; --muted: #ccc1b1; --line: #e5e9ed26; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: #121623; color: var(--text); font-family: system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; line-height: 1.6; word-break: keep-all; -webkit-font-smoothing: antialiased; }
#tank { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; border: 1px solid var(--line); background: transparent; transition: background .2s, border-color .2s, opacity .2s; }
button:hover { background: #ffffff12; border-color: #e9edea70; }
button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid #e8d8b5; outline-offset: 5px; }
.site-header { position: absolute; top: 0; left: 0; right: 0; width: min(100%, 760px); margin-inline: auto; padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; z-index: 3; }
.header-controls { display: flex; align-items: center; gap: 4px; }
.language-picker { position: relative; }
.language-picker summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: 0 .65rem;
  list-style: none;
  cursor: pointer;
}
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary::after {
  content: '';
  width: .38rem;
  height: .38rem;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
}
.language-picker[open] summary::after { transform: translateY(2px) rotate(225deg); }
.language-picker nav {
  position: absolute;
  z-index: 1;
  right: 0;
  top: 100%;
  min-width: 9rem;
  padding: 5px;
  background: url('/paper-grain.png'), #ebd6ad;
  color: #39291f;
  border: 1px solid #a97953;
  border-radius: 4px 7px 5px 6px;
  box-shadow: 2px 4px 0 #17152180;
}
.language-picker nav :is(a, strong) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  color: inherit;
  font: inherit;
  white-space: nowrap;
  text-decoration: none;
}
.language-picker nav :is(a:hover, strong) { background: #6c4c2922; }
.theme-toggle:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 .65rem;
  border: 0;
}
.theme-icon { font: 1rem system-ui; }
.language-picker nav strong::after { content: '✓'; margin-inline-start: auto; font-family: system-ui; }


#brand { min-height: 44px; padding: 8px 14px; font-size: 1rem; font-weight: 700; letter-spacing: .03em; --button-paper: #ead5ae; }
#brand:hover { background: transparent; }
body[data-state='done'] #brand { display: none; }
body[data-state='done'] .header-controls { margin-inline-start: auto; }
main { min-height: 100svh; padding: 130px 10vw 48px; }
.panel { display: none; max-width: 600px; }
body[data-state='idle'] #idle, body[data-state='done'] #done { display: block; animation: arrive .65s ease both; }
@keyframes arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { font-size: .65rem; letter-spacing: .18em; color: #c9c9c6; margin: 0 0 22px; }
h1 { font-family: 'Gowun Batang', 'AppleMyungjo', 'Nanum Myeongjo', serif; font-weight: 700; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.35; letter-spacing: -.035em; margin: 0; }
h1 em { font-style: normal; color: #d9cdb9; }
/* Keep a lone last character (often in Chinese) from dropping to its own line. */
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
.sub { font-size: 1.0625rem; color: var(--muted); margin: 12px 0; }
#subline { display: flex; align-items: center; gap: 8px; }
#subline:empty { display: none; }
#subline::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #aebead; }
#start { display: flex; justify-content: center; align-items: center; min-height: 44px; margin-top: 28px; border-radius: 5px; background: #e6decd; color: #263039; border-color: #e6decd; padding: 13px 21px; font-size: 1.0625rem; }
#start:hover { background: #f2eada; }
.fine { color: var(--muted); font-size: 1rem; line-height: 1.8; margin: 14px 0 0; }
.info-toggle { margin: 20px 6px 0; padding: 8px; border: 0; text-decoration: underline; text-underline-offset: 5px; color: var(--muted); font-size: .95rem; }
.info-panel {
  /* iPad Safari stretches a popover pinned to all four edges to the full screen height.
     Pin only the top-left corner and center with a transform so the height follows the content. */
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(440px, calc(100% - 32px));
  height: auto;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #191f2d;
  color: var(--text);
  text-align: left;
  font-size: 1rem;
  line-height: 1.8;
}
.info-panel::backdrop { background: #090c1460; }
.info-panel p:first-child { margin-top: 0; }
.info-panel p:last-child { margin-bottom: 0; }
.invite { color: #e0cfab; font-size: 1rem; margin: 0 0 30px; }
.invite:empty, .sub:empty { display: none; }
.rest-controls { display: none; position: fixed; z-index: 5; bottom: max(25px, env(safe-area-inset-bottom)); gap: 12px; align-items: center; justify-content: space-between; pointer-events: none; }
body[data-state='zoning'] {
  --rest-gutter: clamp(20px, 5vw, 72px);
  --rest-left: max(var(--rest-gutter), calc(env(safe-area-inset-left) + 16px));
  --rest-right: max(var(--rest-gutter), calc(env(safe-area-inset-right) + 16px));
}
@media (orientation: landscape) and (max-height: 500px) {
  body[data-state='zoning'] { --rest-gutter: clamp(28px, 9vw, 88px); }
}
.rest-controls, .rest-toolbar {
  left: var(--rest-left);
  right: var(--rest-right);
  max-width: min(720px, calc(100% - var(--rest-left) - var(--rest-right)));
  margin-inline: auto;
}
body[data-state='zoning'] .rest-controls { display: flex; }
.rest-controls button { pointer-events: auto; min-height: 44px; padding: 9px 16px; border-radius: 5px; background: #14233460; }
:is(#finish, #again, #share, #home, #room-toggle, #start, #brand) {
  isolation: isolate;
  position: relative;
  border: 0;
  background: transparent;
  color: #39291f;
  filter: drop-shadow(1px 2px 0 #120e189c);
}
:is(#finish, #again, #share, #home, #room-toggle, #start, #brand)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url('/paper-grain.png') 0 0 / 48px 48px, var(--button-paper, #ddbd8e);
  clip-path: polygon(1% 6%, 29% 2%, 64% 5%, 97% 0, 100% 33%, 98% 72%, 100% 94%, 60% 97%, 37% 95%, 3% 100%, 0 66%);
}
:is(#finish, #again, #share, #home, #room-toggle, #start, #brand):is(:hover, :active, :focus-visible)::before { background-color: #efd3a2; }
.clock { font-variant-numeric: tabular-nums; margin: 0; pointer-events: none; }
body[data-state='zoning'] :is(#rest-total, .clock, #finish, #rest-room-toggle, #fire-sound, .rest-toolbar .theme-toggle) {
  font-size: 1rem;
  font-weight: 700;
}
/* 가만히 있으면 버튼과 커서가 가라앉고 풍경만 남는다. 마우스를 움직이면 다시 나온다.
   키보드로 초점을 둔 동안에는 숨기지 않는다. */
.rest-controls { transition: opacity 1.5s ease; }
body[data-state='zoning'][data-quiet] { cursor: none; }
.departure-note {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 62px));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 8px 13px;
  text-align: center;
  border-radius: 6px;
  background: #142031e8;
  color: var(--muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
body[data-state='zoning'] .site-header { display: none; }
.departure-note[hidden] { display: none; }
body[data-state='done'] main {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(104px, 23svh, 200px) 24px 36px;
}
#done { margin-inline: auto; text-align: center; }
#done .actions { flex-wrap: wrap; justify-content: center; }
#done #home { margin-inline: auto; }
#done h1 { font-size: clamp(2.3rem, 5vw, 4rem); margin-bottom: 28px; }
.actions { display: flex; gap: 10px; margin-top: 30px; }
.actions button { border-radius: 5px; padding: 12px 20px; font-size: 1rem; }
#again { --button-paper: #e6c593; }
#share { --button-paper: #ead5ae; }
#home { --button-paper: #d8bb92; min-height: 44px; padding-inline: 14px; text-decoration: none; }
.text-button { display: block; border: 0; color: #c5cdd2; margin-top: 20px; padding: 10px 0; font-size: .95rem; text-decoration: underline; text-underline-offset: 5px; }
body[data-state='zoning'] main { padding: 0; }
@media (min-width: 1100px) and (min-height: 800px) { main { padding-top: 18vh; } }
@media (max-width: 600px) {
  .site-header { padding: 20px 24px; }
  main { padding: 115px 26px 35px; }
  h1 { font-size: clamp(1.85rem, 8vw, 2.6rem); }
  .eyebrow { margin-bottom: 20px; }
  .rest-controls { bottom: max(20px, env(safe-area-inset-bottom)); gap: 5px; }
  .rest-controls button { padding: 9px 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; } }

body[data-state="idle"] main { display: grid; place-items: center; padding: 95px 24px 50px; }
#idle { text-align: center; }
#idle #start { margin-inline: auto; }
#subline { justify-content: center; }

/* 점이 무엇을 뜻하는지. 화면의 점과 같은 색을 쓴다. */
.legend { list-style: none; margin: 26px auto 0; padding: 0; display: inline-flex; flex-direction: column; gap: 6px; text-align: left; color: var(--muted); font-size: .75rem; }
.legend li { display: flex; align-items: center; gap: 10px; }
.swatch { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #ffd98c; box-shadow: 0 0 9px 3px #ffd27a66; }
.swatch.settled { background: #ff9a5c; box-shadow: 0 0 9px 3px #ff8f4d66; }
.swatch.trace { background: #62646b; box-shadow: none; }
#idle .fine { max-width: 30rem; margin-inline: auto; }
#idle .fine strong { color: var(--text); font-weight: 700; }
.noscript { max-width: 30rem; margin: 20vh auto 0; text-align: center; color: var(--muted); font-size: .85rem; }

body[data-state="idle"] main { padding-top: 42svh; align-items: start; }

#camp-targets { display: none; }
body[data-state='done'] #camp-targets { display: none; }
@media (min-width: 720px) and (hover: hover), (min-width: 1024px) {
  #camp-targets { display: block; position: fixed; z-index: 2; inset: 0; pointer-events: none; }
  #camp-targets button {
    position: absolute;
    transform: translate(-50%, -38%);
    clip-path: polygon(38% 0, 62% 0, 62% 32%, 82% 41%, 96% 53%, 100% 67%, 100% 82%, 90% 94%, 71% 100%, 29% 100%, 8% 94%, 0 80%, 0 61%, 9% 48%, 24% 39%, 38% 32%);
    border: 1px solid transparent;
    pointer-events: auto;
  }
  #camp-targets button:focus-visible { background: #ffd69924; }
  #camp-targets button[aria-disabled='true'],
  #camp-targets button[aria-pressed='true'] { cursor: default; }
  #camp-targets button:hover:not(:focus-visible) { background: transparent; border-color: transparent; }
}

#rest-total {
  margin: 0 auto 0 0;
  min-width: 0;
  color: var(--muted);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
:is(#rest-total, .clock) {
  isolation: isolate;
  padding: 6px 12px;
  color: #39291f;
  line-height: 1.4;
  filter: drop-shadow(1px 2px 0 #120e189c);
}
#rest-total { position: relative; }
:is(#rest-total, .clock)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('/paper-grain.png') 0 0 / 48px 48px, #ddbd8e;
  clip-path: polygon(2% 8%, 29% 3%, 59% 5%, 96% 0, 100% 26%, 98% 59%, 100% 92%, 65% 95%, 39% 93%, 4% 100%, 0 73%, 1% 37%);
}
.clock::before {
  background-color: #ead5ae;
  clip-path: polygon(0 4%, 33% 0, 63% 5%, 98% 2%, 97% 36%, 100% 68%, 96% 98%, 66% 94%, 32% 100%, 2% 95%, 3% 65%, 0 37%);
}
#idle .live-count { color: #e8d9bf; font-variant-numeric: tabular-nums; }



.animal-choice {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-inline-size: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  font-weight: 700;
}
.animal-choice legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.animal-choice label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding-inline: 10px;
  position: relative;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}
.animal-choice input { position: absolute; opacity: 0; margin: 0; }
.animal-choice canvas { width: 40px; height: 24px; pointer-events: none; }
.animal-choice label:has(:checked) { border-color: #c8a376; background: #dfbd8e24; }
.animal-choice label:has(:focus-visible) { outline: 2px solid #f2ddbc; outline-offset: 2px; }
.room-entry { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
#idle .room-entry #start { margin: 0; }
#room-toggle { min-height: 44px; padding: 8px 12px; border-radius: 5px; }


body[data-state="idle"] #camp-targets { display: none; }

body[data-state="idle"] main { padding-top: calc(32svh + clamp(48px, 7svh, 64px)); }
@media (max-width: 719px), (max-width: 1023px) and (hover: none) {
  body[data-state="idle"] main { padding-top: 41svh; }
}
#share-panel { text-align: center; max-width: 360px; padding: 38px 16px 16px; }
.share-close { position: absolute; top: 0; right: 2px; width: 44px; height: 38px; border: 0; font-size: 1.25rem; }
#share-photo-image:not([hidden]) { display: block; width: auto; max-width: 100%; max-height: 61dvh; margin: 0 auto; border-radius: 8px; }
.share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.share-actions :is(a, button) { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 10px; color: #e6cda8; border: 0; text-decoration: underline; text-underline-offset: 5px; }
.share-actions :is(a, button):hover { background: transparent; color: var(--text); }
.share-actions [hidden] { display: none; }


/* With many rooms the list scrolls inside a box of at most four rows. */
#room-select { width: min(460px, calc(100% - 32px)); max-height: min(330px, calc(100dvh - 120px)); overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
#room-select:popover-open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 8px; }
#room-select button { display: grid; place-content: center; gap: 4px; min-height: 68px; padding: 8px 4px; text-align: center; }
#room-select button span { color: #634c3a; font-size: .8rem; font-variant-numeric: tabular-nums; }

button:disabled { opacity: .45; }
.fire-arrows { display: none; }
body[data-state="zoning"] .fire-arrows { display: flex; position: fixed; z-index: 3; inset: 0 16px; align-items: center; justify-content: space-between; pointer-events: none; }
.fire-arrows button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: manipulation;
}
.fire-arrows button::before {
  content: '';
  width: 8px;
  height: 14px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%, 0 82%, 72% 50%, 0 18%);
}
#fire-prev::before { transform: scaleX(-1); }
@media (min-width: 720px) and (hover: hover), (min-width: 1024px) {
  body[data-state="zoning"] .fire-arrows { display: none; }
}
/* 휴식 화면 상단의 방 전환과 소리 */
.rest-toolbar { display: none; }
body[data-state='zoning'] .rest-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0 8px;
  position: fixed;
  z-index: 5;
  top: max(20px, env(safe-area-inset-top));
  pointer-events: none;
}
#rest-total { grid-column: 1; grid-row: 1; }
.rest-toolbar .theme-toggle { grid-column: 2; grid-row: 1; }
#fire-sound { grid-column: 3; grid-row: 1; }
#rest-room-toggle { grid-column: 1 / -1; grid-row: 2; justify-self: end; }
.rest-toolbar :is(button, summary) { pointer-events: auto; }
@media (max-width: 600px) {
  .site-header { padding-inline: 16px; gap: 8px; }
  .header-controls { flex-wrap: wrap; justify-content: flex-end; }
  body[data-state='zoning'] .rest-toolbar { gap: 0 4px; }
}
.rest-toolbar button {
  min-height: 44px;
  padding: 0 5px;
  border: 0;
  color: var(--muted);
}
.rest-toolbar > button:hover:not([aria-pressed='true']) { background: transparent; color: var(--text); }
#fire-sound { display: flex; align-items: center; gap: 5px; }
#fire-sound:is(:hover, :active) { background: transparent; }
.speaker { position: relative; width: 20px; height: 18px; }
.speaker::before { content: ''; position: absolute; inset: 3px 9px 3px 0; background: currentColor; clip-path: polygon(0 30%, 36% 30%, 100% 0, 100% 100%, 36% 70%, 0 70%); }
.speaker::after { content: ''; position: absolute; right: 2px; top: 4px; width: 7px; height: 10px; border-right: 1.5px solid currentColor; border-radius: 50%; }
#fire-sound[aria-pressed="false"] .speaker::after {
  content: '×';
  top: 0;
  right: -2px;
  width: auto;
  height: 18px;
  border: 0;
  border-radius: 0;
  font: 600 14px/18px system-ui;
}

.room-entry :is(#room-toggle, #start) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 5px;
  font-size: 1rem;
  line-height: 1.4;
}
.about-page main { max-width: 680px; margin-inline: auto; padding: clamp(48px, 10vw, 108px) 24px 64px; }
.about-page { height: auto; min-height: 100svh; line-height: 1.8; isolation: isolate; }
#about-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 68% 88%, #d6a28c12, transparent 48%),
    linear-gradient(#121623, #191f2d 55%, #1c2230 83%, #171c28);
}
.about-page p { margin: 0; color: var(--muted); line-height: 1.8; }
.about-page :is(h1, h2, summary) + p { margin-top: 12px; }
.about-page h1 { font-family: inherit; text-align: center; }
.about-page .about-name { margin-top: 6px; font-size: .95rem; }
.about-page header { text-align: center; }
.about-page header p:not(.about-brand) { max-width: 34rem; margin-inline: auto; line-height: 1.8; }
.about-page h2 { font-size: 1.15rem; margin: 0; }
.about-page a { color: inherit; }

#idle :is(.fine, .info-toggle) { font-weight: 700; font-family: 'Gowun Batang', 'AppleMyungjo', 'Nanum Myeongjo', serif; }
#idle .info-toggle { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; text-decoration: none; }
/* Underline only the words on hover: no button tint, and the icon stays clean. */
#idle .info-toggle:hover { background: transparent; }
#idle .info-toggle:hover > :not(.home-icon) { text-decoration: underline; text-underline-offset: 5px; }
.home-icon { display: inline-grid; place-items: center; width: 14px; height: 14px; flex: 0 0 14px; font: 12px/1 system-ui; color: #dcc5a4; }
.icon-book { height: 11px; border: 1px solid currentColor; border-radius: 2px; }
.icon-book::after { content: ''; height: 100%; border-left: 1px solid currentColor; }

.about-camp { display: block; width: min(100%, 460px); height: auto; margin: 20px auto 16px; }

/* Same max width as the home header, so the back link and language menu do not drift apart on wide screens. */
.about-nav { width: min(100%, 760px); margin-inline: auto; padding: 18px 24px 0; }
.about-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; text-decoration: none; }
.about-nav a:hover { text-decoration: underline; }
.about-page main { padding-top: clamp(20px, 6vw, 56px); }

.about-credits { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .875rem; }

.about-credits strong { margin-inline-start: .35em; color: var(--text); }

/* 메인 화면은 글자 전부를 제목과 같은 고운바탕으로 맞춘다.
   글꼴 파일에는 index.html과 app.js의 글자만 들어 있어서 소개 페이지는 빼 둔다. */
body { font-family: 'Gowun Batang', 'AppleMyungjo', 'Nanum Myeongjo', serif; }
.about-points { margin: 0; padding-inline-start: 1.1em; color: var(--muted); line-height: 1.9; }
.about-points li + li { margin-top: 6px; }
.about-privacy { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); line-height: inherit; }
.about-privacy summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--text); list-style: none; }
.about-privacy summary::-webkit-details-marker { display: none; }
.about-privacy summary::after { content: '+'; margin-inline-start: auto; color: var(--muted); }
.about-privacy[open] summary::after { content: '−'; }
.about-privacy ul { margin: 4px 0 0; padding-inline-start: 1.1em; }
.about-privacy li + li { margin-top: 4px; }
.about-privacy ul + p, .about-privacy p + p { margin-top: 14px; }

#room-toggle::after { content: ''; width: 6px; height: 6px; margin: -3px 0 0 8px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); }
.about-page header p:not(.about-brand) { max-width: 30em; text-align: center; text-wrap: balance; }
.about-page header p + p { margin-top: .85em; }
/* Chinese breaks between any two characters, which can split a word (畫|面). Here it breaks only at
   punctuation and the <wbr> marks between phrases in i18n.js. */
html:lang(zh-TW) .about-page header p { word-break: keep-all; }
.about-page main header strong { color: var(--text); }
.about-page .about-points { margin-top: 12px; }

/* 언어별 글꼴과 줄바꿈.
   번체 중국어는 고운바탕 대신 霞鶩文楷 TC를 쓴다. 대만에서 많이 쓰는 해서체라 외국 글꼴 티가 나지 않는다.
   글꼴이 늦게 오거나 빠진 글자가 있으면 번체 명조로 보인다(AppleMyungjo는 한국 한자라 피한다). */
html:lang(zh-TW) :is(body, h1, #idle .fine, #idle .info-toggle) {
  font-family: 'LXGW WenKai TC', 'Songti TC', 'Noto Serif TC', 'Noto Serif CJK TC', PMingLiU, serif;
  letter-spacing: .02em;
}
/* keep-all은 띄어쓰기 없는 중국어를 한 줄로 붙여 버린다. */
html:lang(zh-TW) body { word-break: normal; line-break: strict; }
html:lang(en) body { word-break: normal; overflow-wrap: break-word; }

.about-nav { display: flex; align-items: center; justify-content: space-between; }
html:lang(en) #headline { font-size: clamp(1.75rem, 5.5vw, 2.8rem); text-wrap: balance; }

/* Emoji to my fire: tap my own cat. An invisible button follows my cat (app.js moves it every frame)
   and opens five choices just above it; while waiting, only the time left shows (no choices). */
#react-toggle {
  position: fixed; z-index: 4; transform: translate(-50%, -50%);
  padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
#react-toggle[hidden] { display: none; }
#react-toggle:focus-visible { outline: 2px solid #ffd99c; outline-offset: 2px; }
#react-select {
  inset: auto; transform: translate(-50%, -100%); width: auto; margin: 0;
  padding: 6px; max-width: calc(100% - 16px);
}
#react-select.below-cat { transform: translateX(-50%); }
#react-select:popover-open { display: flex; gap: 2px; align-items: center; }
#react-select::backdrop { background: transparent; }
#react-select button { width: clamp(34px, 11vw, 44px); height: 44px; padding: 0; font-size: 1.35rem; line-height: 1; }

#react-wait { padding: 8px 14px; color: #493627; font-size: .95rem; font-variant-numeric: tabular-nums; }
/* Time left only: show, then fade away before the menu closes itself (app.js, WAIT_SHOW_MS). */
#react-select.only-time { animation: wait-fade 2s ease-in forwards; }
@keyframes wait-fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #react-select.only-time { animation: none; } }

/* Cut cardstock backing and individual offcuts, with print grain on both layers. */
:is(#room-select, #react-select) {
  --paper-grain: url('/paper-grain.png');
  color: #3f2d22;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  isolation: isolate;
  overflow: visible;
  filter: drop-shadow(2px 5px 4px #14101bc2);
}
:is(#room-select, #react-select)::before {
  content: '';
  position: absolute;
  inset: 1px 0 0;
  z-index: -1;
  pointer-events: none;
  background: var(--paper-grain), #be9569;
  clip-path: polygon(0 10%, 2% 3%, 31% 2%, 65% 0, 98% 3%, 100% 14%, 99% 91%, 95% 98%, 39% 100%, 1% 97%);
}
#room-select { overflow-y: auto; }
:is(#room-select, #react-select) button {
  --card-paper: #eddbb8;
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background: none;
  filter: drop-shadow(1px 2px 0 #69472966);
}
:is(#room-select, #react-select) button::before {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  pointer-events: none;
  background: var(--paper-grain), var(--card-paper);
  clip-path: polygon(2% 5%, 15% 2%, 97% 0, 100% 85%, 96% 98%, 3% 100%, 0 83%);
}
:is(#room-select, #react-select) button:nth-child(even)::before {
  clip-path: polygon(0 1%, 97% 4%, 100% 91%, 91% 99%, 1% 97%);
}
:is(#room-select, #react-select) button:is(:hover, :focus-visible, [aria-pressed="true"]) {
  --card-paper: #f4c577;
}

.room-entry #room-toggle { --button-paper: #ead5ae; }
.room-entry #start { --button-paper: #e6c593; }
.room-entry :is(#room-toggle, #start),
#done :is(#again, #share, #home) {
  background: transparent;
  border: 0;
  color: #21150f;
  font-weight: 700;
}

@media (min-width: 700px) and (max-width: 1200px) and (hover: none) {
  body[data-state='idle'] main { padding-top: calc(33svh + 66px); }
}
@media (min-width: 1600px) and (min-height: 750px) {
  :is(#idle, #done) { max-width: 760px; }
  :is(#idle #headline, #done h1) { font-size: clamp(3.6rem, 3.8vw, 5rem); }
  .room-entry :is(#room-toggle, #start), #done :is(#again, #share, #home) {
    min-height: 54px;
    padding-inline: 20px;
    font-size: 1.2rem;
  }
  #idle :is(.fine, .info-toggle), #done .sub { font-size: 1.12rem; }
  body[data-state='idle'] main { padding-top: calc(32svh + 92px); }
}

.rest-debug {
  position: fixed;
  z-index: 10;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 8px;
  max-width: calc(100% - 16px);
  background: #111827eb;
  color: #fff;
  font: 11px/1.3 monospace;
  white-space: pre-wrap;
  pointer-events: none;
}

#result :is(.result-duration, .result-phrase) { display: inline-block; white-space: nowrap; }
@media (max-width: 480px) {
  #done h1 { font-size: clamp(1.625rem, 7vw, 2.1rem); }
}
