/* 局內人 design system — primitive → semantic → component */
@layer reset, tokens, base, components, compact, lobby, utilities;
@layer reset { *,*::before,*::after{box-sizing:border-box} html{scroll-behavior:smooth} body,h1,h2,h3,p,dl,dd{margin:0} button,input{font:inherit} button{cursor:pointer} a{color:inherit} img{max-width:100%} }
@layer tokens {
  :root {
    /* primitives */
    --ink-950:#17201d; --ink-800:#27332f; --ink-600:#53615c; --ink-400:#87938e;
    --paper-50:#fffdf8; --paper-100:#f7f2e8; --paper-200:#ebe2d2; --paper-300:#d8cab6;
    --coral-500:#e55d4a; --coral-600:#c84738; --teal-500:#177f73; --teal-600:#0e695f;
    --aurora-mint:#54cdbd; --aurora-blue:#6ea8ff; --aurora-violet:#9a7cf6; --aurora-rose:#f08aa5;
    --gold-400:#d6a84d; --red-700:#a52d29; --white:#fff;
    --space-1:.25rem; --space-2:.5rem; --space-3:.75rem; --space-4:1rem; --space-5:1.25rem; --space-6:1.5rem; --space-8:2rem; --space-10:2.5rem; --space-12:3rem; --space-16:4rem;
    --radius-sm:6px; --radius-md:12px; --radius-lg:20px; --radius-xl:30px; --radius-round:999px;
    --shadow-sm:0 1px 2px rgb(23 32 29/.08); --shadow-md:0 18px 50px rgb(23 32 29/.10); --shadow-float:0 24px 70px rgb(13 38 33/.20);
    --font-display:"Avenir Next","PingFang TC","Noto Sans TC",system-ui,sans-serif; --font-game:"Iowan Old Style","Noto Serif TC","Songti TC",serif; --font-ui:Inter,"Noto Sans TC",system-ui,sans-serif;
    --duration-fast:140ms; --duration-normal:240ms;
    /* semantic */
    --color-bg:#f2f4ef; --color-surface:rgb(255 253 248/.84); --color-text:var(--ink-950); --color-muted:var(--ink-600); --color-border:rgb(105 122 115/.22);
    --color-primary:var(--coral-500); --color-primary-hover:var(--coral-600); --color-accent:var(--teal-500); --color-danger:var(--red-700);
    --focus-ring:0 0 0 3px rgb(84 205 189/.25); --section-gap:clamp(2rem,4vw,3.5rem);
    /* components */
    --button-radius:var(--radius-sm); --button-height:40px; --button-pad:0 var(--space-4); --card-bg:var(--color-surface); --card-border:1px solid var(--color-border); --card-radius:var(--radius-md);
    --input-bg:var(--paper-50); --input-border:var(--paper-300); --input-focus:var(--coral-500);
  }
}
@layer base {
  html{color-scheme:light;background:var(--color-bg)} body{min-height:100vh;background:radial-gradient(circle at 8% 4%,rgb(84 205 189/.15),transparent 30rem),radial-gradient(circle at 88% 10%,rgb(154 124 246/.12),transparent 28rem),radial-gradient(circle at 62% 92%,rgb(110 168 255/.10),transparent 32rem),var(--color-bg);background-attachment:fixed;color:var(--color-text);font-family:var(--font-ui);font-size:14px;line-height:1.5}
  h1,h2,h3{font-family:var(--font-display);line-height:1.1;letter-spacing:-.025em} h1{font-size:clamp(2rem,4vw,3.8rem);font-weight:600} h2{font-size:clamp(1.45rem,2.5vw,2.1rem)} h3{font-size:1.4rem} p{color:var(--color-muted)}
  input{min-height:40px;width:100%;border:1px solid var(--input-border);border-radius:var(--radius-sm);background:var(--input-bg);padding:0 var(--space-3);color:var(--color-text);outline:none;transition:border var(--duration-fast),box-shadow var(--duration-fast)} input:focus{border-color:var(--aurora-mint);box-shadow:var(--focus-ring)}
  button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--coral-500);outline-offset:3px}.skip-link{position:fixed;z-index:999;top:10px;left:10px;transform:translateY(-150%);background:var(--ink-950);color:white;padding:.7rem 1rem}.skip-link:focus{transform:none}
}
@layer components {
  .site-header{height:78px;padding:0 clamp(1rem,4vw,3.5rem);display:flex;align-items:center;border-bottom:1px solid var(--color-border);background:rgb(247 242 232/.92);backdrop-filter:blur(16px);position:sticky;top:0;z-index:40}.brand{display:flex;align-items:center;gap:.7rem;text-decoration:none;margin-right:auto}.brand-mark{width:38px;height:38px;display:grid;place-items:center;flex:0 0 auto;background:var(--ink-950);color:var(--paper-50);border-radius:50%}.brand-symbol{width:74%;height:74%;display:block;overflow:visible}.brand>span:last-child{display:flex;flex-direction:column;line-height:1}.brand strong{font-family:var(--font-display);font-size:1.15rem;font-weight:700;letter-spacing:.08em}.brand small{font-size:.55rem;letter-spacing:.18em;margin-top:.3rem}.brand-light{color:white}.brand-light .brand-mark{background:var(--paper-50);color:var(--ink-950)}
  .site-nav{display:flex;gap:var(--space-8);margin:0 var(--space-8)}.site-nav a{text-decoration:none;color:var(--ink-600);font-weight:650;font-size:.86rem}.site-nav a:hover{color:var(--ink-950)}.site-nav .lobby-nav-link{min-height:38px;display:inline-flex;align-items:center;gap:.55rem;padding:.26rem .7rem .26rem .32rem;border:1px solid rgb(23 127 115/.24);border-radius:var(--radius-round);background:linear-gradient(135deg,rgb(84 205 189/.18),rgb(110 168 255/.12) 58%,rgb(154 124 246/.12));color:var(--ink-950);font-size:.74rem;font-weight:800;box-shadow:0 6px 18px rgb(23 82 70/.08),inset 0 1px rgb(255 255 255/.7);transition:transform var(--duration-fast),border-color var(--duration-fast),box-shadow var(--duration-fast),background var(--duration-fast)}.site-nav .lobby-nav-link::after{content:"→";margin-left:.12rem;color:var(--teal-600);font-size:.9rem;transition:transform var(--duration-fast)}.site-nav .lobby-nav-link:hover{transform:translateY(-1px);border-color:rgb(23 127 115/.42);background:linear-gradient(135deg,rgb(84 205 189/.28),rgb(110 168 255/.17) 58%,rgb(154 124 246/.16));box-shadow:0 9px 24px rgb(23 82 70/.13),inset 0 1px rgb(255 255 255/.8)}.site-nav .lobby-nav-link:hover::after{transform:translateX(2px)}.lobby-nav-icon{width:27px;height:27px;display:grid;grid-template-columns:repeat(2,4px);grid-auto-rows:4px;place-content:center;gap:3px;border-radius:50%;background:var(--ink-950);box-shadow:0 5px 12px rgb(23 32 29/.18)}.lobby-nav-icon i{width:4px;height:4px;border-radius:50%;background:var(--aurora-mint)}.lobby-nav-icon i:nth-child(2),.lobby-nav-icon i:nth-child(3){background:var(--aurora-blue)}.header-player{display:flex;align-items:center;gap:.35rem;padding-left:var(--space-6);border-left:1px solid var(--color-border)}.profile-link{display:flex;align-items:center;gap:.7rem;padding:.3rem .5rem;border-radius:var(--radius-round);text-decoration:none;transition:background var(--duration-fast),box-shadow var(--duration-fast)}.profile-link:hover{background:rgb(84 205 189/.12)}.profile-link:focus-visible{box-shadow:var(--focus-ring)}.avatar{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:var(--teal-500);color:white;font-family:var(--font-display);font-weight:700}.avatar.large{width:48px;height:48px;font-size:1.25rem}.player-label{display:flex;flex-direction:column;line-height:1.2}.player-label small{font-size:.58rem;letter-spacing:.09em;color:var(--ink-600);margin-top:.2rem}.icon-button{width:42px;height:42px;border:0;border-radius:50%;background:transparent;color:inherit;font-size:1.1rem}.icon-button:hover{background:var(--paper-200)}
  .page-shell{width:min(1180px,calc(100% - 2rem));margin:0 auto;padding:clamp(2rem,5vw,4.5rem) 0 6rem}.eyebrow{font-size:.68rem;font-weight:800;letter-spacing:.2em;text-transform:uppercase;color:rgb(255 255 255/.68)}.eyebrow.ink{color:var(--coral-600)}
  .button{min-height:var(--button-height);border:0;border-radius:var(--button-radius);padding:var(--button-pad);display:inline-flex;align-items:center;justify-content:center;gap:.7rem;text-decoration:none;font-weight:750;transition:transform var(--duration-fast),background var(--duration-fast),box-shadow var(--duration-fast)}.button:hover{transform:translateY(-1px)}.button.primary,.button.coral{background:var(--coral-500);color:white}.button.primary:hover,.button.coral:hover{background:var(--coral-600);box-shadow:0 8px 24px rgb(229 93 74/.22)}.button.teal{background:var(--teal-500);color:white}.button.teal:hover{background:var(--teal-600)}.button.dark{background:var(--ink-950);color:white}.button.ghost{border:1px solid var(--color-border);background:transparent;color:var(--ink-800)}.button.ghost:hover{background:var(--paper-200)}.button.danger{border:1px solid rgb(165 45 41/.3);background:transparent;color:var(--color-danger)}.wide{width:100%}
  .notice{padding:.8rem 1rem;border-left:3px solid var(--ink-400);background:var(--paper-200);margin-bottom:var(--space-5)}.notice.error{border-color:var(--red-700);color:var(--red-700);background:#f9e8e4}.notice.success{border-color:var(--teal-500);color:var(--teal-600);background:#e1f1ec}
  .floating-notice-stack{position:fixed;z-index:220;left:50%;bottom:max(1rem,env(safe-area-inset-bottom));width:min(460px,calc(100% - 1.25rem));display:grid;gap:.5rem;transform:translateX(-50%);pointer-events:none}.floating-notice{margin:0!important;box-shadow:0 14px 38px rgb(23 32 29/.2);opacity:1;transform:translateY(0);transition:opacity 200ms ease,transform 200ms ease;pointer-events:auto}.floating-notice.is-leaving{opacity:0;transform:translateY(10px)}
  .auth-page{background:var(--ink-950)}.auth-shell{min-height:100vh;display:grid;grid-template-columns:minmax(340px,.95fr) minmax(500px,1.05fr)}.auth-story{background:var(--ink-950);color:white;padding:clamp(2rem,5vw,5rem);display:flex;flex-direction:column;position:relative;overflow:hidden}.auth-story::after{content:"";width:460px;height:460px;border:1px solid rgb(255 255 255/.09);border-radius:50%;position:absolute;right:-230px;bottom:-90px;box-shadow:0 0 0 60px rgb(255 255 255/.025),0 0 0 120px rgb(255 255 255/.02)}.story-copy{margin:auto 0;max-width:590px;position:relative;z-index:1}.story-copy h1{font-size:clamp(4rem,8vw,7.8rem);margin:.7rem 0 1.5rem;color:var(--paper-50)}.story-copy p:last-child{max-width:430px;color:rgb(255 255 255/.62);font-size:1.05rem}.register-story blockquote{max-width:390px;margin:0;color:rgb(255 255 255/.48);font-family:var(--font-display);font-style:italic}.auth-panel{background:var(--paper-100);display:grid;place-items:center;padding:2rem}.auth-form-wrap{width:min(480px,100%)}.auth-form-wrap h2{font-size:3rem;margin:.45rem 0 .7rem}.stack-form{display:grid;gap:1.1rem;margin-top:2.2rem}.stack-form label,.admin-form label,.reset-form label{display:grid;gap:.4rem;font-size:.8rem;font-weight:750;color:var(--ink-800)}.stack-form label small{font-weight:500;color:var(--ink-400)}.oauth-button{margin-top:1.5rem;border:1px solid rgb(105 122 115/.3);background:rgb(255 255 255/.72);color:var(--ink-800);box-shadow:var(--shadow-sm)}.oauth-button:hover{border-color:rgb(66 133 244/.42);background:white;box-shadow:0 8px 24px rgb(66 133 244/.1)}.google-mark{width:24px;height:24px;display:grid;place-items:center;flex:0 0 auto;border:1px solid rgb(105 122 115/.18);border-radius:50%;background:white;color:#4285f4;font-family:Arial,sans-serif;font-size:.95rem;font-weight:800;line-height:1;box-shadow:0 1px 2px rgb(23 32 29/.08)}.auth-divider{display:flex;align-items:center;gap:.75rem;margin:1rem 0;color:var(--ink-400);font-size:.66rem;font-weight:700;letter-spacing:.04em}.auth-divider::before,.auth-divider::after{content:"";height:1px;flex:1;background:var(--color-border)}.auth-login-form{margin-top:0}.auth-switch{text-align:center;margin-top:1.7rem}.auth-switch a{color:var(--coral-600);font-weight:750}.two-column-form{grid-template-columns:1fr 1fr}.full{grid-column:1/-1}
  .lobby-hero{display:flex;align-items:flex-end;justify-content:space-between;padding-bottom:var(--section-gap);gap:2rem}.lobby-hero h1{margin:.55rem 0 1rem}.player-stats{display:flex;border-top:1px solid var(--color-border);border-bottom:1px solid var(--color-border)}.player-stats div{min-width:90px;padding:.8rem 1rem;text-align:center;border-right:1px solid var(--color-border)}.player-stats div:last-child{border:0}.player-stats dt{font-size:.7rem;color:var(--ink-600)}.player-stats dd{font-family:var(--font-display);font-size:1.6rem}.section-heading{display:flex;align-items:end;justify-content:space-between;gap:2rem;margin-bottom:var(--space-8)}.section-heading.compact{align-items:center;margin-bottom:var(--space-5)}.section-heading h2{margin-top:.35rem}.join-code{display:grid;grid-template-columns:auto 150px auto;align-items:center;gap:.7rem}.join-code label{font-size:.75rem;font-weight:700}.join-code input{text-transform:uppercase;letter-spacing:.15em;font-weight:800}
  .game-grid{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-6)}.game-card{display:grid;grid-template-columns:43% 57%;min-height:390px;border:var(--card-border);border-radius:var(--card-radius);background:var(--card-bg);overflow:hidden;box-shadow:var(--shadow-sm)}.game-art{position:relative;min-height:260px;display:grid;place-items:center;overflow:hidden}.xiangqi-art{background:#322522}.xiangqi-art::before{content:"";position:absolute;inset:24px;background:repeating-linear-gradient(0deg,transparent 0 37px,rgb(255 255 255/.08) 38px),repeating-linear-gradient(90deg,transparent 0 37px,rgb(255 255 255/.08) 38px);transform:rotate(-5deg) scale(1.1)}.xiangqi-art span{position:absolute;width:86px;height:86px;border-radius:50%;display:grid;place-items:center;background:var(--paper-200);border:5px double var(--red-700);color:var(--red-700);font-family:var(--font-game);font-size:2.5rem;box-shadow:var(--shadow-float)}.xiangqi-art span:first-child{transform:translate(-38px,-82px) rotate(-13deg)}.xiangqi-art span:nth-child(2){transform:translate(54px,12px) rotate(9deg);background:#433b35;color:var(--paper-200);border-color:#776a5d}.xiangqi-art span:last-child{transform:translate(-30px,94px) rotate(7deg)}.gem-art{background:#123d39}.gem-art i{position:absolute;width:94px;height:112px;clip-path:polygon(50% 0,92% 23%,100% 72%,50% 100%,0 72%,8% 23%);background:#f4f0df;box-shadow:inset 0 0 0 10px rgb(255 255 255/.2)}.gem-art i:nth-child(1){transform:translate(-48px,-80px) rotate(-13deg);background:#50a9b7}.gem-art i:nth-child(2){transform:translate(56px,-25px) rotate(10deg);background:#d86450}.gem-art i:nth-child(3){transform:translate(-28px,72px) rotate(-4deg);background:#4a9a78}.gem-art i:nth-child(4){width:55px;height:66px;transform:translate(85px,100px);background:#d6a84d}.gem-art i:nth-child(5){width:45px;height:55px;transform:translate(-92px,35px);background:#ddd7ce}.game-copy{padding:var(--space-8);display:flex;flex-direction:column}.game-copy .eyebrow{color:var(--ink-400)}.game-copy h3{font-size:2.6rem;margin:.35rem 0 1rem}.game-copy>p{font-size:.9rem}.game-meta{display:flex;gap:.8rem;margin:1.2rem 0;font-size:.7rem;color:var(--ink-600)}.game-meta span{padding-right:.8rem;border-right:1px solid var(--color-border)}.game-meta a{margin-left:auto;color:var(--coral-600)}.game-copy form{display:grid;gap:.65rem;margin-top:auto}.game-copy input{background:var(--paper-100)}
  .lobby-lists{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-10);padding-top:var(--section-gap)}.count{min-width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--ink-950);color:white}.room-list{border-top:1px solid var(--color-border)}.room-row{min-height:74px;display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:1rem;padding:.85rem .25rem;border-bottom:1px solid var(--color-border);text-decoration:none}.room-row div{display:flex;flex-direction:column}.room-row small{color:var(--ink-600)}.room-row code{letter-spacing:.12em}.game-dot,.status-mark{width:10px;height:10px;border-radius:50%;background:var(--gold-400)}.coral-bg{background:var(--coral-500)}.teal-bg{background:var(--teal-500)}.status-mark.waiting{background:var(--gold-400)}.status-mark.active{background:var(--teal-500);box-shadow:0 0 0 4px rgb(23 127 115/.12)}.status-mark.finished{background:var(--ink-400)}.status-mark.abandoned{background:var(--coral-500);box-shadow:0 0 0 4px rgb(229 93 74/.1)}.empty-state{min-height:170px;border:1px dashed var(--color-border);display:grid;place-content:center;text-align:center;color:var(--ink-400)}.empty-state>span{font-size:2rem}.empty-state p{margin-top:.5rem;font-size:.85rem}
  .game-shell{width:min(1600px,calc(100% - 1.5rem));margin:auto;padding:.75rem 0}.back-link{display:inline-block;text-decoration:none;color:var(--ink-600);font-size:.8rem}.connection{display:flex;align-items:center;gap:.5rem;font-size:.75rem;color:var(--ink-600)}#connection-dot{width:8px;height:8px;border-radius:50%;background:var(--gold-400)}#connection-dot.online{background:var(--teal-500);box-shadow:0 0 0 4px rgb(23 127 115/.13)}#connection-dot.offline{background:var(--coral-500)}
  .waiting-panel{min-height:calc(100dvh - 88px);background:var(--paper-50);border:var(--card-border);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2rem;position:relative}.waiting-room-heading{position:absolute;top:1.25rem;left:1.5rem;text-align:left}.waiting-room-heading h1{font-size:1.8rem;margin-top:.2rem}.waiting-room-heading .back-link{margin-bottom:.5rem}.waiting-panel h2{font-size:2.7rem;margin:.6rem 0}.waiting-orbit{width:130px;height:130px;border:1px solid var(--paper-300);border-radius:50%;display:grid;place-items:center;position:relative;margin-bottom:2rem}.waiting-orbit span{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:var(--ink-950);color:white;font-family:var(--font-display);font-size:1.5rem}.waiting-orbit i{position:absolute;width:12px;height:12px;background:var(--coral-500);border-radius:50%;animation:orbit 4s linear infinite}.waiting-orbit i:nth-child(2){animation-delay:-1.33s;background:var(--teal-500)}.waiting-orbit i:nth-child(3){animation-delay:-2.66s;background:var(--gold-400)}@keyframes orbit{from{transform:rotate(0deg) translateX(65px)}to{transform:rotate(360deg) translateX(65px)}}.invite-code{display:flex;flex-direction:column;min-width:260px;border:1px solid var(--color-border);background:var(--paper-100);padding:1rem 2rem;margin-top:2rem}.invite-code span,.invite-code small{font-size:.65rem;color:var(--ink-600)}.invite-code strong{font-size:1.8rem;letter-spacing:.18em}
  .table-layout{--play-height:calc(100dvh - 64px - 1.5rem);height:var(--play-height);display:grid;grid-template-columns:minmax(0,1fr) clamp(320px,23vw,360px);gap:.75rem;align-items:stretch}.board-column,.game-info-card,.game-sidebar{border:var(--card-border);background:var(--paper-50)}.board-column{min-width:0;min-height:0;display:grid;place-items:center;background:#e9dec9}.game-board{width:100%;height:100%;min-height:0;padding:clamp(.4rem,1.2vh,.9rem);overflow:auto}.game-page[data-game-type="DARK_CHESS"] .game-board{display:grid;place-items:center;overflow:hidden}.game-rail{min-width:0;min-height:0;height:100%;display:grid;grid-template-rows:auto minmax(0,1fr);gap:.75rem}.game-info-card{overflow:hidden;background:rgb(255 253 248/.88);backdrop-filter:blur(18px)}.game-info-nav{display:flex;align-items:center;justify-content:space-between;padding:.55rem .75rem .35rem}.game-info-card>.eyebrow,.game-info-card>h1{margin-left:.75rem;margin-right:.75rem}.game-info-card>h1{font-size:1.45rem;margin-top:.18rem;margin-bottom:.55rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.players-strip{display:grid;grid-template-columns:1fr 1fr;border-top:1px solid var(--color-border)}.player-seat{display:flex;align-items:center;gap:.5rem;min-width:0;padding:.55rem .65rem}.player-seat:last-child{justify-content:flex-end;text-align:right;border-left:1px solid var(--color-border)}.player-seat.active{background:linear-gradient(135deg,rgb(84 205 189/.16),rgb(110 168 255/.1))}.seat-meta{display:flex;flex-direction:column;min-width:0}.seat-meta strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.seat-meta small{font-size:.62rem;color:var(--ink-600);white-space:nowrap}.turn-banner{position:relative;min-height:52px;display:flex;align-items:center;padding:.65rem .8rem .65rem 2.6rem;background:linear-gradient(135deg,var(--ink-950),#2b3a35);color:white;font-size:.85rem;font-weight:800;letter-spacing:.04em;box-shadow:inset 0 1px rgb(255 255 255/.08)}.turn-banner::before{content:"";position:absolute;left:1rem;width:11px;height:11px;border-radius:50%;background:var(--gold-400);box-shadow:0 0 0 5px rgb(214 168 77/.16)}.turn-banner.is-your-turn{background:linear-gradient(135deg,var(--teal-600),var(--teal-500));box-shadow:inset 0 1px rgb(255 255 255/.16),0 8px 22px rgb(23 127 115/.2)}.turn-banner.is-your-turn::before{background:white;box-shadow:0 0 0 5px rgb(255 255 255/.18);animation:turn-pulse 1.8s ease-in-out infinite}.turn-banner.is-finished{background:linear-gradient(135deg,#3a3530,#66594d)}.turn-banner.is-finished::before{background:var(--paper-300);box-shadow:none}@keyframes turn-pulse{50%{transform:scale(.72);box-shadow:0 0 0 9px rgb(255 255 255/.08)}}.game-actions{display:flex;justify-content:space-between;gap:.5rem;padding:.55rem .65rem;border-top:1px solid var(--color-border)}.game-actions .button{min-height:34px}.game-sidebar{min-height:0;display:flex;flex-direction:column;background:rgb(255 253 248/.86);backdrop-filter:blur(18px)}.sidebar-tabs{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--color-border)}.sidebar-tabs button{height:44px;border:0;background:transparent;color:var(--ink-600);font-weight:700}.sidebar-tabs button[aria-selected=true]{color:var(--ink-950);box-shadow:inset 0 -2px var(--coral-500)}.side-panel{min-height:0;flex:1;display:flex;flex-direction:column}.chat-list{flex:1;overflow:auto;padding:.75rem}.chat-message{margin-bottom:.75rem}.chat-message header{display:flex;justify-content:space-between;font-size:.64rem;color:var(--ink-400)}.chat-message.own header strong{color:var(--teal-600)}.chat-message p{display:inline-block;background:var(--paper-100);padding:.45rem .65rem;margin-top:.2rem;color:var(--ink-800);border-radius:2px 10px 10px 10px}.chat-message.own{text-align:right}.chat-message.own p{background:#dfeee9;border-radius:10px 2px 10px 10px}.chat-form{display:grid;grid-template-columns:1fr auto;gap:.4rem;padding:.65rem;border-top:1px solid var(--color-border)}.chat-form input{border:0;background:var(--paper-100)}.send{background:var(--coral-500);color:white}.history-list{margin:0;padding:.75rem .75rem .75rem 2.35rem;overflow:auto}.history-list li{padding:.45rem;border-bottom:1px solid var(--color-border);font-size:.74rem}.history-list small{display:block;color:var(--ink-400)}
  .xiangqi-stage{width:100%;height:100%;min-height:0;display:flex;justify-content:center;gap:clamp(.4rem,1vw,.85rem);align-items:center}.xiangqi-board{flex:0 1 auto;width:min(100%,820px,calc((var(--play-height) - 1.8rem) * .9));aspect-ratio:9/10;margin:0;display:grid;grid-template-columns:repeat(9,1fr);grid-template-rows:repeat(10,1fr);position:relative;background:#d9b980;border:8px solid #6f4a2d;box-shadow:inset 0 0 0 2px #2f2118,var(--shadow-md)}
  .xiangqi-cell{position:relative;border:0;background:transparent;min-width:0;display:grid;place-items:center}
  .xiangqi-cell::before,.xiangqi-cell::after{content:"";position:absolute;background:rgb(62 40 23/.55)}
  /* Every rank is continuous from the left-most 車 point to the right-most 車 point. */
  .xiangqi-cell::before{height:1px;width:100%;top:50%;left:0}
  .xiangqi-cell:nth-child(9n+1)::before{width:50%;left:50%}
  .xiangqi-cell:nth-child(9n)::before{width:50%;left:0}
  /* Files stop at the board edges and break across 楚河漢界; only both banks stay closed. */
  .xiangqi-cell::after{width:1px;height:100%;top:0;left:50%}
  .xiangqi-cell:nth-child(-n+9)::after{height:50%;top:50%}
  .xiangqi-cell:nth-child(n+82)::after{height:50%;top:0}
  .xiangqi-cell:nth-child(n+38):nth-child(-n+44)::after{height:50%;top:0}
  .xiangqi-cell:nth-child(n+47):nth-child(-n+53)::after{height:50%;top:50%}
  .xiangqi-piece{position:relative;z-index:2;width:76%;aspect-ratio:1;border-radius:50%;border:3px double currentColor;background:#f2ddae;display:grid;place-items:center;font-family:var(--font-game);font-weight:800;font-size:clamp(1rem,3vw,2rem);box-shadow:0 4px 8px rgb(62 40 23/.25);transition:transform var(--duration-fast),box-shadow var(--duration-fast)}.xiangqi-piece-label{width:100%;height:100%;display:grid;place-items:center;transition:transform var(--duration-fast)}.xiangqi-piece-label.opponent-facing{transform:rotate(180deg)}.xiangqi-piece.red{color:var(--red-700)}.xiangqi-piece.black{color:#222}.xiangqi-piece.hidden-piece{background:#50463b;color:#ead8b6;border-color:#807160;background-image:repeating-radial-gradient(circle at 50%,transparent 0 6px,rgb(255 255 255/.04) 7px 8px)}.xiangqi-piece.selected{z-index:4;transform:translateY(-3px) scale(1.04);box-shadow:0 0 0 3px #fff4dc,0 0 0 8px #ef3f32,0 0 24px 11px rgb(239 63 50/.42),0 9px 15px rgb(62 40 23/.34)}.captured-tray{flex:1 1 76px;max-width:92px;width:100%;height:min(100%,920px);align-self:center;padding:.6rem .35rem;display:flex;flex-direction:column;align-items:center;gap:.7rem;border:1px solid rgb(111 74 45/.2);background:linear-gradient(180deg,rgb(255 253 248/.44),rgb(217 185 128/.14));box-shadow:inset 0 1px rgb(255 255 255/.35)}.captured-tray header{width:100%;display:grid;justify-items:center;gap:.25rem;text-align:center}.captured-tray header strong{font-size:.62rem;letter-spacing:.08em;color:var(--ink-600)}.captured-tray header span{min-width:22px;height:22px;padding:0 .3rem;border-radius:999px;display:grid;place-items:center;background:var(--ink-950);color:white;font-size:.65rem}.captured-list{display:grid;grid-template-columns:repeat(2,minmax(24px,30px));gap:.4rem;align-content:start;justify-content:center}.captured-piece{width:clamp(24px,2vw,30px);aspect-ratio:1;border-radius:50%;border:2px double currentColor;background:#f2ddae;display:grid;place-items:center;font-family:var(--font-game);font-size:.88rem;font-weight:800;box-shadow:0 2px 5px rgb(62 40 23/.22)}.captured-piece.red{color:var(--red-700)}.captured-piece.black{color:#222}.captured-piece.hidden-piece{color:#ead8b6;border-color:#807160;background-color:#50463b;background-image:repeating-radial-gradient(circle at 50%,transparent 0 4px,rgb(255 255 255/.05) 5px 6px);box-shadow:inset 0 0 0 1px rgb(255 255 255/.08),0 2px 5px rgb(62 40 23/.25)}.captured-empty{grid-column:1/-1;color:var(--ink-400);font-size:.62rem;writing-mode:vertical-rl;letter-spacing:.15em;margin-top:.3rem}
  .spendee-table{display:grid;gap:1rem}.bank-row{display:grid;grid-template-columns:repeat(6,1fr);gap:.5rem}.gem-stack{border:1px solid var(--color-border);background:var(--paper-50);padding:.65rem .35rem;text-align:center;min-width:0}.gem-token{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;margin:auto;border:3px double rgb(255 255 255/.55);box-shadow:var(--shadow-sm);font-weight:800}.gem-token.DIAMOND{background:#efeee8}.gem-token.SAPPHIRE{background:#3d82b1;color:white}.gem-token.EMERALD{background:#3c946e;color:white}.gem-token.RUBY{background:#c95449;color:white}.gem-token.ONYX{background:#393b3a;color:white}.gem-token.GOLD{background:#d9ad50}.gem-stack small{font-size:.62rem}.bank-actions{display:flex;gap:.25rem;margin-top:.5rem}.bank-actions button{flex:1;border:0;background:var(--paper-200);font-size:.63rem;min-height:30px}.bank-actions button:hover,.bank-actions button.selected{background:var(--ink-950);color:white}.take-selection{display:flex;align-items:center;justify-content:space-between;background:#123d39;color:white;padding:.75rem 1rem}.take-selection p{color:rgb(255 255 255/.7);font-size:.75rem}.take-selection .button{min-height:36px}.nobles-row{display:flex;gap:.5rem}.noble-tile{background:#eee5d5;border:1px solid var(--gold-400);padding:.6rem;min-width:110px}.noble-tile strong{font-family:var(--font-display);font-size:1.2rem}.cost-list{display:flex;gap:.25rem;flex-wrap:wrap}.cost-chip{font-size:.62rem;padding:.1rem .35rem;background:var(--paper-200);border-radius:2px}.market-row{display:grid;grid-template-columns:48px repeat(4,1fr);gap:.5rem}.tier-deck{background:var(--ink-950);color:white;display:grid;place-items:center;writing-mode:vertical-rl;font-size:.7rem;letter-spacing:.08em}.dev-card{min-height:145px;background:var(--paper-50);border:1px solid var(--color-border);padding:.65rem;display:flex;flex-direction:column;position:relative;overflow:hidden}.dev-card::after{content:"";position:absolute;width:70px;height:70px;right:-25px;top:-25px;border-radius:50%;background:var(--bonus-color,#bbb);opacity:.25}.card-head{display:flex;justify-content:space-between;position:relative;z-index:1}.card-points{font-family:var(--font-display);font-size:1.5rem}.card-gem{width:25px;height:25px;border-radius:50%;background:var(--bonus-color)}.dev-card .cost-list{margin-top:auto}.card-actions{display:flex;gap:.3rem;margin-top:.5rem}.card-actions button{border:0;min-height:28px;padding:0 .4rem;font-size:.62rem;background:var(--paper-200)}.card-actions button:first-child{background:var(--teal-500);color:white}.player-economy{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}.economy-panel{background:var(--paper-50);border:1px solid var(--color-border);padding:.75rem}.economy-panel h3{font-size:1rem;margin-bottom:.5rem}.economy-stats{display:flex;gap:.35rem;flex-wrap:wrap}.mini-gem{font-size:.66rem;padding:.25rem .4rem;border:1px solid var(--color-border)}.reserved-row{display:flex;gap:.35rem;margin-top:.6rem}.reserved-card{border:1px dashed var(--color-border);padding:.35rem;font-size:.65rem;background:var(--paper-100)}
  .modal{width:min(540px,calc(100% - 2rem));border:0;background:var(--paper-50);padding:2rem;box-shadow:var(--shadow-float)}.modal::backdrop{background:rgb(23 32 29/.72);backdrop-filter:blur(4px)}.modal-close{position:absolute;right:1rem;top:1rem;border:0;background:transparent;font-size:1.5rem}.modal h2{margin:.5rem 0 1rem}.modal menu{display:flex;justify-content:flex-end;gap:.5rem;padding:0;margin:1.5rem 0 0}.quick-rule-list{padding-left:1.2rem}.quick-rule-list li{margin:.6rem 0}.return-control{display:grid;grid-template-columns:1fr auto auto auto;align-items:center;gap:.6rem;padding:.55rem 0;border-bottom:1px solid var(--color-border)}.return-control button{width:32px;height:32px;border:1px solid var(--color-border);background:transparent}.toast{position:fixed;z-index:90;left:50%;bottom:24px;transform:translate(-50%,150%);background:var(--ink-950);color:white;padding:.75rem 1rem;box-shadow:var(--shadow-float);transition:transform var(--duration-normal)}.toast.show{transform:translate(-50%,0)}
  .profile-shell{width:min(980px,calc(100% - 2rem));padding-top:2rem}.profile-heading{display:flex;align-items:center;gap:1rem;margin:1.4rem 0 1.5rem}.profile-heading h1{margin:.25rem 0;font-size:clamp(1.8rem,3vw,2.6rem)}.profile-heading p:last-child{font-size:.86rem}.profile-avatar{width:64px;height:64px;display:grid;place-items:center;flex:0 0 auto;border-radius:50%;background:linear-gradient(145deg,var(--teal-500),#265f75);color:white;font-family:var(--font-display);font-size:1.7rem;box-shadow:0 12px 30px rgb(23 127 115/.2)}.profile-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(260px,.75fr);gap:1rem}.profile-card{min-width:0;padding:1.35rem;border:var(--card-border);border-radius:var(--radius-lg);background:rgb(255 253 248/.78);box-shadow:var(--shadow-md);backdrop-filter:blur(20px)}.profile-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding-bottom:1rem;border-bottom:1px solid var(--color-border)}.profile-card>header h2{margin-top:.25rem;font-size:1.35rem}.profile-card-index{color:rgb(23 127 115/.28);font-family:var(--font-display);font-size:2rem;line-height:1}.profile-form{margin-top:1.1rem}.profile-form input[readonly]{border-style:dashed;background:rgb(235 226 210/.55);color:var(--ink-600);cursor:not-allowed}.profile-actions{display:flex;justify-content:flex-end;gap:.55rem;padding-top:.25rem}.security-card{display:flex;flex-direction:column}.security-card>p{margin:.8rem 0 1.2rem;font-size:.78rem}.security-card>.button{margin-top:auto}.security-illustration{min-height:150px;display:grid;place-items:center;margin:.8rem 0;border:1px solid rgb(84 205 189/.18);border-radius:var(--radius-md);background:radial-gradient(circle,rgb(84 205 189/.22),transparent 44%),linear-gradient(145deg,rgb(110 168 255/.09),rgb(154 124 246/.08))}.security-illustration span{width:58px;height:58px;display:grid;place-items:center;border:2px solid rgb(255 255 255/.8);border-radius:18px;background:var(--ink-950);color:var(--aurora-mint);font-size:1.25rem;transform:rotate(45deg);box-shadow:0 12px 30px rgb(23 32 29/.18)}.security-illustration span::first-letter{display:inline-block}.google-illustration .google-mark{border-radius:50%;background:white;color:#4285f4;font-family:Arial,sans-serif;font-size:1.5rem;transform:none}.connected-badge{display:inline-flex;align-items:center;align-self:flex-start;gap:.45rem;margin-top:auto;padding:.42rem .65rem;border:1px solid rgb(23 127 115/.22);border-radius:var(--radius-round);background:rgb(84 205 189/.1);color:var(--teal-600);font-size:.7rem;font-weight:750}.connected-badge i{width:7px;height:7px;border-radius:50%;background:var(--teal-500);box-shadow:0 0 0 3px rgb(84 205 189/.18)}.profile-password-dialog{border-radius:var(--radius-md)}.profile-password-dialog>form>p{font-size:.8rem}.profile-password-form{margin-top:1.2rem}.password-dialog-error{margin:1rem 0 0}.profile-password-dialog[open]{animation:profile-dialog-in var(--duration-normal) ease-out}@keyframes profile-dialog-in{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
  .rules-page{max-width:1040px}.rules-page article>h1{margin:.7rem 0 1.4rem}.lead{font-family:var(--font-display);font-size:1.35rem;line-height:1.65;max-width:760px}.rules-grid{display:grid;grid-template-columns:1fr 1fr;margin:4rem 0;border-top:1px solid var(--color-border);border-left:1px solid var(--color-border)}.rules-grid section{padding:2rem;border-right:1px solid var(--color-border);border-bottom:1px solid var(--color-border)}.rule-number{font-family:var(--font-display);color:var(--coral-500);font-size:1.4rem}.rules-grid h2{font-size:1.5rem;margin:.8rem 0}.rule-callout{display:flex;gap:1rem;flex-wrap:wrap;background:var(--ink-950);color:white;padding:1.4rem}.rule-callout strong{margin-right:auto}.source-note{font-size:.75rem}.source-note a{color:var(--coral-600)}
  .admin-page>.section-heading h1{margin:.5rem 0}.admin-list{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}.admin-card,.create-role{background:var(--paper-50);border:1px solid var(--color-border);padding:1.4rem}.admin-card-head{display:flex;align-items:center;gap:1rem;margin-bottom:1.3rem}.admin-card-head>div:first-of-type{margin-right:auto}.admin-card-head h2{font-size:1.35rem}.admin-card-head p{font-size:.75rem}.status-chip{margin-left:auto;padding:.25rem .55rem;background:var(--paper-200);font-size:.65rem}.status-chip.active{background:#dfeee9;color:var(--teal-600)}.status-chip.blocked{background:#f9e8e4;color:var(--red-700)}.admin-form{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.admin-form fieldset{border:1px solid var(--color-border);padding:.75rem}.admin-form legend{font-size:.75rem;font-weight:750}.check-row{display:flex!important;grid-template-columns:none!important;align-items:center;gap:.5rem!important;font-weight:500!important;margin:.35rem 0}.check-row input{width:17px;min-height:17px;box-shadow:none}.check-row span{display:flex;flex-direction:column}.check-row small{color:var(--ink-600)}.toggle-row{display:flex;gap:1rem;align-items:center}.toggle-row label{display:flex;align-items:center;gap:.4rem}.toggle-row input{width:18px;min-height:18px}.reset-form{display:grid;grid-template-columns:1fr auto;align-items:end;gap:.5rem;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--color-border)}.create-role{margin-bottom:1rem}.create-role h2{margin-bottom:1rem}.text-danger{border:0;background:transparent;color:var(--red-700);padding:.8rem 0;text-decoration:underline}.error-page{min-height:calc(100vh - 78px);display:grid;place-content:center;justify-items:center;text-align:center;padding:2rem}.error-page>span{font-family:var(--font-display);font-size:9rem;color:var(--paper-300);line-height:1}.error-page h1{font-size:2.5rem;margin:.5rem 0 1rem}.error-page .button{margin-top:2rem}
}
@layer compact {
  /* Compact Aurora UI: denser controls, translucent surfaces and restrained light blooms. */
  .dice-reveal{position:fixed;z-index:100;inset:0;display:grid;place-items:center;padding:1rem;background:rgb(13 27 24/.7);backdrop-filter:blur(12px);opacity:1;transition:opacity .35s ease}.dice-reveal.hidden{display:none}.dice-reveal-card{width:min(360px,100%);padding:1.5rem;text-align:center;color:white;border:1px solid rgb(255 255 255/.18);background:radial-gradient(circle at 20% 10%,rgb(84 205 189/.25),transparent 55%),radial-gradient(circle at 90% 90%,rgb(154 124 246/.2),transparent 50%),var(--ink-950);box-shadow:var(--shadow-float)}.dice-reveal-card h2{margin:.4rem 0 .75rem;font-size:1.65rem}.dice-reveal-card>p:last-child{min-height:1.5em;color:rgb(255 255 255/.72);font-size:.8rem}.dice-face{width:88px;height:88px;margin:.7rem auto 1rem;display:grid;place-items:center;border-radius:18px;background:var(--paper-50);color:var(--ink-950);font-size:4.6rem;line-height:1;box-shadow:inset 0 0 0 2px rgb(23 32 29/.12),0 18px 38px rgb(0 0 0/.35);transform:rotate(0) scale(1)}.dice-face.rolling{animation:dice-tumble .42s cubic-bezier(.35,.1,.65,.9) infinite}.dice-reveal.settled .dice-face{animation:dice-land .38s cubic-bezier(.2,.8,.2,1)}@keyframes dice-tumble{25%{transform:translateY(-14px) rotate(90deg) scale(.92)}50%{transform:rotate(190deg) scale(1.05)}75%{transform:translateY(8px) rotate(280deg) scale(.94)}to{transform:rotate(360deg)}}@keyframes dice-land{0%{transform:translateY(-20px) rotate(-18deg) scale(.88)}65%{transform:translateY(4px) rotate(3deg) scale(1.08)}to{transform:none}}
  #story-title{font-size:clamp(2.5rem,4.4vw,4.2rem)}.register-story .story-copy h1{font-size:clamp(3rem,5.5vw,5.4rem)}
  .language-switch{display:flex;align-items:center;gap:.15rem;padding:.18rem;border:1px solid rgb(105 122 115/.22);border-radius:var(--radius-round);background:rgb(255 255 255/.55)}.site-header>.language-switch{margin-right:.75rem}.language-switch a{min-width:32px;padding:.2rem .42rem;border-radius:var(--radius-round);color:var(--ink-600);font-size:.62rem;font-weight:750;text-align:center;text-decoration:none}.language-switch a.active{background:var(--ink-950);color:white}.auth-language{position:fixed;z-index:20;top:1rem;right:1rem;border-color:rgb(255 255 255/.18);background:rgb(23 32 29/.42);backdrop-filter:blur(10px)}.auth-language a{color:rgb(255 255 255/.7)}.auth-language a.active{background:var(--paper-50);color:var(--ink-950)}
  .site-header{height:64px;padding:0 clamp(.8rem,3vw,2.5rem);background:rgb(247 249 245/.78);border-color:rgb(105 122 115/.18);box-shadow:0 8px 30px rgb(28 58 49/.05)}
  .brand{gap:.55rem}.brand-mark{width:32px;height:32px;font-size:1.08rem;box-shadow:0 0 24px rgb(84 205 189/.2)}.brand strong{font-size:1rem}.brand small{font-size:.5rem;margin-top:.2rem}.site-nav{gap:var(--space-6);margin:0 var(--space-8)}.site-nav a{font-size:.78rem}.header-player{gap:.55rem;padding-left:var(--space-4)}.avatar{width:30px;height:30px}.avatar.large{width:40px;height:40px;font-size:1.05rem}.player-label{font-size:.8rem}.icon-button{width:40px;height:40px;font-size:1rem}
  .page-shell{width:min(1240px,calc(100% - 2rem));padding:clamp(1.5rem,3.5vw,3rem) 0 4rem}.eyebrow{font-size:.61rem;letter-spacing:.18em}.button{font-size:.82rem;gap:.5rem}.notice{padding:.6rem .8rem;margin-bottom:var(--space-4);font-size:.82rem;border-radius:0 var(--radius-sm) var(--radius-sm) 0}
  .auth-story{background:radial-gradient(circle at 12% 18%,rgb(84 205 189/.18),transparent 27rem),radial-gradient(circle at 84% 80%,rgb(154 124 246/.18),transparent 24rem),var(--ink-950)}.auth-story::before{content:"";position:absolute;inset:0;background:linear-gradient(130deg,transparent 36%,rgb(110 168 255/.05),transparent 68%);pointer-events:none}.auth-story>.brand,.auth-story>.story-copy,.auth-story>blockquote{position:relative;z-index:1}.auth-panel{background:rgb(247 249 245/.88);backdrop-filter:blur(24px);padding:1.5rem}.auth-form-wrap{width:min(430px,100%)}.auth-form-wrap h2{font-size:2.25rem;margin:.35rem 0 .5rem}.stack-form{gap:.8rem;margin-top:1.5rem}.stack-form label,.admin-form label,.reset-form label{gap:.3rem;font-size:.75rem}.auth-switch{margin-top:1.2rem;font-size:.8rem}
  .lobby-hero{padding-bottom:var(--section-gap);gap:1.5rem}.lobby-hero h1{margin:.4rem 0 .65rem}.player-stats div{min-width:78px;padding:.6rem .8rem}.player-stats dt{font-size:.64rem}.player-stats dd{font-size:1.35rem}.section-heading{gap:1.25rem;margin-bottom:var(--space-5)}.section-heading.compact{margin-bottom:var(--space-3)}.join-code{grid-template-columns:auto 132px auto;gap:.5rem}.join-code label{font-size:.7rem}
  .game-grid{gap:var(--space-4)}.game-card{grid-template-columns:40% 60%;min-height:330px;box-shadow:0 14px 40px rgb(24 55 47/.07);backdrop-filter:blur(18px)}.game-art{min-height:220px}.xiangqi-art::before{inset:18px}.xiangqi-art span{width:68px;height:68px;border-width:4px;font-size:2rem}.xiangqi-art span:first-child{transform:translate(-30px,-65px) rotate(-13deg)}.xiangqi-art span:nth-child(2){transform:translate(44px,10px) rotate(9deg)}.xiangqi-art span:last-child{transform:translate(-24px,74px) rotate(7deg)}.gem-art i{width:76px;height:90px}.gem-art i:nth-child(1){transform:translate(-40px,-60px) rotate(-13deg)}.gem-art i:nth-child(2){transform:translate(46px,-20px) rotate(10deg)}.gem-art i:nth-child(3){transform:translate(-24px,58px) rotate(-4deg)}.gem-art i:nth-child(4){width:46px;height:54px;transform:translate(68px,78px)}.gem-art i:nth-child(5){width:38px;height:46px;transform:translate(-72px,28px)}.game-copy{padding:var(--space-5)}.game-copy h3{font-size:2.05rem;margin:.25rem 0 .65rem}.game-copy>p{font-size:.82rem}.game-meta{gap:.6rem;margin:.8rem 0;font-size:.65rem}.game-meta span{padding-right:.6rem}.game-copy form{gap:.5rem}
  .lobby-lists{gap:var(--space-6);padding-top:var(--section-gap)}.count{min-width:25px;height:25px;font-size:.7rem}.room-row{min-height:58px;gap:.75rem;padding:.6rem .2rem;font-size:.82rem}.room-row small{font-size:.7rem}.empty-state{min-height:125px}.empty-state>span{font-size:1.55rem}.empty-state p{font-size:.78rem}
  .game-shell{width:min(1600px,calc(100% - 1.5rem));padding:.75rem 0}.back-link{font-size:.72rem}.connection{font-size:.7rem}.waiting-panel{padding:1.5rem;background:rgb(255 253 248/.78);backdrop-filter:blur(18px)}.waiting-panel h2{font-size:2.2rem;margin:.45rem 0}.waiting-orbit{width:105px;height:105px;margin-bottom:1.35rem}.waiting-orbit span{width:48px;height:48px;font-size:1.25rem}@keyframes orbit{from{transform:rotate(0deg) translateX(52px)}to{transform:rotate(360deg) translateX(52px)}}.invite-code{min-width:230px;padding:.7rem 1.3rem;margin-top:1.25rem}.invite-code strong{font-size:1.5rem}
  .table-layout{grid-template-columns:minmax(0,1fr) clamp(320px,23vw,360px);gap:.75rem}.board-column,.game-info-card,.game-sidebar{background:rgb(255 253 248/.82);backdrop-filter:blur(18px)}.board-column{background:#e9dec9}.player-seat{gap:.45rem;padding:.5rem .55rem;font-size:.76rem}.seat-meta small{font-size:.58rem}.turn-banner{padding:.62rem .75rem .62rem 2.6rem;font-size:.82rem}.game-board{padding:clamp(.4rem,1.2vh,.85rem)}.game-actions{padding:.5rem .6rem}.sidebar-tabs button{height:42px;font-size:.78rem}.chat-list{padding:.7rem}.chat-message{margin-bottom:.65rem}.chat-message header{font-size:.62rem}.chat-message p{padding:.42rem .6rem;margin-top:.18rem;font-size:.78rem}.chat-form{gap:.35rem;padding:.6rem}.history-list{padding:.65rem .65rem .65rem 2.2rem}.history-list li{padding:.42rem;font-size:.72rem}
  .spendee-table{gap:.7rem}.bank-row{gap:.35rem}.gem-stack{padding:.5rem .25rem}.gem-token{width:32px;height:32px}.bank-actions{margin-top:.35rem}.bank-actions button{min-height:26px}.take-selection{padding:.55rem .75rem}.nobles-row{gap:.35rem}.noble-tile{padding:.45rem;min-width:95px}.noble-tile strong{font-size:1.05rem}.market-row{grid-template-columns:42px repeat(4,1fr);gap:.35rem}.dev-card{min-height:125px;padding:.5rem}.card-points{font-size:1.25rem}.player-economy{gap:.5rem}.economy-panel{padding:.55rem}.economy-panel h3{margin-bottom:.35rem}.reserved-row{margin-top:.4rem}
  .modal{padding:1.4rem}.modal h2{margin:.4rem 0 .7rem}.modal menu{margin:1rem 0 0}.quick-rule-list li{margin:.4rem 0}.return-control{gap:.45rem;padding:.4rem 0}.toast{bottom:16px;padding:.6rem .8rem;font-size:.78rem}
  .rules-page article>h1{margin:.5rem 0 1rem}.lead{font-size:1.12rem;line-height:1.55}.rules-grid{margin:2.2rem 0}.rules-grid section{padding:1.25rem}.rule-number{font-size:1.1rem}.rules-grid h2{font-size:1.3rem;margin:.55rem 0}.rule-callout{gap:.75rem;padding:1rem}.source-note{font-size:.7rem}
  .admin-page>.section-heading h1{margin:.35rem 0}.admin-list{gap:.75rem}.admin-card,.create-role{padding:1rem;background:rgb(255 253 248/.82);backdrop-filter:blur(18px)}.admin-card-head{gap:.7rem;margin-bottom:.85rem}.admin-card-head h2{font-size:1.15rem}.admin-card-head p{font-size:.7rem}.status-chip{padding:.2rem .45rem;font-size:.6rem}.admin-form{gap:.7rem}.admin-form fieldset{padding:.55rem}.admin-form legend{font-size:.68rem}.check-row{gap:.4rem!important;margin:.25rem 0}.toggle-row{gap:.7rem}.reset-form{margin-top:.7rem;padding-top:.7rem}.create-role{margin-bottom:.75rem}.create-role h2{margin-bottom:.7rem}.text-danger{padding:.55rem 0;font-size:.75rem}.error-page{min-height:calc(100vh - 64px);padding:1.5rem}.error-page>span{font-size:7rem}.error-page h1{font-size:2rem}.error-page .button{margin-top:1.25rem}
}
@layer lobby {
  .lobby-page{background:radial-gradient(circle at 12% 0,rgb(84 205 189/.14),transparent 28rem),radial-gradient(circle at 84% 8%,rgb(154 124 246/.12),transparent 30rem),#eef2ee}
  .lobby-shell{width:min(1420px,calc(100% - 2rem));height:calc(100dvh - 64px);min-height:640px;display:flex;flex-direction:column;padding:1.25rem 0;overflow:hidden}
  .lobby-overview{display:grid;grid-template-columns:minmax(0,1fr) minmax(420px,520px);gap:1px;margin-bottom:1rem;border:1px solid rgb(105 122 115/.2);border-radius:var(--radius-lg);overflow:hidden;background:rgb(105 122 115/.2);box-shadow:0 16px 50px rgb(24 55 47/.06)}
  .lobby-welcome{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:1.1rem 1.25rem;background:rgb(255 253 248/.76);backdrop-filter:blur(20px)}
  .lobby-welcome h1{margin:.22rem 0;font-size:clamp(1.1rem,1.45vw,1.4rem)}
  .lobby-welcome>div>p:last-child{font-size:.78rem}
  .lobby-welcome .player-stats{flex:0 0 auto;border:1px solid var(--color-border);border-radius:var(--radius-md);overflow:hidden;background:rgb(255 255 255/.38)}
  .lobby-welcome .player-stats div{min-width:72px;padding:.45rem .7rem}
  .lobby-welcome .player-stats dt{font-size:.58rem;text-transform:uppercase;letter-spacing:.08em}
  .lobby-welcome .player-stats dd{font-size:1.15rem;font-family:var(--font-ui);font-weight:800}
  .quick-join{display:grid;grid-template-columns:38px minmax(120px,1fr) 112px auto;align-items:center;gap:.65rem;padding:.85rem 1rem;background:linear-gradient(135deg,rgb(23 32 29/.98),rgb(31 55 49/.96));color:white}
  .quick-join-icon{width:34px;height:34px;display:grid;place-items:center;border:1px solid rgb(255 255 255/.18);border-radius:10px;background:linear-gradient(145deg,rgb(84 205 189/.3),rgb(154 124 246/.22));font-weight:900}
  .quick-join label{display:flex;flex-direction:column;line-height:1.25}
  .quick-join label strong{font-size:.78rem}
  .quick-join label small{margin-top:.2rem;color:rgb(255 255 255/.52);font-size:.59rem}
  .quick-join input{min-height:36px;border-color:rgb(255 255 255/.15);background:rgb(255 255 255/.09);color:white;text-align:center;text-transform:uppercase;letter-spacing:.16em;font-weight:800}
  .quick-join input::placeholder{color:rgb(255 255 255/.42)}
  .quick-join .button{min-height:36px;background:var(--paper-50);color:var(--ink-950)}

  .game-creator{grid-column:2;grid-row:1;min-width:0}
  .game-creator>summary{width:100%;max-width:100%;min-height:50px;display:flex;align-items:center;gap:.6rem;padding:.42rem .65rem;border:1px solid rgb(105 122 115/.28);border-radius:var(--radius-md);background:rgb(255 253 248/.76);color:var(--ink-950);box-shadow:0 10px 28px rgb(24 55 47/.06);list-style:none;cursor:pointer;backdrop-filter:blur(18px);transition:background var(--duration-fast),border-color var(--duration-fast),box-shadow var(--duration-fast)}
  .game-creator>summary::-webkit-details-marker{display:none}
  .game-creator>summary:hover{border-color:rgb(23 127 115/.36);background:var(--paper-50);box-shadow:0 12px 30px rgb(24 55 47/.1)}
  .game-creator>summary:focus-visible{outline:2px solid var(--coral-500);outline-offset:3px}
  .game-creator>summary>span:nth-child(2){display:flex;flex-direction:column;line-height:1.2}.game-creator>summary strong{font-size:.76rem}.game-creator>summary small{margin-top:.16rem;color:var(--ink-600);font-size:.56rem}
  .creator-icon{width:28px;height:28px;display:grid;place-items:center;border-radius:8px;background:var(--ink-950);color:white;font-size:1rem;transition:transform var(--duration-normal),background var(--duration-fast)}
  .creator-chevron{margin-left:.15rem;color:var(--ink-400);font-size:1rem;transition:transform var(--duration-normal)}
  .game-creator[open]>summary{border-color:rgb(23 127 115/.34);background:rgb(255 253 248/.94)}
  .game-creator[open] .creator-icon{transform:rotate(45deg);background:var(--coral-500)}
  .game-creator[open] .creator-chevron{transform:rotate(180deg)}
  .game-creator[open]>.game-library{margin-top:.7rem;animation:creator-open var(--duration-normal) ease-out}
  .game-creator[open]{grid-column:1/-1;grid-row:1}
  .lobby-shell:has(.game-creator[open]){height:auto;overflow:visible}
  @keyframes creator-open{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}

  .lobby-workspace{min-height:0;flex:1;display:grid;grid-template-columns:minmax(0,1fr) 390px;grid-template-rows:auto minmax(0,1fr);align-items:stretch;gap:1rem}
  .game-library,.activity-panel{border:1px solid rgb(105 122 115/.2);border-radius:var(--radius-lg);background:rgb(255 253 248/.72);box-shadow:0 14px 44px rgb(24 55 47/.055);backdrop-filter:blur(18px)}
  .game-library{padding:1.15rem}
  .game-library>.section-heading{margin-bottom:.85rem}
  .game-library .section-heading h2,.activity-panel .section-heading h2{margin-top:.18rem;font-family:var(--font-ui);font-size:1.05rem;letter-spacing:-.01em}
  .library-count{padding:.26rem .55rem;border:1px solid var(--color-border);border-radius:var(--radius-round);color:var(--ink-600);font-size:.63rem;font-weight:700}
  .game-library .game-grid{gap:.8rem}
  .game-library .game-card{display:flex;min-width:0;min-height:0;flex-direction:column;border-color:rgb(105 122 115/.24);border-radius:var(--radius-md);background:rgb(255 255 255/.54);box-shadow:none;transition:transform var(--duration-normal),border-color var(--duration-normal),box-shadow var(--duration-normal)}
  .game-library .game-card:hover{transform:translateY(-2px);border-color:rgb(23 127 115/.36);box-shadow:0 16px 34px rgb(23 65 56/.09)}
  .game-library .game-art{min-height:0;height:150px;border-bottom:1px solid rgb(255 255 255/.12)}
  .game-library .game-art::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 40%,rgb(10 24 21/.35));pointer-events:none}
  .game-library .game-art em{position:absolute;z-index:3;left:.7rem;bottom:.65rem;padding:.22rem .48rem;border:1px solid rgb(255 255 255/.2);border-radius:var(--radius-round);background:rgb(23 32 29/.58);color:white;font-family:var(--font-ui);font-size:.55rem;font-style:normal;font-weight:800;letter-spacing:.1em;text-transform:uppercase;backdrop-filter:blur(8px)}
  .game-library .xiangqi-art::before{inset:12px;background:repeating-linear-gradient(0deg,transparent 0 31px,rgb(255 255 255/.08) 32px),repeating-linear-gradient(90deg,transparent 0 31px,rgb(255 255 255/.08) 32px)}
  .game-library .xiangqi-art span{z-index:2;width:54px;height:54px;border-width:3px;font-size:1.55rem}
  .game-library .xiangqi-art span:first-child{transform:translate(-84px,-22px) rotate(-10deg)}
  .game-library .xiangqi-art span:nth-child(2){transform:translate(2px,8px) rotate(7deg)}
  .game-library .xiangqi-art span:nth-child(3){transform:translate(88px,-16px) rotate(5deg)}
  .game-library .gem-art i{z-index:2;width:58px;height:70px}
  .game-library .gem-art i:nth-child(1){transform:translate(-92px,-10px) rotate(-13deg)}
  .game-library .gem-art i:nth-child(2){transform:translate(-45px,12px) rotate(8deg)}
  .game-library .gem-art i:nth-child(3){transform:translate(8px,-10px) rotate(-4deg)}
  .game-library .gem-art i:nth-child(4){width:50px;height:60px;transform:translate(60px,12px) rotate(9deg)}
  .game-library .gem-art i:nth-child(5){width:46px;height:56px;transform:translate(106px,-10px) rotate(-7deg)}
  .game-library .game-copy{min-height:295px;padding:.85rem}
  .game-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem}
  .game-library .game-copy h3{margin:.18rem 0 0;font-family:var(--font-ui);font-size:1.35rem;font-weight:800;letter-spacing:-.025em}
  .rule-link{flex:0 0 auto;padding:.28rem .48rem;border:1px solid var(--color-border);border-radius:var(--radius-sm);color:var(--ink-600);font-size:.62rem;font-weight:750;text-decoration:none}
  .rule-link:hover{border-color:var(--teal-500);color:var(--teal-600)}
  .game-library .game-copy>p{min-height:2.6em;margin-top:.55rem;font-size:.75rem;line-height:1.55}
  .game-library .game-meta{margin:.65rem 0 .75rem;gap:.75rem;font-size:.61rem}
  .game-library .game-meta span{padding:0;border:0}
  .game-library .game-meta>span:first-child{color:var(--teal-600)}
  .game-library .game-copy form{grid-template-columns:minmax(0,1fr) auto;gap:.4rem}
  .room-visibility{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:.35rem;margin:0 0 .15rem;padding:0;border:0}
  .room-visibility legend{width:100%;margin-bottom:.3rem;color:var(--ink-600);font-size:.6rem;font-weight:750}
  .room-visibility label{position:relative;display:flex;align-items:center;gap:.45rem;min-height:42px;padding:.38rem .55rem;border:1px solid var(--color-border);border-radius:var(--radius-sm);background:rgb(247 242 232/.5);cursor:pointer}
  .room-visibility label:has(input:checked){border-color:var(--teal-500);background:rgb(84 205 189/.11);box-shadow:inset 0 0 0 1px rgb(23 127 115/.08)}
  .room-visibility input{width:14px;min-height:14px;margin:0;padding:0;accent-color:var(--teal-500);box-shadow:none}
  .room-visibility span{display:flex;min-width:0;flex-direction:column;line-height:1.25}
  .room-visibility strong{font-size:.68rem}.room-visibility small{color:var(--ink-600);font-size:.55rem}
  .game-library .game-copy input{min-height:36px;background:rgb(247 242 232/.68);font-size:.72rem}
  .game-library .game-copy .button{min-height:36px;padding:0 .75rem;font-size:.72rem;white-space:nowrap}

  .lobby-activity{grid-column:2;grid-row:2;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:1rem}
  .activity-panel{min-width:0;padding:.9rem}
  .activity-panel>.section-heading{margin-bottom:.55rem}
  .activity-panel .count{min-width:24px;height:24px;font-size:.64rem}
  .activity-panel .room-list{max-height:360px;overflow:auto;border-top-color:rgb(105 122 115/.18);scrollbar-width:thin}
  .activity-panel .room-row{min-height:54px;gap:.65rem;padding:.48rem .2rem;font-size:.76rem}
  .activity-panel .room-row small{font-size:.63rem}
  .activity-panel .room-row code{font-size:.62rem}
  .activity-panel .room-row .button{min-height:30px;padding:0 .65rem;font-size:.67rem}
  .activity-panel .empty-state{min-height:116px;border-radius:var(--radius-sm);background:rgb(247 242 232/.3)}
  .activity-panel .empty-state>span{width:30px;height:30px;display:grid;place-items:center;margin:auto;border:1px solid var(--color-border);border-radius:50%;font-size:1rem}
  .activity-panel .empty-state p{max-width:250px;font-size:.7rem}
  .recent-panel{height:100%;min-height:0;display:flex;flex-direction:column}
  .recent-panel .room-list{min-height:0;max-height:none;flex:1}
  .recent-panel .empty-state{min-height:0;flex:1}
  .recent-panel .room-row{grid-template-columns:auto 1fr auto}
  .recent-panel .arrow{font-weight:800;transition:transform var(--duration-fast)}
  .recent-panel .room-row:hover .arrow{transform:translateX(3px)}
  .online-panel{min-height:156px;max-height:220px;display:flex;flex-direction:column}.online-panel>.section-heading{margin-bottom:.45rem}.online-heading-meta{display:flex;align-items:center;gap:.5rem}.lobby-live{display:inline-flex;align-items:center;gap:.35rem;color:var(--ink-400);font-size:.56rem;font-weight:750}.lobby-live i{width:7px;height:7px;border-radius:50%;background:var(--gold-400);box-shadow:0 0 0 3px rgb(214 168 77/.13)}.lobby-live.connected{color:var(--teal-600)}.lobby-live.connected i{background:var(--teal-500);box-shadow:0 0 0 3px rgb(84 205 189/.16)}.online-player-list{min-height:0;display:grid;grid-template-columns:1fr 1fr;gap:.35rem;overflow:auto;scrollbar-width:thin}.online-player-row{min-width:0;min-height:44px;display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:.5rem;padding:.35rem .45rem;border:1px solid rgb(105 122 115/.16);border-radius:var(--radius-sm);background:rgb(255 255 255/.46)}.online-avatar{width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(145deg,var(--teal-500),#3b7487);color:white;font-size:.68rem;font-weight:800}.online-player-row>span:nth-child(2){min-width:0;display:flex;flex-direction:column;line-height:1.2}.online-player-row strong{overflow:hidden;font-size:.68rem;text-overflow:ellipsis;white-space:nowrap}.online-player-row small{margin-top:.15rem;color:var(--ink-400);font-size:.55rem}.online-player-row>i{width:7px;height:7px;border-radius:50%;background:var(--teal-500);box-shadow:0 0 0 3px rgb(84 205 189/.14)}.online-empty{min-height:72px;display:grid;grid-template-columns:auto 1fr;place-content:center;align-items:center;gap:.55rem;padding:.6rem;border:1px dashed rgb(105 122 115/.2);border-radius:var(--radius-sm);color:var(--ink-400)}.online-empty>span{font-size:1.1rem}.online-empty p{font-size:.65rem}
  .waiting-primary{grid-column:1;grid-row:1/3;height:100%;min-height:0;display:flex;flex-direction:column;padding:1.05rem}
  .game-creator[open]~.waiting-primary{grid-column:1;grid-row:2;min-height:560px}
  .game-creator[open]~.lobby-activity{grid-column:2;grid-row:2;min-height:560px}
  .waiting-primary>.section-heading{margin-bottom:.75rem;padding-bottom:.65rem;border-bottom:1px solid rgb(105 122 115/.18)}
  .waiting-primary .section-heading h2{font-size:1.25rem}
  .waiting-primary .count{min-width:30px;height:30px;font-size:.72rem}
  .waiting-primary .room-list{min-height:0;max-height:none;flex:1;border-top:0;overflow:auto;scrollbar-width:thin}
  .waiting-primary .room-row{min-height:62px;padding:.58rem .35rem;font-size:.8rem}
  .waiting-primary .room-row small{font-size:.67rem}
  .waiting-primary .empty-state{min-height:0;flex:1;border-color:rgb(105 122 115/.24);background:linear-gradient(145deg,rgb(84 205 189/.04),rgb(154 124 246/.035))}
}
@layer utilities {.hidden{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}}
@media (max-width:1200px){.xiangqi-stage{display:grid;grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr) auto;grid-template-areas:"opponent" "board" "mine";gap:.35rem}.xiangqi-board{grid-area:board;width:min(100%,680px,calc((var(--play-height) - 7rem) * .9))}.captured-mine{grid-area:mine}.captured-opponent{grid-area:opponent}.captured-tray{max-width:none;width:min(100%,680px);height:auto;min-height:42px;justify-self:center;padding:.3rem .5rem;flex-direction:row;gap:.55rem}.captured-tray header{width:auto;min-width:78px;display:flex;align-items:center;justify-content:space-between;gap:.45rem;padding-right:.5rem;border-right:1px solid var(--color-border);text-align:left}.captured-list{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:.3rem}.captured-empty{writing-mode:horizontal-tb;margin:0;letter-spacing:.08em}}
@media (max-width:1050px){.site-nav{display:none}.game-grid{grid-template-columns:1fr}.table-layout{height:auto;grid-template-columns:1fr;grid-template-areas:"info" "board" "sidebar";gap:.75rem}.game-rail{display:contents}.game-info-card{grid-area:info}.board-column{grid-area:board;height:auto}.game-sidebar{grid-area:sidebar;height:560px}.game-board,.game-page[data-game-type="DARK_CHESS"] .game-board{height:auto;min-height:0}.xiangqi-stage{height:auto}.xiangqi-board{width:min(100%,680px)}.admin-list{grid-template-columns:1fr}}
@media (max-width:820px){.profile-grid{grid-template-columns:1fr}.security-card{min-height:330px}.security-illustration{min-height:120px}}
@media (max-width:760px){.site-header{height:58px;padding:0 .65rem}.brand-mark{width:30px;height:30px}.player-label{display:none}.header-player{padding-left:.35rem;border:0}.auth-shell{grid-template-columns:1fr}.auth-story{min-height:38vh;padding:1.25rem}.auth-story .brand{margin-bottom:2rem}.story-copy{margin:0}.story-copy h1{font-size:3.25rem;margin:.5rem 0 1rem}.register-story blockquote{display:none}.auth-panel{padding:1.5rem .9rem}.two-column-form{grid-template-columns:1fr}.full{grid-column:auto}.page-shell{width:min(100% - 1rem,1240px);padding-top:1.5rem}.lobby-hero{align-items:flex-start;flex-direction:column;gap:1rem}.player-stats{width:100%}.player-stats div{flex:1;min-width:0;padding:.5rem}.section-heading{align-items:flex-start;flex-direction:column;gap:.75rem}.join-code{width:100%;grid-template-columns:1fr auto}.join-code label{grid-column:1/-1}.game-card{grid-template-columns:1fr}.game-art{min-height:190px}.lobby-lists{grid-template-columns:1fr}.room-row{grid-template-columns:auto 1fr auto}.room-row code{display:none}.game-shell{width:100%;padding:.5rem 0 1.25rem}.table-layout{gap:.5rem}.board-column,.game-info-card,.game-sidebar{border-left:0;border-right:0}.game-info-nav{padding:.5rem .65rem .3rem}.game-info-card>.eyebrow,.game-info-card>h1{margin-left:.65rem;margin-right:.65rem}.game-info-card>h1{font-size:1.3rem}.game-board{padding:.3rem}.players-strip{font-size:.7rem}.player-seat{padding:.48rem .55rem}.turn-banner{min-height:48px}.xiangqi-board{width:100%;border-width:4px}.xiangqi-piece{width:88%;font-size:clamp(.85rem,5vw,1.55rem);border-width:2px}.bank-row{grid-template-columns:repeat(3,1fr)}.market-row{grid-template-columns:repeat(2,1fr)}.tier-deck{grid-column:1/-1;min-height:30px;writing-mode:horizontal-tb}.player-economy{grid-template-columns:1fr}.rules-grid{grid-template-columns:1fr;margin:1.5rem 0}.admin-form{grid-template-columns:1fr}.admin-form .full{grid-column:auto}.rule-callout{flex-direction:column}.rule-callout strong{margin:0}.game-sidebar{height:440px}.game-actions{padding:.5rem .6rem}.return-modal{padding:1rem}}
@media (max-width:560px){.profile-shell{width:min(100% - 1rem,980px);padding-top:1rem}.profile-heading{gap:.75rem;margin:1rem 0}.profile-avatar{width:50px;height:50px;font-size:1.35rem}.profile-card{padding:1rem;border-radius:var(--radius-md)}.profile-actions{flex-direction:column-reverse}.profile-actions .button{width:100%}.profile-password-dialog{padding:1.1rem}.profile-password-dialog menu{display:grid;grid-template-columns:1fr 1fr}.profile-password-dialog menu .button{width:100%}}
@media (max-width:760px){#story-title{font-size:2.15rem}.register-story .story-copy h1{font-size:2.6rem}}
@media (max-width:1180px){
  .lobby-overview{grid-template-columns:minmax(0,1fr) minmax(390px,44%)}
  .lobby-workspace{grid-template-columns:minmax(0,1fr) 340px}
  .quick-join{grid-template-columns:34px 1fr auto}.quick-join label small{display:none}.quick-join input{grid-column:2/3}.quick-join .button{grid-column:3/4;grid-row:2/3}
  .game-library .game-copy form{grid-template-columns:1fr}.game-library .game-copy .button{width:100%}
}
@media (max-width:920px){
  .lobby-shell{height:auto;min-height:0;overflow:visible}
  .lobby-overview{grid-template-columns:1fr}.quick-join{grid-template-columns:34px 1fr 120px auto}.quick-join input,.quick-join .button{grid-column:auto;grid-row:auto}.quick-join label small{display:block}
  .lobby-workspace{flex:none;grid-template-columns:1fr;grid-template-rows:auto auto auto}.game-creator,.game-creator[open]{grid-column:1;grid-row:1}.waiting-primary,.game-creator[open]~.waiting-primary{grid-column:1;grid-row:2;height:auto;min-height:520px}.lobby-activity,.game-creator[open]~.lobby-activity{grid-column:1;grid-row:3;min-height:0}.recent-panel{height:auto}.recent-panel .room-list{max-height:300px}.recent-panel .empty-state{min-height:116px;flex:none}
  .game-library .game-copy form{grid-template-columns:minmax(0,1fr) auto}
}
@media (max-width:760px){
  .lobby-shell{width:min(calc(100% - 1rem),1420px);padding-top:.65rem}.lobby-overview{border-radius:var(--radius-md)}
  .lobby-welcome{align-items:flex-start;flex-direction:column;padding:.85rem}.lobby-welcome .player-stats{width:100%}.lobby-welcome .player-stats div{flex:1;min-width:0}
  .quick-join{grid-template-columns:34px 1fr auto;padding:.7rem}.quick-join label small{display:none}.quick-join input{grid-column:1/3}.quick-join .button{grid-column:3;grid-row:2}
  .game-creator>summary{width:100%;margin-left:0}.creator-chevron{margin-left:auto}
  .game-library,.activity-panel{border-radius:var(--radius-md)}.game-library{padding:.75rem}.game-library>.section-heading,.activity-panel>.section-heading{align-items:center;flex-direction:row}
  .game-library .game-grid{grid-template-columns:1fr}.game-library .game-art{height:130px}.game-library .game-copy{min-height:0}
  .game-library .game-copy form{grid-template-columns:1fr}.lobby-activity{grid-template-columns:1fr}.waiting-primary,.game-creator[open]~.waiting-primary{min-height:430px}.waiting-primary .room-list{max-height:420px}.waiting-primary .empty-state{min-height:310px;flex:none}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}
