:root {
  color-scheme: light;
  --paper: #fbf8f2;
  --white: #fffdfa;
  --ink: #2d2037;
  --muted: #6e6071;
  --purple: #39294a;
  --line: #e8dfdf;
  --tint: #f1eaf5;
  --orange: #f9aa7b;
  --error: #972e3e;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 46px;
  padding: .68rem 1.05rem;
  font-weight: 700;
  color: inherit;
}
button:disabled { cursor: default; opacity: .54; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #865aac;
  outline-offset: 3px;
}
button:not(:disabled):active { transform: translateY(1px); }
.primary { background: var(--orange); color: #2e1b2e; }
.primary:hover:not(:disabled) { background: #ffba91; }
.secondary { background: var(--white); border-color: #dcd0e0; }
.secondary:hover:not(:disabled), .quiet:hover { background: var(--tint); }
.quiet { background: transparent; }
button span { margin-left: .55em; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 71px; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-weight: 800; font-size: 1.25rem; text-decoration: none; }
.logo { position: relative; width: 31px; height: 30px; display: inline-block; }
.logo::before, .logo::after {
  content: ""; position: absolute; width: 18px; height: 15px; border-radius: 7px 7px 7px 2px;
}
.logo::before { left: 1px; top: 5px; background: var(--purple); }
.logo::after { left: 11px; top: 10px; background: var(--orange); border: 2px solid var(--paper); }
.shell { margin-block: 58px 64px; }
.hero { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.1fr); min-height: 472px; gap: clamp(24px, 6vw, 92px); align-items: center; }
.intro { padding-block: 15px; }
h1, h2, p { margin-top: 0; }
h1 { letter-spacing: -.07em; line-height: 1.12; }
.intro h1 { font-size: clamp(3.25rem, 7.3vw, 6rem); margin: 0 0 26px; white-space: nowrap; }
.intro h1 span { color: #724f8b; }
.intro-copy { max-width: 350px; color: var(--muted); font-size: 1.09rem; line-height: 1.8; margin-bottom: 34px; }
#entry-form { max-width: 360px; display: grid; gap: 10px; }
label { display: block; font-size: .88rem; font-weight: 750; }
input {
  border: 1px solid #d9ccd9; background: var(--white); color: var(--ink);
  padding: .8rem .9rem; border-radius: 12px; min-width: 0; width: 100%; min-height: 50px;
}
input::placeholder { color: #857987; }
input:disabled { background: var(--tint); }
#entry-form button { min-height: 51px; margin-top: 3px; }
.form-error { color: var(--error); margin: 2px 0 0; line-height: 1.55; }
.demo {
  min-height: 456px; overflow: hidden; position: relative; display: grid; place-items: center;
  isolation: isolate; border-radius: 28px; background: var(--purple); color: #fff8f4;
}
.orbit { position: absolute; z-index: -1; border: 1px solid #675277; border-radius: 50%; width: 115%; aspect-ratio: 1; top: -47%; left: 32%; }
.orbit-two { width: 137%; top: -58%; left: 21%; }
.demo-content { width: min(460px, 91%); display: grid; justify-items: center; padding: 25px 0; }
.demo-heading { font-size: .9rem; color: #e8d9ed; font-weight: 650; letter-spacing: .12em; }
.demo-heading span { display: inline-block; background: var(--orange); width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 2px; }
.demo-words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin: 41px 0 35px; gap: 4px; }
.word-card {
  display: flex; flex-direction: column; justify-content: space-between; align-items: start;
  height: clamp(100px, 13vw, 153px); padding: 13px 15px; border-radius: 16px;
  color: var(--ink); box-shadow: 0 12px 23px #22192d66;
}
.word-card span { font-size: .75rem; }
.word-card strong { font-size: clamp(1.2rem, 2.65vw, 2.45rem); white-space: nowrap; letter-spacing: -.07em; line-height: 1.4; }
.card-one { background: #e3d5f3; transform: rotate(-10deg) translateY(8px); }
.card-two { background: #ffc6a7; transform: rotate(5deg) translateY(-9px); z-index: 1; }
.card-three { background: #dfebca; transform: rotate(11deg) translateY(11px); }
.demo-next { border: 1px solid #7b6686; background: #4a375a; border-radius: 999px; padding: .6rem .9rem; color: #f3e7f1; font-size: .9rem; }
.demo-next span { margin-right: 6px; color: #ffc6a7; }
.demo-next strong { margin-left: 8px; color: #ffc6a7; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; border-top: 1px solid var(--line); padding-top: 30px; margin-top: 44px; }
.steps > div { display: flex; align-items: flex-start; gap: 13px; }
.step-icon { flex: 0 0 38px; height: 38px; display: grid; place-items: center; background: var(--tint); border-radius: 11px; color: #64427e; font-size: 1.18rem; }
.steps p { margin: 0; line-height: 1.55; }
.steps p span { display: block; font-size: .86rem; color: var(--muted); margin-top: 3px; }
.room-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.room-heading h1 { font-size: clamp(2.1rem, 5vw, 3.45rem); margin: 10px 0 0; }
.back { text-decoration: none; color: var(--muted); font-size: .88rem; }
.back:hover { text-decoration: underline; }
.room-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(235px, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 23px; padding: clamp(20px, 3.3vw, 36px); }
#stage h2 { font-size: clamp(1.55rem, 4vw, 2.25rem); letter-spacing: -.035em; margin-bottom: 12px; }
#stage[data-phase="finished"] { background: var(--purple); color: #fff8f4; }
#stage[data-phase="finished"] .stage-copy { color: #e8d9ed; }
.stage-copy { color: var(--muted); line-height: 1.7; margin-bottom: 20px; }
.clock { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 5px; }
.clock span { color: var(--muted); font-size: .89rem; }
.clock strong { font-variant-numeric: tabular-nums; font-size: 1.65rem; }
.clock strong::after { content: " s"; font-size: .8rem; color: var(--muted); }
.clock.urgent strong { color: var(--error); }
.meter { height: 5px; border-radius: 9px; overflow: hidden; background: var(--tint); margin-bottom: 23px; }
.meter span { display: block; height: 100%; width: 100%; background: #9668b0; transform-origin: left; }
.word-input { display: flex; gap: 9px; margin-top: 7px; }
.word-input button { flex: 0 0 auto; }
.field-note { color: var(--muted); font-size: .83rem; line-height: 1.55; margin: 9px 0 0; }
.words { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 123px), 1fr)); gap: 8px; margin-bottom: 20px; }
.word-tile { border-radius: 12px; background: var(--tint); color: var(--ink); padding: .65rem .75rem; overflow-wrap: anywhere; }
.word-tile:nth-child(3n + 2) { background: #fce8dc; }
.word-tile:nth-child(3n) { background: #e9efde; }
.word-tile span { display: block; font-size: .76rem; color: #5e4d61; margin-bottom: 3px; }
.word-tile strong { font-size: 1.06rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.roster { padding: 23px 20px; }
.roster-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.roster-heading h2, .history h2 { font-size: 1.1rem; margin: 0; }
.roster-heading span { color: var(--muted); font-size: .86rem; }
#players { list-style: none; padding: 0; margin: 13px 0 0; }
#players li { display: grid; grid-template-columns: 33px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; background: var(--tint); font-size: .83rem; font-weight: 800; }
#players li:nth-child(3n + 2) .avatar { background: #fce8dc; }
#players li:nth-child(3n) .avatar { background: #e9efde; }
.player-name { font-weight: 650; font-size: .9rem; overflow-wrap: anywhere; }
.player-status { font-size: .76rem; color: var(--muted); }
.player-status.ready { color: #477148; }
.history { margin-top: 16px; }
.history h2 { margin-bottom: 13px; }
details { border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: 12px 0; }
details .words { margin-bottom: 12px; }
.notice { padding: .75rem 1rem; background: var(--tint); border-radius: 12px; overflow-wrap: anywhere; }
dialog {
  max-width: min(480px, calc(100% - 30px)); border-radius: 22px; border: 1px solid var(--line);
  padding: 24px 28px; background: var(--white); color: var(--ink);
}
dialog::backdrop { background: #25193385; }
dialog h2 { margin: 8px 0 14px; }
dialog ol { padding-left: 1.4rem; line-height: 1.75; }
dialog li + li { margin-top: 10px; }
.dialog-close { float: right; }
@media (max-width: 760px) {
  .header-inner, .shell { width: calc(100% - 36px); }
  .shell { margin-block: 30px 45px; }
  .hero, .room-layout { grid-template-columns: 1fr; gap: 18px; }
  .intro { padding-block: 7px 10px; }
  .intro h1 { margin-bottom: 18px; }
  .intro-copy { margin-bottom: 22px; }
  #entry-form { max-width: none; }
  .demo { min-height: 255px; border-radius: 21px; }
  .demo-content { width: min(365px, 88%); }
  .demo-words { margin-block: 21px; }
  .word-card { padding: 10px; }
  .word-card strong { font-size: clamp(1.4rem, 6vw, 2rem); }
  .steps { grid-template-columns: 1fr; margin-top: 24px; padding-top: 21px; gap: 14px; }
}
@media (max-width: 370px) {
  .room-heading { align-items: start; flex-direction: column; }
  .word-input { flex-direction: column; }
}

.intro h1.joining { font-size: clamp(2.65rem, 5.5vw, 4.5rem); white-space: normal; }
