/* A quiet, original fox-led waiting scene. The document remains scrollable. */
body:has(.waiting-page) {
  background: #fffaf6;
}
body:has(.waiting-page) > .site-header,
body:has(.waiting-page) > .site-footer,
body:has(.waiting-page) .mobile-nav {
  display: none;
}
body:has(.waiting-page) #main,
.page.waiting-page {
  min-height: 100vh;
  min-height: 100svh;
}
.page.waiting-page {
  max-width: none;
  margin: 0;
  padding: 0;
}
.waiting-room {
  --wr-paper: #fffaf6;
  --wr-ink: #4f3930;
  --wr-accent: #9b4e38;
  width: 100%;
  max-width: 1060px;
  min-width: 0;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  color: var(--wr-ink);
  background: var(--wr-paper);
}
.wr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  min-width: 0;
}
.wr-home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  flex: 0 0 auto;
}
.wr-home img {
  width: 104px;
  height: auto;
}
.wr-controls {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  margin-left: auto;
}
.wr-controls:empty { display: none; }
.wr-controls select {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 28px 8px 10px;
  border: 1px solid #dcc6b9;
  border-radius: 8px;
  background: #fffdf9;
  color: var(--wr-ink);
  font-size: .875rem;
}
.wr-content {
  width: 100%;
  max-width: 820px;
  margin: clamp(36px, 7vh, 86px) auto 0;
}
.wr-preview-label {
  margin: 0 0 22px;
  color: #796254;
  font-size: .75rem;
  text-align: center;
}
.wr-scene {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-areas: 'fox status' 'fox story' '. footer';
  align-items: center;
  gap: 24px 38px;
  min-width: 0;
}
.wr-status {
  grid-area: status;
  min-width: 0;
}
.wr-status-title {
  margin: 0;
  color: var(--wr-ink);
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: -.045em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.wr-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 8px;
  margin-top: 14px;
  color: var(--wr-accent);
}
.wr-dots i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.waiting-room[data-ongoing='true'] .wr-dots i {
  animation: wr-dot-light 1.6s ease-in-out infinite;
}
.wr-dots i:nth-child(2) { animation-delay: .18s !important; }
.wr-dots i:nth-child(3) { animation-delay: .36s !important; }
.wr-illustration {
  grid-area: fox;
  justify-self: center;
  align-self: center;
  width: 260px;
  max-width: 100%;
  margin: 0;
}
.wr-illustration img { width: 100%; height: auto; }
.wr-story { grid-area: story; min-width: 0; }
.wr-speech {
  position: relative;
  padding: 20px 23px;
  border-radius: 20px 20px 20px 6px;
  background: #f5e9dd;
}
.wr-speech::before {
  content: '';
  position: absolute;
  top: 25px;
  left: -11px;
  width: 18px;
  height: 17px;
  background: #f5e9dd;
  clip-path: polygon(100% 0, 100% 100%, 0 55%);
}
.wr-tip-stack { display: grid; min-width: 0; }
.wr-tip-stack > p {
  grid-area: 1 / 1;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: -.02em;
  text-align: center;
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.wr-tip-measure { visibility: hidden; pointer-events: none; user-select: none; }
.wr-footer { grid-area: footer; min-width: 0; }
.wr-errors:empty { display: none; }
.wr-errors .inline-error {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8c382b;
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.wr-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}
.wr-actions:empty { display: none; }
.wr-actions > * {
  flex: 1 1 150px;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 9px;
  font-size: .875rem;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.wr-actions > .primary-button {
  background: var(--wr-accent);
  border-color: var(--wr-accent);
  color: #fffdf9;
}
.wr-actions > .primary-button:hover { background: #82412f; border-color: #82412f; }
.wr-actions > .secondary-button { border-color: #d9c2b2; background: transparent; color: var(--wr-ink); }
.wr-actions > .secondary-button:hover { background: #f5e9dd; }
.waiting-room :is(a, button, select):focus-visible { outline: 3px solid #9b4e38; outline-offset: 4px; }
@keyframes wr-dot-light { 0%, 100% { opacity: .32; } 45% { opacity: 1; } }
@media (max-width: 639px) {
  .waiting-room { padding-right: max(24px, env(safe-area-inset-right)); padding-left: max(24px, env(safe-area-inset-left)); }
  .wr-content { max-width: 390px; margin-top: 28px; }
  .wr-scene { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'status' 'fox' 'story' 'footer'; gap: 16px; }
  .wr-status { text-align: center; }
  .wr-status-title { font-size: 1.375rem; }
  .wr-dots { justify-content: center; margin-top: 10px; }
  .wr-illustration { width: clamp(170px, 48vw, 190px); }
  .wr-speech { padding: 18px 20px; border-radius: 18px; }
  .wr-speech::before { top: -11px; left: calc(50% - 9px); width: 18px; height: 15px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
  .wr-footer { margin-top: 1px; }
  .wr-preview-label { margin-bottom: 18px; }
}
@media (min-width: 640px) and (max-height: 520px) {
  .wr-content { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .waiting-room[data-ongoing] .wr-dots i { animation: none; }
  .waiting-room *, .waiting-room *::before, .waiting-room *::after { scroll-behavior: auto; }
}
@media print {
  .waiting-room .wr-controls, .waiting-room .wr-actions { display: none; }
  .waiting-room[data-ongoing] .wr-dots i { animation: none; }
}
