/* 在线客户端基础 + 大厅样式（自原 style.css 拆分） */
/* ============================================================
   在线客户端重制版
   仅覆盖大厅与对局页面，布局编辑器保持原有样式。
   ============================================================ */

:root {
    --ink-950: #061719;
    --ink-900: #0a2325;
    --ink-800: #123436;
    --ink-700: #285052;
    --paper: #f3ecdc;
    --paper-dim: #c8c2b5;
    --ember: #b84535;
    --violet: #8a3d9c;
    --gold: #d2a93b;
    --line: rgba(243, 236, 220, 0.16);
    --panel: rgba(6, 23, 25, 0.94);
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    min-height: 100dvh;
    display: block;
    background: var(--ink-950);
    color: var(--paper);
    font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 300;
    padding: 0.6rem 0.8rem;
    background: var(--paper);
    color: var(--ink-950);
    transform: translateY(-180%);
    transition: transform 180ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.screen {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.btn,
.btn-icon {
    -webkit-tap-highlight-color: transparent;
}

.btn {
    min-height: 2.75rem;
    border-radius: 4px;
    border: 1px solid transparent;
    font-weight: 650;
    cursor: pointer;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn:disabled,
.btn-icon:disabled {
    cursor: not-allowed;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px) scale(0.99);
}

.btn svg,
.btn-icon svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.2rem;
    background: var(--ember);
    color: #fff8ea;
    box-shadow: 0 0.7rem 2rem rgba(58, 14, 11, 0.25);
}

.btn-primary:hover {
    background: #cf5845;
    box-shadow: 0 0.8rem 2.1rem rgba(58, 14, 11, 0.34);
}

.btn-secondary {
    padding: 0.65rem 1rem;
    background: var(--paper);
    border-color: var(--paper);
    color: var(--ink-950);
}

.btn-secondary:hover {
    background: #fffaf0;
    border-color: #fffaf0;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding: 0.55rem 0.8rem;
    background: transparent;
    border-color: var(--line);
    color: var(--paper-dim);
}

.btn-ghost:hover {
    color: var(--paper);
    border-color: rgba(243, 236, 220, 0.42);
}

.btn-large {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.8rem 1.25rem;
    font-size: 1rem;
}

.btn-small {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.btn-icon {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--paper-dim);
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--paper);
}

.btn-icon:active {
    transform: scale(0.96);
}

/* 大厅 */

#lobby {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: clamp(0.75rem, 2vh, 1.5rem);
    background-color: var(--ink-950);
}

#lobby::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("/static/assets/land.webp");
    background-size: 42rem;
    opacity: 0.035;
    mix-blend-mode: luminosity;
}

.lobby-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(22rem, 0.85fr);
    width: min(74rem, calc(100vw - clamp(1.5rem, 4vh, 3rem)));
    height: min(44rem, calc(100dvh - clamp(1.5rem, 4vh, 3rem)));
    min-height: 32rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 2rem 5rem rgba(0, 8, 9, 0.44);
}

.lobby-art {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4.5rem);
    background-color: #e8dfcc;
    background-image: url("/static/assets/land.webp");
    background-size: cover;
    background-blend-mode: luminosity;
    color: var(--ink-950);
}

.lobby-art::after {
    content: "";
    position: absolute;
    right: -16%;
    bottom: -38%;
    width: 74%;
    aspect-ratio: 1;
    border: 1px solid rgba(6, 23, 25, 0.22);
    border-radius: 50%;
    box-shadow: 0 0 0 2rem rgba(6, 23, 25, 0.035), 0 0 0 4rem rgba(6, 23, 25, 0.025);
}

.brand-lockup {
    position: relative;
    z-index: 1;
    max-width: 34rem;
}

.brand-kicker,
.eyebrow,
.lobby-edition,
.modal-kicker {
    display: block;
    color: var(--ember);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.18em;
}

.brand-lockup h1 {
    margin: 0.55rem 0 0.8rem;
    color: var(--ink-950);
    font-family: "Songti SC", "STSong", serif;
    font-size: clamp(3.4rem, 8vh, 6.3rem);
    line-height: 0.98;
    letter-spacing: 0;
    text-wrap: balance;
}

.brand-lockup p {
    max-width: 27rem;
    color: #365052;
    font-family: "Songti SC", "STSong", serif;
    font-size: 1rem;
    line-height: 1.75;
    text-wrap: pretty;
}

.animal-showcase {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    height: min(17rem, 38vh);
    margin: 1rem 0 0;
}

.animal-medallion {
    display: block;
    width: min(14rem, 31%);
    aspect-ratio: 1;
    flex: none;
    border: 0.35rem solid var(--ink-950);
    border-radius: 50%;
    background-image: url("/static/assets/animals.webp?v=2");
    background-repeat: no-repeat;
    background-size: 400% 600%;
    box-shadow: 0 1.2rem 2rem rgba(6, 23, 25, 0.24);
}

.animal-red {
    z-index: 3;
    background-position: 33.333% 0;
    transform: rotate(-7deg);
}

.animal-violet {
    z-index: 2;
    margin-left: -5%;
    background-position: 33.333% 40%;
    transform: translateY(-12%) rotate(3deg);
}

.animal-gold {
    z-index: 1;
    margin-left: -5%;
    background-position: 33.333% 80%;
    transform: rotate(8deg);
}

.lobby-edition {
    position: absolute;
    right: 2rem;
    bottom: 1.7rem;
    z-index: 2;
    color: rgba(6, 23, 25, 0.58);
    writing-mode: vertical-rl;
}

.lobby-panel {
    min-width: 0;
    overflow: hidden;
    padding: clamp(1.5rem, 4vh, 2.8rem);
    background: var(--panel);
}

.mobile-brand {
    display: none;
}

.panel-heading {
    margin-bottom: clamp(1.25rem, 3vh, 2rem);
}

.panel-heading .eyebrow {
    color: var(--gold);
}

.panel-heading h2 {
    margin-top: 0.55rem;
    color: var(--paper);
    font-family: "Songti SC", "STSong", serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
}

.panel-heading p {
    margin-top: 0.6rem;
    color: var(--paper-dim);
    font-size: 0.82rem;
    line-height: 1.55;
}

.join-section {
    margin-top: clamp(1.25rem, 3vh, 2rem);
}

.join-section > label {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--paper-dim);
    font-size: 0.76rem;
    font-weight: 600;
}

.join-by-code {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    margin: 0;
}

.join-by-code input {
    width: 100%;
    min-width: 0;
    height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    outline: none;
    background: rgba(255, 255, 255, 0.055);
    color: var(--paper);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 1.08rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.32em;
    text-align: left;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.join-by-code input::placeholder {
    color: #6f8281;
    font-family: inherit;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.join-by-code input:focus {
    border-color: var(--violet);
    background: rgba(255, 255, 255, 0.08);
}

.room-list-section {
    margin-top: clamp(1.25rem, 3vh, 2rem);
    text-align: left;
}

.room-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.room-list-header h3 {
    color: var(--paper);
    font-size: 0.78rem;
    font-weight: 650;
}

.room-list-header span {
    display: block;
    margin-top: 0.12rem;
    color: #718381;
    font-size: 0.66rem;
}

.room-list {
    height: clamp(5.2rem, 15vh, 8.5rem);
    max-height: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ink-700) transparent;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.14);
}

.room-list-empty {
    display: grid;
    min-height: 100%;
    place-items: center;
    padding: 1rem;
    color: #718381;
    font-size: 0.75rem;
}

.room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--line);
    transition: background-color 180ms ease;
}

.room-item:hover {
    background: rgba(24, 133, 126, 0.11);
}

.room-item-id {
    min-width: 4.6rem;
    color: var(--paper);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.room-item-info {
    display: flex;
    flex: 1;
    gap: 0.55rem;
}

.room-item-players {
    color: var(--paper-dim);
    font-size: 0.7rem;
}

.room-item-slots {
    display: flex;
    gap: 0.28rem;
}

.room-slot-dot {
    width: 0.5rem;
    height: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.waiting-heading {
    margin-bottom: 1.2rem;
}

.room-id-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 0.9rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.045);
}

.room-id-display > div {
    min-width: 0;
}

.room-id-label {
    display: block;
    color: #7f918f;
    font-size: 0.66rem;
}

.room-id-text {
    display: block;
    margin-top: 0.15rem;
    color: var(--paper);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 1.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.16em;
}

.status-box {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 0 0.8rem;
    padding: 0.7rem 0.85rem;
    border-radius: 4px;
    background: rgba(24, 133, 126, 0.12);
}

.status-box p {
    color: #8fd1ca !important;
    font-size: 0.75rem;
    line-height: 1.4;
}

.status-box.status-error {
    background: rgba(184, 69, 53, 0.14);
}

.status-box.status-error .status-pulse {
    background: #d97060;
    box-shadow: 0 0 0 0.3rem rgba(217, 112, 96, 0.11);
}

.status-box.status-error p {
    color: #e8a69c !important;
}

.status-pulse {
    width: 0.5rem;
    height: 0.5rem;
    flex: none;
    border-radius: 50%;
    background: #55bfb5;
    box-shadow: 0 0 0 0.3rem rgba(85, 191, 181, 0.11);
}

.player-info {
    margin: 0 0 0.8rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
    color: var(--paper-dim);
    font-size: 0.75rem;
}

.player-info span {
    margin-left: 0.3rem;
    font-size: 0.84rem;
}

.waiting-room {
    margin-top: 0;
}

.slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.slot {
    width: auto;
    min-width: 0;
    padding: 0.7rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.035);
    text-align: center;
    transition: border-color 250ms ease, background-color 250ms ease;
}

.slot.filled {
    border-color: rgba(243, 236, 220, 0.42);
    background: rgba(255, 255, 255, 0.075);
}

.slot-color,
.player-dot {
    border-radius: 50%;
}

.slot-color {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0 auto 0.4rem;
    border: 2px solid rgba(255, 255, 255, 0.28);
}

.slot strong {
    display: block;
    color: var(--paper);
    font-size: 0.76rem;
}

.slot-color.red,
.player-dot.red { background: var(--ember); }
.slot-color.violet,
.player-dot.violet { background: var(--violet); }
.slot-color.gold,
.player-dot.gold { background: var(--gold); }

.slot-status {
    margin-top: 0.2rem;
    color: #758785;
    font-size: 0.62rem;
}

.slot.filled .slot-status {
    color: #8fd1ca;
}

.slot.bot {
    border-style: dashed;
    background: rgba(210, 169, 59, 0.08);
}

.slot.bot .slot-status {
    color: var(--gold);
    font-family: "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0.08em;
}

.bot-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.bot-control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.35rem;
    margin: 0;
    padding: 0.5rem 0.65rem;
    font-size: 0.72rem;
}

.bot-control-btn svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.bot-control-btn:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

#wait-text {
    color: var(--paper-dim);
    font-size: 0.72rem;
    text-align: center;
}

