@font-face {
  font-family: "Fredoka";
  src: url("../../assets/fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
:root {
  --ink: #4a4655;
  --muted: #8b8498;
  --soft: #b8afbd;
  --cream: #fffaf0;
  --paper: rgba(255, 252, 246, .88);
  --white: #fffdf8;
  --coral: #ff8f85;
  --coral-deep: #f27470;
  --mint: #78d6b2;
  --sky: #82b9ef;
  --lemon: #f3ce67;
  --line: rgba(90, 73, 105, .12);
  --line-strong: rgba(90, 73, 105, .22);
  --shadow: 0 24px 60px rgba(111, 92, 127, .16);
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Fredoka", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html { background: #fff7ea; }
body {
  margin: 0; min-width: 320px; min-height: 100svh;
  color: var(--ink); font-family: var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: transparent;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--lemon); color: #55412d; }

.sky-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 247, 234, .1), rgba(255, 247, 234, .44) 56%, #fff7ea 100%),
    radial-gradient(55% 55% at 50% 16%, rgba(255, 255, 255, .2), transparent 70%),
    url("../assets/flight-bg.webp") center / cover no-repeat;
  transform: scale(1.015);
}
.sky-veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 252, 244, .03), rgba(255, 249, 240, .26) 60%, rgba(255, 247, 234, .76));
}
.sky-dust { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; opacity: .28; }

.ch-header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(1500px, calc(100% - 52px)); height: 76px; margin: 0 auto;
  border-bottom: 1px solid rgba(78, 69, 87, .1);
}
.ch-back { display: inline-flex; align-items: center; gap: 8px; color: #81798b; font-size: 10px; letter-spacing: .04em; }
.ch-back span { color: var(--coral-deep); font-size: 18px; }
.ch-back:hover { color: var(--ink); }
.ch-brand { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; }
.ch-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; color: #fff; font-size: 18px;
  background: linear-gradient(145deg, #ffad9d, #ff8f85 56%, #f0bd72);
  box-shadow: 0 10px 25px rgba(241, 136, 120, .24), inset 0 1px 0 rgba(255,255,255,.6);
  transform: rotate(-7deg);
}
.ch-brand-copy { display: flex; flex-direction: column; gap: 2px; }
.ch-brand-copy strong { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: .12em; }
.ch-brand-copy small { color: #8b8498; font-size: 8px; letter-spacing: .2em; }
.ch-actions { display: flex; align-items: center; gap: 8px; }
.ch-text, .ch-new, .ch-icon { transition: .2s ease; }
.ch-text { color: #8b8498; font-size: 10px; padding: 8px; }
.ch-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #837b90; border: 1px solid var(--line); background: rgba(255,255,255,.48); }
.ch-icon svg { width: 16px; height: 16px; fill: currentColor; }
.ch-icon svg .wave { fill: none; }
.ch-icon.is-muted .wave { display: none; }
.ch-new { min-height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line); color: #6d6579; background: rgba(255,255,255,.55); font-size: 9px; }
.ch-text:hover, .ch-new:hover, .ch-icon:hover { color: var(--ink); background: rgba(255,255,255,.85); }

.ch-layout {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 242px minmax(430px, 1fr) 270px; gap: 20px; align-items: center;
  width: min(1500px, calc(100% - 52px)); min-height: calc(100svh - 76px);
  margin: 0 auto; padding: 18px 0 26px;
}
.players-rail, .side-rail { display: flex; flex-direction: column; gap: 12px; }
.soft-card {
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 252, 247, .9), rgba(255, 249, 241, .74));
  box-shadow: 0 18px 44px rgba(111, 92, 127, .1), inset 0 1px 0 #fff;
  backdrop-filter: blur(16px);
}
.players-card, .energy-card, .room-card, .log-card, .rule-card { padding: 15px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #a098a8; font-size: 8px; letter-spacing: .16em; }
.card-top b { color: #9b93a4; font-weight: 500; letter-spacing: .04em; }
.player-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.waiting-line { padding: 16px 4px; color: #aca4b2; font-size: 9px; text-align: center; }
.player-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 7px;
  border-radius: 12px; border: 1px solid transparent;
  transition: .25s ease;
}
.player-row.is-turn { border-color: rgba(255, 143, 133, .36); background: rgba(255, 236, 226, .55); }
.player-dot { width: 17px; height: 17px; flex: 0 0 auto; border-radius: 50%; border: 3px solid rgba(255,255,255,.8); box-shadow: 0 3px 8px rgba(80, 70, 90, .15); }
.player-info { min-width: 0; flex: 1; }
.player-info b { display: block; font-size: 10px; font-weight: 600; }
.player-info small { display: block; color: #a59cab; font-size: 7px; margin-top: 2px; letter-spacing: .08em; }
.player-home { display: flex; gap: 3px; }
.player-home i { width: 5px; height: 5px; border-radius: 50%; background: rgba(90,73,105,.14); }
.player-home i.is-home { background: var(--mint); }
.player-shield { color: var(--sky); font-size: 11px; margin-left: 1px; }
.player-turn { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.player-row.is-turn .player-turn { background: var(--coral-deep); box-shadow: 0 0 8px rgba(242,116,112,.6); }
.tiny { margin: 9px 0 0; color: #a49cab; font-size: 8px; line-height: 1.7; }
.energy-pips { display: flex; gap: 5px; margin-top: 12px; }
.energy-pips i { width: 26px; height: 8px; border-radius: 99px; background: rgba(120, 214, 178, .14); border: 1px solid rgba(120, 214, 178, .25); transition: .3s ease; }
.energy-pips i.is-full { background: linear-gradient(90deg, #b2ecd5, #78d6b2); border-color: transparent; box-shadow: 0 0 10px rgba(120,214,178,.34); }
.power-buttons { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.power-btn {
  display: flex; align-items: center; gap: 8px; min-height: 53px; padding: 7px 8px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.42);
  transition: .2s ease;
}
.power-btn:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(255,255,255,.78); transform: translateY(-1px); }
.power-btn:disabled { opacity: .4; cursor: default; }
.power-btn.is-active { border-color: var(--coral); background: rgba(255, 238, 228, .7); }
.power-icon { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; font-size: 15px; }
.power-dash .power-icon { color: #b47a4d; background: linear-gradient(145deg, #ffe9bd, #f5d18a); }
.power-shield .power-icon { color: #5687b6; background: linear-gradient(145deg, #e3f2ff, #b9dcf9); }
.power-btn span:nth-child(2) { min-width: 0; flex: 1; }
.power-btn strong { display: block; color: #5c5567; font-size: 9px; font-weight: 600; }
.power-btn small { display: block; color: #a79fac; font-size: 7px; margin-top: 2px; }
.power-btn em { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #a68a65; background: rgba(243, 206, 103, .25); font-size: 8px; font-style: normal; }

.board-stage { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.turn-pill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 12px;
  margin-bottom: 8px; border: 1px solid rgba(255,255,255,.7); border-radius: 99px;
  color: #7f7789; background: rgba(255,252,246,.67); backdrop-filter: blur(12px);
  box-shadow: 0 8px 22px rgba(111,92,127,.07);
  font-size: 8px; letter-spacing: .14em; transition: .3s ease;
}
.turn-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.turn-pill.is-mine { color: #b05e58; border-color: rgba(255,143,133,.4); background: rgba(255,244,234,.82); }
.turn-pill.is-mine i { background: var(--coral-deep); box-shadow: 0 0 9px var(--coral-deep); }
.turn-pill.is-waiting i { background: var(--sky); box-shadow: 0 0 8px var(--sky); }
.board-frame {
  position: relative; width: min(100%, calc(100svh - 238px), 680px); aspect-ratio: 1 / 1;
  border-radius: 28px; border: 1px solid rgba(255,255,255,.85);
  background: #fffaf0; overflow: hidden;
  box-shadow: 0 34px 70px rgba(108, 89, 123, .18), inset 0 1px 0 #fff;
}
#flight-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
.board-glow { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 50px rgba(255,255,255,.3); border-radius: inherit; }
.flight-console {
  display: flex; align-items: center; gap: 10px; width: min(100%, calc(100svh - 238px), 680px);
  margin-top: 9px; padding: 9px; border: 1px solid rgba(255,255,255,.8); border-radius: 18px;
  background: rgba(255,252,246,.78); box-shadow: 0 16px 38px rgba(111,92,127,.1); backdrop-filter: blur(16px);
}
.dice-box { position: relative; width: 52px; height: 49px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: linear-gradient(145deg, #fffdf8, #f8edda); border: 1px solid rgba(187,163,135,.22); }
.dice-box span { color: #b3a897; font-size: 6px; letter-spacing: .16em; }
.dice-box b { color: var(--ink); font-family: var(--font-display); font-size: 22px; line-height: 1; font-weight: 500; margin-top: 2px; }
.dice-box i { position: absolute; right: 5px; top: 4px; color: var(--coral-deep); font-size: 7px; font-style: normal; }
.console-actions { min-width: 0; flex: 1; display: flex; align-items: center; gap: 7px; }
.roll-btn { width: auto; flex: 0 0 auto; min-height: 35px; margin: 0; padding: 0 13px; font-size: 9px; }
.plane-picker { min-width: 0; flex: 1; display: flex; gap: 5px; align-items: center; overflow-x: auto; color: #a79ead; font-size: 8px; scrollbar-width: none; }
.plane-picker::-webkit-scrollbar { display: none; }
.plane-picker button {
  flex: 0 0 auto; min-height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  color: #71697e; background: rgba(255,255,255,.55); font-size: 8px; white-space: nowrap;
}
.plane-picker button:hover { border-color: var(--coral); color: #b15f59; }
.board-caption { display: flex; justify-content: space-between; gap: 12px; width: min(100%, calc(100svh - 238px), 680px); padding-top: 7px; color: #a49ba9; font-size: 7px; letter-spacing: .08em; }
.board-caption span:last-child { color: #8b8192; }

.cover {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow-y: auto;
  background: radial-gradient(70% 65% at 50% 36%, rgba(255,252,245,.72), rgba(255,248,237,.9));
  backdrop-filter: blur(5px);
}
.cover-card {
  width: min(430px, 100%); padding: 24px 28px 20px; text-align: center;
  border: 1px solid rgba(255,255,255,.9); border-radius: 24px;
  background: linear-gradient(160deg, rgba(255,253,247,.95), rgba(255,248,238,.85));
  box-shadow: 0 24px 55px rgba(125,101,128,.14), inset 0 1px 0 #fff;
}
.cover-kicker { color: #bd958d; font-size: 7px; letter-spacing: .2em; }
.cover h1 { margin: 11px 0 8px; color: var(--ink); font-family: var(--font-display); font-size: 56px; line-height: .92; font-weight: 500; letter-spacing: -.04em; }
.cover h1 em { color: var(--coral-deep); font-style: normal; }
.cover-sub { margin: 0 auto; max-width: 300px; color: #8d8495; font-size: 9px; line-height: 1.8; }
.cover-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; text-align: left; }
.option-label { color: #a59ca9; font-size: 8px; letter-spacing: .08em; }
.segmented { display: flex; gap: 3px; padding: 3px; border: 1px solid rgba(90,73,105,.1); border-radius: 9px; background: rgba(255,255,255,.5); }
.segmented button { min-height: 25px; padding: 0 9px; border-radius: 6px; color: #a49baa; font-size: 8px; transition: .2s ease; }
.segmented button.is-active { color: #fff; background: var(--coral); box-shadow: 0 4px 10px rgba(255,143,133,.25); }
.online-room { margin-top: 12px; padding: 9px; border: 1px solid rgba(90,73,105,.09); border-radius: 12px; background: rgba(255,255,255,.46); text-align: left; }
.online-actions { display: flex; gap: 6px; }
.online-btn { flex: 1; min-height: 33px; border: 1px solid var(--line); border-radius: 8px; color: #817889; background: rgba(255,255,255,.6); font-size: 9px; transition: .2s ease; }
.online-btn.is-selected { color: #fff; border-color: transparent; background: linear-gradient(110deg, #ffa294, #ff8f85); box-shadow: 0 6px 14px rgba(255,143,133,.22); }
.online-btn:hover:not(:disabled) { border-color: var(--line-strong); }
.online-btn:disabled { opacity: .55; }
.online-join { display: flex; gap: 6px; margin-top: 6px; }
.online-join input { min-width: 0; flex: 1; min-height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.62); color: var(--ink); font: 11px var(--font-display); letter-spacing: .15em; outline: none; text-transform: uppercase; }
.online-join input::placeholder { color: #b2a9b7; font: 8px var(--font-body); letter-spacing: .02em; text-transform: none; }
.online-join input:focus { border-color: rgba(255,143,133,.65); }
.online-join button { flex: 0 0 auto; min-height: 31px; padding: 0 11px; border: 1px solid rgba(255,143,133,.25); border-radius: 8px; color: #c26d66; background: rgba(255,239,233,.65); font-size: 8px; }
.waiting-room { margin-top: 8px; padding: 9px; border: 1px dashed rgba(120,214,178,.55); border-radius: 10px; background: rgba(120,214,178,.06); }
.room-code-line { display: flex; align-items: center; gap: 7px; }
.room-code-line span { color: #a59cab; font-size: 6px; letter-spacing: .14em; }
.room-code-line b { color: #3f9f80; font-family: var(--font-display); font-size: 19px; letter-spacing: .2em; }
.room-code-line button { color: #55a98d; font-size: 7px; padding: 0 0 1px; border-bottom: 1px solid rgba(85,169,141,.4); }
.waiting-players { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.waiting-players span { padding: 3px 7px; border-radius: 99px; color: #71687c; background: rgba(255,255,255,.7); font-size: 7px; }
.waiting-note { margin-top: 5px; color: #a59cab; font-size: 7px; }
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 44px; margin-top: 13px; padding: 0 16px; border-radius: 99px;
  color: #fff; background: linear-gradient(110deg, #ffa295, #ff8f85 58%, #f5bd83);
  box-shadow: 0 12px 26px rgba(242,133,117,.22), inset 0 1px 0 rgba(255,255,255,.5);
  font-size: 10px; font-weight: 600; letter-spacing: .04em; transition: transform .2s var(--ease), box-shadow .2s ease;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(242,133,117,.28); }
.primary-btn span { font-size: 14px; }
.start-flight { min-height: 36px; margin-top: 8px; font-size: 8px; }
.cancel-room { display: block; margin: 6px auto 0; color: #a59cab; font-size: 7px; border-bottom: 1px solid var(--line); padding: 0 0 1px; }
.cover-foot { display: block; margin-top: 10px; color: #aaa1af; font-size: 7px; letter-spacing: .04em; }
.result-cover { background: radial-gradient(65% 65% at 50% 40%, rgba(255,252,246,.78), rgba(255,248,237,.93)); }
.result-cloud { width: 76px; height: 76px; margin: 13px auto 2px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 32px; background: linear-gradient(145deg, #ffd6c5, #ff9d8e); box-shadow: 0 12px 30px rgba(255,143,133,.22), inset 0 1px 0 rgba(255,255,255,.7); }
.result-card h1 { font-size: 48px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 13px; }
.result-stats div { padding: 7px 3px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-stats span { display: block; color: #a69dab; font-size: 7px; }
.result-stats b { display: block; margin-top: 3px; color: var(--ink); font-family: var(--font-display); font-size: 15px; font-weight: 500; }
.result-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.result-actions .primary-btn { margin-top: 0; }
.outline-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 99px; color: #817889; background: rgba(255,255,255,.5); font-size: 8px; transition: .2s ease; }
.outline-btn:hover { border-color: var(--line-strong); color: var(--ink); background: #fff; }

.room-code-big { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.room-code-big span { color: #a69dab; font-size: 7px; }
.room-code-big b { color: var(--coral-deep); font-family: var(--font-display); font-size: 18px; letter-spacing: .14em; }
.room-code-big button { color: #b07670; font-size: 7px; border-bottom: 1px solid rgba(176,118,112,.35); }
.room-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; color: #a39baa; font-size: 7px; }
.room-meta b { color: #706778; font-weight: 500; }
.room-leave { min-height: 29px; margin-top: 10px; font-size: 7px; }
.flight-log { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-height: 145px; overflow: hidden; }
.flight-log li { display: flex; align-items: center; gap: 6px; color: #8c8396; font-size: 7px; line-height: 1.4; }
.flight-log li i { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: #cfc5d2; }
.flight-log li b { color: #6f6679; font-weight: 500; }
.flight-log li.empty { color: #b1a8b5; }
.mini-kicker { color: #b49690; font-size: 7px; letter-spacing: .16em; }
.rule-card p { margin: 8px 0 0; color: #9b92a1; font-size: 7px; line-height: 1.7; }
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(89, 76, 95, .28); backdrop-filter: blur(9px); }
.modal-card { position: relative; width: min(420px, 100%); max-height: 92vh; overflow-y: auto; padding: 24px; border: 1px solid #fff; border-radius: 20px; background: #fffaf2; box-shadow: 0 30px 70px rgba(90,72,97,.22); }
.modal-close { position: absolute; right: 13px; top: 10px; color: #a59cab; font-size: 22px; }
.modal-card h2 { margin: 8px 0 14px; color: var(--ink); font-family: var(--font-display); font-size: 30px; font-weight: 500; }
.modal-card ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.modal-card li { display: grid; grid-template-columns: 36px 1fr; gap: 7px; color: #8f8699; font-size: 9px; line-height: 1.6; }
.modal-card li b { color: #c07870; font-weight: 500; }
.modal-card .primary-btn { margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 300; transform: translate(-50%, 8px); padding: 9px 14px; border: 1px solid rgba(255,255,255,.8); border-radius: 99px; color: var(--ink); background: rgba(255,252,246,.94); box-shadow: 0 12px 30px rgba(95,77,102,.16); font-size: 9px; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .ch-header, .ch-layout { width: calc(100% - 34px); }
  .ch-layout { grid-template-columns: 218px minmax(400px, 1fr) 246px; gap: 13px; }
}
@media (max-width: 980px) {
  .ch-header { height: 66px; }
  .ch-brand { position: static; transform: none; margin-right: auto; }
  .ch-layout { display: flex; flex-direction: column; min-height: auto; padding: 10px 0 24px; gap: 9px; }
  .players-rail { order: 2; display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .board-stage { order: 1; width: 100%; }
  .side-rail { order: 3; display: grid; grid-template-columns: 1.1fr 1fr; width: 100%; }
  .rule-card { display: none; }
  .board-frame, .flight-console, .board-caption { width: min(100%, 620px); }
  .board-frame { width: min(100%, 620px); }
}
@media (max-width: 640px) {
  .ch-header { width: calc(100% - 22px); }
  .ch-back { font-size: 0; }
  .ch-back span { font-size: 18px; }
  .ch-brand-copy strong { font-size: 12px; }
  .ch-brand-copy small { font-size: 7px; }
  .ch-text, .ch-new { display: none; }
  .ch-layout { width: calc(100% - 18px); }
  .turn-pill { margin-bottom: 6px; }
  .board-frame { width: 100%; border-radius: 20px; }
  .flight-console { width: 100%; padding: 7px; gap: 6px; border-radius: 14px; }
  .dice-box { width: 44px; height: 44px; }
  .console-actions { gap: 4px; flex-wrap: wrap; }
  .roll-btn { min-height: 34px; font-size: 8px; }
  .plane-picker { flex: 1 1 100%; min-height: 26px; }
  .plane-picker button { min-height: 27px; }
  .board-caption { width: 100%; font-size: 6px; }
  .players-rail { display: flex; flex-direction: column; }
  .side-rail { display: flex; flex-direction: column; }
  .players-card, .energy-card { padding: 11px; }
  .player-list { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
  .player-row { padding: 6px; }
  .player-info small { display: none; }
  .energy-card .power-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .power-btn { min-height: 48px; }
  .cover { padding: 10px; }
  .cover-card { padding: 18px 16px 15px; border-radius: 17px; }
  .cover h1 { font-size: 43px; }
  .cover-sub { font-size: 8px; }
  .cover-option { margin-top: 10px; }
  .online-room { margin-top: 8px; }
  .cover-foot { font-size: 6px; }
  .result-cloud { width: 60px; height: 60px; font-size: 26px; }
  .result-card h1 { font-size: 38px; }
  .room-card, .log-card { padding: 12px; }
  .room-code-big b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
/* The generic primary button is full-width; keep the flight roll compact. */
.flight-console .primary-btn.roll-btn {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 14px;
  min-height: 35px;
}
.flight-console .console-actions { flex-wrap: nowrap; }
@media (max-width: 640px) {
  .flight-console .console-actions { flex-wrap: wrap; }
  .flight-console .primary-btn.roll-btn { flex: 0 0 auto; }
}

.cell-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 9px;
  width: min(100%, calc(100svh - 238px), 680px);
  padding-top: 8px; color: #9e93a5; font-size: 7px; letter-spacing: .02em;
}
.cell-legend-side {
  width: 100%; justify-content: flex-start; gap: 7px;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px dashed rgba(90,73,105,.12);
  font-size: 7.5px; line-height: 1.6;
}
.cell-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cell-legend i { width: 11px; height: 11px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.legend-ring { border: 1.5px solid #ff8f85; border-radius: 50%; background: rgba(255,143,133,.12); }
.legend-dash { border-top: 1.5px dashed #82b9ef; height: 1px !important; }
.legend-cloud { color: #6aaecd; font-size: 11px; font-style: normal; }
.legend-home { border-radius: 3px; background: linear-gradient(135deg,#ff8f85 0 25%,#78d6b2 25% 50%,#82b9ef 50% 75%,#f3ce67 75%); }
@media (max-width: 640px) {
  .cell-legend { width: 100%; gap: 7px; font-size: 6px; padding-top: 5px; }
  .cell-legend i { width: 9px; height: 9px; }
}
/* ---------------- Immortal Path: xianxia skin ---------------- */
:root {
  --ink: #2f2a22;
  --muted: #796b58;
  --soft: #a4937c;
  --cream: #f6eedc;
  --paper: rgba(247, 239, 221, .92);
  --white: #fffaf0;
  --coral: #b84a3f;
  --coral-deep: #8f3129;
  --mint: #5f9b72;
  --sky: #4f83a8;
  --lemon: #c8a96a;
  --line: rgba(92, 70, 43, .2);
  --line-strong: rgba(92, 70, 43, .35);
  --shadow: 0 24px 60px rgba(14, 17, 15, .28);
  --font-display: "Songti SC", "STSong", "SimSun", serif;
  --font-body: "Songti SC", "STSong", "Microsoft YaHei", serif;
}
body { color: var(--ink); }
.sky-bg {
  background:
    linear-gradient(180deg, rgba(17, 20, 18, .28), rgba(17, 20, 18, .42) 58%, rgba(12, 15, 14, .62)),
    radial-gradient(55% 50% at 50% 16%, rgba(207, 177, 118, .12), transparent 70%),
    url("../assets/immortal-bg.webp") center / cover no-repeat;
  filter: saturate(.92) contrast(1.04);
}
.sky-veil {
  background:
    radial-gradient(80% 80% at 50% 42%, transparent 25%, rgba(9, 13, 12, .48) 100%),
    linear-gradient(180deg, rgba(12, 16, 14, .12), rgba(12, 16, 14, .46));
}
.ch-header { border-bottom: 1px solid rgba(212, 182, 123, .34); }
.ch-back { color: #eadcc2; }
.ch-back span { color: #d4b67b; }
.ch-brand-copy strong { color: #f6eedc; font-family: var(--font-display); font-size: 15px; letter-spacing: .18em; }
.ch-brand-copy small { color: #cfb98f; letter-spacing: .22em; }
.ch-mark {
  color: #2c2118;
  background: linear-gradient(145deg, #f0d8a3, #c8a96a 58%, #9a7540);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 250, 232, .7);
  transform: rotate(-3deg);
  font-family: var(--font-display); font-weight: 600;
}
.ch-text, .ch-icon, .ch-new { color: #e2d1b2; border-color: rgba(212, 182, 123, .28); background: rgba(14, 18, 16, .25); }
.ch-text { border-color: transparent; }
.ch-text:hover, .ch-new:hover, .ch-icon:hover { color: #fff7e7; background: rgba(212, 182, 123, .14); }
.soft-card {
  border-color: rgba(212, 182, 123, .45);
  background: linear-gradient(155deg, rgba(247, 239, 222, .94), rgba(234, 220, 195, .88));
  box-shadow: 0 22px 50px rgba(8, 12, 10, .3), inset 0 1px 0 rgba(255, 252, 243, .8);
}
.card-top, .card-top b, .rail-head, .rail-head b { color: #8d795f; }
.player-row { border-color: rgba(92, 70, 43, .08); }
.player-row.is-turn { border-color: rgba(184, 74, 63, .4); background: rgba(255, 247, 228, .55); }
.player-info b { color: #3a3228; }
.player-info small { color: #9e8d74; }
.player-home i { background: rgba(92, 70, 43, .16); }
.player-home i.is-home { background: var(--lemon); }
.player-shield { color: var(--sky); }
.player-row.is-turn .player-turn { background: var(--coral); box-shadow: 0 0 8px rgba(184,74,63,.45); }
.tiny, .rule-card p { color: #8f7e66; }
.energy-pips i { background: rgba(95, 155, 114, .1); border-color: rgba(95, 155, 114, .3); }
.energy-pips i.is-full { background: linear-gradient(90deg, #a9d4b2, #5f9b72); box-shadow: 0 0 10px rgba(95,155,114,.35); }
.power-btn { background: rgba(255, 250, 238, .48); border-color: var(--line); }
.power-btn:hover:not(:disabled) { background: rgba(255, 252, 243, .86); border-color: var(--line-strong); }
.power-btn.is-active { border-color: var(--coral); background: rgba(243, 219, 197, .68); }
.power-btn strong { color: #504635; }
.power-btn small { color: #9a8970; }
.power-dash .power-icon { color: #7d5a23; background: linear-gradient(145deg, #f5e2ad, #c8a96a); }
.power-shield .power-icon { color: #3e6076; background: linear-gradient(145deg, #dfeef3, #9fc2ce); }
.power-btn em { color: #7c5d2e; background: rgba(200, 169, 106, .24); }
.cell-legend-side { color: #8d7a5f; border-top-color: rgba(92,70,43,.2); font-size: 7px; }
.legend-ring { border-color: var(--coral); background: rgba(184,74,63,.12); }
.legend-dash { border-top-color: var(--sky); }
.legend-event { color: #fff8e9; font-family: var(--font-display); font-size: 8px; border-radius: 50%; background: var(--coral); }
.legend-home { background: linear-gradient(135deg,#4f83a8 0 25%,#b84a3f 25% 50%,#8d6aa8 50% 75%,#5f9b72 75%); }
.turn-pill { color: #e4d4b8; border-color: rgba(212,182,123,.3); background: rgba(17,22,19,.58); box-shadow: 0 8px 22px rgba(5,8,7,.24); }
.turn-pill.is-mine { color: #ffe7bd; border-color: rgba(200,169,106,.65); background: rgba(54,37,25,.72); }
.turn-pill i { background: var(--lemon); box-shadow: 0 0 8px var(--lemon); }
.board-frame { border-color: rgba(212,182,123,.62); background: #1a1712; box-shadow: 0 36px 80px rgba(0,0,0,.46), 0 0 0 6px rgba(212,182,123,.08), inset 0 0 0 1px rgba(255,245,218,.18); }
.flight-console { border-color: rgba(212,182,123,.48); background: rgba(246, 237, 218, .9); box-shadow: 0 16px 36px rgba(8,12,10,.24); }
.dice-box { background: linear-gradient(145deg, #fff9eb, #eadbbd); border-color: rgba(151,120,67,.32); }
.dice-box span { color: #a1855c; }
.dice-box b { color: #3b3125; }
.dice-box i { color: var(--coral-deep); }
.plane-picker { color: #89775f; }
.plane-picker button { color: #5f503d; background: rgba(255, 250, 238, .65); border-color: var(--line); }
.plane-picker button:hover { color: var(--coral-deep); border-color: var(--coral); }
.board-caption { color: #b8a589; }
.board-caption span:last-child { color: #d6c4a5; }
.cover {
  background: radial-gradient(68% 68% at 50% 35%, rgba(246,238,220,.92), rgba(16,20,17,.64));
  backdrop-filter: blur(5px);
}
.cover-card {
  border-color: rgba(255, 248, 228, .92);
  background: linear-gradient(160deg, rgba(250, 242, 226, .97), rgba(237, 223, 198, .94));
  box-shadow: 0 26px 60px rgba(9,12,10,.36), inset 0 1px 0 #fff;
}
.cover-kicker { color: #a8784f; letter-spacing: .19em; }
.cover h1 { color: #332b20; font-family: var(--font-display); font-weight: 600; letter-spacing: -.06em; }
.cover h1 em { color: var(--coral-deep); font-style: normal; }
.cover-sub { color: #806f58; }
.option-label { color: #8f7d63; }
.segmented { border-color: rgba(92,70,43,.16); background: rgba(255,250,238,.58); }
.segmented button { color: #8f7d63; }
.segmented button.is-active { color: #fff8e9; background: linear-gradient(110deg,#b84a3f,#8f3129); box-shadow: 0 4px 12px rgba(143,49,41,.24); }
.online-room { border-color: rgba(92,70,43,.14); background: rgba(255,250,238,.42); }
.online-btn { color: #7f6c52; background: rgba(255,250,238,.56); border-color: var(--line); }
.online-btn.is-selected { color: #fff8e9; background: linear-gradient(110deg,#b84a3f,#8f3129); border-color: transparent; }
.online-join input { color: #3d3326; background: rgba(255,250,238,.65); border-color: var(--line); }
.online-join input::placeholder { color: #ab987b; }
.online-join button { color: #8f3129; background: rgba(243,222,204,.55); border-color: rgba(184,74,63,.24); }
.waiting-room { border-color: rgba(95,155,114,.5); background: rgba(95,155,114,.07); }
.room-code-line span, .waiting-note { color: #917d60; }
.room-code-line b { color: #477a59; }
.waiting-players span { color: #5f503d; background: rgba(255,250,238,.7); }
.primary-btn { color: #fff8e9; background: linear-gradient(110deg, #c25a4e, #a83f35 58%, #8f6b34); box-shadow: 0 12px 26px rgba(111,45,38,.3), inset 0 1px 0 rgba(255,255,255,.32); }
.primary-btn:hover { box-shadow: 0 16px 30px rgba(111,45,38,.36); }
.cover-foot { color: #a18c6e; }
.outline-btn { color: #7f6c52; background: rgba(255,250,238,.45); border-color: var(--line); }
.outline-btn:hover { background: #fff9ec; color: #3c3125; }
.result-cloud { color: #fff8e9; background: linear-gradient(145deg, #d7b274, #b84a3f); box-shadow: 0 12px 30px rgba(143,49,41,.24); }
.result-stats span { color: #96836a; }
.result-stats b { color: #3a3024; }
.room-code-big b { color: var(--coral-deep); }
.room-meta, .room-meta b { color: #8f7b60; }
.flight-log li { color: #8b7960; }
.flight-log li b { color: #66533c; }
.modal-card { background: #f7eedb; border-color: #fff8e8; }
.modal-card h2 { color: #3a3024; }
.modal-card li { color: #8a7760; }
.modal-card li b { color: var(--coral-deep); }
.toast { color: #f8eed9; background: rgba(28, 31, 26, .94); border-color: rgba(212,182,123,.4); }
.event-pop {
  position: fixed; left: 50%; top: 20%; z-index: 160; width: min(340px, calc(100% - 34px));
  transform: translateX(-50%); padding: 18px 22px 17px; text-align: center;
  border: 1px solid rgba(212,182,123,.65); border-radius: 14px;
  background: linear-gradient(160deg, rgba(250,243,227,.98), rgba(235,221,195,.96));
  box-shadow: 0 24px 60px rgba(8,12,10,.4), inset 0 1px 0 #fff;
  animation: eventIn .35s var(--ease) both;
}
.event-pop[hidden] { display: none !important; }
.event-pop > span { color: #a8784f; font-size: 7px; letter-spacing: .22em; }
.event-pop h2 { margin: 5px 0 5px; color: var(--coral-deep); font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.event-pop p { margin: 0; color: #71604a; font-size: 10px; line-height: 1.65; }
@keyframes eventIn { from { opacity: 0; transform: translate(-50%, 8px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@media (max-width: 640px) {
  .event-pop { top: 18%; padding: 15px 17px; }
  .event-pop h2 { font-size: 25px; }
}
/* Xianxia readability pass: keep muted labels readable on parchment. */
.soft-card .waiting-line { color: #66543e; font-size: 10px; }
.soft-card .tiny { color: #6b5740; }
.card-top { color: #776044; }
.card-top b { color: #8a7153; }
.player-info small { color: #79654c; }
.player-info b { color: #392f23; }
.player-home i { background: rgba(88, 68, 43, .22); }
.rule-card p { color: #6a5740; }
.cell-legend, .cell-legend-side { color: #69563f; }
.cover-sub { color: #6e5a43; }
.option-label { color: #796346; }
.waiting-note { color: #6f5c45; }
.waiting-players span { color: #4f4232; }
.online-join input::placeholder { color: #88745a; }
.room-meta, .room-meta b { color: #6d5840; }
.room-meta b { color: #44372a; }
.flight-log li { color: #705d47; }
.flight-log li b { color: #4d3d2c; }
.flight-log li.empty { color: #7a6650; }
.room-note, .tiny { color: #6b5740; }
.power-btn:disabled { opacity: .78; }
.power-btn:disabled strong { color: #4c3e2e; }
.power-btn:disabled small { color: #705b44; }
.power-btn:disabled .power-icon { filter: saturate(.7); }
.power-btn:disabled em { color: #6e583e; background: rgba(200, 169, 106, .2); }
.power-btn small { color: #6f5b44; }
.power-btn strong { color: #4b3d2d; }
.energy-card .tiny { color: #6b5740; }
.board-caption { color: #aa967c; }
@media (max-width: 640px) {
  .soft-card .waiting-line { font-size: 10px; }
}
/* 96-cell board and larger UI text */
.board-frame, .flight-console, .board-caption { width: min(100%, calc(100svh - 160px), 760px); }
body { font-size: 14px; }
.card-top { font-size: 9.5px; }
.card-top b { font-size: 9.5px; }
.player-info b { font-size: 14px; }
.player-info small { font-size: 9.5px; }
.tiny { font-size: 11px; line-height: 1.6; }
.soft-card .tiny { font-size: 11px; }
.cell-legend, .cell-legend-side { font-size: 8.5px; gap: 8px; line-height: 1.7; }
.legend-event { width: 12px; height: 12px; font-size: 9px; }
.power-btn strong { font-size: 13px; }
.power-btn small { font-size: 10px; }
.power-btn em { font-size: 10px; }
.energy-pips i { height: 7px; }
.board-caption { font-size: 8.5px; padding-top: 6px; }
.cover-kicker { font-size: 9px; }
.cover-sub { font-size: 12px; }
.option-label { font-size: 10px; }
.segmented button { font-size: 12px; }
.online-btn { font-size: 12px; }
.online-join input { font-size: 11.5px; }
.online-join button { font-size: 12px; }
.cover-foot { font-size: 9.5px; }
.room-meta { font-size: 10px; }
.room-note, .tiny { font-size: 11px; }
.flight-log li { font-size: 10px; line-height: 1.6; }
.rule-card p { font-size: 11px; line-height: 1.65; }
.mini-kicker { font-size: 9px; }
.modal-card li { font-size: 12px; }
.modal-card li span { font-size: 11px; }
.waiting-note { font-size: 11px; }
.waiting-players span { font-size: 10px; }
.howto .tiny { font-size: 10.5px; }
.plane-picker { font-size: 10.5px; }
.plane-picker button { font-size: 10.5px; padding: 7px 10px; }
.roll-btn { font-size: 12px; }
.dice-box span { font-size: 8px; }
.dice-box b { font-size: 22px; }
.cell-codex { padding: 15px 16px 13px; }
.cell-codex .card-top { margin-bottom: 8px; }
.codex-empty { color: #6d5942; font-size: 11px; line-height: 1.7; }
.codex-detail { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0 8px; }
.codex-detail[hidden] { display: none !important; }
.codex-glyph { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff8e9; background: var(--coral); font-family: var(--font-display); font-size: 17px; box-shadow: 0 5px 12px rgba(80,50,25,.2); }
.codex-detail strong { display: block; color: #3a3024; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.codex-detail p { margin: 3px 0 0; color: #6b5740; font-size: 11px; line-height: 1.65; }
.codex-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; padding-top: 7px; border-top: 1px dashed rgba(92,70,43,.18); }
.codex-item { display: flex; align-items: center; gap: 5px; border: 0; padding: 3px 0; background: none; color: #6d5942; font: inherit; font-size: 9.5px; text-align: left; cursor: pointer; }
.codex-item:hover { color: var(--coral-deep); }
.codex-item b { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; color: #fff8e9; background: var(--coral); font-family: var(--font-display); font-size: 9px; font-weight: 500; }
@media (max-width: 980px) {
  .board-frame, .flight-console, .board-caption { width: min(100%, 720px); }
  .cell-codex { order: 4; }
}
@media (max-width: 640px) {
  .board-frame, .flight-console, .board-caption { width: 100%; }
  .cell-codex { order: 4; }
  .cell-legend, .cell-legend-side { font-size: 8px; }
}
/* final 96-cell readability */
.card-top, .card-top b { font-size: 10px; }
.player-info small { font-size: 10px; }
.power-btn strong { font-size: 13.5px; }
.power-btn small { font-size: 10.5px; }
.cell-legend, .cell-legend-side { font-size: 9px; }
.legend-event { width: 13px; height: 13px; font-size: 10px; }
.board-caption { font-size: 9px; }
.rule-card p { font-size: 12px; line-height: 1.7; }
.flight-log li { font-size: 10.5px; }
.codex-empty { font-size: 12px; }
.codex-detail strong { font-size: 17px; }
.codex-detail p { font-size: 12px; }
.codex-item { font-size: 10.5px; padding: 4px 0; }
.codex-item b { width: 18px; height: 18px; font-size: 10px; }
.cell-codex .card-top { font-size: 10px; }
.legend-trib { color: #fff8e9; font-family: var(--font-display); font-size: 8px; border-radius: 3px; background: #b8863e; }
.player-home i.is-tribulation { background: #b8863e; }
.player-home i.is-inner { background: #5f9b72; }
.tribulation-btn { border-color: rgba(184, 74, 63, .4) !important; color: #8f3129 !important; background: rgba(243, 222, 204, .72) !important; }
.tribulation-btn:hover { border-color: var(--coral) !important; background: #fff6e1 !important; }
.codex-detail p { font-size: 12px; }
@media (max-width: 640px) {
  .codex-list { grid-template-columns: 1fr 1fr; }
}
/* larger board for legibility */
.board-frame, .flight-console, .board-caption { width: min(100%, calc(100svh - 110px), 820px); }
@media (max-width: 980px) {
  .board-frame, .flight-console, .board-caption { width: min(100%, 760px); }
}
