@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
:root{--bg:#071823;--ink:#f7edd8;--muted:#b8c7cb;--gold:#e7ba70;--gold-light:#ffe2a5;--line:rgba(231,186,112,.35);--panel:rgba(11,31,44,.88);--serif:'Cinzel',Georgia,serif;--sans:'DM Sans',Arial,sans-serif}*{box-sizing:border-box}html{min-height:100%;background:var(--bg)}body{margin:0;min-height:100vh;color:var(--ink);font-family:var(--sans)}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.46;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--gold-light);outline-offset:3px}.hidden{display:none!important}.ambient{position:fixed;inset:0;z-index:-1;background:linear-gradient(130deg,rgba(2,10,19,.88),rgba(6,28,40,.53)),url('lighthouse/cover.jpg') center 54%/cover no-repeat;filter:saturate(.67)}.ambient:after{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at 50% 15%,transparent 15%,#06131ee8 90%)}.page{min-height:100svh}.home-page{display:grid;grid-template-rows:auto 1fr auto;justify-items:center;align-items:center;position:relative;padding:18px 24px 42px;overflow:hidden}.home-top{z-index:2;position:absolute;top:clamp(16px,2.2vw,32px);right:clamp(16px,3vw,48px);left:clamp(16px,3vw,48px);display:flex;align-items:center;justify-content:space-between}.edition,.eyebrow,.home-hint,.field-label{color:var(--gold);font-family:var(--serif);font-size:.67rem;font-weight:700;letter-spacing:.19em}.icon-button{display:grid;place-items:center;width:45px;height:45px;border:1px solid var(--line);border-radius:50%;background:linear-gradient(140deg,#264255,#081925);box-shadow:inset 0 1px #ffffff24,0 5px 14px #0008;color:var(--gold-light);font-family:Georgia,serif;font-size:1.35rem;line-height:1}.icon-button:hover,.modal-close:hover{border-color:var(--gold-light);transform:translateY(-2px)}.cover-wrap{grid-row:2;position:relative;width:min(62vw,59svh,490px);aspect-ratio:1122/1402;margin-top:28px;filter:drop-shadow(0 22px 40px #000c)}.cover-wrap:before{content:"";position:absolute;inset:-5px;z-index:-1;border:1px solid #e7ba705f;box-shadow:0 0 36px #e7ba7017}.cover{width:100%;height:100%;object-fit:cover;object-position:center;border:1px solid #b7a47778;box-shadow:inset 0 1px #fff8}.home-actions{grid-row:3;z-index:2;display:flex;flex-direction:column;align-items:center;gap:16px;margin-top:-34px}.primary-button,.secondary-button{min-height:49px;padding:12px 23px;border:1px solid #f2d493;border-radius:4px;background:linear-gradient(180deg,#fce6ac 0%,#dba653 54%,#aa702f 100%);box-shadow:inset 0 2px 1px #fff8,0 5px 0 #5d3d22,0 12px 18px #0008;color:#112433;font-family:var(--serif);font-size:.8rem;font-weight:700;letter-spacing:.07em;text-shadow:0 1px #fff8;transition:transform .15s,box-shadow .15s}.primary-button:hover:not(:disabled){transform:translateY(-2px);box-shadow:inset 0 2px 1px #fff8,0 7px 0 #5d3d22,0 15px 21px #0009}.primary-button:active:not(:disabled){transform:translateY(3px);box-shadow:inset 0 2px 1px #fff8,0 2px 0 #5d3d22,0 5px 10px #0008}.primary-button.large{min-width:min(315px,82vw);font-size:.94rem}.home-hint{font-size:.62rem;letter-spacing:.27em;color:#f6dab0}
.lobby-page{padding:0 0 35px}.lobby-header{min-height:76px;padding:13px clamp(16px,4vw,60px);display:flex;align-items:center;justify-content:space-between;gap:14px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#07131ff2,#102a3ddb);box-shadow:0 8px 20px #0006}.room-badge{display:flex;align-items:center;gap:11px;min-width:174px}.room-badge small{font-family:var(--serif);font-size:.58rem;letter-spacing:.1em;color:var(--gold)}.room-badge strong{font-size:1.25rem;letter-spacing:.16em;color:var(--gold-light)}.copy-button,.text-button{border:0;background:none;color:var(--gold-light);font-weight:700}.copy-button{font-size:1.3rem}.header-title{font-family:var(--serif);font-weight:700;color:var(--gold-light);font-size:.92rem;letter-spacing:.08em;text-align:center}.header-title em{display:block;color:var(--muted);font-family:Georgia,serif;font-size:.76rem;font-weight:400;letter-spacing:.03em}.header-tools{display:flex;gap:8px}.header-tools .icon-button{width:39px;height:39px;font-size:1.15rem}.lobby-body{max-width:1220px;margin:auto;padding:29px clamp(16px,3.5vw,40px)}.lobby-heading{text-align:center;margin:0 0 26px}.lobby-heading h1{margin:5px 0 3px;color:var(--gold-light);font:700 clamp(1.45rem,3vw,2.3rem)/1.3 var(--serif);text-shadow:0 2px 8px #000}.lobby-heading p{margin:0;color:var(--muted);font-size:.9rem}.lobby-grid{display:grid;grid-template-columns:1.06fr .84fr 1fr;gap:17px;align-items:stretch}.glass-panel{min-width:0;padding:20px;border:1px solid var(--line);border-radius:11px;background:linear-gradient(145deg,rgba(22,49,60,.93),rgba(7,23,35,.93));box-shadow:inset 0 1px 0 #fff2,0 14px 24px #0008,0 2px 0 #020f1b;backdrop-filter:blur(8px)}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-bottom:15px;margin-bottom:13px;border-bottom:1px solid #f0ca8051}.panel-head h2{margin:4px 0 0;font:700 1rem/1.3 var(--serif);color:#fff0cf}.count-pill{border:1px solid var(--line);padding:5px 10px;color:var(--gold-light);border-radius:40px;font-size:.75rem;white-space:nowrap}.crew-panel{display:flex;flex-direction:column;min-height:495px}.player-list{display:grid;gap:7px;align-content:start;overflow-y:auto;max-height:460px;padding-right:4px}.player-row{min-height:47px;display:flex;align-items:center;gap:10px;padding:6px 9px;background:#071a2ab5;border:1px solid #c9b17c29;border-radius:6px}.player-row.me{border-color:#e7ba7075}.player-mini{width:34px;height:37px;object-fit:cover;object-position:top;border:1px solid #e7ba7080;border-radius:3px}.player-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.81rem;font-weight:700}.host-tag{margin-left:5px;color:var(--gold-light);font-size:.59rem;letter-spacing:.08em}.player-state{margin-left:auto;white-space:nowrap;color:#aabec5;font-size:.67rem}.player-state.is-ready{color:#a9e6c3}.empty-slot{color:#8fa6ae;border-style:dashed;background:#06162270;font-size:.77rem}.empty-slot .slot-icon{width:34px;text-align:center;color:#c9a66f;font-size:1.3rem}.invite-strip{margin-top:auto;padding-top:16px;display:flex;justify-content:space-between;gap:6px;align-items:center;color:var(--muted);font-size:.7rem}.invite-strip strong{color:var(--gold-light);letter-spacing:.13em}.text-button{font-size:.66rem;white-space:nowrap}.right-stack{display:grid;grid-template-rows:auto 1fr;gap:17px}.avatar-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}.avatar-choice{border:1px solid #e7ba7066;border-radius:5px;background:#081824;padding:7px;color:var(--muted);font:700 .62rem var(--serif);letter-spacing:.1em;box-shadow:0 4px 8px #0008}.avatar-choice img{display:block;width:100%;height:115px;object-fit:cover;object-position:center 23%;margin-bottom:7px;border-radius:2px}.avatar-choice.selected{border-color:var(--gold-light);background:#374130;color:var(--gold-light);box-shadow:0 0 0 2px #e7ba7055,0 7px 12px #0009;transform:translateY(-2px)}.tiny-note,.field-help{color:#a7b9bd;font-size:.68rem;line-height:1.55}.tiny-note{margin:13px 0 0}.conditions{display:grid;gap:10px}.conditions span{display:flex;justify-content:space-between;gap:8px;padding:9px 1px;border-bottom:1px solid #d6bf8850;color:var(--muted);font-size:.78rem}.conditions b{color:var(--gold-light);font-weight:600;text-align:right}.chat-panel{display:flex;flex-direction:column;min-height:495px}.online-dot{color:#a9e6c3;white-space:nowrap;font-size:.53rem;letter-spacing:.1em}.online-dot:before{content:"●";margin-right:5px}.chat-log{display:flex;flex:1;flex-direction:column;gap:10px;min-height:230px;max-height:320px;overflow-y:auto;overscroll-behavior:contain;padding:3px 4px 12px}.chat-item{max-width:94%;align-self:flex-start}.chat-item.own{align-self:flex-end}.chat-meta{display:block;color:var(--gold);font-size:.67rem;margin-bottom:4px}.chat-item.own .chat-meta{text-align:right}.chat-bubble{display:inline-block;max-width:100%;overflow-wrap:anywhere;padding:8px 10px;border-radius:9px 9px 9px 1px;background:#1d3947;color:#edf1e9;font-size:.77rem;line-height:1.4}.own .chat-bubble{border-radius:9px 9px 1px 9px;background:#39504b}.chat-empty{margin:auto;color:var(--muted);font:italic .8rem Georgia,serif;text-align:center}.reactions{display:flex;gap:7px;padding:8px 0}.reactions button{width:32px;height:31px;border:1px solid #e7ba7050;border-radius:6px;background:#193445;font-size:1rem}.reactions button:hover{transform:translateY(-2px);border-color:var(--gold)}.chat-form{display:flex;border:1px solid var(--line);border-radius:5px;background:#071b2b}.chat-form input{width:100%;min-width:0;border:0;background:transparent;padding:11px;color:var(--ink);outline:0;font-size:.76rem}.chat-form button{width:45px;border:0;background:none;color:var(--gold-light);font-size:1.3rem}.lobby-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:20px;padding:17px 20px;border:1px solid var(--line);border-radius:9px;background:#071a2be6;box-shadow:0 12px 20px #0007}.status-box{display:flex;align-items:center;gap:11px;color:var(--muted);font-size:.8rem}.status-flame{font-size:1.5rem;color:var(--gold-light)}.footer-actions{display:flex;gap:12px}.secondary-button{background:linear-gradient(#244354,#102637);color:var(--gold-light);border-color:var(--line);text-shadow:none;box-shadow:inset 0 1px #ffffff24,0 4px 0 #06141e,0 8px 14px #0009}.secondary-button.ready{color:#b4ffda;border-color:#b4ffda}.secondary-button:hover:not(:disabled){transform:translateY(-2px)}
.modal-layer{position:fixed;z-index:10;inset:0;display:grid;place-items:center;padding:16px}.modal-backdrop{position:absolute;inset:0;background:#020a12db;backdrop-filter:blur(6px)}.modal{position:relative;z-index:1;width:min(100%,460px);max-height:min(92svh,900px);border:1px solid var(--gold);border-radius:9px;background:linear-gradient(145deg,#1b3848,#071924 75%);box-shadow:0 25px 70px #000e,inset 0 1px #fff4;overflow:hidden}.modal-close{position:absolute;z-index:3;top:12px;right:12px;width:35px;height:35px;border:1px solid var(--line);border-radius:50%;background:#0d2233ed;color:var(--gold-light);font-size:1.7rem;line-height:1}.instructions-modal{width:min(94vw,720px);padding:12px;background:#071722}.instructions-scroll{max-height:calc(92svh - 58px);overflow-y:auto;scrollbar-color:var(--gold) #0a2030}.instructions-scroll img{display:block;width:100%;height:auto}.manual-link{display:block;padding:11px;text-align:center;color:var(--gold-light);font:700 .67rem var(--serif);letter-spacing:.08em;text-decoration:none}.manual-link:hover{text-decoration:underline}.modal-inner{padding:31px;overflow:auto;max-height:92svh}.modal-inner h2{font:700 1.45rem var(--serif);color:var(--gold-light);margin:7px 0 5px}.modal-intro{font-size:.85rem;color:var(--muted);margin:0 0 22px}.entry-tabs{display:grid;grid-template-columns:1fr 1fr;margin:0 0 18px;padding:4px;border:1px solid var(--line);background:#071622;border-radius:6px}.entry-tabs button{border:0;padding:10px 5px;background:transparent;color:var(--muted);font:700 .67rem var(--serif);letter-spacing:.08em}.entry-tabs button[aria-selected="true"]{background:#d9aa60;color:#0a1c29;border-radius:3px}.field-label{display:block;margin:15px 0 7px;font-size:.65rem}.modal input,.modal select{width:100%;height:43px;padding:9px 11px;color:var(--ink);background:#061724;border:1px solid #ad956e99;border-radius:5px}.modal select{color-scheme:dark}.modal input::placeholder{color:#829ba4}.field-help{display:block;margin-top:5px}.full-width{width:100%;margin-top:23px}.modal-footnote{margin:17px 0 0;text-align:center}.form-error{margin:13px 0 0;color:#ffb2a5;font-size:.75rem}.center{text-align:center}.launch-symbol{display:block;color:var(--gold-light);font-size:3.2rem;margin-bottom:4px}.center p{color:var(--muted);font-size:.87rem;line-height:1.6}.toast{position:fixed;z-index:20;bottom:22px;left:50%;transform:translate(-50%,16px);background:#edcf92;color:#0c2533;padding:10px 18px;box-shadow:0 6px 22px #0009;border-radius:6px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;text-align:center;font-size:.8rem;font-weight:700}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:1050px){.lobby-grid{grid-template-columns:1fr 1fr}.chat-panel{grid-column:1/-1;min-height:330px}.chat-log{max-height:250px}.crew-panel{min-height:400px}}@media(max-width:680px){.home-page{padding:14px 15px 38px}.edition{max-width:210px;font-size:.5rem}.cover-wrap{width:min(87vw,54svh,410px);margin-top:23px}.home-actions{margin-top:-20px}.lobby-header{min-height:66px;padding:9px 13px}.room-badge{min-width:0;gap:5px;flex-wrap:wrap;max-width:110px}.room-badge small{width:100%;font-size:.48rem}.room-badge strong{font-size:1rem}.header-title{font-size:.57rem;line-height:1.2}.header-title em{display:none}.header-tools{gap:4px}.header-tools .icon-button{height:30px;width:30px;font-size:1rem}.lobby-body{padding:20px 13px}.lobby-heading{margin-bottom:18px}.lobby-heading h1{font-size:1.35rem}.lobby-heading p{font-size:.74rem}.lobby-grid{display:flex;flex-direction:column;gap:12px}.glass-panel{padding:16px}.crew-panel{min-height:0}.player-list{max-height:300px}.right-stack{grid-template-columns:1fr 1fr;grid-template-rows:auto;gap:12px}.right-stack .panel-head h2{font-size:.78rem}.right-stack .eyebrow{font-size:.53rem}.avatar-choice img{height:92px}.avatar-choice{padding:4px;font-size:.5rem}.conditions span{display:block;font-size:.66rem}.conditions b{display:block;text-align:left;margin-top:4px}.tiny-note{font-size:.6rem}.chat-panel{min-height:320px}.lobby-footer{position:sticky;bottom:7px;z-index:2;flex-direction:column;align-items:stretch;padding:12px;gap:10px}.footer-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px}.footer-actions button{padding:8px;font-size:.65rem}.status-box{font-size:.69rem}.modal-inner{padding:24px 18px}.modal-close{top:8px;right:8px}.instructions-modal{padding:5px}.instructions-scroll{max-height:calc(92svh - 46px)}}@media(max-width:380px){.right-stack{grid-template-columns:1fr}.avatar-choice img{height:105px}.conditions span{display:flex}.conditions b{text-align:right;margin:0}.header-title{display:none}}
/* PLAYABLE EDITION */
.home-top{justify-content:flex-end;gap:10px}.home-top .edition{margin-right:auto}.home-top [data-action=music]{order:-1}.playing{height:100dvh;overflow:hidden}.game-page{height:100dvh;display:flex;flex-direction:column;overflow:hidden;background:radial-gradient(ellipse at 55% 32%,#20414a66,#051522e8 80%)}.game-header{height:70px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 20px;border-bottom:1px solid var(--line);background:#061823ed;z-index:5;box-shadow:0 5px 20px #0006}.game-room{display:flex;align-items:center;gap:8px}.game-room small{color:var(--gold);font:600 .63rem var(--serif);letter-spacing:.1em}.game-room strong{color:var(--gold-light);letter-spacing:.15em}.small-icon{border:0;background:none;color:var(--gold);font-size:1.1rem}.game-clock{text-align:center;position:absolute;left:50%;transform:translateX(-50%)}.game-clock>span{display:block;font:600 1.65rem var(--serif);color:#ffe1a6;font-variant-numeric:tabular-nums}.game-clock small{display:block;letter-spacing:.12em;font-size:.55rem;color:#b6ccd0}.urgent{color:#ff9e8a!important}.game-stage{flex:1;min-height:0;position:relative;display:flex}.board-shell{position:relative;display:flex;flex-direction:column;flex:1;min-width:0;padding:8px 44px 0}.board-tools{display:flex;align-items:center;justify-content:space-between;padding:0 14px;height:29px;flex-shrink:0;font:600 .61rem var(--serif);letter-spacing:.1em;color:#b6c6c9}.board-tools>div{display:flex;gap:3px}.board-tools button{border:1px solid #e7ba7050;background:#102a3c;color:var(--gold-light);border-radius:3px;padding:3px 9px;font-size:.62rem}.board-viewport{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#b08d5660 transparent;padding:8px;display:grid;justify-items:safe center;align-items:safe center}.board{--cw:40px;position:relative;display:grid;grid-template-columns:repeat(11,var(--cw));grid-template-rows:repeat(var(--rows),calc(var(--cw)*1.4));gap:1px;flex-shrink:0;width:max-content;height:max-content;border:1px solid #e7ba7024;border-radius:5px;padding:3px;background:linear-gradient(145deg,#081c22f2,#102723d9);box-shadow:0 15px 32px #0008,inset 0 0 38px #0005;transition:opacity .2s}.board.dealing{opacity:0}.cell{position:relative;border:1px solid #baaa7524;padding:0;background:radial-gradient(#86a69509,#07161c40);overflow:visible;min-width:0;border-radius:2px;display:grid;place-items:center}.cell.occupied{border:0;box-shadow:0 1px 3px #0009}.cell img{width:100%;height:100%;object-fit:fill;display:block;border-radius:2px}.cell.reserved{border:0;background:none}.cell.reserved:after{content:'✧';color:#c5a3663b;font-size:.65rem}.cell-coordinate{color:#b5bca848;font-size:clamp(7px,calc(var(--cw)*.17),12px)}.cell:not(.reserved):hover{outline:1px solid #e7ba7088;z-index:2}.cell.face-down{box-shadow:0 0 0 1px #e7ba7060,0 3px 7px #0009}.cell.blocked:after{content:'×';position:absolute;right:2px;top:1px;color:#ffb7a9;font-size:12px;background:#791d1dc4;border-radius:50%;width:13px;height:13px;line-height:11px}.cell.drop-hover{outline:3px solid #ffdd9a;z-index:3}.claim-badge{position:absolute;bottom:1px;right:1px;background:#d7b16a;color:#061621;padding:1px 3px;font-size:8px;border-radius:3px;z-index:3}.meeple-layer{position:absolute;inset:0;pointer-events:none;z-index:4}.meeple{position:absolute;width:14px;height:17px;object-fit:cover;object-position:center 20%;border:1px solid #ffdf97;border-radius:45%;box-shadow:0 2px 5px #000e;top:0;left:0}.game-log{height:31px;flex-shrink:0;text-align:center;display:grid;place-items:center;font-size:.69rem;color:#ded2b9;overflow:hidden;text-overflow:ellipsis;padding:2px 20px}
.player-rail{position:absolute;left:-64px;top:17px;bottom:7px;width:118px;z-index:6;transition:left .25s;display:flex;flex-direction:column;background:linear-gradient(90deg,#071724f5,#102937db);border:1px solid var(--line);border-radius:0 9px 9px 0;box-shadow:5px 7px 18px #0008;padding:7px 4px}.player-rail.expanded{left:0}.rail-toggle{position:absolute;right:-17px;top:5px;width:21px;height:30px;border:1px solid var(--line);background:#183847;color:var(--gold-light);border-radius:0 7px 7px 0;z-index:2;font-size:.8rem;padding:0}.player-rail.expanded .rail-toggle{transform:scaleX(-1)}#game-players{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:space-around;gap:3px;padding-top:15px}.game-player{position:relative;display:flex;align-items:center;justify-content:flex-end;height:clamp(27px,5vh,46px);min-height:23px;border:1px solid #b4b7a533;background:#092335d9;border-radius:5px;color:#d7e5e3;width:100%;padding:2px 4px;box-shadow:0 3px 6px #0005}.game-player img{order:2;height:100%;max-height:38px;width:33px;object-fit:cover;object-position:top;border-radius:3px;border:1px solid #d2b0705c}.gp-name{font-size:.65rem;margin-right:5px;overflow:hidden}.gp-bot{position:absolute;bottom:0;left:5px;font-size:.43rem;color:var(--gold)}.gp-obstacles{position:absolute;right:1px;bottom:-3px;font-size:9px;letter-spacing:-2px;z-index:2}.game-player.turn{border-color:#ffdf95;background:linear-gradient(100deg,#645437,#253936);box-shadow:0 0 14px #efb86670}.game-player.turn img{border:2px solid #ffdf95}.avatar-bubble{position:absolute;left:calc(100% + 12px);top:0;min-width:90px;max-width:190px;width:max-content;padding:8px 11px;background:#f5e0b8;color:#0d2635;border-radius:8px 8px 8px 1px;font-size:.75rem;overflow-wrap:anywhere;box-shadow:0 5px 12px #0008;pointer-events:none;z-index:15;animation:bubbleIn .18s}.chat-opener{min-height:30px;margin-top:6px;border:1px solid var(--line);border-radius:5px;background:#203d48;color:var(--gold-light);font-size:1rem;text-align:right}.chat-opener span{font-size:.6rem}.chat-opener b{font-size:.55rem;background:#d7aa64;color:#112434;border-radius:10px;padding:2px}.chat-opener b:empty{display:none}.deck-rail{position:absolute;right:-69px;top:32px;width:119px;z-index:5;background:#0a2233e8;border:1px solid var(--line);padding:10px;border-radius:8px 0 0 8px;box-shadow:-4px 7px 16px #0007;transition:right .25s}.deck-rail.expanded{right:0}.deck-rail .rail-toggle{left:-18px;right:auto;border-radius:7px 0 0 7px}.deck-rail.expanded .rail-toggle{transform:scaleX(-1)}.deck-stack,.discard-stack{position:relative;display:block;padding:0;background:none;border:0;color:#e8cc91;width:100%;margin:12px 0}.deck-stack>span,.discard-stack>span{display:block;font:600 .56rem var(--serif);letter-spacing:.13em;padding-bottom:7px;text-align:center}.deck-stack>img,.discard-stack>img{width:87px;height:122px;border-radius:4px;box-shadow:2px 2px 0 #c4ad6b,4px 4px 0 #19354a,6px 6px 0 #9b8957,8px 8px 15px #0008;border:1px solid #b9a47370;object-fit:cover}.diamond{position:absolute;left:3px;top:11px;width:30px;height:30px;background:#eac784;border:2px solid #a57b42;color:#0a2130;transform:rotate(45deg);display:grid;place-items:center;box-shadow:0 4px 6px #0008}.diamond span{transform:rotate(-45deg);font-size:.69rem}.discard-stack>b{position:absolute;bottom:2px;left:2px;background:#112b3c;color:#f7d79a;border:1px solid var(--line);padding:3px 6px;border-radius:4px;font-size:.65rem}
.hand-area{height:200px;flex-shrink:0;position:relative;border-top:1px solid #b79d654a;background:linear-gradient(180deg,#0a253242,#061722fa 60%);z-index:4}.hand-status{height:31px;display:flex;justify-content:center;align-items:center;gap:20px;font-size:.64rem;color:var(--gold-light);padding:0 12px}.hand-status button{background:#102d3b;border:1px solid var(--line);color:#f0d5a4;border-radius:4px;font-size:.55rem;padding:5px 8px}.hand-status>span{text-align:center;max-width:45vw}.hand{position:absolute;bottom:22px;left:74px;right:74px;height:142px;touch-action:none;user-select:none;-webkit-user-select:none}.fan-card{--gap:48px;position:absolute;left:50%;bottom:8px;width:102px;height:143px;padding:0;border:1px solid #dcb777;border-radius:7px;background:#092234;transform:translateX(calc(-50% + var(--i)*var(--gap))) translateY(var(--dip)) rotate(var(--angle));transform-origin:50% 110%;box-shadow:-3px 3px 9px #000b;transition:transform .13s,border-color .13s;touch-action:none}.fan-card img{width:100%;height:100%;object-fit:cover;border-radius:6px;pointer-events:none}.fan-card.selected{border:2px solid #ffe4a5;box-shadow:0 0 9px #ffd48680,-3px 3px 9px #000b}.fan-card.lifted{transform:translateX(calc(-50% + var(--i)*var(--gap))) translateY(-40px) rotate(0deg);z-index:30!important;box-shadow:0 0 13px #ffd486a0,-3px 8px 12px #000b}.hand-side{position:absolute;bottom:57px;z-index:40;width:66px;min-height:60px;padding:8px 4px;border:1px solid var(--line);border-radius:8px;background:linear-gradient(#234653,#0d2636);color:var(--gold-light);font-size:1.45rem;box-shadow:0 4px 0 #020e17,0 7px 10px #0008}.hand-side span{display:block;font:600 .5rem var(--serif);letter-spacing:.04em}.discard-button{left:20px}.pass-button{right:20px}.hand-tip{position:absolute;bottom:3px;left:0;right:0;text-align:center;font-size:.6rem;color:#bcc8c7;pointer-events:none}.drag-ghost{position:fixed;width:85px;height:119px;transform:translate(-50%,-75%);border-radius:5px;border:2px solid #ffe2a5;box-shadow:0 15px 30px #000b;pointer-events:none;z-index:40;opacity:.94}
.rule-scroll{max-height:88dvh;overflow:auto;overscroll-behavior:contain;padding:34px clamp(18px,4vw,40px);color:#233943;background:linear-gradient(110deg,#e9d7b1,#fff0cd 45%,#d6bf90);font-family:var(--sans)}.rule-scroll .eyebrow{color:#75511f}.rule-scroll h2{font:700 1.8rem var(--serif);color:#18323e;margin:10px 0 14px}.rule-scroll h3{font:700 1rem var(--serif);color:#24404b;margin:26px 0 8px;border-bottom:1px solid #b39463;padding-bottom:6px}.rule-scroll p{font-size:.85rem;line-height:1.65}.rule-scroll table{width:100%;border-collapse:collapse;font-size:.75rem;margin:12px 0}.rule-scroll th,.rule-scroll td{padding:8px 5px;text-align:left;border:1px solid #b4996c}.rule-scroll th{background:#b59b692e}.rule-scroll .tiny-note{color:#52636a}.instructions-modal{padding:6px}.game-chat-modal{background:#092031ec;backdrop-filter:blur(15px)}.game-chat-modal .chat-log{height:280px;max-height:42dvh}.peek-modal{max-width:420px}.peek-modal img{width:min(150px,26dvh);border:1px solid var(--gold);border-radius:8px;margin:14px 0;box-shadow:0 10px 22px #000a}.peek-modal h2{font-size:1.1rem}.peek-modal p{font-size:.76rem}#claim-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}#claim-actions button{min-height:35px;font-size:.56rem;padding:8px}.zoom-card{position:fixed;inset:0;z-index:50;background:#020c17eb;backdrop-filter:blur(12px);display:flex;flex-direction:column;justify-content:center;align-items:center;padding:30px;text-align:center;cursor:zoom-out}.zoom-card img{height:min(58dvh,540px);max-width:85vw;object-fit:contain;border:2px solid #d2b37b;border-radius:10px;box-shadow:0 20px 60px #000d;animation:bubbleIn .18s}.zoom-card h2{font:600 1.3rem var(--serif);color:var(--gold-light);margin:14px 0 5px}.zoom-card p{max-width:490px;font-size:.85rem;line-height:1.5;margin:5px 0 13px;color:#deded1}.zoom-card>span{font-size:.68rem;color:#a8bec3}.help-offer{position:fixed;z-index:9;top:83px;left:50%;transform:translateX(-50%);max-width:90vw;width:max-content;padding:13px 17px;background:#e8d4a6;color:#102736;border:2px solid #bb995e;border-radius:10px;box-shadow:0 12px 22px #0009;font-size:.8rem;text-align:center}.help-offer button{padding:7px 10px;border-radius:5px;background:#344552;color:#fff;border:0;margin:4px;font-size:.66rem}.help-offer .accept{background:#28644b}.help-offer small{display:block;margin-top:5px}.result-modal #result-roles{display:grid;grid-template-columns:1fr 1fr;gap:4px;text-align:left}.result-modal #result-roles p{font-size:.7rem;margin:0;padding:4px;border-bottom:1px solid var(--line)}.result-modal .text-button{margin-top:20px}.deal-overlay{position:fixed;inset:0;z-index:8;background:radial-gradient(#16404bdc,#020b15ed);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:20px;pointer-events:none}.deal-overlay h2{font:600 clamp(1.4rem,3vw,2.4rem) var(--serif);color:var(--gold-light)}.deal-overlay p{font:italic 1rem Georgia,serif;color:#d7cfb8}.deal-four{display:flex;gap:12px;perspective:900px}.deal-card{width:clamp(60px,17vw,145px);aspect-ratio:5/7;border:1px solid var(--gold);border-radius:7px;box-shadow:0 10px 20px #000a;object-fit:cover}.deal-card.spinning{animation:shuffleOrbit .72s linear infinite;animation-delay:calc(var(--order)*-.18s)}@keyframes shuffleOrbit{0%{transform:translate(0,0) rotateY(0deg) rotate(0deg)}25%{transform:translate(30px,-30px) rotateY(90deg) rotate(90deg)}50%{transform:translate(-15px,15px) rotateY(180deg) rotate(180deg)}75%{transform:translate(-30px,-20px) rotateY(270deg) rotate(270deg)}100%{transform:translate(0,0) rotateY(360deg) rotate(360deg)}}@keyframes bubbleIn{from{opacity:0;transform:translateY(8px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:680px){.game-header{height:63px;padding:7px 9px;gap:4px}.game-room{display:block;max-width:92px;font-size:.73rem}.game-room small{display:block;font-size:.45rem}.game-room .small-icon{display:none}.game-clock{left:43%}.game-clock>span{font-size:1.22rem}.game-clock small{font-size:.43rem;letter-spacing:.04em}.game-header .header-tools{gap:3px}.game-header .icon-button{width:28px;height:28px;font-size:.9rem}.board-shell{padding:4px 28px 0}.board-tools{font-size:.48rem;padding:0 13px 0 27px;height:25px}.board-tools button{font-size:.54rem;padding:3px 7px}.board-viewport{padding:4px}.player-rail{width:106px;left:-65px;top:6px;padding-right:3px}.player-rail.expanded{left:0}.gp-name{font-size:.6rem}.game-player img{width:26px}.player-rail .rail-toggle{right:-13px;width:17px}.chat-opener span{font-size:.5rem}.deck-rail{width:96px;right:-65px;top:36px;padding:8px}.deck-rail .rail-toggle{left:-13px;width:17px}.deck-stack>img,.discard-stack>img{width:67px;height:94px}.deck-stack>span,.discard-stack>span{font-size:.49rem}.diamond{width:24px;height:24px;left:-3px}.diamond span{font-size:.55rem}.game-log{font-size:.57rem;height:33px;padding:1px 20px}.hand-area{height:167px}.hand-status{gap:8px;height:29px;padding:0 5px;font-size:.53rem}.hand-status button{font-size:.48rem;padding:4px 6px}.hand{height:113px;left:37px;right:37px;bottom:20px}.fan-card{width:75px;height:105px;--gap:min(8vw,33px)}.hand-side{width:36px;min-height:50px;bottom:54px;font-size:1.1rem;border-radius:5px;padding:4px 1px}.hand-side span{font-size:.36rem;letter-spacing:0}.discard-button{left:3px}.pass-button{right:3px}.hand-tip{font-size:.49rem}.fan-card.lifted{transform:translateX(calc(-50% + var(--i)*var(--gap))) translateY(-31px) rotate(0deg)}.avatar-bubble{max-width:145px;font-size:.69rem;padding:7px 9px}.help-offer{top:68px;font-size:.69rem;padding:8px;min-width:240px}.meeple{width:10px;height:13px}.deal-four{gap:7px}.deal-overlay{gap:12px}.deal-overlay p{font-size:.8rem}.rule-scroll p{font-size:.8rem}.rule-scroll table{font-size:.68rem}}
@media(max-height:520px) and (orientation:landscape){.game-header{height:49px}.game-clock>span{font-size:1.1rem}.hand-area{height:115px}.hand{height:78px;bottom:17px}.fan-card{width:59px;height:83px;--gap:35px}.hand-status{height:23px}.hand-side{min-height:42px;bottom:31px}.hand-tip{font-size:.49rem}.player-rail{top:2px}.game-player{min-height:18px}.game-player img{height:19px;width:19px}.gp-bot{display:none}.deck-rail{top:10px}.deck-stack>img,.discard-stack>img{width:45px;height:63px}.deck-rail{width:85px;right:-51px}.game-log{height:22px}.board-tools{height:22px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.001ms!important;transition-duration:.001ms!important}.deal-card.spinning{animation:none}}

.playing .ambient{background-position:center,center bottom;background-size:cover,auto 220%}.fan-card{bottom:18px}

/* Touch-first refinements. Existing page and asset names are preserved. */
.modal-layer.chat-open .modal-backdrop{background:#020a1266;backdrop-filter:blur(1px)}
.icon-button{display:inline-flex!important;align-items:center;justify-content:center;line-height:1;padding:0;flex-shrink:0;font-family:Arial,sans-serif}
.game-header{display:grid;grid-template-columns:1fr auto 1fr}.game-clock{position:static;transform:none}.game-header .header-tools{justify-self:end}.game-room{min-width:0}
.mode-options{display:flex;gap:20px;border:1px solid #ad956e99;border-radius:8px;padding:12px;margin-top:18px}.mode-options legend{font-size:.7rem;letter-spacing:.1em;color:var(--gold-light)}.mode-options label,.check-option{display:flex;gap:8px;align-items:center}.mode-options input,.check-option input{width:20px;height:20px;accent-color:#e3bf78;flex-shrink:0}.check-option{margin-top:18px;font-size:.85rem}.music-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:14px}.music-controls button{background:#183847;color:#ffe1a6;padding:9px;border:1px solid var(--line);border-radius:5px}.music-controls span{width:100%;color:#ffe1a6}
.avatar-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.avatar-choice img{height:54px;width:54px;object-fit:contain}.avatar-choice{padding:8px 3px}.player-mini{object-fit:contain!important}.game-player img{object-fit:contain;border:0}.meeple{width:15px;height:15px;border:0;border-radius:50%;background:#09202a;object-fit:contain}.curse-badge{display:inline-grid;place-items:center;min-width:20px;min-height:20px;background:#071823;border:1px solid #d0af71;border-radius:50%;font-size:11px;letter-spacing:normal;cursor:zoom-in}.gp-obstacles{bottom:-5px;right:-5px;display:flex;gap:2px}
.story-lines{position:relative;width:min(90vw,620px);min-height:70px;margin:20px auto 30px;text-align:center;display:grid;place-items:center}.story-lines span{grid-area:1/1;opacity:0;font:italic clamp(15px,2vw,22px) Georgia,serif;color:#ffe4b0;animation:story 25s infinite;max-width:90%;text-shadow:0 2px 8px #000}.story-lines span:nth-child(2){animation-delay:5s}.story-lines span:nth-child(3){animation-delay:10s}.story-lines span:nth-child(4){animation-delay:15s}.story-lines span:nth-child(5){animation-delay:20s}@keyframes story{0%,20%,100%{opacity:0;transform:translateY(6px)}3%,17%{opacity:1;transform:none}}.home-page .cover-wrap{max-height:58svh}.home-page .cover{max-height:58svh;object-fit:contain}.home-actions{margin-top:0}
.hand-status{gap:10px}.hand-status button{min-height:32px;white-space:nowrap}.hand-status>span{max-width:32vw}.hand-area{height:215px}.hand{bottom:25px;height:145px}.fan-card{--gap:58px;width:108px;height:151px;overflow:hidden}.fan-card.selected{transform:translateX(calc(-50% + var(--i)*var(--gap))) translateY(-17px) rotate(var(--angle));z-index:20!important}.fan-card.lifted{z-index:30!important;transform:translateX(calc(-50% + var(--i)*var(--gap))) translateY(-40px) rotate(0)}.gesture-guide{position:absolute;top:-36px;left:15%;right:15%;display:flex;justify-content:space-between;gap:8px;font-size:.68rem;color:#ffe2a5;background:#071823ed;border:1px solid #a48952;border-radius:8px;padding:9px;pointer-events:none;z-index:45}.cell{overflow:hidden}.cell img{transform-origin:center}.drag-ghost{object-fit:fill}.chat-opener{height:40px;flex-shrink:0;padding:5px}.game-chat-modal{position:fixed;left:12px;bottom:12px;width:min(370px,94vw);max-height:76dvh;margin:0}.game-chat-modal .modal-inner{padding:23px 16px 16px}.game-chat-modal .chat-log{height:240px}.game-chat-modal .chat-form input{min-width:0}.deal-role{display:flex;align-items:center;gap:14px;max-width:90vw;color:#ffe0a3;font-size:.8rem}.deal-role img:first-child{width:45px;height:45px}.deal-role img:nth-child(2){width:60px;border:1px solid #e1ba71;border-radius:4px}.deal-role span{max-width:170px}
@media(max-width:680px){.game-header{height:68px;padding:7px;gap:5px;grid-template-columns:70px 1fr auto}.game-clock>span{font-size:1.35rem}.game-clock small{font-size:.43rem}.game-header .header-tools{gap:3px}.game-header .icon-button{width:27px;height:30px;font-size:1rem}.hand-area{height:187px}.hand{height:121px;bottom:25px;left:35px;right:35px}.fan-card{width:80px;height:112px;--gap:min(9vw,39px)}.hand-status{gap:4px;height:38px}.hand-status button{font-size:.48rem;padding:4px;min-height:30px}.hand-status>span{font-size:.48rem;max-width:28vw}.hand-tip{font-size:.47rem;padding:0 30px}.gesture-guide{left:5%;right:5%;font-size:.57rem;top:-35px}.game-chat-modal{left:3vw;bottom:14px}.player-rail{bottom:4px}.chat-opener{margin-top:10px;height:35px}.avatar-choice img{height:43px;width:43px}.meeple{width:12px;height:12px}.cover-wrap{margin-top:10px}.story-lines{margin-top:12px;margin-bottom:18px;min-height:64px}}
@media(max-height:520px) and (orientation:landscape){.hand-area{height:128px}.hand{height:78px;bottom:20px}.fan-card{width:59px;height:83px;--gap:40px}.hand-status{height:26px}.hand-status button{min-height:24px}.game-header{height:50px}}
@media(prefers-reduced-motion:reduce){.story-lines{display:block}.story-lines span{display:none;animation:none}.story-lines span:last-child{display:block;opacity:1}.meeple{transition:none}}
.home-top{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%}.home-music{display:flex;align-items:center;gap:7px;min-width:0}.home-music .icon-button{order:0!important}.track-window{width:110px;max-width:28vw;height:30px;display:flex;align-items:center;overflow:hidden;border:1px solid var(--line);border-radius:5px;background:#071b29d9;padding:0 7px;color:#e6c58b;font-size:.68rem}.track-window span{display:block;flex:none;white-space:nowrap;animation:trackTravel 5s ease-in-out infinite alternate}@keyframes trackTravel{from{transform:translateX(0)}to{transform:translateX(-24px)}}
.home-page .cover-wrap{position:relative;margin:24px auto;max-height:none;width:min(82vw,440px)}.home-page .cover{display:block;width:100%;max-height:70svh;object-fit:contain}.home-page .story-lines{position:absolute;inset:36% 4% auto;width:92%;height:27%;min-height:105px;margin:0;display:grid;place-items:center;padding:14px;background:radial-gradient(ellipse,#06131df2 20%,#06131daa 65%,transparent 80%);z-index:2;text-align:center;pointer-events:none}.home-page .story-lines span{position:static;grid-area:1/1;max-width:100%;width:100%;margin:0;font:italic clamp(16px,2.3vw,23px)/1.65 Georgia,serif;letter-spacing:normal;opacity:0;animation:storyV4 30s ease-in-out infinite;transform:translateY(10px);text-shadow:0 2px 6px #000}.home-page .story-lines span:nth-child(1){animation-delay:0s}.home-page .story-lines span:nth-child(2){animation-delay:5s}.home-page .story-lines span:nth-child(3){animation-delay:10s}.home-page .story-lines span:nth-child(4){animation-delay:15s}.home-page .story-lines span:nth-child(5){animation-delay:20s}.home-page .story-lines span:nth-child(6){animation-delay:25s}@keyframes storyV4{0%,16.66%,100%{opacity:0;transform:translateY(10px)}2%,14%{opacity:1;transform:translateY(-3px)}}.home-page.hidden .story-lines span{animation-play-state:paused}.home-actions{margin:0 auto 15px}
.right-stack,.profile-panel,.conditions-panel{min-width:0}.profile-panel{overflow:hidden}.avatar-choices{display:flex;flex-wrap:nowrap;gap:9px;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;padding:5px 2px 12px;scrollbar-width:thin;scrollbar-color:#d1b47b #0b2532}.avatar-choice{flex:0 0 82px;min-width:0;scroll-snap-align:start;padding:8px 4px}.avatar-choice img{width:52px;height:52px}.avatar-choice span{font-size:.59rem}.profile-panel .panel-head h2{overflow-wrap:anywhere}
.rail-action{position:relative;display:block;min-height:36px;width:116px;flex-shrink:0;border:1px solid #c6ad74;border-radius:6px;background:linear-gradient(#234653,#0d2636);color:#ffe1a0;font:600 .65rem Georgia,serif;letter-spacing:.05em;padding:9px 12px;box-shadow:0 3px 8px #0008;z-index:8;left:auto;right:auto;bottom:auto}.player-rail .discard-button{align-self:flex-end;margin:8px 0 1px;transform:translateX(64px)}.player-rail.expanded .discard-button{transform:none;width:100%}.deck-rail .pass-button{width:106px;margin:12px 0 2px;transform:translateX(-69px)}.deck-rail.expanded .pass-button{transform:none;width:100%}.chat-opener{margin-top:5px}.hand{left:22px;right:22px}.hand-status{gap:12px}.hand-status>span{max-width:65vw}.hand-status button{min-height:32px}.hand-tip{font-size:.6rem;padding:0 8px}.target-player{display:flex;gap:12px;align-items:center;width:100%;padding:8px;margin:6px 0;border:1px solid var(--line);border-radius:6px;background:#102b37;color:#ffe1a0;text-align:left;min-height:48px}.target-player img{width:32px;height:32px}.target-player:disabled{opacity:.35;cursor:not-allowed}
@media(max-width:680px){.home-top .icon-button{width:36px;height:36px;font-size:1.1rem}.home-page{padding:14px 15px 24px}.home-page .cover-wrap{width:min(87vw,440px);margin:20px auto}.home-page .story-lines{inset:36% 3% auto;width:94%;height:30%;min-height:110px}.home-page .story-lines span{font-size:17px}.avatar-choice{flex-basis:74px}.avatar-choice img{width:45px;height:45px}.rail-action{width:99px;min-height:33px;font-size:.58rem;padding:8px}.player-rail .discard-button{transform:translateX(65px)}.deck-rail .pass-button{width:92px;transform:translateX(-65px)}.hand-tip{font-size:.5rem;bottom:5px}.hand-status>span{max-width:61vw}.hand-status{gap:8px}.hand{left:10px;right:10px}.profile-panel .tiny-note{line-height:1.6}.right-stack{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.track-window span{animation:none}.home-page .story-lines{inset:23% 3% auto;height:auto;background:#071823eb}.home-page .story-lines span{display:block;grid-area:auto;opacity:1;transform:none;animation:none;font-size:12px;line-height:1.5}}

.home-top{width:auto}.deck-rail .pass-button{max-width:none}@media(max-width:680px){.deck-rail:not(.expanded) .pass-button{transform:translateX(-80px)}}

/* v5 refinements */
.home-page .story-lines{inset:31% 4% auto;width:92%;height:26%;min-height:0;padding:0;background:transparent!important;overflow:visible;place-items:center;filter:none}
.home-page .story-lines span{max-width:94%;font:italic clamp(15px,2.15vw,22px)/1.45 Georgia,serif;color:#ffe3ad;text-align:center;text-shadow:0 2px 7px #000,0 0 16px #06131d;animation:storyV5 20s ease-in-out infinite;transform:translateY(12px)}
.home-page .story-lines span:nth-child(1){animation-delay:0s}.home-page .story-lines span:nth-child(2){animation-delay:5s}.home-page .story-lines span:nth-child(3){animation-delay:10s}.home-page .story-lines span:nth-child(4){animation-delay:15s}
@keyframes storyV5{0%,24%,100%{opacity:0;transform:translateY(12px)}5%,19%{opacity:1;transform:translateY(-5px)}}

.deal-overlay{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:14px}
.deal-overlay h2{order:1}.deal-role{order:2;display:grid;grid-template-columns:auto auto;grid-template-areas:"card token" "card text";align-items:center;justify-items:start;gap:4px 14px;max-width:92vw}.deal-four{order:3}.deal-overlay>p{order:4}
.deal-role .deal-character{grid-area:card;width:92px!important;height:auto!important;border:2px solid #e1ba71;border-radius:7px;box-shadow:0 10px 28px #000b,0 0 20px #d4ae5b44;transition:transform .5s}.deal-role .deal-avatar{grid-area:token;width:48px!important;height:48px!important}.deal-role span{grid-area:text;max-width:190px}.deal-role.role-flip .deal-character{transform:rotateY(180deg)}
.deal-four .deal-card{width:68px}

/* Equal-height side rails. Actions live with the decks on the right. */
.player-rail,.deck-rail{top:6px;bottom:6px;height:auto;min-height:0}
.player-rail{display:flex;flex-direction:column}.player-rail #game-players{flex:1;min-height:0;overflow-y:auto}.player-rail .chat-opener{margin-top:auto}
.deck-rail{display:flex;flex-direction:column;align-items:center;overflow:visible}.deck-stack,.discard-stack{flex:0 0 auto}.rail-actions{margin-top:auto;width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:9px;padding:8px 0 2px}
.rail-circle{width:42px;height:42px;min-width:42px;border-radius:50%;border:1px solid #c8ab6b;background:linear-gradient(#244552,#0a2231);color:#ffe0a0;display:flex;align-items:center;justify-content:center;gap:10px;box-shadow:0 4px 10px #0008;overflow:visible;position:relative}
.rail-circle b{font:700 1rem Georgia,serif}.rail-circle span{position:absolute;right:50px;white-space:nowrap;opacity:0;transform:translateX(8px);pointer-events:none;color:#ffe0a0;font:600 .63rem Georgia,serif;letter-spacing:.07em;text-shadow:0 2px 4px #000;transition:.2s}
.deck-rail.expanded .rail-circle span{opacity:1;transform:none}.deck-rail.expanded .rail-actions{align-items:flex-end}.deck-rail.expanded .rail-circle span{right:50px}
.hand-status{justify-content:center}.hand-status>span{max-width:80vw}

.zoom-card{z-index:130}.zoom-action{margin:8px auto 2px;min-width:140px;padding:10px 18px;border:1px solid #e2bd73;border-radius:8px;background:linear-gradient(#f6d78b,#b8782e);color:#09202d;font:700 .8rem Georgia,serif;letter-spacing:.08em;box-shadow:0 4px 12px #0008}.zoom-action.hidden{display:none!important}

@media(max-width:680px){
 .home-page .story-lines{inset:30% 3% auto;width:94%;height:28%}.home-page .story-lines span{font-size:15px;line-height:1.4;max-width:96%}
 .deal-role .deal-character{width:84px!important}.deal-four .deal-card{width:58px}.deal-role span{font-size:.68rem;max-width:155px}
 .player-rail,.deck-rail{top:4px;bottom:4px}.rail-actions{gap:6px;padding-bottom:1px}.rail-circle{width:34px;height:34px;min-width:34px}.rail-circle b{font-size:.8rem}.rail-circle span{right:40px;font-size:.5rem}.deck-rail.expanded .rail-circle span{right:40px}
 .hand-status{height:28px}.hand-area{height:180px}.hand{height:124px;bottom:23px}
}
@media(prefers-reduced-motion:reduce){.home-page .story-lines span{animation:none;display:none;opacity:1;transform:none}.home-page .story-lines span:first-child{display:block}}


/* v6: reliable sequenced intro + waiting-room lighthouse row option */
.home-page .story-lines span{animation:none!important;opacity:0;transform:translateY(9px);will-change:opacity,transform}
@media(prefers-reduced-motion:reduce){.home-page .story-lines span{display:block!important;opacity:0!important;animation:none!important}}
.create-top-row{margin-top:14px}
.lobby-top-row-option{display:flex!important;align-items:center;gap:9px;color:var(--ink);font-weight:600}
.lobby-top-row-option input{width:18px;height:18px;accent-color:var(--gold);flex:none}
.lobby-top-row-option input:disabled+span{opacity:.7}
.music-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.music-controls #track-name{flex:1 1 100%;color:var(--gold-light);font-family:var(--serif);letter-spacing:.06em}

/* v7 polish: robust intro, vertical avatar selector, compact modals */
.home-page .story-lines{inset:31% 5% auto;width:90%;height:22%;min-height:90px;display:grid;place-items:center;background:transparent!important;padding:0!important;overflow:visible}
.home-page .story-lines #story-current{display:block!important;position:static!important;grid-area:1/1;width:100%;max-width:96%;opacity:0!important;transform:translateY(12px)!important;animation:none!important;transition:opacity .5s ease,transform 3.5s ease!important;font:italic clamp(15px,2.1vw,22px)/1.5 Georgia,serif;color:#ffe3ad;text-align:center;text-shadow:0 2px 7px #000,0 0 16px #06131d;will-change:opacity,transform}
.home-page .story-lines #story-current.story-visible{opacity:1!important;transform:translateY(-7px)!important}
@media(prefers-reduced-motion:reduce){.home-page .story-lines #story-current{display:block!important;opacity:0!important;transition:opacity .5s ease!important}.home-page .story-lines #story-current.story-visible{opacity:1!important;transform:none!important}}

.profile-panel{display:flex;flex-direction:column;min-height:495px;overflow:hidden}
.profile-panel .panel-head{flex:0 0 auto}
.profile-panel .avatar-choices{flex:1 1 auto;min-height:250px;max-height:385px;width:100%;display:flex;flex-direction:column;align-items:center;gap:10px;overflow-y:auto!important;overflow-x:hidden!important;scroll-snap-type:y proximity;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding:4px 8px 10px;scrollbar-width:thin;scrollbar-color:#d1b47b #0b2532}
.profile-panel .avatar-choice{flex:0 0 auto;width:min(100%,220px);min-height:72px;display:grid;grid-template-columns:58px auto;justify-content:center;align-items:center;column-gap:14px;text-align:left;scroll-snap-align:center;padding:8px 14px}
.profile-panel .avatar-choice img{width:54px;height:54px;margin:0;justify-self:center}
.profile-panel .avatar-choice span{font-size:.66rem;justify-self:start}
.profile-panel .tiny-note{flex:0 0 auto;margin-top:14px;text-align:center}

.peek-modal{width:min(92vw,430px)!important;max-width:430px!important}
.peek-modal .modal-inner.center{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;text-align:center!important;width:100%!important;padding:28px 24px 24px!important}
.peek-modal #peek-image{display:block!important;width:min(180px,43vw)!important;height:auto!important;max-height:38dvh!important;object-fit:contain!important;margin:12px auto 16px!important;align-self:center!important}
.peek-modal #peek-title,.peek-modal #peek-description{width:100%;max-width:340px;margin-left:auto!important;margin-right:auto!important;text-align:center!important}
.peek-modal #claim-actions{width:100%;display:flex;justify-content:center;align-items:center;gap:9px;flex-wrap:wrap}

.game-chat-modal{position:relative!important;left:auto!important;bottom:auto!important;width:min(88vw,390px)!important;max-height:min(68dvh,560px)!important;margin:0!important}
.game-chat-modal .modal-inner{padding:20px 16px 14px!important}
.game-chat-modal .chat-log{height:min(28dvh,220px)!important;min-height:130px!important;max-height:220px!important}
.game-chat-modal .reactions{padding:6px 0!important;gap:6px!important}
.game-chat-modal .chat-form input{padding:9px 10px!important}

.exit-modal{width:min(90vw,380px)!important}
.exit-modal .modal-inner.center{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;padding:30px 24px 24px}
.exit-modal h2{margin:2px 0 0;color:var(--gold-light);font:700 1.35rem var(--serif)}
.exit-modal p{margin:0 0 8px;color:var(--muted);font-size:.82rem;line-height:1.55}
.exit-modal .full-width{width:100%}

@media(max-width:680px){
 .home-page .story-lines{inset:30% 4% auto;width:92%;height:24%;min-height:82px}
 .home-page .story-lines #story-current{font-size:15px;line-height:1.45;max-width:98%}
 .profile-panel{min-height:500px}
 .profile-panel .avatar-choices{max-height:390px;min-height:290px}
 .profile-panel .avatar-choice{width:min(100%,190px);grid-template-columns:52px auto;min-height:66px}
 .profile-panel .avatar-choice img{width:48px;height:48px}
 .game-chat-modal{width:min(86vw,360px)!important;max-height:62dvh!important}
 .game-chat-modal .chat-log{height:min(24dvh,185px)!important;min-height:115px!important}
 .peek-modal{width:min(88vw,400px)!important}
 .peek-modal .modal-inner.center{padding:26px 18px 20px!important}
 .peek-modal #peek-image{width:min(165px,45vw)!important}
}


/* v8 polish: lower 5-second story, balanced waiting-room panels, compact speech previews */
.home-page .story-lines{
  inset:43% 5% auto!important;
  width:90%!important;
  height:16%!important;
  min-height:72px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  background:transparent!important;
  pointer-events:none;
}
.home-page .story-lines #story-current{
  max-width:92%!important;
  font:italic clamp(16px,2.05vw,22px)/1.45 Georgia,serif!important;
  text-align:center!important;
  opacity:0!important;
  transform:translateY(13px)!important;
  transition:opacity 3s ease-in,transform 8s ease-out!important;
}
.home-page .story-lines #story-current.story-visible{
  opacity:1!important;
  transform:translateY(-10px)!important;
  transition:opacity 3s ease-in,transform 8s ease-out!important;
}
.home-page .story-lines #story-current.story-fading{
  opacity:0!important;
  transform:translateY(-13px)!important;
  transition:opacity 2s ease-out,transform 2s ease-out!important;
}

/* Let the content determine the panel height; the two columns stretch equally. */
.right-stack{align-items:stretch!important}
.profile-panel,.conditions-panel{height:auto!important;min-height:0!important}
.profile-panel .avatar-choices{
  flex:0 1 auto!important;
  height:250px!important;
  min-height:0!important;
  max-height:250px!important;
}
.profile-panel .tiny-note{margin-top:10px!important}

/* Speech previews are intentionally tiny: enough to signal activity, not replace chat. */
.avatar-bubble{
  min-width:0!important;
  width:max-content!important;
  max-width:82px!important;
  padding:5px 7px!important;
  font-size:.62rem!important;
  line-height:1.15!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

@media(max-width:680px){
  .home-page .story-lines{inset:42% 5% auto!important;width:90%!important;height:17%!important}
  .home-page .story-lines #story-current{max-width:96%!important;font-size:15px!important;line-height:1.42!important}
  .profile-panel .avatar-choices{height:215px!important;max-height:215px!important}
  .profile-panel .avatar-choice{min-height:62px!important}
  .profile-panel .tiny-note{margin-top:8px!important;line-height:1.5!important}
  .right-stack{align-items:stretch!important}
  .right-stack>.profile-panel,.right-stack>.conditions-panel{align-self:stretch!important}
  .avatar-bubble{max-width:72px!important;font-size:.58rem!important;padding:4px 6px!important}
}


/* v11 single walking keeper figure */
.keeper-token{position:absolute;top:0;left:0;width:36px;height:50px;z-index:6;pointer-events:none;filter:drop-shadow(0 7px 8px #0009);transform-origin:50% 84%;will-change:transform}
.keeper-token::before,.keeper-token::after{content:'';position:absolute;pointer-events:none;border-radius:999px;right:0px;top:13px;transform-origin:50% 50%}
.keeper-token::before{width:10px;height:10px;background:radial-gradient(circle,#fff6b2 0%,#ffd45e 35%,#ffb12a 58%,rgba(255,153,39,.15) 100%);filter:blur(.35px);animation:lanternCore .22s steps(2,end) infinite}
.keeper-token::after{width:28px;height:28px;right:-8px;top:4px;background:radial-gradient(circle,rgba(255,231,153,.72) 0%,rgba(255,188,74,.42) 35%,rgba(255,153,42,.18) 60%,rgba(255,153,42,0) 100%);mix-blend-mode:screen;filter:blur(3.5px);animation:lanternHalo .55s ease-in-out infinite}
.keeper-token .keeper-figure{display:block;width:100%;height:100%;object-fit:contain;transform-origin:50% 86%;animation:keeperIdle 1.7s ease-in-out infinite;filter:drop-shadow(0 0 1px #ffb94c33)}
.keeper-token.walking .keeper-figure{animation:keeperStride .45s ease-in-out infinite}
@keyframes keeperIdle{0%,100%{transform:translateY(0) rotate(-.6deg)}50%{transform:translateY(-1px) rotate(.9deg)}}
@keyframes keeperStride{0%{transform:translateY(0) rotate(-3deg)}25%{transform:translateY(-2px) rotate(1deg)}50%{transform:translateY(0) rotate(3deg)}75%{transform:translateY(-2px) rotate(-1deg)}100%{transform:translateY(0) rotate(-3deg)}}
@keyframes lanternCore{0%{opacity:.85;transform:scale(.92)}20%{opacity:1;transform:scale(1.05)}40%{opacity:.8;transform:scale(.9)}65%{opacity:1;transform:scale(1.12)}100%{opacity:.9;transform:scale(.96)}}
@keyframes lanternHalo{0%{opacity:.5;transform:scale(.86)}18%{opacity:.72;transform:scale(1.02)}37%{opacity:.58;transform:scale(.92)}66%{opacity:.84;transform:scale(1.12)}100%{opacity:.6;transform:scale(.96)}}
@media(max-width:680px){.keeper-token{width:30px;height:42px}.keeper-token::before{width:8px;height:8px;right:-1px;top:11px}.keeper-token::after{width:22px;height:22px;right:-7px;top:4px}}
@media(prefers-reduced-motion:reduce){.keeper-token .keeper-figure,.keeper-token::before,.keeper-token::after{animation:none}}
\n\n/* v13 lighthouse reveal + endgame sequences */
.cell{perspective:700px}
.goal-flip-back,.goal-flip-face{position:absolute!important;inset:0;width:100%!important;height:100%!important;object-fit:fill!important;backface-visibility:hidden;transform-origin:50% 50%;z-index:7}
.goal-flip-back{transform:rotateY(0deg);opacity:1}
.goal-flip-face{opacity:0;transform:rotateY(-90deg)}
.goal-flipping .goal-flip-back{animation:goalBackFlip .48s ease-in forwards}
.goal-flipping .goal-flip-face{animation:goalFaceFlip .52s .46s ease-out forwards}
@keyframes goalBackFlip{0%{transform:rotateY(0deg);opacity:1}100%{transform:rotateY(90deg);opacity:.1}}
@keyframes goalFaceFlip{0%{transform:rotateY(-90deg);opacity:.2;filter:brightness(.7)}100%{transform:rotateY(0deg);opacity:1;filter:brightness(1.08)}}
.endgame-overlay{position:fixed;inset:0;z-index:48;display:grid;place-items:center;background:radial-gradient(circle at 50% 45%,rgba(20,58,72,.88),rgba(1,9,17,.96) 68%);backdrop-filter:blur(8px);padding:24px}
.endgame-stage{width:min(92vw,720px);text-align:center;color:#f6ddb0;position:relative}
.endgame-stage h2{font:700 clamp(1.8rem,6vw,3.4rem) var(--serif);letter-spacing:.08em;margin:0 0 10px;text-shadow:0 3px 18px #000}
.endgame-stage p{color:#d4dcd8;margin:0 0 24px;font-size:clamp(.8rem,2.5vw,1rem)}
.endgame-lighthouses{display:flex;justify-content:center;gap:clamp(8px,2vw,18px);perspective:1200px}
.end-lighthouse-card{position:relative;width:min(25vw,145px);aspect-ratio:5/7;transform-style:preserve-3d}
.end-lighthouse-card img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border:1px solid #e9c77c;border-radius:8px;backface-visibility:hidden;box-shadow:0 12px 28px #000a}
.end-card-back{transform:rotateY(0deg)}.end-card-face{transform:rotateY(-180deg)}
.endgame-lighthouses.reveal-all .end-card-back{animation:endBack .7s ease-in forwards}.endgame-lighthouses.reveal-all .end-card-face{animation:endFace .7s ease-out forwards}.endgame-lighthouses.reveal-all .end-lighthouse-card:nth-child(2) img{animation-delay:.28s}.endgame-lighthouses.reveal-all .end-lighthouse-card:nth-child(3) img{animation-delay:.56s}
@keyframes endBack{to{transform:rotateY(180deg)}}@keyframes endFace{to{transform:rotateY(0deg)}}
.true-beacon-stage{position:relative;width:min(76vw,320px);height:min(62vh,460px);margin:4px auto 0;display:grid;place-items:end center;overflow:visible}
.true-beacon-stage img{width:min(62vw,235px);max-height:90%;object-fit:contain;border-radius:10px;box-shadow:0 0 0 1px #f3d38b,0 20px 45px #000b;animation:trueRise 1.25s cubic-bezier(.2,.85,.2,1) both}
.beacon-core{position:absolute;left:50%;top:18%;width:18px;height:18px;border-radius:50%;transform:translate(-50%,-50%);background:#fff9c5;box-shadow:0 0 10px 5px #fff4a6,0 0 28px 13px #ffd665,0 0 55px 22px #ffb22e99;animation:beaconPulse .36s ease-in-out infinite alternate}
.beacon-light{position:absolute;top:18%;left:50%;height:22px;width:min(68vw,330px);transform-origin:0 50%;background:linear-gradient(90deg,rgba(255,249,193,.96),rgba(255,210,91,.5) 42%,rgba(255,181,55,0));filter:blur(2px);opacity:.9;clip-path:polygon(0 34%,100% 0,100% 100%,0 66%);animation:beaconSweep 2.8s ease-in-out infinite alternate}
.beacon-right{transform:translateY(-50%) rotate(7deg)}.beacon-left{transform:translateY(-50%) rotate(187deg)}
@keyframes trueRise{0%{opacity:0;transform:translateY(120px) scale(.72)}70%{opacity:1;transform:translateY(-8px) scale(1.03)}100%{opacity:1;transform:translateY(0) scale(1)}}
@keyframes beaconPulse{from{opacity:.78;transform:translate(-50%,-50%) scale(.86)}to{opacity:1;transform:translate(-50%,-50%) scale(1.15)}}
@keyframes beaconSweep{0%{opacity:.5;rotate:-10deg}50%{opacity:1}100%{opacity:.62;rotate:10deg}}
@media(max-width:680px){.endgame-overlay{padding:16px}.true-beacon-stage{height:min(56vh,390px)}.endgame-stage h2{font-size:1.8rem}}
@media(prefers-reduced-motion:reduce){.goal-flip-back,.goal-flip-face,.end-lighthouse-card img,.true-beacon-stage img,.beacon-core,.beacon-light{animation-duration:.01ms!important;animation-iteration-count:1!important}}


/* v13.2 — True Lighthouse victory animation anchored to the board card */
.cell.true-lighthouse-active{z-index:18!important;overflow:visible!important;box-shadow:0 0 0 2px rgba(255,222,139,.92),0 0 20px 7px rgba(255,192,70,.48),0 0 46px 16px rgba(255,164,42,.22)!important;animation:trueGoalCardGlow .72s ease-in-out infinite alternate}
@keyframes trueGoalCardGlow{from{filter:brightness(1.03)}to{filter:brightness(1.34)}}
.board-true-lighthouse-fx{--goal-w:48px;--goal-h:67px;position:fixed;z-index:47;width:max(58px,calc(var(--goal-w) * 1.25));height:max(165px,calc(var(--goal-h) * 2.75));transform:translate(-50%,-100%);pointer-events:none;overflow:visible;filter:drop-shadow(0 14px 12px rgba(0,0,0,.72));animation:boardFxAppear .18s ease-out both}
.board-lighthouse-ground{position:absolute;left:50%;bottom:-4px;width:150%;height:28%;transform:translateX(-50%);border-radius:50%;background:radial-gradient(ellipse,rgba(255,229,154,.78) 0%,rgba(255,181,58,.34) 30%,rgba(255,145,31,.13) 52%,rgba(255,145,31,0) 76%);filter:blur(4px);animation:boardGroundGlow .42s ease-in-out infinite alternate}
.board-lighthouse-tower{position:absolute;left:50%;bottom:0;width:58%;height:88%;transform:translateX(-50%);transform-origin:50% 100%;animation:boardTowerRise 1.15s cubic-bezier(.15,.88,.18,1.05) both}
.board-tower-body{position:absolute;left:50%;bottom:0;width:58%;height:74%;transform:translateX(-50%);clip-path:polygon(27% 0,73% 0,94% 100%,6% 100%);background:linear-gradient(90deg,rgba(0,0,0,.22),transparent 26%,rgba(255,240,201,.22) 48%,transparent 68%,rgba(0,0,0,.30)),repeating-linear-gradient(0deg,#c9b27d 0 9px,#a58c5d 10px 11px);border:1px solid rgba(255,225,157,.75);box-shadow:inset 0 0 10px rgba(30,18,7,.55),0 0 7px rgba(255,198,91,.18)}
.board-tower-balcony{position:absolute;left:50%;bottom:72%;width:82%;height:5%;transform:translateX(-50%);border-radius:2px;background:#2a2925;border:1px solid #d6b76e;box-shadow:0 2px 3px #000b}
.board-tower-lantern{position:absolute;left:50%;bottom:76%;width:52%;height:14%;transform:translateX(-50%);border:2px solid #342c20;border-radius:3px 3px 2px 2px;background:linear-gradient(90deg,transparent 18%,#332c21 20% 24%,transparent 26% 48%,#332c21 50% 54%,transparent 56% 78%,#332c21 80% 84%,transparent 86%),radial-gradient(circle at 50% 52%,#fffbd0 0 14%,#ffd75b 30%,#ff9e22 58%,rgba(255,147,24,.2) 76%);box-shadow:0 0 10px #ffd45c,0 0 24px rgba(255,174,46,.78);animation:boardLanternFlicker .18s steps(2,end) infinite}
.board-tower-roof{position:absolute;left:50%;bottom:88%;width:72%;height:11%;transform:translateX(-50%);clip-path:polygon(50% 0,100% 78%,76% 100%,24% 100%,0 78%);background:linear-gradient(#191d1f,#343126 70%,#17191a);border-bottom:1px solid #d0ad65}
.board-tower-roof::after{content:"";position:absolute;left:49%;top:-28%;width:2px;height:34%;background:#d3b269}
.board-tower-window{position:absolute;left:50%;width:18%;height:8%;transform:translateX(-50%);border-radius:50% 50% 2px 2px;background:#ffd878;box-shadow:0 0 6px rgba(255,192,72,.85)}
.board-tower-window.w1{top:30%}.board-tower-window.w2{top:55%}
.board-tower-door{position:absolute;left:50%;bottom:0;width:26%;height:14%;transform:translateX(-50%);border-radius:50% 50% 0 0;background:#27241f;border:1px solid #b99656}
.board-beacon-core{position:absolute;left:50%;top:50%;width:12px;height:12px;transform:translate(-50%,-50%);border-radius:50%;background:#fffbd0;box-shadow:0 0 8px 4px #fff7ad,0 0 20px 9px #ffd45b,0 0 38px 15px rgba(255,166,45,.72)}
.board-beacon-rig{position:absolute;z-index:-1;left:50%;bottom:79%;width:0;height:0;opacity:0;animation:boardBeaconStart .35s .72s ease-out forwards,boardBeaconRotate 2.25s .95s linear infinite}
.board-beam{position:absolute;left:0;top:-14px;width:min(42vw,360px);height:28px;transform-origin:0 50%;clip-path:polygon(0 38%,100% 0,100% 100%,0 62%);background:linear-gradient(90deg,rgba(255,251,211,.98),rgba(255,221,115,.66) 30%,rgba(255,183,61,.28) 62%,rgba(255,168,43,0) 100%);filter:blur(2px);mix-blend-mode:screen}
.board-beam.beam-a{transform:rotate(0deg)}.board-beam.beam-b{transform:rotate(180deg)}
@keyframes boardFxAppear{from{opacity:0}to{opacity:1}}
@keyframes boardTowerRise{0%{opacity:0;transform:translateX(-50%) translateY(72%) scale(.32)}22%{opacity:1}72%{transform:translateX(-50%) translateY(-3%) scale(1.035)}100%{opacity:1;transform:translateX(-50%) translateY(0) scale(1)}}
@keyframes boardBeaconStart{from{opacity:0;transform:scale(.3)}to{opacity:.96;transform:scale(1)}}
@keyframes boardBeaconRotate{from{transform:rotate(-16deg)}to{transform:rotate(344deg)}}
@keyframes boardLanternFlicker{0%{filter:brightness(.90);box-shadow:0 0 8px #ffd45c,0 0 19px rgba(255,174,46,.62)}35%{filter:brightness(1.22);box-shadow:0 0 13px #fff09a,0 0 30px rgba(255,174,46,.92)}70%{filter:brightness(1.02);box-shadow:0 0 10px #ffd45c,0 0 22px rgba(255,174,46,.70)}100%{filter:brightness(1.30);box-shadow:0 0 15px #fff4a5,0 0 34px rgba(255,174,46,.98)}}
@keyframes boardGroundGlow{from{opacity:.55;transform:translateX(-50%) scale(.92)}to{opacity:.9;transform:translateX(-50%) scale(1.08)}}
@media(max-width:680px){.board-true-lighthouse-fx{width:max(50px,calc(var(--goal-w) * 1.18));height:max(135px,calc(var(--goal-h) * 2.35))}.board-beam{width:min(48vw,245px);height:22px;top:-11px}.board-beacon-core{width:9px;height:9px}}
@media(prefers-reduced-motion:reduce){.board-lighthouse-tower,.board-beacon-rig,.board-tower-lantern,.board-lighthouse-ground,.cell.true-lighthouse-active{animation-duration:.01ms!important;animation-iteration-count:1!important}}


/* ================================================================
   v13.3 — Keeper-scale THE LIGHTHOUSE KEEPERS victory lighthouse
   Shorter tower, dark storybook stone + antique gold + warm beacon.
   ================================================================ */

.board-true-lighthouse-fx.themed-mini-lighthouse{
  /* Tower is intentionally only a little taller than the mini Keeper. */
  width: max(42px, calc(var(--goal-w) * .86));
  height: max(82px, calc(var(--goal-h) * 1.34));
  transform: translate(-50%,-100%);
  filter:
    drop-shadow(0 7px 5px rgba(0,0,0,.72))
    drop-shadow(0 0 8px rgba(255,185,67,.20));
}

/* Small rocky foundation so it looks as if it grows out of the card. */
.themed-mini-lighthouse .board-lighthouse-ground{
  left:50%;
  bottom:-2px;
  width:118%;
  height:18%;
  background:
    radial-gradient(ellipse at 50% 72%,
      rgba(255,216,126,.54) 0 15%,
      rgba(170,119,50,.28) 32%,
      rgba(8,24,33,.78) 58%,
      rgba(5,17,25,0) 78%);
  filter:blur(2px);
  animation:themeGroundPulse .42s ease-in-out infinite alternate;
}

/* Short, sturdy tower matching the game's dark-blue / antique-gold art. */
.themed-mini-lighthouse .board-lighthouse-tower{
  left:50%;
  bottom:0;
  width:78%;
  height:94%;
  transform:translateX(-50%);
  transform-origin:50% 100%;
  animation:themeTowerEmerge 1s cubic-bezier(.18,.9,.24,1.08) both;
}

.themed-mini-lighthouse .board-tower-body{
  left:50%;
  bottom:0;
  width:55%;
  height:70%;
  transform:translateX(-50%);
  clip-path:polygon(31% 0,69% 0,87% 100%,13% 100%);
  background:
    /* narrow moonlit highlight */
    linear-gradient(90deg,
      rgba(0,0,0,.34) 0%,
      rgba(12,31,40,.38) 25%,
      rgba(217,194,143,.20) 47%,
      rgba(255,226,159,.30) 53%,
      rgba(16,37,46,.36) 72%,
      rgba(0,0,0,.46) 100%),
    /* old stone courses */
    repeating-linear-gradient(0deg,
      #627077 0 5px,
      #46565d 5px 6px,
      #718087 6px 10px,
      #3c4c53 10px 11px);
  border:1px solid rgba(229,194,115,.82);
  box-shadow:
    inset 0 0 7px rgba(0,10,17,.76),
    0 0 0 1px rgba(5,20,29,.68),
    0 2px 5px rgba(0,0,0,.55);
}

/* Gold belt/balcony like the card-frame language. */
.themed-mini-lighthouse .board-tower-balcony{
  left:50%;
  bottom:68%;
  width:82%;
  height:5%;
  transform:translateX(-50%);
  border-radius:1px;
  background:linear-gradient(#d6b46d,#6f5429 56%,#d0aa60);
  border:1px solid rgba(255,220,143,.78);
  box-shadow:0 2px 3px rgba(0,0,0,.75);
}
.themed-mini-lighthouse .board-tower-balcony::before,
.themed-mini-lighthouse .board-tower-balcony::after{
  content:"";
  position:absolute;
  bottom:100%;
  width:1px;
  height:7px;
  background:#d5b46d;
}
.themed-mini-lighthouse .board-tower-balcony::before{left:20%}
.themed-mini-lighthouse .board-tower-balcony::after{right:20%}

/* Lantern room: warm amber fire behind a dark metal cage. */
.themed-mini-lighthouse .board-tower-lantern{
  left:50%;
  bottom:72%;
  width:50%;
  height:15%;
  transform:translateX(-50%);
  border:1px solid #d7b76d;
  border-radius:2px;
  background:
    linear-gradient(90deg,
      #17252a 0 8%, transparent 8% 29%,
      #17252a 29% 36%, transparent 36% 64%,
      #17252a 64% 71%, transparent 71% 92%,
      #17252a 92% 100%),
    radial-gradient(circle at 50% 55%,
      #fffbd1 0 11%,
      #ffe177 23%,
      #ffad35 45%,
      #d86d16 65%,
      rgba(72,25,5,.28) 78%);
  box-shadow:
    0 0 6px rgba(255,224,125,.92),
    0 0 14px rgba(255,161,43,.62);
  animation:themeLanternFire .15s steps(2,end) infinite;
}

.themed-mini-lighthouse .board-tower-roof{
  left:50%;
  bottom:87%;
  width:72%;
  height:11%;
  transform:translateX(-50%);
  clip-path:polygon(50% 0,100% 74%,80% 100%,20% 100%,0 74%);
  background:
    linear-gradient(90deg,#07141b,#17303a 46%,#263f45 55%,#071218);
  border-bottom:1px solid #d7b66b;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.8));
}
.themed-mini-lighthouse .board-tower-roof::after{
  content:"";
  left:49%;
  top:-33%;
  width:2px;
  height:40%;
  background:#d5b46b;
}

/* Warm windows make the miniature feel inhabited rather than generic. */
.themed-mini-lighthouse .board-tower-window{
  width:16%;
  height:7%;
  background:#ffc95d;
  border:1px solid rgba(255,232,166,.82);
  box-shadow:0 0 4px rgba(255,179,55,.86);
}
.themed-mini-lighthouse .board-tower-window.w1{top:31%}
.themed-mini-lighthouse .board-tower-window.w2{top:54%}
.themed-mini-lighthouse .board-tower-door{
  width:24%;
  height:13%;
  background:#12242b;
  border:1px solid #9e7d42;
}

/* Beacon originates precisely from the lantern room. */
.themed-mini-lighthouse .board-beacon-rig{
  left:50%;
  bottom:79.5%;
  z-index:-1;
  opacity:0;
  animation:
    themeBeaconIgnite .28s .82s ease-out forwards,
    themeBeaconSweep 2.15s 1.05s linear infinite;
}

/* Narrower, more lighthouse-like beams that sweep OUT across the board. */
.themed-mini-lighthouse .board-beam{
  left:0;
  top:-7px;
  width:min(46vw,330px);
  height:14px;
  transform-origin:0 50%;
  clip-path:polygon(0 35%,100% 0,100% 100%,0 65%);
  background:linear-gradient(90deg,
    rgba(255,252,220,.98) 0%,
    rgba(255,231,143,.78) 16%,
    rgba(255,201,86,.48) 42%,
    rgba(255,175,55,.18) 72%,
    rgba(255,164,42,0) 100%);
  filter:blur(1.2px);
  mix-blend-mode:screen;
}
.themed-mini-lighthouse .board-beam.beam-a{transform:rotate(0deg)}
.themed-mini-lighthouse .board-beam.beam-b{transform:rotate(180deg)}

.themed-mini-lighthouse .board-beacon-core{
  width:8px;
  height:8px;
  background:#fffde0;
  box-shadow:
    0 0 5px 3px #fff4a8,
    0 0 11px 6px #ffd461,
    0 0 22px 9px rgba(255,164,39,.60);
}

@keyframes themeTowerEmerge{
  0%{
    opacity:0;
    transform:translateX(-50%) translateY(70%) scale(.55,.18);
    filter:brightness(.6);
  }
  30%{opacity:1}
  76%{
    transform:translateX(-50%) translateY(-3%) scale(1.03);
    filter:brightness(1.05);
  }
  100%{
    opacity:1;
    transform:translateX(-50%) translateY(0) scale(1);
    filter:brightness(1);
  }
}
@keyframes themeBeaconIgnite{
  0%{opacity:0;transform:scale(.18)}
  55%{opacity:1;transform:scale(1.18)}
  100%{opacity:.98;transform:scale(1)}
}
@keyframes themeBeaconSweep{
  from{transform:rotate(-12deg)}
  to{transform:rotate(348deg)}
}
@keyframes themeLanternFire{
  0%{filter:brightness(.82) saturate(.96)}
  25%{filter:brightness(1.28) saturate(1.12)}
  55%{filter:brightness(.98) saturate(1.03)}
  75%{filter:brightness(1.38) saturate(1.16)}
  100%{filter:brightness(1.08) saturate(1.08)}
}
@keyframes themeGroundPulse{
  from{opacity:.48;transform:translateX(-50%) scale(.94)}
  to{opacity:.82;transform:translateX(-50%) scale(1.06)}
}

/* Phone/tablet: preserve keeper-scale proportions instead of becoming tall. */
@media(max-width:680px){
  .board-true-lighthouse-fx.themed-mini-lighthouse{
    width:max(38px,calc(var(--goal-w) * .82));
    height:max(72px,calc(var(--goal-h) * 1.25));
  }
  .themed-mini-lighthouse .board-beam{
    width:min(50vw,230px);
    height:12px;
    top:-6px;
  }
}

/* ================================================================
   v13.4 — user-selected 3D white-stone lighthouse model
   Uses the supplied model as the actual board tower. The beacon is
   deliberately local: it lights only the surrounding board area.
   ================================================================ */
.board-true-lighthouse-fx.themed-mini-lighthouse{
  width:max(36px,calc(var(--goal-w) * .78));
  height:max(66px,calc(var(--goal-h) * 1.05));
  overflow:visible;
  filter:drop-shadow(0 5px 5px rgba(0,0,0,.72)) drop-shadow(0 0 6px rgba(255,191,68,.22));
}
.themed-mini-lighthouse .board-lighthouse-model{
  position:absolute;
  z-index:2;
  left:50%;
  bottom:-1px;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:50% 100%;
  transform:translateX(-50%);
  transform-origin:50% 100%;
  filter:drop-shadow(0 3px 3px rgba(0,0,0,.52));
  animation:modelTowerEmerge 1s cubic-bezier(.18,.9,.24,1.08) both;
}
.themed-mini-lighthouse .board-lighthouse-ground{
  z-index:0;
  width:125%;
  height:19%;
  bottom:-3px;
  background:radial-gradient(ellipse,rgba(255,225,145,.58) 0 17%,rgba(255,183,62,.27) 36%,rgba(255,150,35,.09) 58%,transparent 78%);
  filter:blur(2.2px);
}
/* Lantern is about 19% down from the top of the supplied 3D model. */
.themed-mini-lighthouse .board-beacon-rig{
  z-index:1;
  left:50%;
  bottom:80.5%;
  opacity:0;
  animation:themeBeaconIgnite .28s .82s ease-out forwards,themeBeaconSweep 2.15s 1.05s linear infinite;
}
/* Short local sweep: roughly one to one-and-a-half cards each side. */
.themed-mini-lighthouse .board-beam{
  top:-5px;
  width:min(11vw,82px);
  height:10px;
  clip-path:polygon(0 33%,100% 12%,100% 88%,0 67%);
  background:linear-gradient(90deg,rgba(255,253,222,.96) 0%,rgba(255,231,144,.72) 22%,rgba(255,197,78,.35) 58%,rgba(255,171,46,0) 100%);
  filter:blur(.9px);
  opacity:.9;
}
.themed-mini-lighthouse .board-beacon-core{
  width:6px;
  height:6px;
  box-shadow:0 0 4px 2px #fff6b0,0 0 9px 4px #ffd35d,0 0 15px 6px rgba(255,166,45,.48);
}
@keyframes modelTowerEmerge{
  0%{opacity:0;transform:translateX(-50%) translateY(72%) scale(.52,.16);filter:brightness(.62)}
  32%{opacity:1}
  78%{transform:translateX(-50%) translateY(-3%) scale(1.035);filter:brightness(1.08)}
  100%{opacity:1;transform:translateX(-50%) translateY(0) scale(1);filter:brightness(1)}
}
@media(max-width:680px){
  .board-true-lighthouse-fx.themed-mini-lighthouse{
    width:max(32px,calc(var(--goal-w) * .74));
    height:max(58px,calc(var(--goal-h) * .98));
  }
  .themed-mini-lighthouse .board-beam{width:min(15vw,60px);height:8px;top:-4px}
  .themed-mini-lighthouse .board-beacon-core{width:5px;height:5px}
}

/* v14 — 5-second miniature lighthouse reveals + compact local beacon */
.cell.lighthouse-active{z-index:18!important;overflow:visible!important}
.board-lighthouse-fx{--goal-w:48px;--goal-h:67px;position:fixed;z-index:47;width:max(36px,calc(var(--goal-w) * .78));height:max(66px,calc(var(--goal-h) * 1.05));transform:translate(-50%,-100%);pointer-events:none;overflow:visible;filter:drop-shadow(0 5px 5px rgba(0,0,0,.72));}
.board-lighthouse-fx .board-lighthouse-model{animation:v14TowerRise 5s cubic-bezier(.16,.82,.22,1) both!important}
.board-lighthouse-fx.is-dormant .board-lighthouse-ground{background:radial-gradient(ellipse,rgba(208,194,155,.35) 0 18%,rgba(118,102,76,.16) 42%,transparent 76%)}
.board-lighthouse-fx.is-dormant .board-lighthouse-model{filter:drop-shadow(0 3px 4px rgba(0,0,0,.68)) brightness(.88)}
.board-lighthouse-fx.is-true .board-beacon-rig{opacity:0;animation:v14BeaconIgnite .25s 5s ease-out forwards,v14BeaconSweep 3s 5.05s linear 1!important}
.board-lighthouse-fx.is-true .board-beam{width:min(9vw,70px)!important;height:9px!important;top:-4px!important;opacity:.82!important;filter:blur(.8px)!important}
.board-lighthouse-fx.is-true .board-beacon-core{width:6px!important;height:6px!important;box-shadow:0 0 4px 2px #fff6b0,0 0 9px 4px #ffd35d,0 0 14px 5px rgba(255,166,45,.42)!important}
.journey-event-message{position:fixed;z-index:55;left:50%;top:48%;transform:translate(-50%,-50%);max-width:min(88vw,760px);padding:14px 22px;text-align:center;pointer-events:none;color:#ffe0a0;font:700 clamp(1.45rem,5vw,3rem) var(--serif);letter-spacing:.08em;text-transform:uppercase;text-shadow:0 3px 18px #000,0 0 24px rgba(255,194,82,.28);opacity:0}
.journey-event-message.play{animation:v14JourneyMessage 3s ease-in-out both}
@keyframes v14TowerRise{0%{opacity:0;transform:translateX(-50%) translateY(82%) scale(.48,.12);filter:brightness(.52)}18%{opacity:.7}72%{opacity:1;transform:translateX(-50%) translateY(-2%) scale(1.025);filter:brightness(1.02)}100%{opacity:1;transform:translateX(-50%) translateY(0) scale(1);filter:brightness(1)}}
@keyframes v14BeaconIgnite{from{opacity:0;transform:scale(.25)}to{opacity:.92;transform:scale(1)}}
@keyframes v14BeaconSweep{from{transform:rotate(-20deg)}to{transform:rotate(340deg)}}
@keyframes v14JourneyMessage{0%{opacity:0;transform:translate(-50%,calc(-50% + 12px))}18%{opacity:1;transform:translate(-50%,-50%)}78%{opacity:1;transform:translate(-50%,calc(-50% - 5px))}100%{opacity:0;transform:translate(-50%,calc(-50% - 12px))}}
@media(max-width:680px){.board-lighthouse-fx{width:max(34px,calc(var(--goal-w) * .76));height:max(60px,calc(var(--goal-h) * 1.02))}.board-lighthouse-fx.is-true .board-beam{width:min(15vw,58px)!important}.journey-event-message{top:46%;font-size:1.35rem;padding:10px 16px}}
@media(prefers-reduced-motion:reduce){.board-lighthouse-fx .board-lighthouse-model,.board-lighthouse-fx.is-true .board-beacon-rig,.journey-event-message.play{animation-duration:.01ms!important}}

/* v14.8 — curse/help card flight from the activating player's portrait to centre stage */
.card-action-fx{position:fixed;inset:0;z-index:70;pointer-events:none;overflow:hidden;background:rgba(2,10,15,0);transition:background .32s ease,opacity .5s ease}
.card-action-fx.arrived{background:rgba(2,10,15,.38)}
.card-action-fx.leaving{opacity:0}
.card-action-flying{position:fixed;z-index:2;width:clamp(112px,23vw,190px);height:auto;transform-origin:center;filter:drop-shadow(0 14px 22px rgba(0,0,0,.7));border-radius:8px}
.card-action-fx.is-curse .card-action-flying{box-shadow:0 0 0 1px rgba(255,110,91,.35),0 0 34px rgba(211,47,47,.48)}
.card-action-fx.is-help .card-action-flying{box-shadow:0 0 0 1px rgba(255,224,139,.35),0 0 34px rgba(99,211,181,.36)}
.card-action-message{position:fixed;z-index:3;left:50%;top:calc(46% + clamp(112px,23vw,190px)*.78);transform:translate(-50%,18px) scale(.94);width:min(88vw,680px);padding:12px 18px;text-align:center;opacity:0;color:#ffe0a0;font:700 clamp(1.15rem,4.5vw,2.35rem) var(--serif);letter-spacing:.075em;text-transform:uppercase;text-shadow:0 3px 18px #000,0 0 20px rgba(255,193,75,.3)}
.card-action-fx.is-curse .card-action-message{color:#ffb0a2;text-shadow:0 3px 18px #000,0 0 24px rgba(211,47,47,.5)}
.card-action-fx.is-help .card-action-message{color:#ffe3a0;text-shadow:0 3px 18px #000,0 0 24px rgba(91,219,181,.36)}
.card-action-fx.arrived .card-action-message{animation:cardActionMessageIn .48s .08s ease-out both}
@keyframes cardActionMessageIn{from{opacity:0;transform:translate(-50%,18px) scale(.94)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
@media(max-width:680px){.card-action-flying{width:clamp(104px,29vw,150px)}.card-action-message{top:calc(46% + clamp(104px,29vw,150px)*.82);font-size:1.12rem;padding:10px 12px}}
@media(prefers-reduced-motion:reduce){.card-action-message{opacity:1!important;transform:translate(-50%,0)!important}.card-action-fx{transition:none}}
\n\n/* v15.0 — reliable floating chat previews + peer voice controls */\n.floating-chat-bubble{position:fixed!important;z-index:120!important;left:8px;top:8px;max-width:min(230px,62vw)!important;width:max-content!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;padding:7px 10px!important;background:#f5e0b8!important;color:#0d2635!important;border:1px solid #d2ad6b;border-radius:9px 9px 9px 2px!important;box-shadow:0 6px 18px #000a!important;font-size:.7rem!important;line-height:1.25!important;pointer-events:none;animation:bubbleIn .18s ease-out}\n.floating-chat-bubble.leaving{opacity:0;transform:translateY(-4px);transition:opacity .18s ease,transform .18s ease}\n.voice-controls{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:2px 0 8px}.voice-controls button{min-height:34px;border:1px solid #b99a62;border-radius:6px;background:#102c3b;color:#e9d29f;font:700 .58rem Georgia,serif;letter-spacing:.03em;padding:6px}.voice-controls button.active{border-color:#9fe0bd;color:#b9f3d3;background:#163b39;box-shadow:0 0 10px #71d6a333}.voice-controls button:disabled{opacity:.45}.voice-status{grid-column:1/-1;color:#9db6bc;font-size:.55rem;text-align:center}.remote-voice-audio{display:none!important}\n@media(max-width:680px){.floating-chat-bubble{max-width:min(190px,58vw)!important;font-size:.64rem!important}.voice-controls button{font-size:.53rem;min-height:32px}}\n

/* v15.1 — avatar-anchored chat preview */
.floating-chat-bubble:before{content:"";position:absolute;left:-5px;top:50%;width:9px;height:9px;background:#f5e0b8;border-left:1px solid #d2ad6b;border-bottom:1px solid #d2ad6b;transform:translateY(-50%) rotate(45deg)}

/* v15.2 — speech bubbles follow the visible player avatar, including collapsed rail */
.floating-chat-bubble[data-side="left"]{border-radius:9px 9px 2px 9px!important}
.floating-chat-bubble[data-side="left"]:before{left:auto;right:-5px;border-left:0;border-bottom:0;border-right:1px solid #d2ad6b;border-top:1px solid #d2ad6b}

/* v15.3: in-game settings are clearly read-only; deal cards fly in viewport coordinates. */
.settings-readonly{width:100%;min-height:46px;padding:10px 13px;border:1px solid #8b949b66;border-radius:5px;background:#8b949b24!important;color:#aeb8bd!important;opacity:1!important;-webkit-text-fill-color:#aeb8bd;cursor:default}.settings-mode-readonly{margin:7px 0 17px;padding:0;color:#c4ced1;font-size:1rem}.deal-flying-layer{position:fixed;inset:0;z-index:10;pointer-events:none}.deal-flying-layer .deal-card{position:fixed;margin:0;object-fit:cover;box-shadow:0 10px 20px #000a}

/* v15.5: connection/presence, turn timer and improved action/tower effects */
#turn-countdown{display:block;font:700 .66rem var(--sans);color:#ffe0a0;letter-spacing:.09em;margin-top:2px}
#turn-countdown.urgent{color:#ff9786;animation:turnPulse .55s ease-in-out infinite alternate}
@keyframes turnPulse{to{opacity:.52}}
.game-player.offline{border-color:rgba(255,129,120,.55)!important;filter:saturate(.55)}
.game-player.offline .gp-bot{color:#ffb2a4}
.game-player.bot-takeover .gp-bot{color:#ffdc87}
/* The trail traces the card's 2-second flight; soft glow fades as it reaches centre. */
.card-action-trail{position:fixed;left:var(--trail-x);top:var(--trail-y);width:0;height:0;z-index:1;pointer-events:none;filter:drop-shadow(0 0 8px currentColor);color:rgba(244,179,112,.7)}
.card-action-fx.is-curse .card-action-trail{color:rgba(244,102,109,.6)}
.card-action-fx.is-help .card-action-trail{color:rgba(126,227,184,.58)}
.card-action-trail::before{content:"";position:absolute;left:0;top:0;width:110px;height:7px;border-radius:50%;transform-origin:0 50%;background:linear-gradient(90deg,transparent,currentColor 52%,transparent);filter:blur(5px);animation:cardFlightTrail 2s cubic-bezier(.3,.55,.18,1) both}
.card-action-trail::after{content:"";position:absolute;left:0;top:0;width:42px;height:4px;border-radius:50%;background:currentColor;filter:blur(8px);animation:cardFlightTrail 2s cubic-bezier(.3,.55,.18,1) both}
@keyframes cardFlightTrail{0%{opacity:0;transform:translate(0,0) rotate(-14deg) scale(.2)}20%{opacity:.7}72%{opacity:.46}100%{opacity:0;transform:translate(var(--trail-dx),var(--trail-dy)) rotate(0) scale(1.2)}}
/* Earth splits during the first seconds; tower emerges within five seconds. */
.board-lighthouse-fx .board-lighthouse-crack{position:absolute;z-index:0;left:50%;bottom:-4%;width:158%;height:38%;border-radius:50%;background:radial-gradient(ellipse at center,rgba(5,10,13,.95) 0 21%,rgba(47,38,29,.92) 25% 34%,rgba(232,174,93,.75) 36% 39%,rgba(10,18,19,0) 55%),conic-gradient(from 10deg,transparent 0 14deg,#161b1b 16deg 21deg,transparent 23deg 65deg,#1b1918 67deg 73deg,transparent 75deg 132deg,#191816 134deg 142deg,transparent 144deg 218deg,#191918 220deg 229deg,transparent 231deg 295deg,#1c1b18 297deg 304deg,transparent 306deg);transform:translateX(-50%) scale(.08);opacity:0;animation:groundSplit 5s ease-out both}
.board-lighthouse-fx .board-lighthouse-dust{position:absolute;z-index:1;left:50%;bottom:0;width:180%;height:48%;border-radius:50%;background:radial-gradient(ellipse,rgba(204,169,114,.68),rgba(137,113,84,.28) 48%,transparent 75%);filter:blur(5px);transform:translateX(-50%) scale(.25);opacity:0;animation:groundDust 5s ease-out both}
.board-lighthouse-fx .board-lighthouse-ground{animation:groundLightRise 5s ease-in-out both!important}
.board-lighthouse-fx .board-lighthouse-model{animation:earthTowerRise 5s cubic-bezier(.19,.7,.18,1) both!important}
@keyframes groundSplit{0%{opacity:0;transform:translateX(-50%) scale(.05)}9%{opacity:.7}28%{opacity:1;transform:translateX(-50%) scale(1.1)}58%{opacity:1;transform:translateX(-50%) scale(1)}85%,100%{opacity:.72;transform:translateX(-50%) scale(1)}}
@keyframes groundDust{0%,9%{opacity:0;transform:translateX(-50%) scale(.2)}18%{opacity:.5}35%{opacity:.75;transform:translateX(-50%) scale(1.12)}74%{opacity:.22}100%{opacity:0;transform:translateX(-50%) scale(1.2)}}
@keyframes groundLightRise{0%{opacity:0;transform:translateX(-50%) scale(.3)}20%{opacity:.8}50%,100%{opacity:.5;transform:translateX(-50%) scale(1)}}
@keyframes earthTowerRise{0%,9%{opacity:0;transform:translateX(-50%) translateY(90%) scale(.55,.12);filter:brightness(.35)}22%{opacity:.95}76%{opacity:1;transform:translateX(-50%) translateY(-3%) scale(1.025);filter:brightness(.96)}85%,100%{opacity:1;transform:translateX(-50%) translateY(0) scale(1);filter:brightness(1)}}
/* The keeper enters the door after the model settles at ~4.25s, before the 5s beacon. */
.board-lighthouse-fx .board-keeper-enter{position:absolute;z-index:4;left:12%;bottom:-3%;width:38%;height:39%;object-fit:contain;object-position:bottom;opacity:0;transform-origin:bottom center;animation:keeperEnterTower .65s 4.3s ease-in both}
@keyframes keeperEnterTower{0%{opacity:0;transform:translate(-50%,8%) scale(.82)}15%{opacity:1}65%{opacity:1;transform:translate(52%,-8%) scale(.62)}100%{opacity:0;transform:translate(84%,-9%) scale(.22)}}
.keeper-token.entering-lighthouse{opacity:0;transition:opacity .18s}
@media(prefers-reduced-motion:reduce){.board-lighthouse-fx .board-lighthouse-crack,.board-lighthouse-fx .board-lighthouse-dust,.board-lighthouse-fx .board-lighthouse-ground,.board-lighthouse-fx .board-keeper-enter,.card-action-trail::before,.card-action-trail::after{animation-duration:.01ms!important;animation-delay:0ms!important}}

/* v15.6: mobile viewport containment, accessible tools and a 15-second avatar dial. */
.playing{position:fixed;inset:0;width:100%;max-width:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
.playing #app{height:100%;max-width:100%;min-width:0;overflow:hidden}
.playing .game-page{height:100%;width:100%;max-width:100%;min-width:0;overflow:hidden}
.game-stage,.board-shell{min-width:0;max-width:100%;}
.game-header{position:relative;z-index:9;min-width:0;width:100%;max-width:100%;grid-template-columns:minmax(0,1fr) minmax(0,auto) minmax(0,1fr);}
.game-header .header-tools{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;justify-content:flex-end}
.game-header .game-room{min-width:0;overflow:hidden}
.game-header .game-room strong{display:block;overflow:hidden;text-overflow:ellipsis}
.game-header .game-clock{min-width:0;white-space:nowrap}
.game-header .game-clock #game-turn-label{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.deck-rail:not(.expanded) .rail-actions{position:absolute;right:calc(100% + 8px);bottom:12px;width:40px;max-width:40px;display:flex;flex-direction:column;align-items:center;gap:8px;margin:0;padding:6px 2px;border:1px solid rgba(231,186,112,.35);border-radius:22px;background:rgba(7,24,35,.87);box-shadow:0 4px 12px #0008}
.deck-rail:not(.expanded) .rail-actions .rail-circle{margin:0;transform:none;flex-shrink:0}
.deck-rail.expanded .rail-actions{position:static;right:auto;bottom:auto;width:100%;max-width:none;margin-top:auto;padding:8px 0 2px;border:0;background:none;box-shadow:none}
.gp-turn-dial{display:none;position:absolute;z-index:5;right:1px;top:50%;transform:translateY(-50%);width:35px;height:35px;border-radius:50%;align-items:center;justify-content:center;isolation:isolate;background:conic-gradient(#ff615b calc(var(--turn-progress,1) * 1turn),rgba(80,30,32,.94) 0);border:1px solid #ffaba0;color:#fff0e4;font:800 15px/1 var(--sans);font-variant-numeric:tabular-nums;box-shadow:0 0 0 2px rgba(115,29,29,.65),0 0 13px rgba(255,61,59,.46);text-shadow:0 1px 2px #000}
.gp-turn-dial::before{content:'';position:absolute;inset:3px;border-radius:50%;background:#3b161bf0;z-index:-1}
.game-player.turn .gp-turn-dial.active{display:flex}
.gp-turn-dial.urgent{color:#fff;box-shadow:0 0 0 2px #f7433f,0 0 19px #f43c39;animation:avatarDialPulse .7s ease-in-out infinite alternate}
@keyframes avatarDialPulse{to{box-shadow:0 0 0 2px #ff9e94,0 0 8px #e84140}}
@media(max-width:680px){
 .game-header{height:68px;min-height:68px;padding:5px 5px 6px;gap:3px;grid-template-columns:minmax(49px,1fr) minmax(74px,auto) minmax(135px,1.6fr)}
 .game-header .game-room{max-width:none;font-size:.62rem;line-height:1.12}
 .game-header .game-room strong{font-size:.72rem;letter-spacing:.04em}
 .game-header .game-clock>span{font-size:1.14rem}
 .game-header .game-clock small{font-size:.42rem;letter-spacing:0}
 .game-header .header-tools{gap:2px}
 .game-header .header-tools .icon-button{width:26px;height:30px;min-width:26px;font-size:.9rem}
 .game-header .header-tools .icon-button[data-action=next-music]{font-size:.85rem}
 .deck-rail:not(.expanded) .rail-actions{right:calc(100% + 5px);bottom:7px;width:39px;max-width:39px;gap:6px;padding:5px 2px}
 .deck-rail:not(.expanded) .rail-actions .rail-circle{width:32px;height:32px;min-width:32px}
 .gp-turn-dial{right:0;width:30px;height:30px;font-size:13px}
 .game-player.turn .gp-turn-dial.active{display:flex}
}
@media(max-width:365px){.game-header{grid-template-columns:minmax(40px,1fr) minmax(67px,auto) minmax(129px,1.6fr)}.game-header .header-tools .icon-button{width:24px;min-width:24px;height:28px}.game-header .header-tools{gap:1px}.game-header .game-room strong{font-size:.62rem}.game-header .game-clock>span{font-size:1.06rem}}
@media(max-height:520px) and (orientation:landscape){.game-header{height:49px;min-height:49px}.deck-rail:not(.expanded) .rail-actions{gap:3px;bottom:2px;padding:2px}.deck-rail:not(.expanded) .rail-actions .rail-circle{height:28px;width:28px;min-width:28px}}
@media(prefers-reduced-motion:reduce){.gp-turn-dial.urgent{animation:none}}


/* v15.7 — keep the entire hand and help text inside the visible Samsung viewport.
   Actions belong INSIDE the right deck rail, below the discard pile. */
.playing{inset:0 auto auto 0!important;height:var(--lk-visible-height,100svh)!important;max-height:100svh;width:100%;overflow:hidden}
.playing .game-page{height:100%!important;max-height:100%!important;min-height:0}
.game-stage{min-height:0;overflow:hidden}
.deck-rail .rail-actions,.deck-rail:not(.expanded) .rail-actions,.deck-rail.expanded .rail-actions{
  position:static;right:auto;bottom:auto;left:auto;flex:0 0 auto;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
  width:100%;max-width:100%;margin:5px 0 0;padding:7px 0 3px;
  gap:7px;border:0;border-top:1px solid rgba(231,186,112,.3);
  border-radius:0;background:none;box-shadow:none;
}
.deck-rail .rail-actions .rail-circle,.deck-rail:not(.expanded) .rail-actions .rail-circle{
  position:relative;flex:0 0 auto;margin:0;transform:none;
}
.deck-rail.expanded .rail-actions{align-items:center}
.deck-rail.expanded .rail-actions .rail-circle span{opacity:0}
/* Compact deck panel is fully on-screen on phones; expansion shows wider decks. */
@media(max-width:680px){
 .board-shell{padding-right:68px;padding-left:30px}
 .deck-rail,.deck-rail:not(.expanded){right:0!important;top:4px;bottom:4px;width:64px;padding:6px 5px 7px;overflow-y:auto;overflow-x:visible;scrollbar-width:none;align-items:center;gap:0}
 .deck-rail::-webkit-scrollbar{display:none}
 .deck-rail.expanded{right:0!important;width:110px;padding:7px 8px}
 .deck-rail .rail-toggle{left:-15px;top:5px;width:16px;height:28px}
 .deck-stack,.discard-stack{margin:5px 0 4px;width:100%;text-align:center;min-height:0}
 .deck-stack>span,.discard-stack>span{font-size:.45rem;letter-spacing:.04em;padding-bottom:4px}
 .deck-stack>img,.discard-stack>img{width:48px;height:67px;max-width:100%;object-fit:cover}
 .deck-rail.expanded .deck-stack>img,.deck-rail.expanded .discard-stack>img{width:72px;height:101px}
 .diamond{width:19px;height:19px;left:-2px;top:9px}
 .diamond span{font-size:.46rem}
 .discard-stack>b{font-size:.5rem;padding:2px 4px;bottom:0;left:0}
 .deck-rail .rail-actions,.deck-rail:not(.expanded) .rail-actions,.deck-rail.expanded .rail-actions{margin:5px 0 0;padding:7px 0 0;gap:7px;min-width:0}
 .deck-rail .rail-actions .rail-circle,.deck-rail:not(.expanded) .rail-actions .rail-circle{width:35px;height:35px;min-width:35px;min-height:35px}
 .deck-rail .rail-circle b{font-size:.84rem}
 .deck-rail .rail-circle span,.deck-rail.expanded .rail-circle span{display:none}
 .hand-area{height:165px;min-height:165px;max-height:165px;flex-shrink:0;overflow:hidden}
 .hand-status{height:23px;min-height:23px;padding:0 8px;font-size:.52rem}
 .hand{left:7px;right:7px;bottom:32px;height:110px}
 .fan-card{width:72px;height:101px;bottom:12px;--gap:min(8.4vw,34px)}
 .fan-card.selected{transform:translateX(calc(-50% + var(--i)*var(--gap))) translateY(-12px) rotate(var(--angle))}
 .fan-card.lifted{transform:translateX(calc(-50% + var(--i)*var(--gap))) translateY(-24px) rotate(0deg)}
 .hand-tip{position:absolute;z-index:60;left:0;right:0;bottom:0;min-height:28px;
   padding:5px 8px 7px;display:flex;align-items:center;justify-content:center;
   text-align:center;line-height:1.3;font-size:.54rem;white-space:normal;
   background:linear-gradient(180deg,rgba(5,19,28,.89),#061722 52%);
   color:#e2dfd2;pointer-events:none}
}
@media(max-width:380px){
 .deck-rail,.deck-rail:not(.expanded){width:59px;padding-left:4px;padding-right:4px}
 .board-shell{padding-right:62px}
 .deck-stack>img,.discard-stack>img{width:43px;height:60px}
 .fan-card{width:68px;height:95px;--gap:min(8.2vw,31px)}
 .hand{bottom:33px;height:104px}
 .hand-area{height:157px;min-height:157px;max-height:157px}
 .hand-tip{font-size:.5rem}
}
@media(max-height:590px) and (orientation:landscape){
 .deck-rail,.deck-rail:not(.expanded){width:62px;padding:3px 4px}
 .deck-stack,.discard-stack{margin:2px 0}
 .deck-stack>img,.discard-stack>img{width:36px;height:49px}
 .deck-stack>span,.discard-stack>span{padding-bottom:1px}
 .deck-rail .rail-actions,.deck-rail:not(.expanded) .rail-actions{gap:3px;margin-top:2px;padding-top:3px}
 .deck-rail .rail-actions .rail-circle,.deck-rail:not(.expanded) .rail-actions .rail-circle{width:27px;height:27px;min-width:27px;min-height:27px}
 .hand-area{height:112px;min-height:112px;max-height:112px}
 .hand-status{height:18px;min-height:18px}
 .hand{height:70px;bottom:24px}
 .fan-card{width:54px;height:76px;bottom:3px;--gap:min(8vw,34px)}
 .hand-tip{min-height:23px;padding:2px 6px;font-size:.45rem}
}

/* Keep the outer fanned cards clear of the instruction strip on narrow screens. */
@media(max-width:680px){.fan-card{--dip:0px}}
@media(max-height:590px) and (orientation:landscape){
 .board-shell{padding-right:65px}
 .deck-rail,.deck-rail:not(.expanded),.deck-rail.expanded{right:0!important;top:3px;bottom:3px;width:62px;overflow-y:auto;scrollbar-width:none}
 .deck-rail .rail-actions,.deck-rail:not(.expanded) .rail-actions{position:static;right:auto;bottom:auto;width:100%;max-width:100%;border:0;border-top:1px solid rgba(231,186,112,.3);background:none;box-shadow:none;align-items:center}
 .fan-card{height:69px;width:51px;bottom:10px}
}

/* Final phone spacing: the instruction strip is never covered by the fan. */
@media(max-width:680px){
 .fan-card{height:96px;bottom:14px}
 .hand-tip{font-size:.6rem}
 .deck-rail .rail-actions,.deck-rail:not(.expanded) .rail-actions{gap:17px}
 .deck-rail .rail-actions .rail-circle::after{position:absolute;bottom:-13px;left:50%;transform:translateX(-50%);font:600 .44rem/1 var(--sans);color:#ecd4a3;letter-spacing:.02em;white-space:nowrap;pointer-events:none}
 .deck-rail .rail-actions .rail-circle[data-action=role]::after{content:'ROLE'}
 .deck-rail .rail-actions .rail-circle[data-action=discard]::after{content:'DISCARD'}
 .deck-rail .rail-actions .rail-circle[data-action=pass]::after{content:'PASS'}
}
@media(max-width:380px){.fan-card{height:93px;bottom:14px}}
@media(max-height:590px) and (orientation:landscape){
 .deck-stack>img,.discard-stack>img{width:29px;height:40px}
 .deck-rail .rail-actions,.deck-rail:not(.expanded) .rail-actions{gap:3px;margin-top:2px;padding-top:3px}
 .deck-rail .rail-actions .rail-circle,.deck-rail:not(.expanded) .rail-actions .rail-circle{width:24px;height:24px;min-width:24px;min-height:24px}
 .deck-rail .rail-actions .rail-circle::after{display:none}
 .fan-card{height:67px;width:51px;bottom:17px}
}
/* The base body min-height:100vh must not override the shorter visual viewport. */
body.playing{min-height:0!important}
@media(max-height:600px) and (orientation:portrait){
 .deck-stack,.discard-stack{margin:3px 0}
 .deck-stack>img,.discard-stack>img{height:57px;width:41px}
 .deck-rail .rail-actions,.deck-rail:not(.expanded) .rail-actions{gap:13px;padding-top:5px;margin-top:3px}
 .deck-rail .rail-actions .rail-circle,.deck-rail:not(.expanded) .rail-actions .rail-circle{width:30px;height:30px;min-width:30px;min-height:30px}
}


/* v15.8 — compact right rail, visible mobile hand and recoverable board zoom. */
@media(max-width:680px){
  /* The deck rail should end immediately after PASS, not stretch to the hand. */
  .game-stage .deck-rail,
  .game-stage .deck-rail:not(.expanded),
  .game-stage .deck-rail.expanded{
    top:4px!important;
    bottom:auto!important;
    height:max-content!important;
    max-height:calc(100% - 8px);
    justify-content:flex-start;
    overflow-y:auto;
    overflow-x:hidden;
  }
  .game-stage .deck-rail .rail-actions,
  .game-stage .deck-rail:not(.expanded) .rail-actions,
  .game-stage .deck-rail.expanded .rail-actions{
    margin-top:5px!important;
    margin-bottom:0!important;
    padding-bottom:14px!important;
    flex:0 0 auto;
  }
  .deck-rail .rail-actions .rail-circle:last-child{margin-bottom:0}
  /* Keep the instruction strip above the bottom browser toolbar. */
  .game-page .hand-area{height:156px;min-height:156px;max-height:156px;overflow:hidden}
  .game-page .hand-status{height:22px;min-height:22px}
  .game-page .hand{bottom:34px;height:105px;left:5px;right:5px}
  .game-page .fan-card{width:70px;height:98px;bottom:7px}
  .game-page .hand-tip{bottom:0;min-height:31px;padding:5px 10px 7px;z-index:80;
    background:#061722;line-height:1.2;font-size:.55rem}
  .game-page .board-viewport{overscroll-behavior:contain;touch-action:pan-x pan-y}
}
@media(max-width:380px){
  .game-page .hand-area{height:150px;min-height:150px;max-height:150px}
  .game-page .hand{bottom:34px;height:100px}
  .game-page .fan-card{width:65px;height:91px;bottom:7px}
}
/* Android in-app Chrome tabs can report a visual viewport taller than the
   space above their bottom navigation. Leave a modest browser-control guard. */
@media(max-width:680px) and (orientation:portrait){
  html.lk-android body.playing{--lk-browser-reserve:58px}
}
body.playing{
  left:var(--lk-visible-left,0px)!important;
  top:var(--lk-visible-top,0px)!important;
  width:var(--lk-visible-width,100%)!important;
  height:calc(var(--lk-visible-height,100svh) - var(--lk-browser-reserve,0px))!important;
  max-height:none!important;
}
@media(max-height:590px) and (orientation:landscape){
  .game-stage .deck-rail,.game-stage .deck-rail:not(.expanded),.game-stage .deck-rail.expanded{bottom:auto!important;height:max-content!important}
  .game-page .hand-area{height:112px;min-height:112px;max-height:112px}
  .game-page .hand{height:70px;bottom:24px}
  .game-page .fan-card{height:67px;width:51px;bottom:10px}
  .game-page .hand-tip{min-height:23px;padding:2px 6px;font-size:.45rem}
}

/* v15.11: isolated board frame; built directly on known-good v15.8 stylesheet. */
body.playing .game-page{height:100%;min-height:0;overflow:hidden}
body.playing .game-stage{display:grid;grid-template-columns:54px minmax(0,1fr) 116px;min-height:0;overflow:hidden;align-items:stretch}
body.playing .game-stage .player-rail{position:relative!important;grid-column:1;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;width:54px!important;height:100%!important;min-height:0;display:flex;flex-direction:column;overflow:visible;padding:6px 3px;border-radius:0 7px 7px 0;transition:none}
body.playing .game-stage .player-rail.expanded{width:112px!important;z-index:15;background:#0a2636f7;box-shadow:8px 4px 22px #000a}
body.playing .game-stage .player-rail .rail-toggle{right:-14px;z-index:12}
body.playing .game-stage .player-rail:not(.expanded) .gp-name,body.playing .game-stage .player-rail:not(.expanded) .gp-bot{display:none}
body.playing .game-stage .player-rail:not(.expanded) .game-player{justify-content:center;padding:2px}
body.playing .game-stage .player-rail:not(.expanded) .game-player img{order:0;width:100%;max-width:38px}
body.playing .game-stage .player-rail:not(.expanded) .chat-opener span{display:none}
body.playing .game-stage .player-rail #game-players{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;justify-content:flex-start;gap:clamp(2px,0.5vh,7px);padding-top:36px;scrollbar-width:none}
body.playing .game-stage .player-rail #game-players::-webkit-scrollbar{display:none}
body.playing .game-stage .player-rail .game-player{flex:0 0 auto;height:clamp(25px,4.1vh,42px);min-height:24px}
body.playing .game-stage .player-rail .chat-opener{flex:0 0 auto;margin-top:5px}
body.playing .game-stage .board-shell{grid-column:2;grid-row:1;min-width:0;min-height:0;max-width:none;padding:5px 4px 0;overflow:hidden}
body.playing .game-stage .board-tools{padding-left:16px;padding-right:4px}
body.playing .game-stage .board-viewport{min-width:0;min-height:0;overflow:auto!important;overscroll-behavior:contain;touch-action:pan-x pan-y;scrollbar-width:thin;justify-items:safe center;align-items:safe center}
body.playing .game-stage .deck-rail,body.playing .game-stage .deck-rail:not(.expanded),body.playing .game-stage .deck-rail.expanded{position:relative!important;grid-column:3;grid-row:1;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;width:116px!important;max-height:100%;height:max-content!important;min-height:0;align-self:start;overflow-y:auto;overflow-x:hidden;transition:none;padding:8px 7px 6px;border-radius:7px 0 0 7px}
body.playing .game-stage .deck-rail .rail-toggle{display:none!important}
body.playing .game-stage .deck-rail .rail-actions,body.playing .game-stage .deck-rail:not(.expanded) .rail-actions{position:static!important;right:auto!important;bottom:auto!important;display:flex;flex-direction:column;align-items:center;gap:16px;width:100%!important;max-width:none!important;margin:7px 0 0!important;padding:9px 0 9px!important;background:none;border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none}
body.playing .game-stage .deck-rail .rail-actions .rail-circle{width:38px;min-width:38px;height:38px;min-height:38px;margin:0;flex-shrink:0}
body.playing .game-stage .deck-rail .deck-stack,body.playing .game-stage .deck-rail .discard-stack{margin:4px 0 10px;max-width:100%}
body.playing .game-stage .deck-rail .deck-stack>img,body.playing .game-stage .deck-rail .discard-stack>img{width:min(78px,100%);height:auto;aspect-ratio:69/94}
body.playing .game-stage .deck-rail .rail-circle span{display:none}
body.playing .hand-area{flex-shrink:0}
@media(max-width:680px){
 body.playing .game-stage{grid-template-columns:47px minmax(0,1fr) 92px}
 body.playing .game-stage .player-rail{width:47px!important;padding:5px 2px}
 body.playing .game-stage .player-rail.expanded{width:107px!important}
 body.playing .game-stage .deck-rail,body.playing .game-stage .deck-rail:not(.expanded),body.playing .game-stage .deck-rail.expanded{width:92px!important;padding:6px 5px}
 body.playing .game-stage .board-shell{padding:4px 2px 0}
 body.playing .game-stage .deck-rail .deck-stack>img,body.playing .game-stage .deck-rail .discard-stack>img{width:69px}
 body.playing .game-stage .deck-rail .rail-actions{gap:15px!important}
 body.playing .game-stage .deck-rail .rail-actions .rail-circle{width:34px;min-width:34px;height:34px;min-height:34px}
 body.playing .game-stage .player-rail #game-players{padding-top:30px}
 body.playing .game-stage .player-rail .game-player{height:clamp(24px,3.8vh,38px)}
 body.playing .game-stage .board-tools{padding-left:15px;padding-right:2px}
}
@media(max-width:380px){body.playing .game-stage{grid-template-columns:43px minmax(0,1fr) 84px}body.playing .game-stage .player-rail{width:43px!important}body.playing .game-stage .deck-rail,body.playing .game-stage .deck-rail:not(.expanded),body.playing .game-stage .deck-rail.expanded{width:84px!important}}
@media(max-height:550px) and (orientation:landscape){body.playing .game-stage .deck-rail .rail-actions{gap:4px!important}body.playing .game-stage .deck-rail .rail-actions .rail-circle{width:27px;height:27px;min-width:27px;min-height:27px}}
/* Use the measured visual viewport; the older 58px Android reserve created a blank band. */
html.lk-android body.playing{--lk-browser-reserve:0px}
body.playing{height:var(--lk-visible-height,100dvh)!important}


/* v15.12 — Eleven embossed avatar medallions, contained and left-aligned.
   In particular, the 2-column phone lobby must never center a 190px button
   inside a ~120px column or let its label push outside the glass panel. */
.profile-panel .avatar-choices{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  padding:5px 3px 9px!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
}
.profile-panel .avatar-choice{
  box-sizing:border-box!important;
  flex:0 0 auto!important;
  display:grid!important;
  grid-template-columns:clamp(35px,3.5vw,48px) minmax(0,1fr)!important;
  align-items:center!important;
  justify-content:stretch!important;
  justify-items:stretch!important;
  gap:clamp(5px,0.8vw,10px)!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:61px!important;
  margin:0!important;
  padding:7px 8px!important;
  text-align:left!important;
  letter-spacing:.035em!important;
  border-radius:10px;
  background:linear-gradient(155deg,#143040,#091b28 70%);
  box-shadow:inset 0 1px 0 #ffffff1d,0 3px 8px #0008;
  transition:border-color .2s,background .2s,box-shadow .2s,transform .2s;
}
.profile-panel .avatar-choice img{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:48px!important;
  height:auto!important;
  aspect-ratio:1!important;
  object-fit:contain!important;
  justify-self:start!important;
  margin:0!important;
  filter:drop-shadow(0 3px 3px #0009);
}
.profile-panel .avatar-choice span{
  box-sizing:border-box!important;
  display:block!important;
  min-width:0!important;
  max-width:100%!important;
  justify-self:start!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  white-space:normal!important;
  text-align:left!important;
  font-size:clamp(.65rem,1.1vw,.75rem)!important;
  line-height:1.22!important;
  letter-spacing:.03em!important;
}
.profile-panel .avatar-choice.selected{
  border-color:#ffdd96!important;
  background:linear-gradient(155deg,#34514f,#152f3c 75%)!important;
  box-shadow:inset 0 1px 0 #fff5c06b,0 0 0 1px #e7ba7080,0 0 12px #f2c87938,0 5px 9px #0009!important;
  transform:none!important;
}
.profile-panel .avatar-choice.selected img{filter:drop-shadow(0 0 5px #e7ba7088) drop-shadow(0 3px 3px #0008)}
@media(hover:hover){.profile-panel .avatar-choice:hover{border-color:#ffdfaa;transform:translateY(-1px);box-shadow:inset 0 1px 0 #fff3,0 4px 10px #0009,0 0 9px #f1d0932b}}
/* Keep the same 3D medallion treatment in the game rail and lobby crew list. */
.game-player img,.player-row .player-mini,.deal-avatar,.target-player img{object-fit:contain!important;border:0!important;filter:drop-shadow(0 2px 3px #000a)}
.game-player.turn img{filter:drop-shadow(0 0 4px #f7d68a8a) drop-shadow(0 2px 2px #000a)}
@media(max-width:680px){
 .profile-panel .avatar-choices{padding:4px 1px 8px!important}
 .profile-panel .avatar-choice{grid-template-columns:clamp(31px,9vw,40px) minmax(0,1fr)!important;gap:5px!important;padding:6px 5px!important;min-height:55px!important}
 .profile-panel .avatar-choice span{font-size:clamp(.61rem,2.65vw,.69rem)!important;letter-spacing:0!important}
 .profile-panel .avatar-choice img{max-width:40px!important}
}
@media(max-width:360px){.profile-panel .avatar-choice{grid-template-columns:30px minmax(0,1fr)!important;gap:4px!important;padding:5px 4px!important}.profile-panel .avatar-choice span{font-size:.6rem!important}}
@media(prefers-reduced-motion:reduce){.profile-panel .avatar-choice{transition:none!important}}


/* v15.13 — Auto Saboteur count, balanced lobby avatar panel. */
.saboteur-range{margin:7px 0 4px;padding:12px 13px;border:1px solid #d5b47865;border-radius:7px;background:#0b2130;color:var(--gold-light);font:700 1.03rem/1.3 var(--serif);letter-spacing:.04em}
/* Both waiting-room panels occupy the same grid row; fill the profile's unused
   vertical area with scrollable avatars, keeping its note visible at the bottom. */
@media(min-width:381px) and (max-width:680px){
  .right-stack{grid-template-rows:minmax(0,1fr)!important;align-items:stretch!important}
  .right-stack>.profile-panel,.right-stack>.conditions-panel{height:100%!important;min-height:0!important}
  .profile-panel{display:flex!important;flex-direction:column!important}
  .profile-panel .avatar-choices{flex:1 1 0!important;height:0!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior-y:contain!important}
  .profile-panel .tiny-note{flex:0 0 auto!important;margin-top:10px!important;padding-bottom:2px}
}
@media(max-width:380px){
  /* At narrow widths the panels stack: avoid collapsing the avatar scroller. */
  .right-stack{grid-template-rows:auto auto!important}
  .right-stack>.profile-panel,.right-stack>.conditions-panel{height:auto!important}
  .profile-panel .avatar-choices{flex:0 0 auto!important;height:clamp(240px,42dvh,390px)!important;max-height:390px!important}
}

/* v15.15 — cover animation aligned to the actual lantern, responsive equal rails,
   compact lobby, legible manual, and unobstructed hand. */
.cover-alive{position:absolute;inset:0;z-index:1;overflow:hidden;pointer-events:none;isolation:isolate;}
.cover-motion-layer{position:absolute;inset:0;background:url('lighthouse/cover.jpg') center/100% 100% no-repeat;pointer-events:none;}
/* Only the sky, branches, and water are moved: the lettering and characters remain sharp. */
.cover-clouds{opacity:.37;-webkit-mask-image:radial-gradient(ellipse 33% 12% at 47% 13%,#000 25%,transparent 100%);mask-image:radial-gradient(ellipse 33% 12% at 47% 13%,#000 25%,transparent 100%);animation:lkCloudDrift 22s ease-in-out infinite alternate;}
.cover-sea{opacity:.35;-webkit-mask-image:radial-gradient(ellipse 27% 10% at 77% 69%,#000 12%,transparent 100%);mask-image:radial-gradient(ellipse 27% 10% at 77% 69%,#000 12%,transparent 100%);animation:lkSeaDrift 5.8s ease-in-out infinite alternate;}
.cover-foliage-left{opacity:.48;-webkit-mask-image:radial-gradient(ellipse 20% 41% at 9% 45%,#000 15%,transparent 100%);mask-image:radial-gradient(ellipse 20% 41% at 9% 45%,#000 15%,transparent 100%);transform-origin:5% 70%;animation:lkLeavesLeft 4.4s ease-in-out infinite alternate;}
.cover-foliage-right{opacity:.45;-webkit-mask-image:radial-gradient(ellipse 20% 42% at 93% 44%,#000 15%,transparent 100%);mask-image:radial-gradient(ellipse 20% 42% at 93% 44%,#000 15%,transparent 100%);transform-origin:96% 70%;animation:lkLeavesRight 5.3s ease-in-out infinite alternate;}
/* Star locations sit in the actual painted sky, not across the title. */
.cover-stars,.cover-stars::before,.cover-stars::after{position:absolute;inset:0;content:'';pointer-events:none;}
.cover-stars{background:radial-gradient(circle at 50.8% 2.6%,#fff 0 1.2px,#fff8ccaa 2px,transparent 5px),radial-gradient(circle at 82.4% 2.9%,#fff 0 1px,transparent 4px),radial-gradient(circle at 67.2% 4.7%,#fff 0 1px,transparent 4px),radial-gradient(circle at 38% 5%,#fff 0 1px,transparent 4px),radial-gradient(circle at 59% 6.5%,#fff 0 1.1px,transparent 5px);filter:drop-shadow(0 0 3px #dcefff);animation:lkStarA 3.4s ease-in-out infinite alternate;}
.cover-stars::before{background:radial-gradient(circle at 45% 3.4%,#fff 0 1px,transparent 4px),radial-gradient(circle at 70% 2%,#fff 0 1px,transparent 4px),radial-gradient(circle at 54% 7%,#fff 0 1px,transparent 4px),radial-gradient(circle at 34% 7.5%,#fff 0 1px,transparent 4px);animation:lkStarB 4.1s ease-in-out -1.8s infinite alternate;}
.cover-stars::after{background:radial-gradient(circle at 63% 2.3%,#fff 0 1.3px,transparent 5px),radial-gradient(circle at 75% 4.8%,#fff 0 1px,transparent 4px),radial-gradient(circle at 57% 3.5%,#fff 0 1px,transparent 4px);animation:lkStarB 5.7s ease-in-out -2.6s infinite alternate;}
/* The light's origin is x=56.4%, y=42.2% in the source painting.
   Sweep the light ALONG the painted lantern, not around the headline. */
.cover-beacon{position:absolute;left:56.45%;top:42.18%;width:4px;height:4px;border-radius:50%;background:#fff9c7;box-shadow:0 0 5px 2px #ffe3a8,0 0 12px 5px #ffc16e66;animation:lkLanternPulse 3s ease-in-out infinite alternate;}
.cover-beam{position:absolute;left:56.45%;top:42.18%;width:49%;height:7%;transform-origin:0 50%;background:linear-gradient(90deg,rgba(255,242,170,.52),rgba(255,222,135,.27) 38%,rgba(255,226,156,.08) 82%,transparent);clip-path:polygon(0 44%,100% 0,100% 100%,0 56%);filter:blur(2px);mix-blend-mode:screen;animation:lkLanternSweep 11s ease-in-out infinite alternate;}
.cover-beam::after{content:'';position:absolute;inset:18% 0;background:linear-gradient(90deg,#fff4bc77,transparent);filter:blur(3px)}
.story-lines{z-index:3!important}
@keyframes lkLanternSweep{0%{transform:translateY(-50%) rotate(-11deg);opacity:.62}50%{opacity:.95}100%{transform:translateY(-50%) rotate(18deg);opacity:.55}}
@keyframes lkLanternPulse{from{opacity:.7}to{opacity:1;box-shadow:0 0 7px 3px #fff4c0,0 0 18px 9px #ffbd6180}}
@keyframes lkStarA{0%,100%{opacity:.26}50%{opacity:.9}}
@keyframes lkStarB{0%{opacity:.1}60%{opacity:1}100%{opacity:.28}}
@keyframes lkCloudDrift{from{transform:translateX(-1.2%) translateY(.1%)}to{transform:translateX(1.2%) translateY(-.25%)}}
@keyframes lkSeaDrift{from{transform:translateX(-.55%) translateY(.2%)}to{transform:translateX(.6%) translateY(-.25%)}}
@keyframes lkLeavesLeft{from{transform:rotate(-.35deg) translateX(-.15%)}to{transform:rotate(.5deg) translateX(.22%)}}
@keyframes lkLeavesRight{from{transform:rotate(.4deg) translateX(.15%)}to{transform:rotate(-.45deg) translateX(-.22%)}}
.rule-scroll p{text-align:justify!important;text-justify:inter-word;hyphens:auto;overflow-wrap:break-word}
.rule-scroll h3{margin-top:18px!important}.rule-scroll p{margin-bottom:10px!important}
.manual-card-strip{display:flex;gap:7px;overflow-x:auto;overflow-y:hidden;padding:4px 2px 10px;margin:2px 0 14px;scrollbar-width:thin;scroll-snap-type:x proximity}
.manual-card{position:relative;flex:0 0 58px;margin:0;text-align:center;scroll-snap-align:start}
.manual-card img{display:block;width:54px;height:76px;object-fit:cover;border-radius:4px;border:1px solid #8c7042;box-shadow:0 3px 7px #0005}
.manual-card figcaption{margin-top:4px;color:#173747;font:700 .48rem/1.1 var(--serif);letter-spacing:.03em}
.manual-gesture{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);white-space:nowrap;padding:3px 5px;border-radius:10px;background:#0b2638e8;color:#ffe0a0;font-size:.42rem;box-shadow:0 2px 5px #0008}
/* Keep both lobby columns as compact as the room conditions permit. */
@media(min-width:381px) and (max-width:680px){
 .right-stack{grid-template-rows:minmax(0,1fr)!important;align-items:stretch!important}
 .right-stack>.profile-panel,.right-stack>.conditions-panel{height:100%!important;min-height:0!important;padding:13px 12px!important}
 .right-stack .panel-head{padding-bottom:10px;margin-bottom:9px}
 .profile-panel{display:flex!important;flex-direction:column!important}
 .profile-panel .avatar-choices{flex:1 1 0!important;height:0!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior-y:contain!important;gap:7px!important}
 .profile-panel .avatar-choice{min-height:49px!important;padding:5px 4px!important}
 .profile-panel .avatar-choice img{max-width:35px!important}
 .profile-panel .tiny-note{flex:0 0 auto!important;margin-top:7px!important;line-height:1.35!important}
 .conditions{gap:4px!important}
 .conditions span{padding:6px 0!important;line-height:1.22!important}
 .conditions-panel .tiny-note{line-height:1.35!important;margin-top:8px!important}
 .lobby-top-row-option{margin:4px 0!important;padding:6px 0!important}
}
/* Keep the working grid: never add 2x rail width as board padding. */
body.playing .game-stage{display:grid!important;grid-template-columns:58px minmax(0,1fr) 58px!important;align-items:stretch!important;overflow:hidden!important;min-height:0!important;}
body.playing .game-stage .board-shell{grid-column:2!important;grid-row:1!important;min-width:0!important;min-height:0!important;max-width:none!important;padding:3px 2px 0!important;overflow:hidden!important;}
body.playing .game-stage .board-tools{padding:0 6px 0 17px!important;min-width:0;gap:3px}
body.playing .game-stage #board-mode{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:.02em}
body.playing .game-stage .board-viewport{display:block!important;flex:1!important;min-height:0!important;min-width:0!important;padding:3px!important;overflow:auto!important;overscroll-behavior:contain;touch-action:pan-x pan-y!important;background:transparent!important;}
body.playing .game-stage .board{margin:8px auto 10px!important;background:transparent!important;box-shadow:none!important;border-color:#e7ba702b!important;}
body.playing .game-stage .cell{background:transparent!important;border-color:#baaa753b!important;}
body.playing .game-stage .cell.reserved{background:transparent!important;}
body.playing .game-stage .player-rail,body.playing .game-stage .deck-rail,body.playing .game-stage .deck-rail:not(.expanded){position:relative!important;grid-row:1!important;top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;width:58px!important;height:100%!important;min-height:0!important;max-height:100%!important;padding:6px 3px!important;border-radius:0!important;overflow-x:hidden!important;overflow-y:auto!important;align-self:stretch!important;transition:none!important;}
body.playing .game-stage .player-rail{grid-column:1!important;z-index:12!important;overflow:visible!important;}
body.playing .game-stage .deck-rail{grid-column:3!important;z-index:12!important;display:flex!important;flex-direction:column!important;align-items:center!important;}
body.playing .game-stage .player-rail.expanded{width:116px!important;z-index:15!important;}
body.playing .game-stage .deck-rail.expanded{width:116px!important;max-width:none!important;transform:translateX(-58px)!important;z-index:15!important;background:#0a2636fa!important;box-shadow:-8px 4px 22px #000a!important;}
body.playing .game-stage .player-rail .rail-toggle{display:block!important;right:-1px!important;top:4px!important;z-index:17!important;}
body.playing .game-stage .deck-rail .rail-toggle{display:block!important;position:sticky!important;top:0!important;left:auto!important;right:auto!important;align-self:flex-start!important;margin:0 0 4px!important;z-index:17!important;flex:0 0 22px!important;}
body.playing .game-stage .deck-rail:not(.expanded) .deck-stack>span,body.playing .game-stage .deck-rail:not(.expanded) .discard-stack>span{display:none!important;}
body.playing .game-stage .deck-rail .deck-stack,body.playing .game-stage .deck-rail .discard-stack{flex:0 0 auto!important;width:100%!important;max-width:100%!important;margin:5px 0 9px!important;padding:0!important;overflow:visible!important;}
body.playing .game-stage .deck-rail .deck-stack>img,body.playing .game-stage .deck-rail .discard-stack>img{display:block!important;max-width:none!important;width:66px!important;height:92px!important;object-fit:cover!important;margin:0!important;}
body.playing .game-stage .deck-rail.expanded .deck-stack>img,body.playing .game-stage .deck-rail.expanded .discard-stack>img{width:82px!important;height:115px!important;margin:0 auto!important;}
body.playing .game-stage .deck-rail .rail-actions,body.playing .game-stage .deck-rail:not(.expanded) .rail-actions{position:static!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:8px!important;width:100%!important;max-width:none!important;margin:5px 0 0!important;padding:9px 0 8px!important;background:none!important;border:0!important;border-top:1px solid var(--line)!important;border-radius:0!important;box-shadow:none!important;flex:0 0 auto!important;}
body.playing .game-stage .deck-rail .rail-actions .rail-circle{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;margin:0!important;}
body.playing .game-stage .deck-rail:not(.expanded) .rail-circle span,body.playing .game-stage .deck-rail:not(.expanded) .rail-circle::after{display:none!important;}
body.playing .game-stage .deck-rail.expanded .rail-circle span{display:block!important;}
body.playing .game-stage .player-rail #game-players{padding-top:31px!important;}
body.playing .game-stage .player-rail:not(.expanded) .game-player{justify-content:center!important;padding:2px!important;}
body.playing .game-stage .player-rail:not(.expanded) .game-player img{order:0!important;max-width:39px!important;}
body.playing .game-stage .player-rail:not(.expanded) .gp-name,body.playing .game-stage .player-rail:not(.expanded) .gp-bot{display:none!important;}
body.playing .game-stage .player-rail:not(.expanded) .chat-opener span{display:none!important;}
body.playing .hand-area{height:181px!important;min-height:181px!important;max-height:181px!important;flex:0 0 181px!important;overflow:hidden!important;}
body.playing .hand-status{position:relative!important;height:26px!important;min-height:26px!important;z-index:3!important;}
body.playing .hand{position:absolute!important;top:32px!important;bottom:auto!important;height:111px!important;left:3px!important;right:3px!important;}
body.playing .fan-card{width:77px!important;height:108px!important;bottom:3px!important;--gap:min(9vw,38px)!important;}
body.playing .hand-tip{position:absolute!important;bottom:0!important;left:0!important;right:0!important;min-height:27px!important;padding:5px 8px!important;z-index:6!important;background:#061722!important;line-height:1.2!important;font-size:.56rem!important;}
@media(max-width:680px){
 body.playing .game-header{height:59px!important;min-height:59px!important;padding:5px 8px!important;gap:2px!important;}
 body.playing .game-header .game-room{max-width:73px!important;min-width:0!important;}
 body.playing .game-header .game-clock{left:42%!important;}
 body.playing .game-header .header-tools{gap:2px!important;}
 body.playing .game-header .icon-button{width:28px!important;height:28px!important;}
 body.playing .game-stage{grid-template-columns:52px minmax(0,1fr) 52px!important;}
 body.playing .game-stage .player-rail,body.playing .game-stage .deck-rail,body.playing .game-stage .deck-rail:not(.expanded){width:52px!important;padding:5px 3px!important;}
 body.playing .game-stage .player-rail.expanded,body.playing .game-stage .deck-rail.expanded{width:106px!important;}
 body.playing .game-stage .deck-rail.expanded{transform:translateX(-54px)!important;}
 body.playing .game-stage .deck-rail .deck-stack>img,body.playing .game-stage .deck-rail .discard-stack>img{width:62px!important;height:87px!important;}
 body.playing .game-stage .deck-rail .rail-actions{gap:7px!important;}
 body.playing .game-stage .deck-rail .rail-actions .rail-circle{width:33px!important;height:33px!important;min-width:33px!important;min-height:33px!important;}
 body.playing .game-stage .board-tools{padding:0 4px 0 15px!important;height:26px!important;font-size:.52rem!important;}
 body.playing .game-stage .board-tools button{padding:3px 5px!important;font-size:.54rem!important;}
 body.playing .hand-area{height:180px!important;min-height:180px!important;max-height:180px!important;flex-basis:180px!important;}
 body.playing .hand{top:31px!important;height:111px!important;}
 body.playing .fan-card{width:76px!important;height:107px!important;bottom:3px!important;}
 .manual-card{flex-basis:52px}.manual-card img{width:48px;height:67px}.manual-card figcaption{font-size:.43rem}
}
@media(max-width:380px){
 body.playing .game-stage{grid-template-columns:48px minmax(0,1fr) 48px!important;}
 body.playing .game-stage .player-rail,body.playing .game-stage .deck-rail,body.playing .game-stage .deck-rail:not(.expanded){width:48px!important;}
 body.playing .game-stage .deck-rail .deck-stack>img,body.playing .game-stage .deck-rail .discard-stack>img{width:57px!important;height:80px!important;}
 body.playing .game-stage .deck-rail .rail-actions .rail-circle{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;}
 body.playing .hand-area{height:173px!important;min-height:173px!important;max-height:173px!important;flex-basis:173px!important;}
 body.playing .fan-card{width:70px!important;height:99px!important;}
 body.playing .hand{height:104px!important;}
}
@media(max-height:560px) and (orientation:landscape){
 body.playing .hand-area{height:115px!important;min-height:115px!important;max-height:115px!important;flex-basis:115px!important;}
 body.playing .hand{top:21px!important;height:69px!important;}
 body.playing .fan-card{width:51px!important;height:72px!important;}
 body.playing .hand-tip{min-height:20px!important;font-size:.45rem!important;padding:2px!important;}
 body.playing .game-stage .deck-rail .deck-stack>img,body.playing .game-stage .deck-rail .discard-stack>img{width:33px!important;height:46px!important;}
 body.playing .game-stage .deck-rail .rail-actions{gap:2px!important;padding:3px 0!important;}
 body.playing .game-stage .deck-rail .rail-actions .rail-circle{width:25px!important;height:25px!important;min-width:25px!important;min-height:25px!important;}
}
@media(prefers-reduced-motion:reduce){.cover-alive *{animation:none!important}}
/* Expanded deck: action labels belong below each button, never across the circle. */
body.playing .game-stage .deck-rail.expanded .rail-actions{gap:22px!important;padding-bottom:16px!important;}
body.playing .game-stage .deck-rail.expanded .rail-circle span{display:block!important;position:absolute!important;left:50%!important;right:auto!important;top:calc(100% + 3px)!important;transform:translateX(-50%)!important;opacity:1!important;white-space:nowrap!important;font-size:.52rem!important;letter-spacing:.02em!important;}


/* v15.16 — compact star glints and subtly moving painted layers. */
.cover-stars,.cover-stars::before,.cover-stars::after{background:none!important;filter:none!important;animation:none!important;opacity:1!important}
.cover-stars::before,.cover-stars::after{content:none!important}
.cover-star-point{position:absolute;display:block;width:5px;height:5px;background:#fff9d9;clip-path:polygon(50% 0,61% 37%,100% 50%,61% 63%,50% 100%,39% 63%,0 50%,39% 37%);filter:drop-shadow(0 0 2px #fff2b9);opacity:.16;transform:scale(.5);animation:lkPointTwinkle 3.8s ease-in-out infinite}
.cover-star-point::after{content:'';position:absolute;inset:1px;background:#fff;clip-path:inherit}
.cover-star-point:nth-child(1){left:46%;top:2.5%;animation-delay:-.3s;animation-duration:3.3s}
.cover-star-point:nth-child(2){left:53%;top:5.8%;animation-delay:-2.1s;animation-duration:4.8s}
.cover-star-point:nth-child(3){left:66%;top:3%;animation-delay:-1.7s;animation-duration:5.1s}
.cover-star-point:nth-child(4){left:74%;top:7%;animation-delay:-.8s;animation-duration:3.7s}
.cover-star-point:nth-child(5){left:39%;top:7%;animation-delay:-3.1s;animation-duration:4.2s}
.cover-star-point:nth-child(6){left:83%;top:4%;animation-delay:-1.2s;animation-duration:4.7s}
.cover-star-point:nth-child(7){left:61%;top:10%;animation-delay:-4.2s;animation-duration:5.4s}
.cover-star-point:nth-child(8){left:88%;top:11%;animation-delay:-2.7s;animation-duration:4.3s}
.cover-star-point:nth-child(9){left:29%;top:12%;animation-delay:-1.5s;animation-duration:4.9s}
.cover-star-point:nth-child(10){left:76%;top:14%;animation-delay:-3.8s;animation-duration:5.5s}
.cover-star-point:nth-child(11){left:37%;top:16%;animation-delay:-.6s;animation-duration:3.6s}
.cover-star-point:nth-child(12){left:91%;top:19%;animation-delay:-3s;animation-duration:5.2s}
.cover-star-point:nth-child(13){left:24%;top:6%;animation-delay:-1.9s;animation-duration:4.6s}
.cover-star-point:nth-child(14){left:59%;top:1.7%;animation-delay:-2.8s;animation-duration:4.4s}
.cover-star-point:nth-child(15){left:81%;top:20%;animation-delay:-1.3s;animation-duration:5.3s}
@keyframes lkPointTwinkle{0%,35%,100%{opacity:.12;transform:scale(.4)}48%{opacity:.93;transform:scale(1.12)}65%{opacity:.28;transform:scale(.7)}}
/* Masks reveal the existing painted clouds, leaves and water; no floating duplicate text. */
.cover-motion-layer{will-change:transform,opacity;background-size:100% 100%!important;mix-blend-mode:screen;}
.cover-clouds{opacity:.68!important;-webkit-mask-image:radial-gradient(ellipse 38% 15% at 51% 15%,#000 20%,transparent 95%)!important;mask-image:radial-gradient(ellipse 38% 15% at 51% 15%,#000 20%,transparent 95%)!important;animation:lkCloudFlow 19s ease-in-out infinite alternate!important}
.cover-sea{opacity:.63!important;-webkit-mask-image:radial-gradient(ellipse 26% 9% at 78% 68%,#000 20%,transparent 95%)!important;mask-image:radial-gradient(ellipse 26% 9% at 78% 68%,#000 20%,transparent 95%)!important;animation:lkSeaFlow 4.8s ease-in-out infinite alternate!important}
.cover-foliage-left{opacity:.65!important;-webkit-mask-image:radial-gradient(ellipse 21% 37% at 8% 45%,#000 22%,transparent 96%)!important;mask-image:radial-gradient(ellipse 21% 37% at 8% 45%,#000 22%,transparent 96%)!important;transform-origin:5% 20%!important;animation:lkFoliageFlow 5.4s ease-in-out infinite alternate!important}
.cover-foliage-right{opacity:.62!important;-webkit-mask-image:radial-gradient(ellipse 20% 36% at 94% 45%,#000 22%,transparent 96%)!important;mask-image:radial-gradient(ellipse 20% 36% at 94% 45%,#000 22%,transparent 96%)!important;transform-origin:96% 20%!important;animation:lkFoliageFlow 6.3s ease-in-out -1.9s infinite alternate-reverse!important}
@keyframes lkCloudFlow{from{transform:translate(-2.2%,.2%);opacity:.48}to{transform:translate(2.2%,-.4%);opacity:.75}}
@keyframes lkSeaFlow{from{transform:translate(-.7%,.6%) scale(1.003);opacity:.47}to{transform:translate(.7%,-.4%) scale(1.008);opacity:.72}}
@keyframes lkFoliageFlow{from{transform:skewX(-.8deg) translateX(-.5%);opacity:.5}to{transform:skewX(.8deg) translateX(.6%);opacity:.7}}
/* Lobby: both cards stretch to the content height, not an inherited 500px minimum. */
@media(min-width:381px) and (max-width:680px){
 .lobby-page .right-stack{grid-template-rows:auto!important;align-items:stretch!important}
 .lobby-page .right-stack>.profile-panel,.lobby-page .right-stack>.conditions-panel{height:auto!important;min-height:0!important;padding:11px 11px 12px!important}
 .lobby-page .right-stack .panel-head{padding-bottom:7px!important;margin-bottom:7px!important}
 .lobby-page .profile-panel{display:flex!important;flex-direction:column!important}
 .lobby-page .profile-panel .avatar-choices{flex:0 0 225px!important;height:225px!important;min-height:0!important;max-height:225px!important;gap:5px!important;padding:2px 1px 4px!important;overflow-y:auto!important}
 .lobby-page .profile-panel .avatar-choice{min-height:43px!important;padding:3px 4px!important;grid-template-columns:32px minmax(0,1fr)!important;gap:5px!important}
 .lobby-page .profile-panel .avatar-choice img{width:32px!important;max-width:32px!important}
 .lobby-page .profile-panel .tiny-note{margin-top:5px!important;padding:0!important;line-height:1.28!important;font-size:.61rem!important}
 .lobby-page .conditions{gap:1px!important}
 .lobby-page .conditions span{padding:6px 0!important;line-height:1.15!important}
 .lobby-page .conditions-panel .tiny-note{margin-top:6px!important;line-height:1.3!important;font-size:.63rem!important}
 .lobby-page .lobby-top-row-option{padding:5px 0!important;margin:2px 0!important}
}
/* Gameplay: the side tracks remain equal. Expanded panels overlay the board, not the other rail. */
body.playing .game-stage{--lk-rail:54px;grid-template-columns:var(--lk-rail) minmax(0,1fr) var(--lk-rail)!important;position:relative!important}
body.playing .game-stage .player-rail,body.playing .game-stage .deck-rail,body.playing .game-stage .deck-rail:not(.expanded){width:var(--lk-rail)!important;min-width:0!important;min-height:0!important;height:100%!important;max-height:100%!important;align-self:stretch!important;overflow-x:hidden!important;overflow-y:hidden!important;padding:5px 2px!important;}
body.playing .game-stage .player-rail{overflow:visible!important;z-index:14!important;display:flex!important;flex-direction:column!important}
body.playing .game-stage .player-rail.expanded{width:118px!important;z-index:19!important;background:#0a2636fa!important;box-shadow:8px 5px 20px #000a!important}
body.playing .game-stage .player-rail #game-players{flex:1 1 0!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding-top:31px!important}
body.playing .game-stage .player-rail .chat-opener{position:relative!important;display:flex!important;flex:0 0 auto!important;align-items:center!important;justify-content:center!important;gap:5px!important;width:100%!important;min-width:0!important;max-width:100%!important;height:45px!important;min-height:45px!important;margin:5px 0 1px!important;padding:3px!important;overflow:visible!important;border:1px solid #dcb675!important;border-radius:8px!important;background:linear-gradient(155deg,#24475b,#071d2a)!important;box-shadow:inset 0 1px 0 #fff5,0 4px 7px #0009,0 0 0 1px #9b753744!important;color:#f6d796!important;text-align:center!important}
body.playing .game-stage .player-rail .chat-opener .chat-glyph{width:28px!important;height:28px!important;flex-shrink:0!important;filter:drop-shadow(0 2px 2px #0008) drop-shadow(0 0 3px #efc5765c)}
body.playing .game-stage .player-rail .chat-opener span{display:none!important;position:static!important;white-space:nowrap!important;font:700 .58rem/1 var(--serif)!important;letter-spacing:.02em!important}
body.playing .game-stage .player-rail.expanded .chat-opener span{display:inline!important}
body.playing .game-stage .player-rail .chat-opener #unread{position:absolute!important;right:1px!important;top:0!important}
body.playing .game-stage .deck-rail,body.playing .game-stage .deck-rail:not(.expanded){display:flex!important;flex-direction:column!important;align-items:center!important;grid-column:3!important;grid-row:1!important;z-index:14!important;position:relative!important;top:auto!important;bottom:auto!important;right:auto!important;left:auto!important;transform:none!important;overflow-x:hidden!important;overflow-y:auto!important;scrollbar-width:none!important}
body.playing .game-stage .deck-rail.expanded{width:122px!important;transform:translateX(calc(var(--lk-rail) - 122px))!important;z-index:20!important;background:#0a2636fa!important;box-shadow:-8px 5px 22px #000a!important;overflow-x:hidden!important;overflow-y:auto!important;padding:5px 8px!important}
body.playing .game-stage .deck-rail .rail-toggle{position:relative!important;top:auto!important;left:auto!important;right:auto!important;align-self:flex-start!important;flex:0 0 24px!important;min-height:24px!important;width:22px!important;height:24px!important;margin:0 0 2px!important;padding:0!important;z-index:21!important}
body.playing .game-stage .deck-rail .deck-stack,body.playing .game-stage .deck-rail .discard-stack{box-sizing:border-box!important;position:relative!important;flex:0 0 auto!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;width:100%!important;max-width:100%!important;margin:2px 0 5px!important;padding:0!important;overflow:visible!important;min-height:0!important;}
body.playing .game-stage .deck-rail .deck-stack>span,body.playing .game-stage .deck-rail .discard-stack>span{display:block!important;position:relative!important;visibility:visible!important;opacity:1!important;flex:0 0 auto!important;font:700 .49rem/1.15 var(--serif)!important;letter-spacing:0!important;white-space:nowrap!important;color:#e6c991!important;text-align:center!important;align-self:center!important;margin:0 0 4px!important;padding:0!important;}
body.playing .game-stage .deck-rail .deck-stack>img,body.playing .game-stage .deck-rail .discard-stack>img{display:block!important;flex:0 0 auto!important;width:88px!important;max-width:none!important;height:clamp(86px,15vh,130px)!important;aspect-ratio:auto!important;object-fit:cover!important;object-position:left center!important;margin:0!important;}
body.playing .game-stage .deck-rail.expanded .deck-stack,body.playing .game-stage .deck-rail.expanded .discard-stack{align-items:center!important;margin:2px 0 5px!important;}
body.playing .game-stage .deck-rail.expanded .deck-stack>img,body.playing .game-stage .deck-rail.expanded .discard-stack>img{width:88px!important;height:120px!important;object-fit:contain!important;margin:0 auto!important;}
body.playing .game-stage .deck-rail .rail-actions,body.playing .game-stage .deck-rail:not(.expanded) .rail-actions,body.playing .game-stage .deck-rail.expanded .rail-actions{position:static!important;display:flex!important;flex-direction:column!important;flex:0 0 auto!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:auto 0 0!important;padding:7px 0 12px!important;background:none!important;border:0!important;border-top:1px solid #d2b87c55!important;border-radius:0!important;box-shadow:none!important;}
body.playing .game-stage .deck-rail .rail-actions .rail-circle{position:relative!important;flex:0 0 auto!important;width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;margin:0!important;padding:0!important;transform:none!important;display:grid!important;place-items:center!important}
body.playing .game-stage .deck-rail .rail-actions .rail-circle::after{display:none!important;content:none!important}
body.playing .game-stage .deck-rail .rail-circle span,body.playing .game-stage .deck-rail:not(.expanded) .rail-circle span{display:none!important;opacity:0!important;}
body.playing .game-stage .deck-rail.expanded .rail-actions{gap:21px!important;padding:8px 0 15px!important}
body.playing .game-stage .deck-rail.expanded .rail-circle span{display:block!important;opacity:1!important;position:absolute!important;left:50%!important;right:auto!important;top:calc(100% + 3px)!important;bottom:auto!important;transform:translateX(-50%)!important;font:700 .49rem/1.1 var(--serif)!important;letter-spacing:.02em!important;color:#e9ce98!important;white-space:nowrap!important;pointer-events:none!important;}
@media(max-width:380px){body.playing .game-stage{--lk-rail:48px}body.playing .game-stage .deck-rail .deck-stack>img,body.playing .game-stage .deck-rail .discard-stack>img{height:clamp(74px,13vh,115px)!important}}
@media(max-height:600px) and (orientation:landscape){body.playing .game-stage .deck-rail .deck-stack>img,body.playing .game-stage .deck-rail .discard-stack>img{height:54px!important;width:45px!important}body.playing .game-stage .deck-rail .rail-actions{gap:3px!important;padding:3px 0!important}body.playing .game-stage .deck-rail .rail-actions .rail-circle{width:27px!important;height:27px!important;min-width:27px!important;min-height:27px!important}}
@media(prefers-reduced-motion:reduce){.cover-motion-layer,.cover-star-point{animation:none!important}}
/* v15.16 final specificity fixes: visible collapsed deck labels, full-height expanded rail. */
body.playing .game-stage .deck-rail.expanded{height:100%!important;min-height:0!important;max-height:100%!important;align-self:stretch!important;}
body.playing .game-stage .deck-rail:not(.expanded) .deck-stack>span,
body.playing .game-stage .deck-rail:not(.expanded) .discard-stack>span{display:block!important;visibility:visible!important;opacity:1!important;font-size:.45rem!important;line-height:1.15!important;margin:0 0 4px!important;align-self:center!important;}
@media(max-width:380px){
 .lobby-page .right-stack>.profile-panel,.lobby-page .right-stack>.conditions-panel{height:auto!important;min-height:0!important;padding:12px!important}
 .lobby-page .profile-panel{min-height:0!important;display:flex!important;flex-direction:column!important}
 .lobby-page .profile-panel .avatar-choices{flex:0 0 225px!important;height:225px!important;min-height:0!important;max-height:225px!important;gap:5px!important;overflow-y:auto!important}
 .lobby-page .profile-panel .avatar-choice{min-height:43px!important;padding:3px 5px!important}
 .lobby-page .profile-panel .avatar-choice img{max-width:33px!important}
 .lobby-page .profile-panel .tiny-note{margin-top:6px!important}
}

/* v15.17: title is painted into the cover. Keep every animated paint layer
   behind an exclusion mask so moving cloud/foliage cannot ghost the letters. */
.cover-motion-layer{
  -webkit-mask-composite:source-over;
  mask-composite:add;
}
/* A cover-matched opaque copy of the original headline stays completely still.
   It sits above the animated layers, but below the separately positioned story. */
.cover-title-still{position:absolute;z-index:3;pointer-events:none;left:0;top:0;width:100%;height:100%;background:url('lighthouse/cover.jpg') center/100% 100% no-repeat;
 -webkit-mask-image:linear-gradient(to bottom,transparent 0%,#000 7%,#000 36%,transparent 39%);
 mask-image:linear-gradient(to bottom,transparent 0%,#000 7%,#000 36%,transparent 39%);
}
/* The title patch also suppresses stars above the lettering without hiding
   the original moon and the night sky at the top of the illustration. */
.cover-title-still{z-index:2}.story-lines{z-index:4!important}
.cover-stars{z-index:1}
/* Fix tower coordinate system: the miniature is a child of its card, not a
   fixed-position element that drifts as the scrollable board moves. */
body.playing .board-lighthouse-fx{position:absolute!important;left:50%!important;top:92%!important;z-index:50!important;}
body.playing .board-viewport.lighthouse-cinematic{padding-top:clamp(85px,15vh,138px)!important;scroll-padding-top:clamp(85px,15vh,138px)}
body.playing .board-viewport.lighthouse-cinematic .board{margin-top:4px!important}
/* On mobile keep the popup *inside the middle play field*, never over the
   player or deck rails. The translucent backdrop is confined to this area. */
body.playing .modal-layer.chat-open{--chat-rail:54px;position:fixed!important;inset:var(--chat-top,62px) calc(var(--chat-rail) + 5px) var(--chat-bottom,180px) calc(var(--chat-rail) + 5px)!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:3px!important;z-index:29!important;}
body.playing .modal-layer.chat-open .modal-backdrop{inset:0!important;border-radius:8px!important;backdrop-filter:blur(3px)!important}
body.playing .modal-layer.chat-open .game-chat-modal{position:relative!important;inset:auto!important;width:100%!important;height:min(100%,460px)!important;max-width:100%!important;max-height:100%!important;margin:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;}
body.playing .modal-layer.chat-open .game-chat-modal .modal-inner{height:100%!important;max-height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;gap:3px!important;overflow:hidden!important;padding:12px 7px 8px!important;}
body.playing .modal-layer.chat-open .game-chat-modal .eyebrow{font-size:.49rem!important;line-height:1!important}
body.playing .modal-layer.chat-open .game-chat-modal h2{font-size:clamp(.78rem,3.2vw,1.2rem)!important;line-height:1.2!important;margin:1px 30px 4px 0!important}
body.playing .modal-layer.chat-open .game-chat-modal .modal-close{top:4px!important;right:4px!important;width:25px!important;height:25px!important;font-size:1.3rem!important;}
body.playing .modal-layer.chat-open .game-chat-modal .chat-log{flex:1 1 auto!important;min-height:55px!important;max-height:none!important;height:auto!important;overflow-y:auto!important;gap:4px!important;padding:3px!important;}
body.playing .modal-layer.chat-open .game-chat-modal .chat-item{max-width:100%!important;min-width:0!important;overflow-wrap:anywhere!important;font-size:.66rem!important}
body.playing .modal-layer.chat-open .game-chat-modal .reactions{flex:0 0 auto!important;display:flex!important;flex-wrap:nowrap!important;justify-content:space-between!important;gap:2px!important;padding:3px 0!important;}
body.playing .modal-layer.chat-open .game-chat-modal .reactions button{width:clamp(23px,6vw,30px)!important;height:27px!important;padding:0!important;font-size:.85rem!important;}
body.playing .modal-layer.chat-open .game-chat-modal .voice-controls{display:grid!important;grid-template-columns:1fr 1fr!important;gap:3px!important;min-width:0!important;margin:0!important;}
body.playing .modal-layer.chat-open .game-chat-modal .voice-controls button{min-width:0!important;max-width:100%!important;white-space:normal!important;font-size:.56rem!important;padding:4px 1px!important;}
body.playing .modal-layer.chat-open .game-chat-modal .voice-status{grid-column:1/-1!important;font-size:.54rem!important;line-height:1.1!important}
body.playing .modal-layer.chat-open .game-chat-modal .chat-form{flex:0 0 35px!important;min-width:0!important;display:flex!important;align-items:stretch!important;}
body.playing .modal-layer.chat-open .game-chat-modal .chat-form input{width:100%!important;min-width:0!important;flex:1!important;height:35px!important;padding:5px!important;font-size:.66rem!important;}
body.playing .modal-layer.chat-open .game-chat-modal .chat-form button{flex:0 0 30px!important;width:30px!important;padding:0!important;}
/* Make the chat opener less dominant in the narrow left rail. */
body.playing .game-stage .player-rail .chat-opener{height:40px!important;min-height:40px!important;margin-top:3px!important;}
body.playing .game-stage .player-rail .chat-opener .chat-glyph{width:23px!important;height:23px!important;}
/* Restore visual breathing room around the deck labels and divider. */
body.playing .game-stage .deck-rail .deck-stack{margin:0 0 9px!important;}
body.playing .game-stage .deck-rail .discard-stack{margin:6px 0 12px!important;}
body.playing .game-stage .deck-rail .deck-stack>span,body.playing .game-stage .deck-rail .discard-stack>span{margin:0 0 6px!important;line-height:1.3!important;}
body.playing .game-stage .deck-rail .rail-actions{padding-top:11px!important;}
@media(max-width:380px){body.playing .modal-layer.chat-open{--chat-rail:48px}}
@media(max-height:600px) and (orientation:landscape){body.playing .modal-layer.chat-open{--chat-top:44px;--chat-bottom:115px}}

/* v15.17 — cover title-safe effects, compact in-board chat, deck spacing, board-anchored lighthouse FX. */
/* Keep the animated star field away from the printed title area. */
.cover-star-point:nth-child(1){left:46%;top:2.2%}
.cover-star-point:nth-child(2){left:53%;top:4.8%}
.cover-star-point:nth-child(3){left:66%;top:2.4%}
.cover-star-point:nth-child(4){left:74%;top:5.2%}
.cover-star-point:nth-child(5){left:18%;top:7%}
.cover-star-point:nth-child(6){left:87%;top:5%}
.cover-star-point:nth-child(7){left:14%;top:12%}
.cover-star-point:nth-child(8){left:91%;top:12%}
.cover-star-point:nth-child(9){left:11%;top:18%}
.cover-star-point:nth-child(10){left:92%;top:19%}
.cover-star-point:nth-child(11){left:8%;top:25%}
.cover-star-point:nth-child(12){left:94%;top:27%}
.cover-star-point:nth-child(13){left:16%;top:31%}
.cover-star-point:nth-child(14){left:86%;top:32%}
.cover-star-point:nth-child(15){left:91%;top:38%}

body.playing .game-stage .player-rail .chat-opener{height:40px!important;min-height:40px!important;margin-top:4px!important}
body.playing .game-stage .player-rail .chat-opener .chat-glyph{width:24px!important;height:24px!important}

/* Crew chat stays inside the central game/board area instead of covering both side rails. */
#modal-layer.chat-open{pointer-events:none!important}
#modal-layer.chat-open .modal-backdrop{display:none!important}
#modal-layer.chat-open .game-chat-modal{pointer-events:auto!important;position:fixed!important;z-index:46!important;left:calc(var(--lk-chat-left,54px) + 8px)!important;right:calc(var(--lk-chat-right,54px) + 8px)!important;top:calc(var(--lk-chat-top,64px) + 8px)!important;bottom:auto!important;width:auto!important;max-width:none!important;height:auto!important;max-height:min(62dvh,500px)!important;margin:0!important;transform:none!important;border-radius:10px!important}
#modal-layer.chat-open .game-chat-modal .modal-inner{padding:14px 12px 11px!important}
#modal-layer.chat-open .game-chat-modal h2{font-size:1.35rem!important;margin:4px 0 8px!important}
#modal-layer.chat-open .game-chat-modal .chat-log{height:min(22dvh,170px)!important;min-height:90px!important}
#modal-layer.chat-open .game-chat-modal .reactions{gap:4px!important;padding:4px 0!important}
#modal-layer.chat-open .game-chat-modal .reactions button{min-width:34px!important;min-height:34px!important;padding:4px!important}
#modal-layer.chat-open .game-chat-modal .voice-controls{gap:4px!important}
#modal-layer.chat-open .game-chat-modal .voice-controls button{padding:7px 8px!important;font-size:.55rem!important}
#modal-layer.chat-open .game-chat-modal .chat-form{margin-top:5px!important}

/* Give DRAW a little breathing room and keep DISCARD clear of the deck and divider. */
body.playing .game-stage .deck-rail .deck-stack{margin-top:7px!important;margin-bottom:10px!important}
body.playing .game-stage .deck-rail .discard-stack{margin-top:4px!important;margin-bottom:9px!important}
body.playing .game-stage .deck-rail .deck-stack>span,body.playing .game-stage .deck-rail .discard-stack>span{margin-bottom:6px!important}
body.playing .game-stage .deck-rail .rail-actions{padding-top:10px!important}

/* Lighthouse models are now children of the board, so they remain attached to their cards while zooming/scrolling. */
.board-lighthouse-fx{position:absolute!important;z-index:47!important}
/* v15.17 final: bind Crew Chat to the actual board-shell rectangle. */
body.playing #modal-layer.chat-open{position:fixed!important;inset:0!important;display:block!important;pointer-events:none!important;padding:0!important;background:none!important;z-index:29!important}
body.playing #modal-layer.chat-open .modal-backdrop{display:none!important}
body.playing #modal-layer.chat-open .game-chat-modal{pointer-events:auto!important;position:fixed!important;left:var(--lk-chat-screen-left,62px)!important;right:var(--lk-chat-screen-right,62px)!important;top:var(--lk-chat-screen-top,72px)!important;bottom:var(--lk-chat-screen-bottom,190px)!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;margin:0!important;transform:none!important;overflow:hidden!important}


/* v15.18 — Safari/Chrome modal state and native music selector. */
/* High-specificity chat-open rules must NEVER override the hidden state. */
#modal-layer.hidden, body.playing #modal-layer.hidden,
body.playing #modal-layer.chat-open.hidden {display:none!important;pointer-events:none!important;visibility:hidden!important;}
#modal-layer .modal.hidden, body.playing #modal-layer .modal.hidden,
body.playing #modal-layer.chat-open .modal.hidden {display:none!important;pointer-events:none!important;}
#modal-layer.chat-open .game-chat-modal .modal-close {
 position:absolute!important;z-index:100!important;pointer-events:auto!important;
 display:grid!important;place-items:center!important;
 min-width:34px!important;min-height:34px!important;width:34px!important;height:34px!important;
 touch-action:manipulation;-webkit-tap-highlight-color:transparent;
}
[data-action=game-chat], [data-action=close-modal], .rail-toggle,
.icon-button, .small-icon {touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
/* The title is an actual select: iOS gets its native picker; Android gets its native list. */
.home-music .track-window {width:clamp(118px,27vw,168px);max-width:36vw;padding:0 3px;overflow:visible;}
.home-music .track-picker {
 display:block;width:100%;height:100%;min-width:0;min-height:0;
 margin:0;padding:0 17px 0 6px;border:0;border-radius:4px;
 background:transparent;color:var(--gold-light);font-size:16px;
 font-family:inherit;line-height:normal;text-overflow:ellipsis;
 -webkit-appearance:menulist;appearance:auto;touch-action:manipulation;
}
.home-music .track-picker option {background:#102536;color:#f6e4bc;}
@media(max-width:400px){.home-music{gap:5px}.home-music .track-window{width:clamp(112px,30vw,142px);max-width:33vw;}}
/* Safari uses a native sheet for select elements; prevent auto-zoom in create/settings. */
@supports (-webkit-touch-callout:none){
 #initial-limit,#limit-select,.home-music .track-picker {font-size:16px!important;}
}


/* v15.19 — artwork coordinates, matched rail toggles, and board-bounded dialogs. */
/* A single sizing box for the bitmap and its animated layers avoids Safari's
   independent max-height/contain calculation moving the lighthouse lantern. */
.home-page .cover-wrap{aspect-ratio:1122 / 1402!important;height:auto!important;max-height:none!important;align-self:center!important;}
.home-page .cover-wrap>.cover{display:block!important;position:relative!important;width:100%!important;height:100%!important;max-height:none!important;aspect-ratio:1122 / 1402!important;object-fit:fill!important;}
.home-page .cover-wrap>.cover-alive,
.home-page .cover-wrap>.cover-title-still{inset:0!important;width:100%!important;height:100%!important;}
/* Pixel-verified centre of the existing lamp in cover.jpg: (622,592) / (1122,1402). */
.home-page .cover-beacon,.home-page .cover-beam{left:55.44%!important;top:42.23%!important;}
/* Safari paints the rotated, clipped beam slightly lower than its transform box.
   Compensate only on iOS WebKit; Android keeps the image-relative coordinate. */
@supports (-webkit-touch-callout:none){
 .home-page .cover-beam{top:40.9%!important;}
 .home-page .cover-beacon{top:42.23%!important;}
}
/* Both rails use the same accessible gold-rimmed, tactile chevron control. */
body.playing .game-stage .player-rail>.rail-toggle,
body.playing .game-stage .deck-rail>.rail-toggle,
body.playing .game-stage .deck-rail:not(.expanded)>.rail-toggle{
 box-sizing:border-box!important;display:grid!important;place-items:center!important;
 width:31px!important;min-width:31px!important;max-width:31px!important;
 height:32px!important;min-height:32px!important;max-height:32px!important;
 flex:0 0 32px!important;padding:0!important;margin:0!important;
 border:1px solid #d7b777!important;border-radius:8px!important;
 background:linear-gradient(150deg,#345266 0%,#152f42 52%,#091d2c 100%)!important;
 box-shadow:inset 0 1px 1px #fff5,0 3px 0 #806037,0 6px 9px #0009!important;
 color:#ffe5a6!important;font:700 1.25rem/1 Georgia,serif!important;
 text-shadow:0 1px 2px #000c,0 0 7px #f2c77c6b!important;
 transform:none!important;transition:background .16s,box-shadow .16s!important;
 touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;
 z-index:26!important;
}
body.playing .game-stage .player-rail>.rail-toggle{position:absolute!important;top:7px!important;right:4px!important;left:auto!important;}
body.playing .game-stage .deck-rail>.rail-toggle,
body.playing .game-stage .deck-rail:not(.expanded)>.rail-toggle{position:relative!important;top:auto!important;right:auto!important;left:auto!important;align-self:flex-start!important;margin:2px 0 6px 2px!important;}
body.playing .game-stage .player-rail>.rail-toggle:active,
body.playing .game-stage .deck-rail>.rail-toggle:active{
 background:linear-gradient(155deg,#6a6048,#233c4a)!important;
 box-shadow:inset 0 2px 5px #0009,0 1px 0 #806037!important;
}
/* The 45-degree rotated draw counter must fit entirely inside the rail. */
body.playing .game-stage .deck-rail .deck-stack>.diamond{
 left:13px!important;top:calc(32px + 5px)!important;width:23px!important;height:23px!important;
 z-index:5!important;overflow:visible!important;
}
body.playing .game-stage .deck-rail.expanded .deck-stack>.diamond{left:13px!important;top:calc(32px + 5px)!important;}
body.playing .game-stage .deck-rail .deck-stack>.diamond span{font-size:.54rem!important;}
/* Other dialogs are constrained to the central board column, rather than
   spanning beneath the player/deck rails. The game-header and hand stay free. */
body.playing #modal-layer.board-dialog:not(.hidden){
 position:fixed!important;
 top:var(--lk-dialog-top,70px)!important;bottom:var(--lk-dialog-bottom,185px)!important;
 left:var(--lk-dialog-left,59px)!important;right:var(--lk-dialog-right,59px)!important;
 width:auto!important;height:auto!important;min-width:0!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 padding:8px!important;z-index:45!important;pointer-events:auto!important;
 overflow:hidden!important;
}
body.playing #modal-layer.board-dialog .modal-backdrop{position:absolute!important;inset:0!important;border-radius:8px!important;}
body.playing #modal-layer.board-dialog .modal:not(.hidden){
 position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
 box-sizing:border-box!important;flex:0 1 390px!important;
 width:min(100%,390px)!important;max-width:100%!important;min-width:0!important;
 height:auto!important;max-height:100%!important;margin:0!important;
 overflow-y:auto!important;overflow-x:hidden!important;
}
body.playing #modal-layer.board-dialog .exit-modal,
body.playing #modal-layer.board-dialog .result-modal{width:min(100%,360px)!important;}
body.playing #modal-layer.board-dialog .modal-inner{
 box-sizing:border-box!important;width:100%!important;max-width:100%!important;
 max-height:none!important;min-width:0!important;overflow-wrap:break-word!important;
 padding:clamp(12px,3.3vw,22px)!important;
}
body.playing #modal-layer.board-dialog .exit-modal .modal-inner.center{
 gap:9px!important;padding:clamp(12px,3.3vw,22px)!important;
}
body.playing #modal-layer.board-dialog .exit-modal h2,
body.playing #modal-layer.board-dialog .result-modal h2{
 font-size:clamp(.93rem,3.5vw,1.35rem)!important;line-height:1.25!important;
 overflow-wrap:anywhere!important;
}
body.playing #modal-layer.board-dialog .exit-modal p,
body.playing #modal-layer.board-dialog .result-modal p{
 font-size:clamp(.66rem,2.7vw,.82rem)!important;line-height:1.45!important;
}
body.playing #modal-layer.board-dialog .primary-button,
body.playing #modal-layer.board-dialog .secondary-button{
 max-width:100%!important;min-height:42px!important;
 font-size:clamp(.6rem,2.5vw,.79rem)!important;padding:9px 5px!important;
 white-space:normal!important;
}
body.playing #modal-layer.board-dialog .result-modal #result-roles{
 width:100%!important;min-width:0!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
/* Keep hidden layers hidden even when an older chat-open rule is present. */
body.playing #modal-layer.hidden{display:none!important;visibility:hidden!important;pointer-events:none!important;}
@media(max-width:390px){
 body.playing #modal-layer.board-dialog:not(.hidden){padding:5px!important;}
 body.playing #modal-layer.board-dialog .modal-inner{padding:12px!important;}
}


/* v15.20 — consistent side-rail geometry and a genuinely foreground manual.
   All changes are scoped to the playing screen; room creation and the cover
   are deliberately left untouched. */
body.playing .game-stage .player-rail #game-players{
  box-sizing:border-box!important;
  padding-top:51px!important; /* 7px top + 32px toggle + 12px gap */
  scroll-padding-top:51px!important;
}
/* Prevent a stale scroll offset from tucking the first player behind the toggle. */
body.playing .game-stage .player-rail .rail-toggle{
  isolation:isolate!important;
}
/* The rail widths still come from the equal-width game-stage grid.  In both
   states, the cards keep the same vertical height and label slots.  Collapsed
   view clips the sides of the card; expanding reveals more of the SAME card,
   without changing its height or shifting the discard stack downward. */
body.playing .game-stage .deck-rail,
body.playing .game-stage .deck-rail:not(.expanded),
body.playing .game-stage .deck-rail.expanded{
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior-y:contain!important;
  scrollbar-width:none!important;
  align-items:center!important;
}
body.playing .game-stage .deck-rail::-webkit-scrollbar{display:none!important}
body.playing .game-stage .deck-rail>.rail-toggle{
  flex:0 0 32px!important;
  position:relative!important;
  align-self:flex-start!important;
  margin:2px 0 11px 2px!important;
  top:auto!important;
  z-index:20!important;
}
body.playing .game-stage .deck-rail .deck-stack,
body.playing .game-stage .deck-rail .discard-stack,
body.playing .game-stage .deck-rail.expanded .deck-stack,
body.playing .game-stage .deck-rail.expanded .discard-stack{
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  position:relative!important;
  flex:0 0 auto!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  padding:0!important;
  margin:0 0 13px!important;
  border:0!important;
  background:transparent!important;
  overflow:visible!important;
}
body.playing .game-stage .deck-rail .deck-stack>span,
body.playing .game-stage .deck-rail .discard-stack>span,
body.playing .game-stage .deck-rail:not(.expanded) .deck-stack>span,
body.playing .game-stage .deck-rail:not(.expanded) .discard-stack>span{
  box-sizing:border-box!important;
  display:block!important;
  flex:0 0 19px!important;
  height:19px!important;
  min-height:19px!important;
  width:100%!important;
  max-width:100%!important;
  padding:2px 0 0!important;
  margin:0 0 4px!important;
  text-align:center!important;
  font-size:clamp(.40rem,1.5vw,.55rem)!important;
  letter-spacing:0!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  overflow:visible!important;
}
body.playing .game-stage .deck-rail .deck-stack>img,
body.playing .game-stage .deck-rail .discard-stack>img,
body.playing .game-stage .deck-rail.expanded .deck-stack>img,
body.playing .game-stage .deck-rail.expanded .discard-stack>img{
  box-sizing:border-box!important;
  display:block!important;
  flex:0 0 110px!important;
  width:81px!important;
  min-width:81px!important;
  max-width:none!important;
  height:110px!important;
  min-height:110px!important;
  max-height:110px!important;
  object-fit:cover!important;
  object-position:center!important;
  margin:0!important;
  transform:none!important;
}
/* Keep the draw badge within the visible rail and clear of the DRAW label. */
body.playing .game-stage .deck-rail .deck-stack>.diamond,
body.playing .game-stage .deck-rail.expanded .deck-stack>.diamond{
  left:11px!important;
  top:30px!important;
  width:21px!important;
  height:21px!important;
  z-index:6!important;
}
body.playing .game-stage .deck-rail .discard-stack>#discard-count{
  z-index:6!important;
}
body.playing .game-stage .deck-rail .rail-actions{
  flex:0 0 auto!important;
  margin-top:0!important;
  padding-top:12px!important;
}
/* The manual must cover BOTH side panels, not be board-bounded like exit and
   result.  It is a body-level overlay with its own independent scroll area. */
body.playing #modal-layer:not(.hidden):not(.chat-open):not(.board-dialog){
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100dvh!important;
  padding:clamp(8px,2.5vw,20px)!important;
  display:grid!important;
  place-items:center!important;
  z-index:1000!important;
  pointer-events:auto!important;
  isolation:isolate!important;
}
body.playing #modal-layer:not(.hidden):not(.chat-open):not(.board-dialog) .modal-backdrop{
  display:block!important;
  position:absolute!important;
  inset:0!important;
  z-index:0!important;
  background:#020a12e8!important;
  backdrop-filter:blur(5px)!important;
}
body.playing #modal-layer:not(.hidden):not(.chat-open):not(.board-dialog) .modal:not(.hidden){
  position:relative!important;
  z-index:1!important;
  max-width:calc(100vw - 16px)!important;
  max-height:calc(100dvh - 16px)!important;
}
body.playing #modal-layer:not(.hidden) #instructions-modal:not(.hidden){
  width:min(94vw,720px)!important;
  height:auto!important;
  max-height:calc(100dvh - 24px)!important;
  overflow:hidden!important;
}
body.playing #modal-layer:not(.hidden) #instructions-modal .rule-scroll{
  box-sizing:border-box!important;
  max-height:calc(100dvh - 38px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
}
body.playing #modal-layer:not(.hidden) #instructions-modal .modal-close{
  position:absolute!important;
  z-index:3!important;
  top:8px!important;
  right:8px!important;
}
@media(max-width:380px){
 body.playing .game-stage .player-rail #game-players{padding-top:49px!important}
 body.playing .game-stage .deck-rail .deck-stack>.diamond,
 body.playing .game-stage .deck-rail.expanded .deck-stack>.diamond{left:9px!important}
}
@media(max-height:560px) and (orientation:landscape){
 body.playing .game-stage .player-rail #game-players{padding-top:46px!important}
 body.playing .game-stage .deck-rail .deck-stack>img,
 body.playing .game-stage .deck-rail .discard-stack>img,
 body.playing .game-stage .deck-rail.expanded .deck-stack>img,
 body.playing .game-stage .deck-rail.expanded .discard-stack>img{
  flex-basis:78px!important;height:78px!important;min-height:78px!important;max-height:78px!important;width:57px!important;min-width:57px!important;
 }
}
/* Equalise the toggle-to-DRAW gap: older collapsed-only rules used 6px. */
body.playing .game-stage .deck-rail:not(.expanded)>.rail-toggle,
body.playing .game-stage .deck-rail.expanded>.rail-toggle{
 margin:2px 0 11px 2px!important;
}


/* v15.21 — right rail is fixed-height, non-scrolling, with a left-edge-visible
   draw/discard preview.  Both rail widths are identical in either state. */
body.playing .game-stage .deck-rail,
body.playing .game-stage .deck-rail:not(.expanded),
body.playing .game-stage .deck-rail.expanded{
  box-sizing:border-box!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  padding:5px 4px!important;
  --lk-deck-card-h:clamp(52px,calc((100dvh - 520px)/2),142px);
}
body.playing .game-stage .deck-rail:not(.expanded){
  width:var(--lk-rail)!important;
  min-width:var(--lk-rail)!important;
  max-width:var(--lk-rail)!important;
  transform:none!important;
}
body.playing .game-stage .deck-rail.expanded{
  width:118px!important;
  min-width:118px!important;
  max-width:118px!important;
  transform:translateX(calc(var(--lk-rail) - 118px))!important;
  padding:5px 8px!important;
}
body.playing .game-stage .deck-rail>.rail-toggle,
body.playing .game-stage .deck-rail:not(.expanded)>.rail-toggle,
body.playing .game-stage .deck-rail.expanded>.rail-toggle{
  box-sizing:border-box!important;
  position:relative!important;
  align-self:flex-start!important;
  flex:0 0 32px!important;
  height:32px!important;
  min-height:32px!important;
  width:32px!important;
  margin:2px 0 8px 2px!important;
  top:auto!important;
  left:auto!important;
  right:auto!important;
}
body.playing .game-stage .deck-rail .deck-stack,
body.playing .game-stage .deck-rail .discard-stack,
body.playing .game-stage .deck-rail.expanded .deck-stack,
body.playing .game-stage .deck-rail.expanded .discard-stack{
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  flex:0 0 auto!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:0!important;
  padding:0!important;
  margin:0 0 9px!important;
  overflow:visible!important;
}
body.playing .game-stage .deck-rail.expanded .deck-stack,
body.playing .game-stage .deck-rail.expanded .discard-stack{
  align-items:center!important;
}
body.playing .game-stage .deck-rail .deck-stack>span,
body.playing .game-stage .deck-rail .discard-stack>span,
body.playing .game-stage .deck-rail:not(.expanded) .deck-stack>span,
body.playing .game-stage .deck-rail:not(.expanded) .discard-stack>span{
  flex:0 0 18px!important;
  height:18px!important;
  min-height:18px!important;
  width:100%!important;
  margin:0 0 4px!important;
  padding:2px 0 0!important;
  font-size:clamp(.40rem,1.5vw,.55rem)!important;
  line-height:1.15!important;
  text-align:center!important;
  white-space:nowrap!important;
}
body.playing .game-stage .deck-rail .deck-stack>img,
body.playing .game-stage .deck-rail .discard-stack>img,
body.playing .game-stage .deck-rail.expanded .deck-stack>img,
body.playing .game-stage .deck-rail.expanded .discard-stack>img{
  box-sizing:border-box!important;
  display:block!important;
  flex:0 0 var(--lk-deck-card-h)!important;
  height:var(--lk-deck-card-h)!important;
  min-height:var(--lk-deck-card-h)!important;
  max-height:var(--lk-deck-card-h)!important;
  width:min(88px,calc(var(--lk-deck-card-h) * .72))!important;
  min-width:0!important;
  max-width:none!important;
  object-fit:fill!important;
  object-position:left center!important;
  align-self:flex-start!important;
  margin:0!important;
  transform:none!important;
}
body.playing .game-stage .deck-rail.expanded .deck-stack>img,
body.playing .game-stage .deck-rail.expanded .discard-stack>img{
  align-self:center!important;
  margin:0 auto!important;
}
/* Left edge of the actual card stays visible in the narrow rail; its far
   right side alone may be clipped, never the lantern/left frame. */
body.playing .game-stage .deck-rail .deck-stack>.diamond,
body.playing .game-stage .deck-rail.expanded .deck-stack>.diamond{
  left:8px!important;
  top:30px!important;
  width:18px!important;
  height:18px!important;
}
body.playing .game-stage .deck-rail.expanded .deck-stack>.diamond{left:12px!important}
body.playing .game-stage .deck-rail .discard-stack>#discard-count{
  left:2px!important;
  bottom:1px!important;
}
body.playing .game-stage .deck-rail .rail-actions,
body.playing .game-stage .deck-rail:not(.expanded) .rail-actions,
body.playing .game-stage .deck-rail.expanded .rail-actions{
  position:relative!important;
  display:flex!important;
  flex:0 0 auto!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:7px!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  margin:auto 0 0!important;
  padding:8px 0 8px!important;
  overflow:visible!important;
}
body.playing .game-stage .deck-rail .rail-actions .rail-circle{
  flex:0 0 33px!important;
  width:33px!important;
  height:33px!important;
  min-width:33px!important;
  min-height:33px!important;
}
body.playing .game-stage .deck-rail.expanded .rail-actions{
  gap:15px!important;
  padding-bottom:11px!important;
}
body.playing .game-stage .deck-rail.expanded .rail-circle span{
  top:calc(100% + 2px)!important;
  font-size:.46rem!important;
}
@media(max-width:380px){
 body.playing .game-stage .deck-rail,
 body.playing .game-stage .deck-rail:not(.expanded),
 body.playing .game-stage .deck-rail.expanded{
  --lk-deck-card-h:clamp(48px,calc((100dvh - 520px)/2),142px);
 }
 body.playing .game-stage .deck-rail .rail-actions .rail-circle{
  flex-basis:30px!important;width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;
 }
}
@media(max-height:560px) and (orientation:landscape){
 body.playing .game-stage .deck-rail,
 body.playing .game-stage .deck-rail:not(.expanded),
 body.playing .game-stage .deck-rail.expanded{--lk-deck-card-h:42px}
 body.playing .game-stage .deck-rail>.rail-toggle{flex-basis:26px!important;height:26px!important;min-height:26px!important;margin-bottom:2px!important}
 body.playing .game-stage .deck-rail .deck-stack>span,
 body.playing .game-stage .deck-rail .discard-stack>span{flex-basis:13px!important;height:13px!important;min-height:13px!important;margin-bottom:1px!important}
 body.playing .game-stage .deck-rail .deck-stack,
 body.playing .game-stage .deck-rail .discard-stack{margin-bottom:3px!important}
 body.playing .game-stage .deck-rail .rail-actions,
 body.playing .game-stage .deck-rail.expanded .rail-actions{gap:2px!important;padding:3px 0!important}
 body.playing .game-stage .deck-rail .rail-actions .rail-circle{flex-basis:25px!important;width:25px!important;height:25px!important;min-width:25px!important;min-height:25px!important}
 body.playing .game-stage .deck-rail.expanded .rail-circle span{display:none!important}
}
/* Landscape-height fallback: every control remains visible without rail scroll. */
@media(max-height:560px) and (orientation:landscape){
 body.playing .game-stage .deck-rail,
 body.playing .game-stage .deck-rail:not(.expanded),
 body.playing .game-stage .deck-rail.expanded{--lk-deck-card-h:30px!important;padding:2px 3px!important}
 body.playing .game-stage .deck-rail>.rail-toggle,
 body.playing .game-stage .deck-rail:not(.expanded)>.rail-toggle,
 body.playing .game-stage .deck-rail.expanded>.rail-toggle{flex-basis:22px!important;height:22px!important;min-height:22px!important;margin:0 0 2px!important}
 body.playing .game-stage .deck-rail .deck-stack>span,
 body.playing .game-stage .deck-rail .discard-stack>span,
 body.playing .game-stage .deck-rail:not(.expanded) .deck-stack>span,
 body.playing .game-stage .deck-rail:not(.expanded) .discard-stack>span{flex-basis:12px!important;height:12px!important;min-height:12px!important;margin:0 0 1px!important;padding:0!important}
 body.playing .game-stage .deck-rail .deck-stack,
 body.playing .game-stage .deck-rail .discard-stack,
 body.playing .game-stage .deck-rail.expanded .deck-stack,
 body.playing .game-stage .deck-rail.expanded .discard-stack{margin:0 0 2px!important}
 body.playing .game-stage .deck-rail .rail-actions,
 body.playing .game-stage .deck-rail:not(.expanded) .rail-actions,
 body.playing .game-stage .deck-rail.expanded .rail-actions{gap:2px!important;padding:2px 0!important}
 body.playing .game-stage .deck-rail .rail-actions .rail-circle{flex-basis:22px!important;width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important}
 body.playing .game-stage .deck-rail.expanded .rail-circle span{display:none!important}
 body.playing .game-stage .deck-rail .deck-stack>.diamond,
 body.playing .game-stage .deck-rail.expanded .deck-stack>.diamond{top:15px!important;width:14px!important;height:14px!important}
}

/* v15.22 — a subtle divider above the avatar explanation, matching the
   room-conditions divider above the game-duration explanation. */
.lobby-page .profile-panel > .tiny-note {
  border-top: 1px solid #d6bf8850 !important;
  padding-top: 8px !important;
}

/* ===== v15.24: discoverability, scroll markers and action status ===== */
.chat-item.system-event .chat-meta{display:none!important}
.chat-item.system-event .chat-bubble{background:rgba(24,58,73,.68);color:#d4e2e4;border-radius:8px;font-size:clamp(12px,.83rem,15px)}
.cell-coordinate{font-size:clamp(8px,calc(var(--cw)*.17),13px)!important;color:rgba(201,215,208,.55)!important;letter-spacing:.01em!important;white-space:nowrap}
.fan-card{--lk-spread:0px;transition:transform .22s cubic-bezier(.2,.8,.23,1),border-color .2s,box-shadow .2s!important;transform:translateX(calc(-50% + var(--i)*var(--gap) + var(--lk-spread))) translateY(var(--dip)) rotate(var(--angle))!important}
.fan-card.selected{transform:translateX(calc(-50% + var(--i)*var(--gap) + var(--lk-spread))) translateY(-28px) rotate(0deg)!important;border-color:#ffe3aa!important;box-shadow:0 7px 20px #070f1b,0 0 0 2px #eac67c70!important;z-index:40!important}
.fan-card.lifted{transform:translateX(calc(-50% + var(--i)*var(--gap) + var(--lk-spread))) translateY(-38px) rotate(0deg)!important;z-index:50!important}
.game-log{font-size:calc(.69rem + 1pt)!important;line-height:1.35!important;font-family:Georgia,'Palatino Linotype',serif!important;letter-spacing:.028em;white-space:normal!important;text-shadow:0 1px 3px #000b}
.game-log.log-appearing{animation:lkLogFloat 3.3s ease-in-out both}
@keyframes lkLogFloat{0%{opacity:0;transform:translateY(9px)}22%{opacity:1;transform:translateY(0)}64%{transform:translateY(-3px)}100%{opacity:1;transform:translateY(0)}}
@media(max-width:680px){.fan-card.selected{transform:translateX(calc(-50% + var(--i)*var(--gap) + var(--lk-spread))) translateY(-25px) rotate(0deg)!important}.game-log{font-size:calc(.60rem + 1pt)!important;padding-inline:10px!important}}
@media(max-height:680px){.fan-card.selected{transform:translateX(calc(-50% + var(--i)*var(--gap) + var(--lk-spread))) translateY(-20px) rotate(0deg)!important}}
.mark-toggle{position:relative;display:grid;place-items:center;flex:none;min-width:37px;min-height:37px;border-color:rgba(218,180,105,.48)!important}
.mark-toggle .flag-glyph{font-size:1.32rem;color:#e8cb8a;line-height:1}
.mark-counter{position:absolute;right:-3px;bottom:-5px;min-width:17px;height:17px;padding:0 3px;background:#112b3b;border:1px solid #c8a56e;border-radius:50%;font:700 10px/15px Arial,sans-serif;color:#fbe2aa;box-shadow:0 1px 3px #000a}
.mark-toggle.has-marks{box-shadow:inset 0 0 8px #e2b56b29,0 0 10px #e5b77130}
.marks-modal{max-width:min(92vw,490px)!important;background:none!important;border:0!important;box-shadow:none!important;padding:12px!important}
.mark-scroll-shell{position:relative;max-height:min(78svh,680px);overflow-y:auto;overscroll-behavior:contain;padding:31px clamp(22px,6vw,45px);color:#3e2b19;background:linear-gradient(90deg,#987246 0%,#ead2a0 5%,#f9e6bd 14%,#f1d8a3 75%,#cba56b 95%,#8b6032 100%);border:2px solid #c5a069;border-radius:25px 12px 25px 12px;box-shadow:inset 0 2px 13px #794b2855,0 12px 28px #000b}
.mark-scroll-shell:before,.mark-scroll-shell:after{content:'✥  ❧  ✥';display:block;text-align:center;color:#8b6038;font-size:18px;letter-spacing:1em}
.mark-scroll-shell h2{font:700 clamp(1.28rem,3vw,1.8rem)/1.25 Georgia,serif;color:#4e3118;margin:12px 0;text-align:center}
.mark-scroll-shell p{font:14px/1.5 Georgia,serif;color:#725131;text-align:center;margin:12px 0}
.mark-scroll-kicker,.mark-scroll-footer{display:block;text-align:center;color:#8f5b34;font:700 10px Georgia,serif;letter-spacing:.19em}
.mark-scroll-list{display:grid;gap:9px;margin:17px 0}
.mark-scroll-item{display:grid;grid-template-columns:45px 1fr;align-items:center;text-align:left;gap:3px 9px;border:1px solid #94714589;border-radius:5px;background:#fff7d852;color:#493318;padding:10px;cursor:pointer}
.mark-scroll-item:active{background:#d5b77a}
.mark-scroll-index{grid-row:span 2;font:700 16px Georgia,serif}
.mark-scroll-title{font:700 14px Georgia,serif}
.mark-scroll-note{grid-column:2;color:#805d37;font:12px/1.4 Georgia,serif}
.mark-empty{font-style:italic!important}
@media(max-width:680px){.mark-toggle{min-width:32px;min-height:32px}.mark-toggle .flag-glyph{font-size:1.13rem}.mark-counter{font-size:9px}.marks-modal{width:95vw!important}}
@media(prefers-reduced-motion:reduce){.game-log.log-appearing{animation:none!important}.fan-card{transition:none!important}}

/* ===== v15.25: marks belong to individual face-down destinations ===== */
body.playing .game-stage .cell.face-down.has-board-mark{overflow:visible!important}
body.playing .game-stage .cell.face-down .board-mark-flag{
 position:absolute;right:1px;top:1px;z-index:11;
 display:grid;place-items:center;width:clamp(16px,calc(var(--cw)*.43),27px);
 height:clamp(16px,calc(var(--cw)*.43),27px);cursor:pointer;
 border:1px solid #eaca85;border-radius:50%;
 color:#f9dfa9;background:radial-gradient(circle at 35% 24%,#34515b,#0a2736 74%);
 box-shadow:0 1px 4px #000e,0 0 5px #c99a5d8a;
 transition:transform .17s ease,filter .17s ease;
 touch-action:manipulation;-webkit-tap-highlight-color:transparent;
}
body.playing .game-stage .board-mark-flag:hover,
body.playing .game-stage .board-mark-flag:focus-visible{
 transform:scale(1.12);outline:1px solid #fff0bd;filter:brightness(1.13)
}
body.playing .game-stage .board-mark-symbol{font:700 clamp(11px,calc(var(--cw)*.26),17px)/1 Georgia,serif;pointer-events:none}
body.playing .game-stage .board-mark-count{
 position:absolute;right:-3px;bottom:-4px;min-width:12px;height:13px;padding:0 2px;
 border-radius:9px;border:1px solid #d4ae71;background:#132b3b;
 font:700 9px/12px system-ui,sans-serif;text-align:center;color:#ffe4b4;
 pointer-events:none;box-shadow:0 1px 3px #000a;
}
@media(max-width:680px){body.playing .game-stage .board-mark-count{font-size:8px}}

/* ===== v15.26: nautical keeper's log — a real opening parchment scroll ===== */
.marks-modal{
  width:min(94vw,520px)!important;max-width:min(94vw,520px)!important;
  max-height:min(89dvh,790px)!important;overflow:visible!important;
  padding:12px 10px!important;border:0!important;background:transparent!important;
  box-shadow:none!important;
}
.marks-modal .modal-close{
  z-index:12;top:-4px;right:-1px;width:41px;height:41px;
  border:1px solid #d5ae73;background:#112b3adf;color:#ffe3aa;
  box-shadow:0 3px 12px #0008;
}
.marks-modal .mark-scroll-shell{
  position:relative;display:flex;flex-direction:column;isolation:isolate;
  width:100%;max-height:min(82dvh,730px);overflow:visible;
  padding:15px 11px!important;color:#3e2b19;background:transparent!important;
  border:0!important;border-radius:0!important;box-shadow:none!important;
  animation:keeperScrollArrive .58s ease both;
}
.marks-modal .mark-scroll-shell::before,.marks-modal .mark-scroll-shell::after{content:none!important}
.marks-modal .mark-scroll-paper{
  position:relative;z-index:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  padding:clamp(24px,5vw,37px) clamp(24px,6.2vw,47px) clamp(28px,5vw,37px);
  color:#432e19;border:1px solid #b78e53;border-top:0;border-bottom:0;border-radius:3px;
  background-image:
   linear-gradient(90deg,rgba(113,73,30,.20),rgba(255,246,210,.12) 10%,transparent 30%,rgba(251,240,200,.20) 74%,rgba(113,73,30,.22)),
   url('keeper-chart.svg'),
   linear-gradient(105deg,#e4c58b 0%,#f6e4b8 16%,#f7e9c7 52%,#ebd09b 87%,#cc9e64 100%);
  background-repeat:no-repeat,repeat-y,no-repeat;
  background-position:center,center top,center;
  background-size:100% 100%,100% auto,100% 100%;
  box-shadow:inset 15px 0 20px -15px #6f461dbb,inset -15px 0 20px -15px #6f461dbb,0 10px 22px #0008;
  transform-origin:50% 0%;animation:keeperScrollUnfurl .73s cubic-bezier(.2,.68,.2,1) both;
  scrollbar-color:#b78b50 #f1dbac;
}
.marks-modal .scroll-roll{
  position:relative;z-index:3;flex:0 0 24px;height:24px;margin:0 -7px;
  border:1px solid #6f4927;border-radius:11px;
  background:linear-gradient(180deg,#f7dfa6 0%,#b9894e 14%,#865426 39%,#d0a264 65%,#6f4527 92%,#b7814a 100%);
  box-shadow:0 3px 8px #0009,inset 0 2px 2px #fff6,inset 0 -2px 2px #56341b;
}
.marks-modal .scroll-roll::before,.marks-modal .scroll-roll::after{
  content:'';position:absolute;top:-5px;bottom:-5px;width:17px;
  background:linear-gradient(90deg,#6a441f,#e3bc7b 43%,#7b5127 85%);
  border:1px solid #5e3c20;border-radius:5px;box-shadow:0 2px 3px #0007;
}
.marks-modal .scroll-roll::before{left:-8px}
.marks-modal .scroll-roll::after{right:-8px}
.marks-modal .scroll-roll-top{transform:translateY(3px)}
.marks-modal .scroll-roll-bottom{transform:translateY(-3px)}
.marks-modal .mark-scroll-kicker,.marks-modal .mark-scroll-footer{
  position:relative;z-index:1;color:#86522b;letter-spacing:.16em;
}
.marks-modal .mark-scroll-paper h2{
  position:relative;z-index:1;margin:12px 0 15px;
  font:700 clamp(1.45rem,5.7vw,2rem)/1.15 Georgia,serif;
  color:#4a2d16;text-shadow:0 1px #ffedc6;
}
.marks-modal .mark-scroll-paper p{position:relative;z-index:1;color:#6e4c2b}
.marks-modal .mark-scroll-list{position:relative;z-index:1}
.marks-modal .mark-scroll-item{
  border:1px solid #9f7b4cb3;
  background:rgba(255,246,218,.78);
  box-shadow:inset 0 1px #fff9;
}
.marks-modal .mark-scroll-note{white-space:pre-line;overflow-wrap:anywhere}
@keyframes keeperScrollArrive{
 from{opacity:0;transform:translateY(-10px) scale(.96)}
 to{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes keeperScrollUnfurl{
 0%{transform:scaleY(.05);opacity:.35;max-height:12px}
 35%{opacity:1}
 100%{transform:scaleY(1);opacity:1;max-height:min(74dvh,665px)}
}
/* Public flag popups display one player's marking per line. */
.toast{white-space:pre-line;max-width:min(88vw,430px);width:max-content;
 line-height:1.48;overflow-wrap:anywhere;text-wrap:pretty}
@media(max-width:420px){
 .marks-modal{width:96vw!important;max-width:96vw!important;padding:9px 6px!important}
 .marks-modal .mark-scroll-shell{padding:12px 10px!important}
 .marks-modal .mark-scroll-paper{padding:24px 25px 28px}
 .marks-modal .scroll-roll{flex-basis:21px;height:21px}
 .marks-modal .mark-scroll-paper p{font-size:13px}
}
@media(prefers-reduced-motion:reduce){
 .marks-modal .mark-scroll-shell,.marks-modal .mark-scroll-paper{animation:none!important}
}

/* v15.27: card summon, not an underground excavation. */
.cell.card-summoning{z-index:19!important;overflow:visible!important;isolation:isolate}
.cell.card-summoning::before{content:"";position:absolute;inset:-18%;z-index:6;pointer-events:none;border-radius:15%;background:radial-gradient(ellipse,rgba(255,249,205,.8),rgba(248,195,87,.33) 38%,transparent 75%);mix-blend-mode:screen;animation:cardSummonAura 5.8s ease-in-out both}
.cell.card-summoning::after{content:"";position:absolute;left:-55%;right:-55%;top:-95%;height:210%;z-index:6;pointer-events:none;background:conic-gradient(from 0deg at 50% 70%,transparent 0deg 27deg,rgba(255,240,172,.0) 28deg,rgba(255,247,195,.55) 38deg,transparent 52deg 90deg,rgba(255,227,130,.48) 104deg,transparent 119deg 210deg,rgba(255,246,190,.42) 222deg,transparent 241deg);opacity:0;filter:blur(4px);animation:cardSummonBeams 5.8s ease-out both}
@keyframes cardSummonAura{0%{opacity:0;transform:scale(.65)}22%{opacity:.85}55%{opacity:1;transform:scale(1.18)}100%{opacity:0;transform:scale(1.35)}}
@keyframes cardSummonBeams{0%,12%{opacity:0;transform:scale(.55) rotate(-12deg)}36%,66%{opacity:.75}100%{opacity:0;transform:scale(1.12) rotate(16deg)}}
.cell.card-summoning .goal-flip-back{filter:drop-shadow(0 0 9px #ffe49b) brightness(1.15)}
.cell.card-summoning.goal-flipping .goal-flip-back{animation:goalBackFlip .48s ease-in forwards}
.cell.card-summoning.goal-flipping .goal-flip-face{animation:goalFaceFlip .52s .46s ease-out forwards}
.board-lighthouse-fx .board-lighthouse-crack,.board-lighthouse-fx .board-lighthouse-dust{display:none!important}
.board-lighthouse-fx .board-card-halo{position:absolute;z-index:1;bottom:-5%;left:50%;width:145%;height:33%;border-radius:50%;background:radial-gradient(ellipse,#fffbe1 0%,#fbdc85a6 31%,#d5a54845 56%,transparent 76%);transform:translateX(-50%) scale(.5);opacity:0;filter:blur(3px);animation:cardTowerHalo 5s ease-in-out both}
.board-lighthouse-fx .board-card-radiance{position:absolute;z-index:0;bottom:-8%;left:50%;width:180%;height:170%;transform:translateX(-50%) scale(.7);transform-origin:bottom center;opacity:0;background:conic-gradient(from 0deg at 50% 100%,transparent 0deg 23deg,#ffeabb85 30deg,transparent 40deg 84deg,#fff2b4a0 96deg,transparent 110deg 155deg,#ffdb8c77 168deg,transparent 182deg 240deg,#ffe7aa94 254deg,transparent 268deg 310deg,#fff7ce8a 327deg,transparent 341deg);filter:blur(5px);animation:cardTowerRays 5s ease-in-out both}
.board-lighthouse-fx .board-lighthouse-ground{background:radial-gradient(ellipse,rgba(255,248,205,.92),rgba(251,210,105,.52) 35%,transparent 76%)!important;animation:cardTowerHalo 5s ease-in-out both!important}
.board-lighthouse-fx .board-lighthouse-model{animation:cardTowerMaterialize 5s cubic-bezier(.19,.77,.16,1) both!important}
@keyframes cardTowerMaterialize{0%,8%{opacity:0;transform:translateX(-50%) translateY(35%) scale(.8);filter:brightness(3) blur(8px)}19%{opacity:.25;filter:brightness(2.7) blur(5px)}35%{opacity:.85;transform:translateX(-50%) translateY(12%) scale(.93);filter:brightness(1.7) blur(1px)}75%{opacity:1;transform:translateX(-50%) translateY(-4%) scale(1.025);filter:brightness(1.12) blur(0)}100%{opacity:1;transform:translateX(-50%) translateY(0) scale(1);filter:brightness(1) blur(0)}}
@keyframes cardTowerHalo{0%,8%{opacity:0;transform:translateX(-50%) scale(.4)}25%,65%{opacity:1;transform:translateX(-50%) scale(1.08)}100%{opacity:.45;transform:translateX(-50%) scale(1)}}
@keyframes cardTowerRays{0%,6%{opacity:0;transform:translateX(-50%) scale(.5) rotate(-9deg)}24%,62%{opacity:.9;transform:translateX(-50%) scale(1.06) rotate(5deg)}100%{opacity:0;transform:translateX(-50%) scale(1.25) rotate(17deg)}}
@media(prefers-reduced-motion:reduce){.cell.card-summoning::before,.cell.card-summoning::after,.board-lighthouse-fx .board-card-halo,.board-lighthouse-fx .board-card-radiance,.board-lighthouse-fx .board-lighthouse-model{animation-duration:.01ms!important;animation-delay:0ms!important}}

/* v15.28 — turn order reveal (after the opening card-deal sequence) */
.opening-order-banner{position:fixed;z-index:140;top:27%;left:50%;width:min(335px,86vw);padding:21px 24px 19px;transform:translate(-50%,-8px);display:flex;flex-direction:column;align-items:center;gap:7px;text-align:center;pointer-events:none;color:#ffe6ab;background:radial-gradient(ellipse at 50% 0%,#254851f2,#091c2bf7 78%);border:2px solid #d6b574;border-radius:13px;box-shadow:0 0 0 5px #061622cc,0 0 39px #e0ae5466,0 18px 38px #000c;animation:orderArrive .75s cubic-bezier(.16,.8,.19,1) both}
.order-kicker,.order-footer{font:700 .68rem Georgia,serif;letter-spacing:.14em;color:#e1bb78}
.order-number{font:700 clamp(3.2rem,13vw,5rem) Georgia,serif;line-height:1.08;text-shadow:0 0 17px #ffd47180}
.order-message{font:600 1.03rem Georgia,serif;color:#fff2d1}
.order-footer{font-size:.59rem;padding-top:7px}
.opening-order-banner.order-out{animation:orderLeave .6s ease both}
@keyframes orderArrive{0%{opacity:0;transform:translate(-50%,30px) scale(.72);filter:blur(7px)}65%{opacity:1;filter:blur(0);transform:translate(-50%,-12px) scale(1.05)}100%{transform:translate(-50%,0) scale(1)}}
@keyframes orderLeave{to{opacity:0;transform:translate(-50%,-23px) scale(.95);filter:blur(5px)}}
@media(prefers-reduced-motion:reduce){.opening-order-banner{animation:none}.opening-order-banner.order-out{animation:none;opacity:0}}


/* v15.31 — clean up flag markers after destination reveal, including endgame flips */
body.playing .game-stage .cell:not(.face-down) .board-mark-flag{display:none!important}
body.playing .game-stage .cell:not(.face-down) .board-mark-count{display:none!important}

/* v15.31 — layered alternating footfalls instead of left-right rocking.
   Original keeper illustration remains unchanged; clipped copies animate only boots. */
.keeper-token{--walk-cycle:320ms}
.keeper-token .keeper-figure{position:absolute;inset:0;z-index:2;clip-path:inset(0 0 20% 0)}
.keeper-token .keeper-leg{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;transform-origin:50% 70%;z-index:1;animation:none}
.keeper-token .keeper-leg-left{clip-path:polygon(21% 68%,52% 68%,54% 100%,24% 100%)}
.keeper-token .keeper-leg-right{clip-path:polygon(51% 67%,90% 67%,90% 100%,51% 100%)}
.keeper-token.walking .keeper-figure{animation:keeperBodyStride var(--walk-cycle) ease-in-out infinite!important}
.keeper-token.walking .keeper-leg-left{animation:keeperLeftFoot calc(var(--walk-cycle) * 2) ease-in-out infinite}
.keeper-token.walking .keeper-leg-right{animation:keeperRightFoot calc(var(--walk-cycle) * 2) ease-in-out infinite}
.keeper-token:not(.walking) .keeper-leg{transform:none}
@keyframes keeperBodyStride{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(-1px) rotate(0)}}
@keyframes keeperLeftFoot{0%,100%{transform:translate(-1px,0) rotate(-5deg)}25%{transform:translate(1px,-2px) rotate(5deg)}50%{transform:translate(2px,0) rotate(4deg)}75%{transform:translate(0,1px) rotate(-3deg)}}
@keyframes keeperRightFoot{0%,100%{transform:translate(2px,0) rotate(5deg)}25%{transform:translate(0,1px) rotate(-3deg)}50%{transform:translate(-1px,0) rotate(-5deg)}75%{transform:translate(1px,-2px) rotate(5deg)}}
.keeper-token[data-walk-direction="left"] .keeper-figure{filter:brightness(.95) drop-shadow(0 0 1px #ffb94c33)}
.keeper-token.walking::after{animation:lanternHalo .75s ease-in-out infinite}

/* v15.31 — lighthouse assembles tier by tier, from card base to lantern. */
.board-lighthouse-fx .board-lighthouse-model{animation:towerAssemble 5s ease-out both!important;will-change:clip-path,transform,filter}
@keyframes towerAssemble{
  0%,13%{opacity:0;clip-path:inset(100% 0 0 0);transform:translateX(-50%) translateY(5%) scale(.96);filter:brightness(2.5)}
  19%{opacity:1;clip-path:inset(83% 0 0 0)}
  33%{clip-path:inset(62% 0 0 0);filter:brightness(1.7)}
  49%{clip-path:inset(39% 0 0 0);filter:brightness(1.55)}
  65%{clip-path:inset(17% 0 0 0);filter:brightness(1.4)}
  78%{clip-path:inset(0 0 0 0);transform:translateX(-50%) translateY(0) scale(1.02);filter:brightness(1.1)}
  100%{opacity:1;clip-path:inset(0 0 0 0);transform:translateX(-50%) translateY(0) scale(1);filter:brightness(1)}
}
.board-lighthouse-fx .tower-build-lights{position:absolute;pointer-events:none;z-index:3;left:8%;right:8%;bottom:0;height:95%;overflow:visible}
.board-lighthouse-fx .tower-build-tier{position:absolute;left:8%;right:8%;height:4px;bottom:calc(11% + var(--tier-index) * 24%);border-radius:60%;background:linear-gradient(90deg,transparent,#ffe9a3,#fffbe1,#ffcc66,transparent);box-shadow:0 0 9px #ffeaa3,0 0 20px #ffcf6a;opacity:0;animation:towerBuildFlash 1.4s ease-out both;animation-delay:calc(0.85s + var(--tier-index) * .74s)}
@keyframes towerBuildFlash{0%{opacity:0;transform:scaleX(.5)}24%{opacity:1;transform:scaleX(1.15)}66%{opacity:.7;transform:scaleX(1)}100%{opacity:0;transform:scaleX(1.06)}}
@media(prefers-reduced-motion:reduce){.keeper-token.walking .keeper-figure,.keeper-token.walking .keeper-leg,.board-lighthouse-fx .board-lighthouse-model,.board-lighthouse-fx .tower-build-tier{animation:none!important}.board-lighthouse-fx .board-lighthouse-model{opacity:1!important;clip-path:none!important}}

/* v15.33 — touch-friendly card fan: deliberate drag and readable selection */
#hand{touch-action:none;user-select:none;-webkit-user-select:none}
#hand .fan-card{touch-action:none;-webkit-tap-highlight-color:transparent;will-change:transform}
#hand .fan-card.selected{transform:translateX(calc(-50% + var(--i)*var(--gap) + var(--lk-spread))) translateY(-33px) rotate(0deg)!important;box-shadow:0 12px 28px #030a15,0 0 0 2px rgba(255,221,157,.65)!important}
#hand .fan-card.lifted{transform:translateX(calc(-50% + var(--i)*var(--gap) + var(--lk-spread))) translateY(-41px) rotate(0deg)!important;filter:brightness(1.08)}
#hand .fan-card:focus-visible{outline:2px solid #ffdf92;outline-offset:3px}
.drag-ghost{pointer-events:none!important;filter:drop-shadow(0 10px 13px rgba(0,0,0,.7));opacity:.95;z-index:999!important}
.cell.drop-hover{outline:2px solid rgba(255,211,123,.88)!important;outline-offset:-3px;box-shadow:inset 0 0 12px #ffda6677!important}
/* Separate boot strides from the torso's small weight shift. */
.keeper-token.walking .keeper-figure{animation:lkNaturalTorso var(--walk-cycle) ease-in-out infinite!important}
.keeper-token.walking .keeper-leg-left{animation:lkHeelLeft calc(var(--walk-cycle) * 2) ease-in-out infinite!important}
.keeper-token.walking .keeper-leg-right{animation:lkHeelRight calc(var(--walk-cycle) * 2) ease-in-out infinite!important}
@keyframes lkNaturalTorso{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(-.8px) rotate(.6deg)}}
@keyframes lkHeelLeft{0%,100%{transform:translate(-1px,0) rotate(-8deg)}24%{transform:translate(1px,-3px) rotate(12deg)}49%{transform:translate(2px,0) rotate(5deg)}74%{transform:translate(0,1px) rotate(-5deg)}}
@keyframes lkHeelRight{0%,100%{transform:translate(2px,0) rotate(5deg)}24%{transform:translate(0,1px) rotate(-5deg)}49%{transform:translate(-1px,0) rotate(-8deg)}74%{transform:translate(1px,-3px) rotate(12deg)}}
/* End sequence: allow a brief view of fully assembled towers before results. */
.journey-event-message.play{animation-duration:var(--journey-duration,2500ms)!important}
@media(max-width:680px){#hand .fan-card.selected{transform:translateX(calc(-50% + var(--i)*var(--gap) + var(--lk-spread))) translateY(-28px) rotate(0deg)!important}}
@media(prefers-reduced-motion:reduce){.keeper-token.walking .keeper-figure,.keeper-token.walking .keeper-leg{animation:none!important}#hand .fan-card{transition:none!important}}
