:root{color-scheme:dark;--bg:#0b2027;--table:#12343b;--panel:#102a31;--line:#ffffff15;--muted:#9bb4b8;--ink:#f1f6f1;--accent:#a9e5ce;--gold:#f2c477;--fire:#ff845f;--water:#59cfed;--cell:58px;font-family:'Segoe UI',system-ui,sans-serif;font-size:16px}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 28% 4%,#1b4147 0,transparent 55%),var(--bg);color:var(--ink);min-height:100vh}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;touch-action:manipulation}button:disabled{cursor:default;opacity:.38}button:focus-visible,a:focus-visible{outline:3px solid var(--gold);outline-offset:4px}button{border:0}a{color:inherit}button{transition:background .18s,box-shadow .18s,transform .18s}button:not(:disabled):active{transform:translateY(1px)}[hidden]{display:none!important}.topbar{height:91px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 4%;gap:20px}.brand{display:block;width:196px;flex-shrink:0}.brand img{width:100%;height:auto;display:block;filter:invert(1);opacity:.96}.header-actions{display:flex;align-items:center;gap:14px}.quiet-button,.text-button{background:transparent;color:var(--muted);padding:10px 12px;font-size:.875rem}.quiet-button:hover,.text-button:hover{color:var(--ink);background:#ffffff08}.new-game-button{background:#ffffff09;color:var(--ink);border:1px solid #ffffff29;border-radius:30px;padding:11px 21px;font-size:.875rem}.new-game-button:hover{border-color:var(--accent)}.game-shell{max-width:1540px;margin:0 auto;padding:30px 4% 32px;display:grid;grid-template-columns:minmax(0,1fr) 352px;gap:32px}.table-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:24px}.eyebrow{display:block;font-size:.75rem;font-weight:700;letter-spacing:.15em;color:var(--accent);margin-bottom:9px}h1,h2,h3,p{margin:0}h1{font-family:'Segoe UI',system-ui,sans-serif;font-size:clamp(1.25rem,1.8vw,1.65rem);font-weight:500;letter-spacing:-.035em;line-height:1.35}.round-badge{white-space:nowrap;border:1px solid var(--line);border-radius:50px;padding:8px 12px;font-size:.8125rem;color:var(--muted)}.round-badge>span:first-child{font-weight:700;color:var(--ink)}.opponents{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 12px 18px}.opponent{display:flex;position:relative;align-items:center;gap:12px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#0c252b90;transition:border-color .2s,background .2s}.opponent.last-player{border-color:var(--gold);background:#403a29;box-shadow:0 0 25px #f2c47710;transition:none}.opponent.last-player .opponent-name,#human-name.last-player{color:var(--gold)}.avatar{width:38px;height:38px;display:flex;align-items:center;justify-content:center;font-family:'Segoe UI',system-ui,sans-serif;font-size:1rem;border-radius:50%;color:var(--gold);background:#59483255;flex-shrink:0}.opponent[data-player="2"] .avatar{color:var(--water);background:#284a5f}.opponent[data-player="1"] .avatar{color:#cab8ee;background:#49395b}.opponent-name{font-size:.9375rem;font-weight:600}.opponent-caption{font-size:.75rem;color:var(--muted);margin-top:2px}.mini-hand{display:flex;gap:0;margin-left:auto;padding-left:5px}.tile-back-mini{width:13px;height:22px;border:1px solid #af8d5555;background:linear-gradient(135deg,#536a64,#2b4744);border-radius:2px;margin-left:-7px;box-shadow:1px 1px 2px #0006}.play-surface{background:linear-gradient(155deg,#1c474b,#13383e 58%,#173e40);border:1px solid #648c8245;box-shadow:0 16px 50px #0002,inset 0 0 90px #02151d40;border-radius:22px;padding:14px 17px 10px;position:relative}.board-toolbar{display:flex;align-items:center;justify-content:space-between;color:var(--muted);margin-bottom:9px}.board-label{font-size:.75rem;letter-spacing:.12em;font-weight:700}.board-label span{font-size:.75rem;letter-spacing:0;margin-left:12px;font-weight:400;color:#99b7b18c}.board-toolbar>div{display:flex;align-items:center}.icon-button{width:34px;height:34px;border-radius:50%;background:#ffffff08;color:var(--ink);font-size:1.2rem}.board-toolbar .text-button{font-size:.8125rem}.board-viewport{overflow:auto;max-height:min(60vh,610px);min-height:290px;border-radius:4px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#51706a transparent;position:relative}.board{display:grid;gap:3px;margin:auto;width:max-content;position:relative;isolation:isolate;padding:4px}.cell{width:var(--cell);height:var(--cell);padding:0;position:relative;border:1px solid #bed1c112;border-radius:3px;background:#0f303529;display:flex;align-items:center;justify-content:center;transition:background .2s,border-color .2s;flex-shrink:0}.cell.occupied{border:0;box-shadow:0 3px 0 #5e4227,0 5px 9px #0007;z-index:1;background:#f9dfb7}.tile-image{width:100%;height:100%;object-fit:cover;display:block;border-radius:2px;pointer-events:none;user-select:none;-webkit-user-drag:none}.cell .tile-image{transition:transform .18s}.cell.last-played{outline:2px solid var(--gold);outline-offset:1px;box-shadow:0 0 16px #f2c4774d,0 3px 0 #5e4227;z-index:2}.cell.last-played::after{content:'';position:absolute;right:3px;top:3px;width:5px;height:5px;border-radius:50%;background:#81560b;box-shadow:0 0 0 2px var(--gold)}.cell.just-played{animation:tileIn .4s cubic-bezier(.16,1,.3,1)}.cell.legal{background:#a9e5ce17;border:1px dashed #a9e5ce90;cursor:pointer}.cell.legal::before{content:'+';color:var(--accent);font-size:1.35rem;font-weight:400}.cell.legal:hover,.cell.legal:focus-visible{background:#a9e5ce35;box-shadow:inset 0 0 15px #a9e5ce15}.cell.legal .placement-preview{position:absolute;inset:0;opacity:0;transition:opacity .18s}.cell.legal:hover .placement-preview,.cell.legal:focus-visible .placement-preview{opacity:.75}.cell.hole::before{content:'✦';font-size:1rem}.cell.start-cell{background:#a9e5ce12;border:1px dashed #a9e5ce88}.cell.start-cell::before{content:'+';color:var(--accent);font-size:1.4rem}.cell.bound-top{border-top-color:#c5d9bf55}.cell.bound-bottom{border-bottom-color:#c5d9bf55}.cell.bound-left{border-left-color:#c5d9bf55}.cell.bound-right{border-right-color:#c5d9bf55}.board-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 2px 4px;font-size:.75rem;color:#b0c9c4}.legend{display:flex;gap:16px}.legend span{display:flex;gap:5px;align-items:center}.legend i{width:7px;height:7px;border-radius:50%;display:block}.fire-mark{background:var(--fire)}.water-mark{background:var(--water)}.wind-mark{background:#cfdedb}.last-key{display:flex;gap:7px;align-items:center;font-size:.75rem}.last-key i{border:1px solid var(--gold);width:10px;height:10px;display:block;border-radius:2px}.turn-strip{display:flex;align-items:center;gap:13px;margin-top:18px;min-height:57px;padding:14px 16px;border-radius:22px;background:#ffad66;color:#102a31}.turn-strip>div{min-width:0}.turn-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;border:1px solid #a9e5ce45;color:#173a32;background:var(--accent);font-weight:700;flex-shrink:0}.turn-strip strong{font-size:.9375rem;font-weight:700;color:#102a31}.turn-strip p{font-size:.875rem;line-height:1.45;font-weight:700;color:#102a31;margin-top:3px}.turn-strip.your-turn .turn-icon{background:var(--accent);color:#173a32;box-shadow:0 0 20px #a9e5ce10}.hand-area{padding:24px 21px 20px;border:1px solid var(--line);background:#0c2429aa;border-radius:18px;align-self:start;min-width:0}.hand-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:19px}.hand-heading .eyebrow{font-size:.75rem;letter-spacing:.12em;color:var(--muted)}h2{font-family:'Segoe UI',system-ui,sans-serif;font-size:1.65rem;font-weight:600;letter-spacing:-.045em}.hand-heading h2{font-size:1.5rem}.hand-heading h2 span{font-size:.875rem;background:#ffffff0d;border:1px solid var(--line);border-radius:20px;padding:3px 8px;margin-left:6px;font-family:'Segoe UI',system-ui,sans-serif;vertical-align:middle;letter-spacing:0}.score-label{font-size:.75rem;color:var(--muted);white-space:nowrap}.selected-controls{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}.selected-controls>div{font-size:.8125rem;color:var(--muted);line-height:1.45}.rotate-button{display:flex;align-items:center;gap:5px;border-radius:25px;background:#ffffff08;color:var(--ink);border:1px solid var(--line);padding:7px 10px;font-size:1.2rem}.rotate-button span{font-size:.8125rem}.hand{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px 8px}.hand-tile{aspect-ratio:1;padding:0;position:relative;background:#f9dfb7;box-shadow:0 3px 0 #816044,0 6px 8px #0005;border-radius:3px;overflow:visible;transition:transform .18s,outline .18s,opacity .18s;outline:2px solid transparent;outline-offset:2px;min-width:0}.hand-tile:hover{transform:translateY(-3px)!important}.hand-tile.selected{outline-color:var(--accent);transform:translateY(-4px);box-shadow:0 4px 0 #816044,0 0 20px #a9e5ce30}.hand-tile.unplayable{opacity:.48}.hand-tile.selected.unplayable{opacity:1}/* Availability halo is separated from the artwork by a dark gap. */
.hand-tile.can-play:not(.selected)::after{content:'';position:absolute;inset:-4px;pointer-events:none;border:1px solid #ffd58d;border-radius:6px;background:transparent;box-shadow:0 0 5px 2px #ffbd6670,0 0 10px 3px #ffad6638}
.hand-tile.dealing{animation:handDeal .4s both;animation-delay:calc(var(--tile-index)*.035s)}.hand.placeholder .hand-tile{background:#1c3c3b;border:1px solid #61827855;box-shadow:0 3px 0 #0a191b}.hand.placeholder .hand-tile::before{content:'C';color:#759888;position:absolute;inset:20%;border:1px solid #658b7877;font-family:'Segoe UI',system-ui,sans-serif;font-size:1.5rem;display:flex;align-items:center;justify-content:center;transform:rotate(45deg)}.hand-actions{margin-top:22px;display:flex;flex-direction:column;gap:10px}.primary-button{background:var(--accent);color:#12382d;border:1px solid var(--accent);border-radius:10px;padding:13px 20px;font-size:.9375rem;font-weight:700;min-height:48px}.primary-button:hover:not(:disabled){background:#c3f2de;box-shadow:0 4px 20px #a9e5ce15}.primary-button:disabled{background:#ffffff0a;border-color:var(--line);color:#aac1bc;opacity:.55}.swap-button{background:#f2c47712;color:var(--gold);border:1px solid #f2c47750;padding:12px;border-radius:10px;font-size:.875rem}.game-dialog{border:1px solid #69877b5c;border-radius:24px;background:radial-gradient(ellipse at top right,#2b4b42,transparent 70%),#132e32;color:var(--ink);padding:38px;width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 40px);box-shadow:0 35px 130px #0008;overflow:auto}.game-dialog::backdrop{background:#041619b8;backdrop-filter:blur(7px)}.game-dialog h2{font-size:2.4rem;line-height:1.12;letter-spacing:-.055em;margin-bottom:16px}.game-dialog p{font-size:.9375rem;line-height:1.7;color:#adc5c2;margin-bottom:24px}.game-dialog>.primary-button{width:100%}.game-dialog>.text-button,.result-content>.text-button{display:block;margin:12px auto 0}.game-dialog .eyebrow{margin-bottom:16px}.start-dialog{text-align:center;width:min(500px,calc(100vw - 32px));padding:40px}.start-emblem{display:flex;align-items:center;justify-content:center;gap:16px;margin:0 auto 25px;padding:13px 21px;border:1px solid #f2c47740;border-radius:16px;width:max-content;max-width:100%;background:#0b202744}.start-emblem>svg{width:30px;height:36px;flex:none}.start-emblem>span{color:#e9f4ed;font-size:.94rem;line-height:1.4;text-align:center;font-weight:600;letter-spacing:.01em}.start-dialog h2{font-size:2.8rem;font-weight:500}.start-dialog p{max-width:320px;margin:0 auto 27px}.deal-summary{display:flex;justify-content:center;gap:26px;margin-bottom:29px;font-size:.8125rem;color:#9eb6b0}.deal-summary strong{display:block;font-size:1.2rem;color:var(--ink);font-weight:500;margin-bottom:4px}.large{display:flex;align-items:center;justify-content:space-between;min-height:54px;padding:14px 20px}.large span{font-size:1.5rem;font-weight:400}.start-rules{font-size:.8125rem!important}.close-button{position:absolute;right:13px;top:12px;background:transparent;color:var(--muted);font-size:1.75rem;width:40px;height:40px;border-radius:50%}.rules-dialog{width:min(580px,calc(100vw - 32px))}.rules-content h3{font-family:'Segoe UI',system-ui,sans-serif;font-size:1rem;font-weight:600;margin:22px 0 8px;color:var(--accent)}.rules-content p{margin:0 0 12px;font-size:.9375rem;line-height:1.65}.rules-content table{width:100%;border-collapse:collapse;font-size:.875rem;margin:14px 0 24px}.rules-content td,.rules-content th{border-bottom:1px solid var(--line);padding:9px 0;text-align:left}.rules-content th{font-weight:500;color:var(--muted)}.rules-content th:last-child,.rules-content td:last-child{text-align:right}.rules-dialog>.primary-button{margin-top:24px}.swap-choices{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.swap-choice{aspect-ratio:1;background:linear-gradient(140deg,#385d50,#17352f);border:1px solid #abcc9980;color:#d0ddbc;font-family:'Segoe UI',system-ui,sans-serif;font-size:1.2rem;border-radius:4px;box-shadow:0 3px 0 #061916}.swap-choice:hover{outline:2px solid var(--gold);outline-offset:2px}.result-dialog{text-align:center}.result-dialog h2{color:var(--gold);font-size:2.8rem}.result-row{display:flex;align-items:center;gap:10px;padding:13px 0;border-top:1px solid var(--line);text-align:left;font-size:.9375rem}.result-row .avatar{width:30px;height:30px;font-size:.8125rem}.result-row small{margin-left:auto;color:var(--muted);font-size:.8125rem}.result-row.winner{color:var(--gold)}#results{margin-bottom:26px}.toast{position:fixed;bottom:25px;left:50%;transform:translate(-50%,15px);opacity:0;pointer-events:none;background:#e5f5e8;color:#15382f;padding:13px 21px;border-radius:30px;font-size:.875rem;box-shadow:0 10px 50px #0005;z-index:20;transition:opacity .2s,transform .2s;width:max-content;max-width:90vw;text-align:center}.toast.visible{opacity:1;transform:translate(-50%,0)}.hand-empty{grid-column:1/-1;color:var(--accent);padding:40px 10px;text-align:center;font-size:.9375rem}.thinking::after{content:'…';display:inline-block;animation:pulse 1.2s infinite}.board-viewport:has(.board:empty){height:430px}@keyframes tileIn{from{transform:scale(1.25) translateY(-12px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}@keyframes handDeal{from{transform:translateY(15px) rotate(4deg);opacity:0}to{transform:translateY(0) rotate(0);opacity:var(--dealt-opacity,1)}}@keyframes pulse{50%{opacity:.25}}
@media(min-width:1440px){.game-shell{grid-template-columns:minmax(0,1fr) 370px;gap:40px}.hand{gap:13px 10px}.play-surface{padding:16px 28px 13px}}
@media(max-width:1100px){.game-shell{grid-template-columns:minmax(0,1fr) 300px;gap:20px;padding:25px 3%}.topbar{padding:0 3%;height:80px}.hand-area{padding:22px 16px}.table-heading h1{font-size:1.25rem}.opponent{padding:10px;gap:8px}.mini-hand{display:none}.opponents{margin-left:0;margin-right:0;gap:8px}.avatar{width:32px;height:32px;font-size:.875rem}.play-surface{padding:10px 10px 9px}.selected-controls{margin-bottom:13px}.hand{gap:10px 7px}}
@media(max-width:900px){.game-shell{grid-template-columns:minmax(0,1fr);max-width:820px;padding:22px 4% 35px;gap:18px}.topbar{padding:0 4%}.hand-area{padding:20px}.hand{grid-template-columns:repeat(8,minmax(0,1fr));gap:12px 8px}.hand-heading{margin-bottom:5px}.hand-heading .eyebrow{display:none}.hand-actions{margin-top:16px;flex-direction:row}.hand-actions>button{flex:1}.opponents{gap:14px;margin:0 20px 17px}.opponent{padding:13px}.mini-hand{display:flex}.table-heading{margin-bottom:20px}.board-viewport{max-height:520px}.play-surface{padding:12px 25px}.table-heading h1{font-size:1.75rem}.turn-strip{margin-top:13px}.selected-controls{min-height:42px;margin-bottom:13px}}
@media(max-width:560px){.topbar{height:72px;gap:8px;padding:0 16px}.brand{width:136px}.header-actions{gap:2px}.quiet-button{padding:8px;font-size:.75rem}.new-game-button{font-size:.75rem;padding:9px 12px}#sound-button{display:none}.game-shell{padding:20px 12px 28px;gap:14px}.table-heading{margin:0 4px 18px}.table-heading .eyebrow{font-size:.75rem;margin-bottom:6px}.table-heading h1{font-size:1.1rem;max-width:215px;letter-spacing:-.025em}.round-badge{font-size:.75rem;padding:7px 9px}.opponents{gap:7px;margin:0 1px 13px}.opponent{padding:9px 7px;gap:7px;border-radius:10px}.opponent .avatar{width:27px;height:27px;font-size:.8125rem}.opponent-name{font-size:.8125rem}.opponent-caption{font-size:.75rem}.mini-hand{display:none}.play-surface{padding:6px 7px 10px;border-radius:14px}.board-toolbar{margin:0 5px 4px}.board-toolbar .icon-button{width:30px;height:30px}.board-viewport{min-height:240px;max-height:460px}.board{gap:2px;padding:3px}.board-footer{font-size:.75rem;padding:13px 7px 2px;gap:5px}.last-key{font-size:.75rem}.legend{gap:10px}.turn-strip{padding:12px 10px;gap:10px;border-radius:14px}.turn-strip strong{font-size:.875rem}.turn-strip p{font-size:.8125rem}.turn-icon{width:34px;height:34px}.hand-area{padding:17px 14px;border-radius:14px}.hand-heading h2{font-size:1.35rem}.hand{grid-template-columns:repeat(4,minmax(0,1fr));gap:13px 10px}.selected-controls{margin:5px 0 13px}.hand-actions{margin-top:18px}.hand-tile{max-width:100%}.game-dialog{padding:30px 23px;border-radius:18px}.start-dialog{padding:30px 25px}.start-dialog h2{font-size:2.4rem}.game-dialog h2{font-size:2.2rem}.game-dialog p{font-size:.875rem}.deal-summary{gap:24px}.hand-area .eyebrow{font-size:.75rem}.toast{bottom:16px}.cell.legal::before{font-size:1rem}.cell.last-played::after{width:3px;height:3px;right:2px;top:2px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Keep instructions and recurring controls legible on touch screens. */
.rules-content p,.game-dialog p{font-size:1rem}.header-actions button,.rotate-button span,.selected-controls>div{font-size:.875rem}.hand-heading .eyebrow{font-size:.75rem}.board-label{font-size:.75rem}.icon-button{min-width:36px;min-height:36px}@media(max-width:560px){.header-actions button{font-size:.8125rem}.brand{width:128px}.quiet-button{padding:8px 7px}.game-dialog p{font-size:1rem}.board-toolbar .icon-button{width:36px;height:36px}.score-label{font-size:.8125rem}}

/* Center the opening tile on an unmarked table. Only playable targets are shown
   until placed Wind sides establish two perpendicular outer boundaries. */
.board-viewport{display:flex}
.board{flex-shrink:0}
.board:not(.grid-defined) .cell:not(.occupied):not(.legal):not(.start-cell){background:transparent;border-color:transparent}
.board:not(.grid-defined) .cell.start-cell:not(.legal){background:transparent;border-color:#a9e5ce45}
.board.grid-defined{border-radius:4px}

/* Keep the count visible while the player's status changes. */
.opponent-details{min-width:0}
.player-order{display:block;color:var(--ink);font-size:.875rem;line-height:1.4;margin:3px 0;font-variant-numeric:tabular-nums}
.player-order[hidden]{display:none}
.opponent-caption{display:grid;gap:2px}
.opponent-count{font-size:.875rem;color:var(--ink);font-variant-numeric:tabular-nums}

/* Match the existing rules paragraphs when presenting steps and short lists. */
.rules-content ul,.rules-content ol{margin:0 0 12px;padding-left:1.4rem;font-size:1rem;line-height:1.65;color:#adc5c2}
.rules-content li{margin-bottom:8px}

/* Optional shop links use the game's existing type and colors. */
.physical-game-promo{width:min(580px,calc(100% - 32px));margin:0 auto 32px;text-align:center}
.game-shell>aside.physical-game-promo{grid-column:1 / -1;justify-self:stretch;display:flex;flex-direction:column;align-items:center;width:auto;max-width:none;margin:0;padding:0 16px;text-align:center}
.game-shell>aside.physical-game-promo .physical-game-shipping{width:100%;max-width:580px}
.physical-game-link{display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-height:44px;padding:11px 20px;border:1px solid #a9e5ce70;border-radius:10px;background:transparent;color:var(--accent);font:inherit;font-size:.9375rem;font-weight:600;line-height:1.4;text-decoration:none;transition:background .18s,border-color .18s}
.physical-game-link:hover{background:#a9e5ce10;border-color:var(--accent)}
.physical-game-promo .physical-game-shipping{margin:8px 0 0;font-size:.875rem;line-height:1.5;color:var(--muted)}
.result-dialog .physical-game-promo{width:auto;margin:16px 0 0}

/* Let the table shrink to the device, not to its scrollable board's intrinsic
   width. Board zoom stays inside its own viewport; page pinch zoom stays free. */
.table-area,.play-surface,.board-viewport{min-width:0;max-width:100%}
.game-dialog{max-width:calc(100% - 32px);max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px)}
@media(max-width:560px){
  .board-toolbar,.board-footer{flex-wrap:wrap;row-gap:8px}
}
@media(max-width:380px){
  .topbar{height:auto;min-height:72px;flex-wrap:wrap;justify-content:center;padding-top:12px;padding-bottom:12px}
}

/* Keep dismissal within reach, including when a dialog scrolls. */
.dialog-close-bar{position:sticky;top:0;z-index:2;display:flex;justify-content:flex-end;margin:-26px -26px 8px;pointer-events:none}
.dialog-close-bar .close-button{position:static;display:grid;place-items:center;flex:none;width:44px;height:44px;padding:0;line-height:1;background:#132e32;color:var(--ink);border:1px solid #69877b5c;pointer-events:auto}
.dialog-close-bar .close-button:hover{background:#2b4b42}
@media(max-width:560px){.dialog-close-bar{margin:-18px -11px 8px}}

/* Illustrated matching examples; game rules and state are unchanged. */
.move-examples{margin:18px 0 26px;padding:16px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.rules-content .move-example-intro{font-size:.9375rem;margin:0 0 14px}
.move-example-switch{display:flex;gap:6px;padding:5px;background:var(--bg);border:1px solid #91b2a52d;border-radius:11px;margin:0 0 16px}
.move-example-switch button{flex:1;min-width:0;min-height:44px;border:1px solid transparent;border-radius:7px;padding:10px 6px;background:transparent;color:var(--muted);font-size:.875rem;font-weight:600}
.move-example-switch button[aria-pressed="true"]{background:var(--accent);color:#113c30;border-color:var(--accent)}
.move-example-switch button[data-move-example="incorrect"][aria-pressed="true"]{background:#f4b0a1;border-color:#f4b0a1;color:#56271f}
.move-example-diagram{display:block;width:100%;height:auto;border-radius:8px}
.move-example-caption{margin:15px 0 0}.move-example-caption>strong{display:block;color:var(--accent);font-size:1rem;margin-bottom:5px}
#move-example-incorrect .move-example-caption>strong{color:#f4b0a1}
.rules-content .move-example-caption p{font-size:.9375rem;margin:0;line-height:1.6}
.rules-content .move-example-reminder{font-size:.875rem;margin:16px 0 0;padding-top:13px;border-top:1px solid var(--line);line-height:1.6}
@media(max-width:380px){.move-example-switch button{font-size:.75rem;padding:9px 3px}}

/* Count the board from a Corner without changing its placement rules. */
.boundary-example{margin:18px 0 26px}
.boundary-diagram{display:block;width:100%;height:auto;border-radius:8px}
.boundary-example figcaption{margin-top:15px;color:var(--ink);font-size:1rem;line-height:1.6}
.boundary-example figcaption>strong{display:block;color:var(--accent);margin-bottom:5px}
.rules-content .boundary-example p{font-size:.9375rem;line-height:1.6;margin:0}
.rules-content .boundary-example .boundary-note{font-size:.8125rem;color:var(--muted);margin-top:10px}

/* Approved insert example: slim gold brackets identify the closed last tile. */
.closed-tile-example{margin:16px 0 24px}
.closed-tile-diagram{display:block;width:100%;height:auto;border-radius:8px}
.closed-tile-example figcaption{margin-top:15px;color:var(--ink);font-size:.9375rem;line-height:1.6}
.closed-tile-example figcaption>strong{display:block;color:var(--accent);font-size:1rem;margin-bottom:5px}
.rules-content .closed-tile-example p{font-size:.9375rem;line-height:1.6;margin:0}
.rules-content .closed-tile-example .closed-tile-reminder{font-size:.8125rem;margin-top:16px;padding-top:13px;border-top:1px solid var(--line);color:var(--muted)}

/* Enclosed-space examples, including already-established edges and corners. */
.gap-examples{margin:16px 0 24px}
.gap-tabs{display:flex;gap:5px;background:var(--bg);border:1px solid #91b2a52d;border-radius:10px;padding:5px;margin:0 0 16px}
.gap-tabs button{flex:1;min-width:0;min-height:44px;border:0;border-radius:6px;padding:9px 5px;font-size:.8125rem;font-weight:600;background:transparent;color:var(--muted)}
.gap-tabs button[aria-pressed="true"]{background:var(--accent);color:#113c30}
.gap-examples button:focus-visible{outline:2px solid #ffd45a;outline-offset:2px}
.rules-content .gap-summary{font-size:.875rem;color:var(--ink);min-height:42px;margin:0 0 12px}
.gap-examples figure{margin:0}
.gap-examples svg{display:block;width:100%;height:auto;border-radius:8px}
.gap-examples figcaption{font-size:.875rem;line-height:1.6;margin-top:14px}
.gap-examples figcaption>strong{display:block;font-size:.9375rem;color:var(--accent);margin-bottom:5px}
.rules-content .gap-examples figcaption p{font-size:.875rem;margin:0;line-height:1.6}
.gap-preview-toggle{display:block;width:100%;min-height:44px;margin:16px 0 0;padding:10px 14px;font-size:.875rem;font-weight:600;color:var(--accent);background:#102a31;border:1px solid #719a8a;border-radius:8px}
.gap-preview-toggle[aria-pressed="true"]{background:var(--accent);color:#113c30}
.rules-content .gap-legend{color:#ffd45a;font-size:.75rem;margin:12px 0 0}
.rules-content .gap-scope{font-size:.75rem;color:var(--muted);margin:4px 0 0}
.rules-content .gap-reminder{font-size:.8125rem;margin:12px 0 0;padding-top:13px;border-top:1px solid var(--line);color:var(--muted)}
.gap-examples [hidden]{display:none!important}
@media(max-width:430px){.gap-tabs button{font-size:.6875rem}}

.game-dialog .feedback-contact{border-top:1px solid var(--line);padding-top:18px;margin:24px 0 0;font-size:.875rem;line-height:1.7;text-align:center;color:var(--muted)}
.feedback-contact span{display:block}
.feedback-contact a{display:inline-block;color:var(--accent);font-weight:600;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere;user-select:text}
.feedback-contact a:hover{color:var(--ink)}
.feedback-contact a:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:2px}

/* Smaller results close icon, with its full 44px touch target retained. */
.result-dialog .dialog-close-bar{margin-top:0}
.result-dialog .dialog-close-bar .close-button{position:relative;inset:auto;isolation:isolate;background:transparent;border:0;font-size:1.4rem}
.result-dialog .dialog-close-bar .close-button::before{content:'';position:absolute;inset:4px;z-index:-1;border:1px solid #69877b5c;border-radius:50%;background:#132e32}
.result-dialog .dialog-close-bar .close-button:hover::before{background:#2b4b42}
.result-dialog .dialog-close-bar .close-button:focus-visible{outline-width:2px;outline-offset:-2px}

.share-shortcut, .share-result-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
}
.share-shortcut svg, .share-result-button svg { flex: none; }
.result-actions { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 8px; }
.result-actions button { min-height: 48px; padding: 10px 8px; font-size: .9375rem; }
.share-result-button {
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}
.share-result-button:hover { background: #a9e5ce10; }
.result-dialog .physical-game-link { width: 100%; gap: 8px; border-color: var(--gold); color: var(--gold); }
#share-dialog label { display: block; font-weight: 600; }
#share-url {
  width: 100%;
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
#copy-status { margin: 12px 0 0; }
#copy-status:empty { margin: 0; }
@media (max-width: 560px) {
  .share-shortcut { min-width: 44px; }
  .share-shortcut span { display: none; }
}
/* Give the close control a separate row from the scrolling scores on phones. */
@media (max-width: 560px), (max-height: 500px) and (pointer: coarse) {
  .result-dialog[open] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 6px 14px 12px;
    overflow: hidden;
  }
  .result-dialog .dialog-close-bar {
    grid-area: 1 / 2;
    position: static;
    margin: 0;
  }
  #result-kicker {
    grid-area: 1 / 1;
    align-self: center;
    margin: 0;
    text-align: left;
  }
  .result-content {
    grid-column: 1 / -1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 2px 4px 6px;
  }
  .result-content h2 { margin: 0 0 8px; }
  #result-reason { margin: 0 0 12px; line-height: 1.45; }
  #results { margin-bottom: 14px; }
  .result-row { padding: 7px 0; }
  .result-dialog .physical-game-promo { margin-top: 10px; }
}
@media (max-width: 300px) { .result-actions { grid-template-columns: 1fr; } }

/* The aggregate count stays private; visitors can read this short notice. */
.count-privacy{font-size:.8125rem;color:var(--muted);line-height:1.6;text-align:left;margin-top:20px}
.count-privacy summary{cursor:pointer;min-height:44px;display:list-item;align-content:center;text-align:center;color:var(--muted);text-underline-offset:3px}
.count-privacy p,.start-dialog .count-privacy p{font-size:.8125rem;line-height:1.65;margin:10px 0 0;max-width:none}
.count-privacy a{color:var(--accent)}
.count-privacy-footer{max-width:620px;margin:0 auto;padding:0 20px 25px}
.count-privacy-footer .count-privacy{margin-top:0}

/* First-game guidance uses the existing surfaces, not a blocking tour. The
   glow surrounds the entire hand, including every row of the sixteen tiles. */
.hand-area.guided-hand{border-color:#a9e5cebb;background:linear-gradient(150deg,#a9e5ce14,#0c2429aa 72%);box-shadow:0 0 0 1px #a9e5ce40,0 0 26px #a9e5ce18,inset 0 0 28px #a9e5ce08}
.first-play-hint{color:var(--accent);font-size:1rem;font-weight:500;line-height:1.45;margin:0}
.selected-controls>div{min-width:0}
.rotate-button{min-height:44px;flex-shrink:0}
.rotate-button.guided-control{background:var(--accent);border-color:var(--accent);color:#12382d;padding:9px 14px;box-shadow:0 0 16px #a9e5ce20}
.rotate-button.guided-control span{font-size:1rem;font-weight:700}
.primary-button.guided-control{box-shadow:0 0 0 2px #a9e5ce35,0 0 20px #a9e5ce20}

.board.guided-placements .cell.legal{background:#a9e5ce29;border-color:#b8f4d5;box-shadow:0 0 8px #a9e5ce12}
.game-dialog .replay-hint{color:var(--accent);font-size:1rem;line-height:1.5;margin:0 0 14px}
@media(max-width:560px){.selected-controls{flex-wrap:wrap;gap:10px}.selected-controls>div{flex:1 1 150px}.first-play-hint{font-size:1rem}}

/* Board camera only. The original header and game layout are unchanged. */
.board-viewport{scroll-behavior:auto}.board{will-change:transform}

/* Compact player rows, preserving original typography and colors. */
.opponents{grid-template-columns:minmax(0,1fr);gap:4px}
.opponent{padding:3px 7px;gap:0}
.opponent>.avatar,.opponent>.mini-hand{display:none}
.opponent-details{display:grid;grid-template-columns:1fr 1fr 1fr;align-items:center;gap:5px;width:100%}
.opponent-name{color:var(--gold)}
.opponent[data-player="1"] .opponent-name{color:#cab8ee}
.opponent[data-player="2"] .opponent-name{color:var(--water)}
.opponent.last-player .opponent-name{color:var(--gold)}
.opponent .player-order{margin:0}
.opponent-caption{display:block;margin:0}
.opponent-status{display:none}

/* Keep the goal legible across the full heading width. */
.table-heading h1.game-goal{max-width:none}

/* Compact, colorful goal using the existing CuadraFio palette and font. */
.table-heading:has(.game-goal){margin-bottom:8px}
.game-goal .goal-match{display:block;font-size:20px;line-height:1.15;font-weight:800;letter-spacing:-.035em}
.game-goal .goal-fire{color:var(--fire)}
.game-goal .goal-water{color:var(--water)}
.game-goal .goal-win{display:block;font-size:14px;line-height:1.3;font-weight:600;letter-spacing:0;color:var(--accent);margin-top:3px}
@media(max-width:560px){.game-shell:has(.game-goal){padding-top:12px}}

/* Match the optional rotation cue to its real enabled control. */
.rotation-word,#rotate-button.rotation-match{background:#123b50;color:#d1f6ff;border:1px solid #59cfed;border-radius:9px;font-weight:800;box-shadow:none}
.rotation-word{display:inline-block;padding:3px 9px;font-size:14px;line-height:1.4;vertical-align:baseline}
#rotate-button.rotation-match{padding:9px 14px;min-height:44px}
#rotate-button.rotation-match span{font-weight:800;font-size:14px}

.turn-strip p{font-weight:400}

/* Place blocked-turn actions with their explanation; preserve the game palette. */
#turn-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
#turn-actions button{min-height:44px;padding:10px 16px;font-weight:700}
#turn-actions .swap-button{background:#f1e2bd;color:#12382d;border:1px solid #12382d}
.turn-strip:has(#turn-actions:not([hidden])){align-items:flex-start}
.turn-strip:has(#turn-actions:not([hidden])) .turn-icon{margin-top:2px}

/* First-play nudge: the hand is below the orange panel only in the stacked layout. */
.first-tile-arrow{display:none;pointer-events:none;flex:0 0 52px;width:52px;height:60px;margin-inline:auto}
.first-tile-arrow svg{display:block;width:100%;height:100%;overflow:visible}
.arrow-shadow{fill:#102a3130}
.arrow-body{fill:var(--accent);stroke:#173a32;stroke-width:3;stroke-linejoin:round}
.arrow-motion{fill:none;stroke:#173a32;stroke-width:2.5;stroke-linecap:round}
.arrow-highlight{fill:none;stroke:#eff9f0;stroke-width:3;stroke-linecap:round}
@media(max-width:900px){.first-tile-arrow{display:block}}
@media(max-width:380px){.first-tile-arrow{flex-basis:40px;width:40px;height:50px}}

.offline-footer{padding:4px 4% 24px;text-align:center;color:var(--muted);font-size:.875rem}

/* Player cards and on-demand move history adapted from the redesign. */
.cf-players{flex:none;display:flex;gap:4px;padding:6px 12px 6px;align-items:stretch}
.cf-player{flex:1;min-width:0;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid var(--line);padding:9px 4px 6px;display:flex;flex-direction:column;align-items:center;gap:2px;position:relative;transition:border-color .2s,background .2s}
.cf-player .av{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:12px;color:#0b2228}
.cf-player .nm{font-size:11.5px;font-weight:600;color:var(--muted);white-space:nowrap}
.cf-player .nm em{font-style:normal;font-weight:500;opacity:.65;font-size:10px}
.cf-player .ct{font-size:16px;font-weight:800;line-height:1}
.cf-player .ct small{font-size:10px;font-weight:500;color:var(--muted);margin-left:2px}
.cf-player.active{border-color:rgba(142,240,200,.75);background:rgba(142,240,200,.10);box-shadow:0 0 0 3px rgba(142,240,200,.12)}
.cf-player.last{border-color:rgba(242,193,78,.6)}
.cf-player .tag{position:absolute;top:-8px;font-size:9px;font-weight:800;letter-spacing:.06em;padding:2px 6px;border-radius:6px;background:var(--accent);color:#0b2228;white-space:nowrap}
.cf-player .tag.g{background:var(--gold)}
.cf-player .tag.think{background:#cfe3dd;animation:pulse 1.1s infinite}
.cf-player-arrow{align-self:center;color:rgba(255,255,255,.22);font-size:11px}
ol.cf-moves{list-style:none;display:flex;flex-direction:column;gap:8px;max-height:60dvh;overflow:auto}
ol.cf-moves li{display:flex;align-items:center;gap:9px;font-size:13.5px;color:#c9dcd7}
ol.cf-moves li:first-child{color:#fff;font-weight:600}
ol.cf-moves .av{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:11px;color:#0b2228;flex:none}
ol.cf-moves .t{width:26px;height:26px;flex:none;border-radius:3px}ol.cf-moves .t.none{background:transparent}
ol.cf-moves .t img{width:100%;height:100%;display:block;border-radius:inherit;pointer-events:none;user-select:none;-webkit-user-drag:none}

.cf-players{margin:0 0 15px;padding:10px 0 0;gap:5px}
.cf-player{padding:12px 3px 7px;min-height:71px;justify-content:center}
.cf-player-tags{display:flex;gap:2px;position:absolute;left:0;right:0;top:-9px;justify-content:center;z-index:1}
.cf-player .tag{position:static;padding:2px 4px;font-size:9px}
.cf-player.last.active{border-color:var(--accent)}
.cf-moves-button{display:inline-grid;place-items:center;min-height:44px;min-width:44px;padding:0;flex:none}
.cf-moves-dialog{width:min(480px,calc(100vw - 26px));padding:24px 20px;background:#132e32;border-color:#4c8a78}
.cf-moves-dialog h2{font-size:1.625rem;letter-spacing:-.02em;margin:0 42px 12px 0}
ol.cf-moves{padding:0;margin:0;overscroll-behavior:contain;max-height:55vh;max-height:55dvh}
ol.cf-moves li{line-height:1.35;padding:2px 0;overflow-wrap:anywhere}
ol.cf-moves .av.none,ol.cf-moves .t.none{visibility:hidden}
ol.cf-moves .t{width:30px;height:30px}
@media(max-width:440px){.cf-players{gap:4px}.cf-player-arrow{display:none}.cf-player .nm{font-size:10px}.cf-player .nm em{font-size:9px}.cf-player .tag{font-size:8px}.cf-moves-button{min-width:40px}.header-actions{gap:4px}}
@media(max-width:350px){.cf-player .nm em{display:block;text-align:center}.cf-player-tags{top:-10px}.cf-player .tag{letter-spacing:0;padding-inline:2px}}
@media(prefers-reduced-motion:reduce){.cf-player,.cf-player .tag.think{animation:none;transition:none}}

/* Played-tile cues adapted from Claude. Green sits opposite the gold dot. */
.cell.occupied.mine::before{
  content:"";position:absolute;left:3px;top:3px;width:6px;height:6px;
  border-radius:50%;background:#8ef0c8;box-shadow:0 0 0 1.5px #0b2228;
  z-index:3;pointer-events:none;
}
.connection-spark{
  position:absolute;width:clamp(9px,calc(var(--cell) * .35),16px);
  aspect-ratio:1;border-radius:50%;translate:-50% -50%;z-index:4;pointer-events:none;
  background:radial-gradient(circle,#fff 0 22%,#ffd36b 38%,rgba(255,120,60,.55) 55%,rgba(59,183,239,0) 72%);
  animation:connectionSpark .9s ease-out both;
}
.connection-spark.edge-0{left:50%;top:0}
.connection-spark.edge-1{left:100%;top:50%}
.connection-spark.edge-2{left:50%;top:100%}
.connection-spark.edge-3{left:0;top:50%}
@keyframes connectionSpark{
  0%{transform:scale(.2);opacity:0}
  25%{transform:scale(1.6);opacity:1}
  100%{transform:scale(.9);opacity:0}
}
@media (max-width:600px){
  .cell.occupied.mine::before{left:2px;top:2px;width:4px;height:4px}
}
@media (prefers-reduced-motion:reduce){
  .cell.just-played{animation:none}
  .connection-spark{animation-name:connectionFade}
}
@keyframes connectionFade{0%,40%{opacity:.88}100%{opacity:0}}

/* Claude home screen, scoped so the game board keeps its original styling. */
#cf-home .hdr{flex:none;height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 14px}#cf-home .logo{height:24px;width:auto;filter:invert(1);opacity:.95;display:block}#cf-home .hbtns{display:flex;gap:8px;align-items:center}#cf-home .ibtn{width:38px;height:38px;border-radius:12px;background:rgba(255,255,255,.06);border:1px solid var(--line);display:grid;place-items:center;font-weight:700;color:var(--mute);font-size:16px}



:is(#cf-home,.cf-home-dialog) .btn{display:grid;place-items:center;height:48px;border-radius:14px;font-weight:700;font-size:15px;border:1px solid var(--line);background:rgba(255,255,255,.06);width:100%}:is(#cf-home,.cf-home-dialog) .btn.pri{background:var(--mint);color:#0b2228;border:none}:is(#cf-home,.cf-home-dialog) .btn.ghost{background:transparent;color:var(--mute)}

#cf-home .home-body{flex:1;overflow:auto;padding:0 16px 90px;max-width:560px;width:100%;margin:0 auto}#cf-home .hero{padding:8px 2px 0}#cf-home .hero h1{font-size:34px;line-height:1.08;letter-spacing:-.02em;font-weight:750}#cf-home .hero .f{color:var(--fire)}#cf-home .hero .w{color:var(--water)}#cf-home .hero .tag{color:var(--mute);margin-top:8px;font-size:14.5px}#cf-home .streak{display:inline-flex;margin-top:12px;padding:6px 12px;border-radius:20px;background:rgba(255,106,61,.14);border:1px solid rgba(255,106,61,.4);font-weight:700;font-size:13px;color:#ffb59c}#cf-home .card{margin-top:16px;border-radius:22px;padding:18px;border:1px solid var(--line);position:relative;overflow:hidden}#cf-home .card.daily{background:linear-gradient(140deg,#20605a 0%,#174149 55%,#123139 100%);border-color:rgba(142,240,200,.35)}#cf-home .card.quick{background:rgba(255,255,255,.04)}#cf-home .card .k{font-size:11px;font-weight:700;letter-spacing:.1em;color:var(--mint);text-transform:uppercase}#cf-home .card .k.mute{color:var(--mute)}#cf-home .card h2{font-size:26px;margin:4px 0 4px;font-weight:750}#cf-home .card p{font-size:14px;line-height:1.4;color:#b9d1cb;max-width:58%}#cf-home .card .btn{margin-top:14px}#cf-home .card .art{position:absolute;--art-tile-size:clamp(26px,8.5vw,36px);right:16px;top:24px;display:grid;grid-template-columns:repeat(2,var(--art-tile-size));gap:3px;transform:rotate(7deg);pointer-events:none}#cf-home .card .art div{width:var(--art-tile-size);height:var(--art-tile-size);border-radius:4px;overflow:hidden;box-shadow:0 3px 0 #6d5232,0 6px 10px rgba(0,0,0,.35)}#cf-home .card .art img{width:100%;height:100%;display:block}#cf-home .daily-done{display:flex;align-items:center;gap:12px;margin-top:14px}#cf-home .daily-done .dres{flex:1;display:flex;flex-direction:column;gap:2px}#cf-home .daily-done .dres b{font-size:16px;color:var(--gold)}#cf-home .daily-done .dres span{font-size:12.5px;color:var(--mute)}#cf-home .daily-done .btn{width:auto;padding:0 22px;margin:0}#cf-home .seg{display:flex;background:rgba(0,0,0,.25);border-radius:12px;padding:3px;margin-top:10px}#cf-home .seg button{flex:1;padding:8px 0;border-radius:9px;font-weight:600;font-size:14px;color:var(--mute)}#cf-home .seg button small{display:block;font-size:10.5px;font-weight:500;opacity:.8}#cf-home .seg button.on{background:rgba(142,240,200,.16);color:var(--mint)}#cf-home .card.quick .btn{margin-top:12px}#cf-home .card.quick .btn.ghost{margin-top:6px;height:40px}#cf-home .row2{display:flex;gap:10px;margin-top:12px}#cf-home .mini{flex:1;text-align:left;border-radius:18px;background:rgba(255,255,255,.04);border:1px solid var(--line);padding:13px;display:flex;flex-direction:column;gap:3px}#cf-home .mini .ic{font-size:18px}#cf-home .mini b{font-size:15px}#cf-home .mini span{font-size:12.5px;line-height:1.35;color:var(--mute)}#cf-home .foot{position:static;width:100%;margin:14px 0 0;border-radius:16px;padding:11px 14px;border:1px dashed rgba(242,193,78,.45);display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:12.5px;color:var(--mute);background:rgba(10,31,36,.85);backdrop-filter:blur(6px)}#cf-home .foot b{color:var(--gold);white-space:nowrap}#cf-home .foot.static{position:static;margin-top:14px}



#cf-home{--mint:#8ef0c8;--gold:#f2c14e;--mute:#9ab8b1;--fire:#ff6a3d;--water:#3bb7ef;
  min-height:100vh;min-height:100dvh;max-width:1180px;margin:0 auto;
  font-family:"Segoe UI",system-ui,-apple-system,sans-serif;color:#eef6f2}
body:has(#cf-home:not([hidden])){background:radial-gradient(120% 60% at 50% 0%,#18444d 0%,#0f2b31 45%,#0a1f24 100%) fixed}
#cf-home .home-body{overflow:visible;padding-bottom:24px}
#cf-home .hero h1{outline:none}
#cf-home .hero .tag{position:static}
#cf-home button{color:inherit}
#cf-home .hdr{position:sticky;top:0;z-index:5;background:#0f2b31e8;backdrop-filter:blur(6px)}
#cf-home .ibtn{color:var(--mute)}
#cf-home .seg button{border:0;background:transparent;color:var(--mute);min-height:44px;padding:6px 4px}
#cf-home .seg button.on{background:#8ef0c829;color:var(--mint)}
#cf-home .seg button small{font-size:.75rem}
#cf-home .foot{text-align:left;color:var(--mute)}
#cf-home .foot b{white-space:normal}
/* The record spans the Quick Game card, unlike the art-constrained Daily Deal copy. */
#cf-home .card.quick .stats-line{width:100%;max-width:none;margin:10px auto 0;text-align:center;font-size:.8125rem}
#cf-home .daily .k,#cf-home .daily h2,#cf-home .daily p,#cf-home .daily .btn,#cf-home .daily .dres{position:relative}
#cf-home .daily p{max-width:calc(100% - 105px)}
#cf-home .card .art .tile-image{width:100%;height:100%}
#cf-home .mini .ic{color:#eef6f2}
#cf-home .daily-done .btn{width:auto}
body:has(#cf-home:not([hidden])) .offline-footer{display:none}
.cf-home-dialog{--mint:#8ef0c8;--mute:#546662;--line:#33434c33}
.cf-home-dialog .btn{text-decoration:none;margin-top:10px}
.cf-home-dialog .btn:not(.pri){background:#15323b0c;color:#15323b}
.cf-home-dialog .fine{margin-top:10px}
.cf-home-dialog .learn{display:grid;gap:14px;list-style:none;padding:0}
.cf-home-dialog .learn li{display:flex;align-items:center;gap:10px}
.cf-home-dialog .learn li div{display:grid;gap:3px}
.cf-home-dialog .learn li div span{font-size:.875rem}
.cf-home-dialog .lt{flex:none;width:44px;height:44px}
.cf-home-dialog .lt img{width:100%;border-radius:4px}
.cf-home-dialog .lt.gold img{outline:2px solid #c28b17}
.cf-game-nav{display:flex;align-items:center;min-width:0;gap:9px}
.cf-back-home{display:grid;place-items:center;flex:none;padding:7px}
.cf-mode-pill{white-space:nowrap;border:1px solid #8ef0c84d;background:#8ef0c814;color:#8ef0c8;padding:4px 8px;border-radius:20px;font-size:.75rem}
@media(max-width:560px){
  #game-header{gap:5px;padding-left:7px;padding-right:7px}
  #game-header .header-actions{gap:2px}
  #game-header .brand{width:clamp(49px,16vw,92px)}
  .cf-game-nav{gap:3px}
  .cf-back-home{padding:4px}
  .cf-mode-pill{padding:3px 5px}
}

/* Compact opening viewport; existing maximum heights remain the ceiling. */
#game .board-viewport{min-height:0;overflow-anchor:none}

/* Keep illegal opening tiles dim through the deal animation and on selection. */
.opening-hand .hand-tile.unplayable{--dealt-opacity:.48;opacity:var(--dealt-opacity)}

/* Legend and one turn card sit together inside the board panel. */
.play-surface>.turn-strip{margin-top:10px}

/* Claude-style phone toolbar; desktop keeps its text labels. */
#game-header .cf-mobile-icon{display:none}
#sound-button[aria-pressed="true"] .cf-sound-off,
#sound-button[aria-pressed="false"] .cf-sound-on{display:none}
@media(max-width:560px){
  #game-header{height:auto;min-height:58px;flex-wrap:nowrap;justify-content:space-between;padding:6px;gap:2px}
  #game-header .brand,#game-header .cf-desktop-label{display:none}
  #game-header .cf-game-nav,#game-header .header-actions{gap:2px}
  #game-header .cf-game-nav{min-width:0}
  #game-header .cf-mode-pill{min-width:0;overflow:hidden;text-overflow:ellipsis}
  #game-header .cf-mobile-icon{display:block;font-size:1.35rem;font-weight:750;line-height:1}
  #game-header button{display:grid;place-items:center;flex:none;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border:1px solid #ffffff29;border-radius:13px;background:#ffffff09;color:var(--muted)}
  #game-header button:hover,#game-header button[aria-pressed="true"]{color:var(--ink);background:#ffffff12}
}

#cf-home a.foot{text-decoration:none;min-height:44px}
#cf-home a.foot:hover b,#cf-home a.foot:focus-visible b{text-decoration:underline}

#learn-skip{margin-top:.55rem}
.count-privacy-footer{max-width:560px;margin:0 auto;padding:12px 16px 24px;color:var(--muted);font-size:.875rem;line-height:1.45}
.count-privacy-footer details{margin:.45rem 0}
.count-privacy-footer summary{cursor:pointer}
.count-privacy-footer details p{margin:.45rem 0}
.count-privacy-footer [data-meta-opt-out]{border:1px solid #a9e5ce77;border-radius:.6rem;padding:.55rem .75rem;background:#17363b;color:var(--ink)}
#result-dialog .physical-game-link{display:inline-block;padding:.65rem 0;color:var(--accent)}
#share-dialog input{width:100%;margin:.5rem 0 1rem;padding:.65rem}
/* Practice dialogs sit on a dark surface, unlike the older light dialog theme. */
#practice-done,#learn-dialog{--mute:#b9d6cf;--line:#7ca39980}
#practice-done .btn:not(.pri),#learn-dialog .btn:not(.pri){background:#1d4349;color:#eef6f2;border:1px solid #91b8ad}
#practice-done .btn.keep-practice{background:transparent;color:#d2e7e0;border-color:#7ca39980}
#practice-done .practice-choice-note{font-size:.875rem;line-height:1.35;margin:.3rem 0 .55rem;color:#b9d6cf}
#practice-done .stack{margin-top:.35rem}

/* Practice introduction: show each example before its short rule. */
#learn-dialog .practice-rules {
  margin: 1rem 0 .9rem;
  gap: 1rem;
}
#learn-dialog .practice-rules li {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: .4rem;
  line-height: 1.25;
  font-size: 1.05rem;
}
#learn-dialog .practice-rule-pair {
  display: flex;
  gap: 0;
  width: min(100%, 8.5rem);
  border-radius: .22rem;
  overflow: hidden;
}
#learn-dialog .practice-rule-pair img {
  display: block;
  width: 50%;
  height: auto;
  aspect-ratio: 1;
}
#learn-dialog .practice-rule-trophy {
  width: 3.25rem;
  height: 3.25rem;
}
#learn-dialog .btn {
  height: auto;
  min-height: 48px;
  padding: .52rem .7rem;
  text-align: center;
  line-height: 1.2;
}
@media (max-height: 650px) {
  #learn-dialog { padding-block: 16px; }
  #learn-dialog .practice-rules { margin-block: .65rem; gap: .65rem; }
  #learn-dialog .practice-rule-pair { width: min(100%, 7rem); }
  #learn-dialog .practice-rule-trophy { width: 2.65rem; height: 2.65rem; }
}
@media (max-height: 650px) {
  #learn-dialog .dialog-close-bar {
    position: absolute;
    inset: 12px 12px auto auto;
    margin: 0;
  }
  #learn-dialog .kick, #learn-dialog h2 { padding-inline-end: 54px; }
}

/* A persistent scroll indicator, including on iOS where native bars fade. */
#rules-dialog{padding:0;overflow:hidden}
.rules-scrollpane{overflow:auto;overscroll-behavior:contain;scrollbar-width:none;padding:38px;max-height:calc(100vh - 42px);max-height:calc(100dvh - 42px)}
.rules-scrollpane:focus{outline:none}
.rules-scrollpane::-webkit-scrollbar{display:none}
.rules-scrollpane>.primary-button{width:100%;margin-top:24px}
.rules-scroll-track{position:absolute;inset:16px 8px 16px auto;width:5px;border-radius:999px;background:#a9e5ce29;pointer-events:none}
.rules-scroll-track>span{position:absolute;inset:var(--rules-thumb-top,0) 0 auto;display:block;height:var(--rules-thumb-height,24px);border-radius:inherit;background:#aadfce}
/* Highlight the scrollbar itself for keyboard focus, not the content area. */
.rules-scrollpane:focus-visible + .rules-scroll-track>span{background:#f4cf88}
@media(max-width:560px){.rules-scrollpane{padding:30px 23px}}
