:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #f1f1eb;
  background: #171b1b;
  --orange: #e98248;
  --muted: #b1b6b2;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; isolation: isolate; }
button, input { font: inherit; -webkit-tap-highlight-color: transparent; }
a, summary { -webkit-tap-highlight-color: transparent; }
svg { display: block; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.glass-filters { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.battlefield, .field-overlay { position: fixed; z-index: -1; inset: 0; pointer-events: none; }
.battlefield {
  background: #202829 url("/branding/aqtw-scene.jpg") center 43% / cover no-repeat;
  filter: saturate(.35) brightness(.75);
}
.field-overlay {
  background: linear-gradient(180deg, #0d1418b3, #10191b24 27%, #0d1517b3 100%),
    linear-gradient(90deg, #10202552, #10171929 45%, #111b208c),
    radial-gradient(ellipse at 50% 45%, transparent 15%, #101a2180 100%);
}
.field-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .15;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #000 3px 4px);
}
.site-header, .site-footer { flex: none; min-height: 76px; padding: 18px 4.5vw; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-brand { display: flex; align-items: center; gap: 22px; color: inherit; text-decoration: none; }
.game-wordmark { display: block; flex: none; width: 148px; height: 37px; background: url("/branding/aqtw-header.png") left top / 523px 37px no-repeat; }
.site-brand .game-wordmark { width: 124px; height: 31px; background-size: 438.2px 31px; }
.site-brand-label { padding-left: 22px; border-left: 1px solid #dce3df40; color: #c3cbc7; font-size: 12px; letter-spacing: 2px; }
.official-link { display: flex; align-items: center; gap: 10px; color: #c0c5bf; font-size: 11px; text-decoration: none; }
.official-link svg { width: 15px; height: 15px; }
.official-link:hover { color: #fff; }
main { flex: 1; display: grid; place-items: center; width: 100%; padding: 20px 24px; }

.entry {
  position: relative;
  isolation: isolate;
  width: min(100%, 460px);
  overflow: hidden;
  border: 1px solid #e1e5da47;
  border-radius: 16px;
  background: linear-gradient(125deg, #424c4569, #182123c9 53%, #242c2899);
  box-shadow: 0 28px 80px #03090c80, 0 5px 18px #030b0e52,
    inset 1px 1px 0 #ffffff24, inset -1px -1px 0 #d8e9da14;
  -webkit-backdrop-filter: blur(22px) saturate(65%);
  backdrop-filter: blur(22px) saturate(65%);
}
.glass-refraction {
  position: absolute; z-index: -1; inset: -6px; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse at 0 0, #dee2c51a, transparent 45%),
    radial-gradient(ellipse at 100% 100%, #99b9b112, transparent 35%);
  box-shadow: inset 1px 1px 16px #f0f7ec10;
  filter: url(#liquid-refraction);
}
.panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 37px; padding: 10px 27px; border-bottom: 1px solid #dfebe618; background: #0b161e26; font-size: 10px; letter-spacing: 1px; color: #b8bdb5; }
.panel-bar > span:first-child { display: flex; align-items: center; gap: 8px; color: #e9a97e; }
.panel-bar > span:last-child { font: 9px/1.3 ui-monospace, Consolas, monospace; letter-spacing: 1.5px; color: #919e98; }
.panel-bar i { width: 4px; height: 9px; background: var(--orange); }
.entry-content { padding: 26px 32px 0; }
.game-identity { display: flex; align-items: center; gap: 15px; }
.game-icon { display: block; flex: none; width: 54px; height: 54px; border-radius: 11px; box-shadow: 0 2px 8px #0004; }
.game-identity .game-wordmark { width: 144px; height: 36px; background-size: 508.865px 36px; }
.game-identity p { margin: 5px 0 0; font-size: 10px; letter-spacing: .4px; color: #bdc3bc; }
.game-identity p span { color: #71817c; margin: 0 7px; }
.entry-heading { margin-top: 25px; }
h1 { margin: 0; font-size: 27px; font-weight: 650; line-height: 1.4; letter-spacing: 1px; }
h1 > span { color: var(--orange); padding-left: 3px; }
.hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.mobile-break { display: none; }
form { margin-top: 24px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: #d0d6ce; }
label svg { width: 16px; height: 16px; color: #a9b4ab; }
#roomHint { font-size: 10px; color: #a1ada4; }
input {
  width: 100%;
  height: 66px;
  border: 1px solid #c9d2bc38;
  border-bottom-color: #c9d2bc61;
  border-radius: 6px;
  background: linear-gradient(180deg, #0b141f66, #14202329);
  box-shadow: inset 0 2px 6px #050e141f, 0 1px 0 #e8f0de0a;
  outline: none;
  color: #f0eade;
  font: 32px/1.2 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 27px;
  text-align: center;
  padding: 0 0 0 27px;
  caret-color: #ef9d64;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder { color: #7d8c86; opacity: 1; }
input:hover { border-color: #b1bcaa73; }
input:focus { border-color: #d68b56; background: #111e2380; box-shadow: 0 0 0 3px #dc8c4517, inset 0 1px 5px #0002; }
input:disabled { opacity: .7; cursor: wait; }
button {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  width: 100%; min-height: 49px; margin-top: 14px; padding: 13px 20px;
  border: 1px solid #f2bd824a; border-radius: 5px;
  background: linear-gradient(110deg, #dd8b51, #cd733c);
  box-shadow: inset 0 1px 0 #ffd5a32b, 0 4px 14px #080c1433;
  color: #1f241e; font-size: 14px; font-weight: 700; letter-spacing: 2px;
  cursor: pointer; transition: background .18s, box-shadow .18s;
}
button svg { width: 20px; height: 20px; stroke-width: 1.6; }
button:hover:not(:disabled) { background: linear-gradient(110deg, #eca469, #dd8b52); box-shadow: inset 0 1px 0 #ffe3b93b, 0 4px 18px #e3984b21; }
button:active:not(:disabled) { background: #c87d49; }
button:disabled { opacity: .72; cursor: wait; }
.button-loading { display: none; }
button:disabled .button-loading { display: inline; }
button:disabled .button-label { display: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #eda163; outline-offset: 4px; }
#joinStatus { display: flex; align-items: flex-start; gap: 7px; min-height: 20px; margin: 11px 0 0; font-size: 10px; line-height: 1.8; color: #a7b3a8; overflow-wrap: anywhere; }
#joinStatus::before { content: ""; flex: none; width: 4px; height: 4px; margin-top: 7px; border: 1px solid currentColor; border-radius: 50%; }
#joinStatus.error { color: #ffc5a5; }
#joinStatus.error::before { border-radius: 0; background: currentColor; }
form:has(button:disabled) #joinStatus { color: #edac73; }
.room-help { margin: 14px 0 20px; color: #b7c0b6; font-size: 11px; }
.room-help summary { display: flex; align-items: center; gap: 7px; min-height: 30px; cursor: pointer; list-style: none; }
.room-help summary::-webkit-details-marker { display: none; }
.room-help summary > svg { width: 15px; height: 15px; color: #95a196; }
.help-toggle { color: #8f9e91; margin-left: auto; font: 17px/1 ui-monospace, Consolas, monospace; transition: transform .15s; }
.room-help[open] .help-toggle { transform: rotate(45deg); }
.room-help[open] summary { color: #e2d5c0; }
.room-help p { margin: 8px 0 2px; padding: 0 0 0 12px; border-left: 2px solid #bc865a78; color: #bec6bd; font-size: 11px; line-height: 1.9; }
.connection-flow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 35px 14px; border-top: 1px solid #d4dfd41f; background: #0b161e24; }
.flow-step { display: flex; flex-direction: column; align-items: center; gap: 7px; color: #b9c3b7; font-size: 10px; letter-spacing: .5px; white-space: nowrap; }
.flow-step > svg { width: 21px; height: 21px; color: #c1ccbd; }
.flow-arrow { width: 25px; height: 14px; color: #74847a; margin-bottom: 18px; flex: none; }
.panel-foot { display: flex; justify-content: center; align-items: center; gap: 7px; padding: 0 22px 18px; background: #0b161e24; font-size: 9px; line-height: 1.6; color: #9aa89c; }
.panel-foot > svg { width: 12px; height: 12px; flex: none; }
.site-footer { color: #a3aba8; font-size: 10px; letter-spacing: .5px; }
.site-footer > span:first-child { font: 10px/1.5 ui-monospace, "Microsoft YaHei", monospace; color: #abb3ad; }
.site-footer b { margin: 0 11px; color: #cc8659; font-weight: 400; }
noscript { padding: 16px; color: #ffbd90; background: #272c28; text-align: center; font-size: 13px; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .entry { background: linear-gradient(135deg, #343d36, #202b2d); }
}
@media (max-height: 800px) and (min-width: 601px) {
  .site-header, .site-footer { min-height: 58px; padding-top: 12px; padding-bottom: 12px; }
  main { padding-top: 16px; padding-bottom: 16px; }
  .entry-content { padding-top: 22px; }
  .entry-heading { margin-top: 21px; }
  form { margin-top: 20px; }
  .room-help { margin-top: 9px; margin-bottom: 14px; }
}
@media (max-width: 600px) {
  .site-header, .site-footer { min-height: 68px; padding: 16px 22px; }
  .site-brand { gap: 14px; }
  .site-brand-label { border-left: 0; padding-left: 0; font-size: 10px; letter-spacing: 1px; }
  .site-brand .game-wordmark { width: 100px; height: 25px; background-size: 353.4px 25px; }
  .official-link { font-size: 10px; gap: 5px; }
  .official-link svg { width: 13px; height: 13px; }
  main { padding: 14px 18px; }
  .entry { border-radius: 13px; }
  .panel-bar { padding-right: 22px; padding-left: 22px; }
  .panel-bar > span:last-child { font-size: 8px; letter-spacing: 1px; }
  .entry-content { padding: 23px 25px 0; }
  .entry-heading { margin-top: 22px; }
  h1 { font-size: 25px; }
  .hint { font-size: 11px; }
  .mobile-break { display: inline; }
  form { margin-top: 21px; }
  .field-heading { gap: 7px; }
  #roomHint { font-size: 9px; }
  input { height: 65px; font-size: 31px; letter-spacing: 24px; padding-left: 24px; }
  .room-help { margin-top: 10px; margin-bottom: 15px; }
  .connection-flow { padding-left: 26px; padding-right: 26px; }
  .site-footer { flex-direction: column; justify-content: center; gap: 5px; font-size: 8px; padding-top: 12px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .site-footer > span:first-child { font-size: 9px; }
  .battlefield { background-position: 48% center; }
}
@media (max-width: 360px) {
  main { padding-left: 13px; padding-right: 13px; }
  .site-header { padding-left: 17px; padding-right: 17px; }
  .site-brand-label { display: none; }
  .entry-content { padding-left: 20px; padding-right: 20px; }
  .panel-bar { padding-left: 20px; padding-right: 20px; }
  .game-identity { gap: 11px; }
  .game-identity p { font-size: 9px; letter-spacing: 0; }
  .game-identity p span { margin: 0 4px; }
  h1 { font-size: 23px; }
  .connection-flow { padding-left: 23px; padding-right: 23px; gap: 7px; }
  .flow-arrow { width: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .battlefield, .field-overlay, .glass-refraction { display: none; }
  .entry, input, button { border: 1px solid CanvasText; }
  button { background: ButtonFace; color: ButtonText; }
  .game-wordmark { forced-color-adjust: none; }
}
