:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#303c33;background:#faf8f4;font-synthesis:none;--sage:#526b59;--light:#eaf0e9;--rose:#f3e6e3;--line:#dce1d8;--muted:#606a62}*{box-sizing:border-box}body{margin:0;font-size:16px;line-height:1.55}header,main,footer{max-width:1180px;margin:auto;padding:24px 32px}header{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:16px}.brand{font-weight:700;text-decoration:none;font-size:20px;color:var(--sage)}.brand span{font-weight:400;margin-left:8px}nav{display:flex;align-items:center;gap:20px}a{color:var(--sage);text-underline-offset:4px}h1{font-size:clamp(28px,4vw,46px);line-height:1.2;letter-spacing:-1px;margin:12px 0 18px;font-weight:650}h2{font-size:22px;line-height:1.3;margin:0 0 16px;font-weight:650}h3{font-size:17px;margin:12px 0}p{margin:0 0 18px}small,.muted{color:var(--muted);font-size:14px}.eyebrow{color:var(--sage);font-size:14px;font-weight:600;margin-bottom:16px}.hero{padding:40px 0 28px;max-width:700px}.hero p:last-child{max-width:600px;color:var(--muted)}.panel{padding:26px;border:1px solid var(--line);border-radius:14px;background:#fffefa;margin-bottom:22px}.narrow{max-width:650px;margin:32px auto}.hero+.narrow{margin-left:0}.page-head,.section-head{display:flex;justify-content:space-between;align-items:center;gap:20px}.page-head{margin:22px 0 28px}.page-head p{margin-bottom:0}.section-head span{font-size:14px;color:var(--muted)}.tag{display:inline-block;padding:5px 12px;background:var(--light);color:#405346;font-size:13px;border-radius:30px}.banner{background:var(--rose);padding:26px;border-radius:14px;margin-bottom:24px}.banner p:last-child{margin:0}.game-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.game-link{display:block;text-decoration:none;color:inherit;margin:0}.game-link h2{margin-top:18px}.game-link:hover{border-color:var(--sage)}form{display:grid;gap:20px}label{display:grid;gap:8px;font-size:14px;font-weight:600}input,select,textarea{font:inherit;font-weight:400;font-size:16px;color:inherit;width:100%;min-width:0;padding:12px;border:1px solid #b9c4b9;border-radius:7px;background:#fff}textarea{resize:vertical;line-height:1.6}input[readonly]{background:#f5f7f2;font-size:14px}select{padding-right:36px;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 7 5 5 5-5' fill='none' stroke='%23526b59' stroke-width='2'/%3E%3C/svg%3E");background-size:18px;background-position:right 12px center;background-repeat:no-repeat}.check{display:flex;align-items:center;gap:10px;font-weight:400}.check input{width:19px;height:19px;flex-shrink:0;accent-color:var(--sage)}button{font:inherit;font-weight:600;font-size:14px;border-radius:8px;border:1px solid #bcc8bc;padding:11px 16px;background:var(--light);color:#344d3b;cursor:pointer;min-height:44px}button:hover:not(:disabled){background:#dfe8de}button.primary{background:var(--sage);border-color:var(--sage);color:white}button.primary:hover:not(:disabled){background:#405b48}.danger{background:#f7eeeb;color:#793e3b;border-color:#d8bcb5}.text-button{background:none;border:none}button:disabled{opacity:.55;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #a57874;outline-offset:3px}.busy button:not(#close-modal){cursor:wait;pointer-events:none}.form-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.editor{grid-template-columns:1fr 1fr;align-items:start}.editor .panel{display:grid;gap:18px}.editor p{margin:0}.editor details{border-top:1px solid var(--line);padding-top:16px}details>summary{cursor:pointer;font-weight:600;margin-bottom:12px}details p{margin-top:12px}details button{margin-top:12px}.play-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:24px}.board-scroll{overflow-x:auto;margin-bottom:22px;padding:3px}.board{display:grid;gap:8px}.cols-2{grid-template-columns:repeat(2,minmax(110px,1fr))}.cols-3{grid-template-columns:repeat(3,minmax(110px,1fr))}.cols-4{grid-template-columns:repeat(4,minmax(110px,1fr))}.cols-5{grid-template-columns:repeat(5,minmax(110px,1fr))}.cols-6{grid-template-columns:repeat(6,minmax(110px,1fr))}.cols-7{grid-template-columns:repeat(7,minmax(110px,1fr))}.cols-8{grid-template-columns:repeat(8,minmax(110px,1fr))}.cell{background:#f7f7f1;min-height:126px;padding:12px 8px;display:flex;flex-direction:column;justify-content:space-between;gap:14px;text-align:left;overflow-wrap:anywhere;font-weight:500}.cell small{font-size:12px}.cell.marked{background:#dce8dc;border-color:#7d967f}.cell.marked small{color:#36563c}.cell:disabled{opacity:1}.players{display:grid;gap:8px}.players button{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:left;background:transparent}.players small{font-size:13px}.request{border-top:1px solid var(--line);padding:8px 0 16px}.request ul{padding-left:20px;font-size:14px}.actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}.field-preview{max-height:280px;overflow:auto;font-size:14px;padding-left:22px}.notice{padding:14px 18px;background:var(--light);border-radius:8px;margin-bottom:20px}.notice.error{background:#f9e7e1;color:#83392b}.success{background:var(--light);padding:12px;border-radius:8px}.error-text{color:#83392b;margin-top:14px}.error-text:empty{display:none}dialog{width:min(640px,calc(100% - 28px));max-height:88dvh;overflow:auto;border:1px solid var(--line);border-radius:14px;padding:24px;color:inherit;background:#fffefa}dialog::backdrop{background:#263a2d70}.dialog-head{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;margin-bottom:20px}.dialog-head h2{overflow-wrap:anywhere;margin:0}.dialog-head button{padding:4px 12px;font-size:24px;flex-shrink:0}.gallery{display:grid;gap:24px}.gallery figure{margin:0}.gallery img,.cell-photo{display:block;width:100%;max-height:440px;object-fit:contain;border-radius:8px;background:var(--light)}figcaption{margin-top:8px}.missing-photo{min-height:80px}footer{text-align:center;color:var(--muted);font-size:13px;padding-top:40px;padding-bottom:36px} @media(max-width:900px){.play-layout{grid-template-columns:1fr}.editor{grid-template-columns:1fr}.page-head{align-items:flex-start}.board-panel{min-width:0}}@media(max-width:600px){header,main,footer{padding:18px 16px}header{align-items:flex-start}.brand{font-size:18px}.brand span{display:block;margin:0;font-size:14px}nav{gap:12px;font-size:14px}.panel{padding:18px}.page-head{display:block}.page-head>button{margin-top:18px}.game-list{grid-template-columns:1fr}.form-row{gap:10px;grid-template-columns:1fr 1fr}.form-row label:last-child{grid-column:1/-1}.section-head{align-items:flex-start;flex-direction:column;gap:0}.cell{min-height:112px}.hero{padding-top:24px}.narrow{margin:22px auto}dialog{padding:18px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
:root[data-palette="rose"]{background:#fdf6f5;--light:#f5e4e5;--rose:#f2dfd8;--line:#e5d7d7}
:root[data-palette="lavender"]{background:#f8f6fc;--light:#eee7f7;--rose:#f2e4ee;--line:#dfd9e8}
:root[data-palette="ocean"]{background:#f3f8fc;--light:#e0edf5;--rose:#f0e6ee;--line:#d3dfe8}
:root[data-accent="green"]{--sage:#385c45;--accent-hover:#294b35;--marked-bg:#c2e8d1;--marked-border:#34734e;--marked-text:#173e28}
:root[data-accent="berry"]{--sage:#883b59;--accent-hover:#6f2946;--marked-bg:#f5d4df;--marked-border:#9b4764;--marked-text:#60223a}
:root[data-accent="blue"]{--sage:#285d83;--accent-hover:#174769;--marked-bg:#cce3f5;--marked-border:#32658a;--marked-text:#193e59}
:root[data-accent="violet"]{--sage:#67458a;--accent-hover:#503170;--marked-bg:#d6d5f6;--marked-border:#6b58a0;--marked-text:#3e2b69}
button.primary:hover:not(:disabled){background:var(--accent-hover,#405b48)}
.brand{display:flex;align-items:center;gap:12px}.brand .brand-title{font-weight:700;margin:0}.brand .brand-title>span{font-size:14px;font-weight:400;margin:0 0 0 8px}.brand-logo{width:52px;height:52px;object-fit:contain;border-radius:8px}.logo-preview{max-width:180px;max-height:120px;object-fit:contain}
.board .cell{position:relative;isolation:isolate;min-height:140px}
.board .cell.marked,.design-preview .cell.marked{background:var(--marked-bg,#c2e8d1);border:2px solid var(--marked-border,#34734e);color:var(--marked-text,#173e28);box-shadow:inset 0 0 0 1px #fff9;font-weight:650;padding-top:52px}
.board .cell.marked:hover{filter:brightness(.96)}
.board .cell.marked small,.design-preview .cell.marked small{color:inherit;font-size:13px;font-weight:700;border-top:1px solid currentColor;padding-top:7px}
.cell-check{position:absolute;right:10px;top:10px;width:30px;height:30px;display:grid;place-items:center;background:#fff;color:inherit;border:2px solid currentColor;border-radius:50%;font-size:21px;font-weight:800;line-height:1}
.design-preview{padding:18px;border:1px solid var(--line);border-radius:10px;background:var(--light)}.design-preview .cell{position:relative;max-width:230px;margin-bottom:14px;min-height:140px}.design-preview p{margin:8px 0 14px}
.design-preview .cell{border-radius:8px;padding-left:12px;padding-right:12px}
.game-summary{margin-bottom:0}.game-summary .game-link{margin-bottom:18px}.game-summary .game-link h2{margin-top:18px}aside>[data-delete]{display:block;margin-top:16px}
@media(max-width:600px){nav{flex-wrap:wrap;justify-content:flex-end;gap:6px 12px}nav button{padding:5px;min-height:38px}.brand-logo{width:38px;height:38px}.brand .brand-title>span{display:block;margin:0}.board .cell{min-height:140px}}

/* Phone-first layout, including iPhone safe areas and dynamic browser chrome. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scrollbar-gutter:stable}
body{min-height:100svh;display:flex;flex-direction:column;overflow-wrap:break-word}
header,main,footer{width:100%}main{flex:1;min-width:0}header{padding-top:max(20px,env(safe-area-inset-top));padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}footer{padding-bottom:max(24px,env(safe-area-inset-bottom))}
button,a,input,select,textarea,summary{-webkit-tap-highlight-color:transparent}button,summary{touch-action:manipulation}
button,summary{min-height:48px}input,select,textarea{font-size:16px}input[type=file]{max-width:100%;font-size:14px;padding:10px 6px}input[type=file]::file-selector-button{font:inherit;padding:10px;border:1px solid var(--line);border-radius:6px;margin-right:8px;background:var(--light);color:inherit}
input[type=number]{min-width:0}img{max-width:100%}.page-head h1{overflow-wrap:anywhere}.brand{min-width:0}.brand-title{overflow-wrap:anywhere}.panel,aside,.editor>*{min-width:0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.touch-hint{display:none}.modal-open{overflow:hidden}
.board-swipe-hint{display:none;margin-top:8px;color:var(--sage);font-weight:600}
@media(hover:none) and (pointer:coarse){.board-swipe-hint{display:block}}
.footer-mosquito{display:inline-block;font-size:.85em;vertical-align:baseline;margin-left:2px}
.play-layout>div{min-width:0}.board-scroll{width:100%;min-width:0}.board{min-width:0}
@media(max-width:900px){.play-layout{grid-template-columns:minmax(0,1fr)}}
dialog{max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overscroll-behavior:contain;scroll-padding-top:76px;-webkit-overflow-scrolling:touch}
dialog .dialog-head{position:sticky;top:-24px;z-index:3;background:#fffefa;padding:10px 0;border-bottom:1px solid var(--line)}dialog input,dialog textarea{scroll-margin-block:85px}dialog .dialog-head button{min-width:48px}
.board .cell{touch-action:pan-x pan-y pinch-zoom;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;transition:background-color .15s,border-color .15s}
.board .cell.holding::after{content:"";position:absolute;left:6px;right:6px;bottom:4px;height:5px;border-radius:4px;background:var(--sage);transform-origin:left;animation:hold-fill 1s linear forwards;pointer-events:none}
.board .cell.holding{outline:3px solid var(--sage);outline-offset:1px}
@keyframes hold-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media(pointer:coarse){.touch-hint{display:inline}.mouse-hint{display:none}nav a,nav button{min-height:48px;display:inline-flex;align-items:center}.board .cell{font-size:14px}.check{min-height:48px}}
@media(max-width:600px){
  header{gap:12px;flex-wrap:wrap;padding:14px max(14px,env(safe-area-inset-right)) 14px max(14px,env(safe-area-inset-left));padding-top:max(14px,env(safe-area-inset-top))}
  header .brand{flex:1 1 160px}nav{gap:4px;max-width:100%}nav a,nav button{font-size:14px;padding:8px 10px;min-height:48px;display:inline-flex;align-items:center}
  main{padding:16px max(12px,env(safe-area-inset-right)) 16px max(12px,env(safe-area-inset-left))}.panel{padding:16px;border-radius:12px;margin-bottom:16px}.play-layout{gap:16px}.page-head{margin:8px 0 20px}h1{font-size:30px;letter-spacing:-.6px}h2{font-size:21px}
  .board-panel{padding:12px}.board{gap:6px}.board-scroll{margin:12px 0 18px;overscroll-behavior-x:contain}.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.cols-4{grid-template-columns:repeat(4,minmax(90px,1fr))}
  .cols-5{grid-template-columns:repeat(5,minmax(90px,1fr))}.cols-6{grid-template-columns:repeat(6,minmax(90px,1fr))}.cols-7{grid-template-columns:repeat(7,minmax(90px,1fr))}.cols-8{grid-template-columns:repeat(8,minmax(90px,1fr))}
  .board .cell{font-size:14px;line-height:1.4;min-height:126px;padding:10px 7px;hyphens:auto}.board .cell.marked{padding-top:44px}.board .cell small{font-size:12px}.board .cell-check{width:26px;height:26px;font-size:18px;top:8px;right:8px}.actions{gap:10px}.actions>button{flex:1 1 150px}
  .form-row{grid-template-columns:1fr 1fr}form{gap:16px}.players button{min-height:64px}.hero{padding:20px 0}.narrow{margin:12px auto}.notice{padding:12px;margin-bottom:14px}
  dialog{width:calc(100% - 16px);max-width:560px;padding:16px;border-radius:16px;max-height:calc(100vh - 24px);max-height:calc(100dvh - max(24px,env(safe-area-inset-top)) - env(safe-area-inset-bottom));margin:auto}
  dialog .dialog-head{top:-16px;padding-top:8px;padding-bottom:10px;gap:10px}dialog h2{font-size:21px}.cell-photo,.gallery img{max-height:48dvh}dialog .actions{display:grid;grid-template-columns:1fr}.gallery{gap:18px}dialog .form-row{grid-template-columns:1fr}.design-preview{padding:12px}
}
@media(max-width:359px){header .brand{flex-basis:100%}nav{justify-content:flex-start}.board .cols-4{gap:4px}.cols-4 .cell{font-size:13px;padding-left:4px;padding-right:4px}}
@media(prefers-reduced-motion:reduce){.board .cell{transition:none}.board .cell.holding::after{animation:none;transform:none}}

/* Compact game variant. Keep touch targets and horizontal board scrolling. */
/* Community content is always plain text; images are fetched with authorization. */
.community-links{display:grid;gap:6px}.community-links button{text-align:left}
.community-nav [role=status]{font-weight:400}
.community-view{min-width:0}.community-view form{margin:18px 0}
.community-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.community-post{padding:18px 0;border-bottom:1px solid var(--line)}
.community-byline{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px;margin-bottom:8px}
.community-byline time{font-size:12px;color:var(--muted)}
.community-text{white-space:pre-wrap;overflow-wrap:anywhere}
.community-photo{display:block;max-width:100%;width:auto;max-height:420px;object-fit:contain;margin:12px 0;border-radius:5px}
.profile-photo{display:block;width:112px;height:112px;object-fit:cover;border-radius:50%;margin:12px 0}
.reactions{display:flex;flex-wrap:wrap;gap:4px;margin-top:12px}
.reactions button{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:32px;min-height:32px;padding:4px;border:0;background:transparent;box-shadow:none;font-size:13px;font-weight:400}
.reactions button:hover:not(:disabled),.reactions button[aria-pressed=true]{background:transparent;border:0}
.reactions button span{font-size:11px;color:var(--muted)}
.reactions button[aria-pressed=true]::after{content:"";position:absolute;bottom:2px;left:calc(50% - 2px);width:4px;height:4px;border-radius:50%;background:var(--sage)}
@media(pointer:coarse){.reactions button{min-width:48px;min-height:48px}}
.attachment{border-block:1px solid var(--line);padding-block:8px}.attachment label{margin-bottom:12px}
.attachment summary{display:flex;align-items:center;margin:0}
.direct-message{margin:12px 24px 12px 0;padding:12px;border-left:3px solid var(--line);background:#fff}
.own-message{margin:12px 0 12px 24px;border-color:var(--sage);background:var(--light)}
#community-update:not(:empty){padding:10px;background:var(--light);margin-bottom:12px;font-size:14px}
@media(max-width:600px){.community-photo{max-height:45dvh}.community-links{grid-template-columns:1fr 1fr}.community-links button:last-child{grid-column:1/-1}.reactions{gap:3px}}
.compact-ui header,.compact-ui main,.compact-ui footer{max-width:1280px}
.compact-ui header{padding-block:12px}
.compact-ui main{padding-top:20px}
.compact-ui h1{font-size:28px;letter-spacing:-.4px;margin:4px 0 8px}
.compact-ui h2{font-size:18px;margin-bottom:12px}
.compact-ui p{margin-bottom:12px}
.compact-ui .brand{font-size:18px}
.compact-ui .brand-logo{width:36px;height:36px}
.compact-ui .panel{padding:18px 0;border:0;border-radius:0;background:transparent;margin-bottom:12px;border-bottom:1px solid var(--line)}
.compact-ui .page-head{margin:0 0 20px;align-items:center}
.compact-ui .page-head p{font-size:14px;color:var(--muted)}
.compact-ui .tag{padding:2px 8px;border-radius:4px}
.compact-ui .hero{padding:20px 0 8px}
.compact-ui .narrow{max-width:560px;margin:16px auto}
.compact-ui .hero+.narrow{margin-left:0}
.compact-ui .play-layout{grid-template-columns:minmax(0,1fr) 270px;gap:32px}
.compact-ui .board-panel{padding-top:0;border-bottom:0}
.compact-ui .section-head{flex-direction:row;align-items:center;gap:12px}
.compact-ui .section-head h2{margin:0}
.compact-ui .board-panel>.muted{font-size:13px;margin-top:8px}
.compact-ui .board-scroll{margin:12px 0 16px;padding:3px}
.compact-ui .board{gap:6px}
.compact-ui .board .cell{min-height:116px;border-radius:5px;background:#fffefa}
.compact-ui .board .cell.marked{background:var(--marked-bg,#c2e8d1);box-shadow:none;padding-top:38px}
.compact-ui .board .cell-check{width:23px;height:23px;font-size:16px;top:7px;right:7px}
.compact-ui .board .cell.marked small{border-top:0;padding-top:0}
.compact-ui aside .panel:first-child{padding-top:0}
.compact-ui aside .panel>p,.compact-ui aside label{font-size:13px}
.compact-ui .players{gap:0}
.compact-ui .players button{border:0;border-top:1px solid var(--line);border-radius:0;padding:10px 2px;min-height:58px}
.compact-ui .players button:first-child{border-top:0}
.compact-ui .players button:hover{background:var(--light)}
.compact-ui .players small{font-weight:400}
.compact-ui button,.compact-ui input,.compact-ui select,.compact-ui textarea{border-radius:5px}
.compact-ui .game-list{display:block}
.compact-ui .game-summary{display:flex;align-items:center;justify-content:space-between;gap:20px}
.compact-ui .game-summary .game-link{flex:1;min-width:0;margin:0}
.compact-ui .game-summary .game-link h2{margin:8px 0 4px}
.compact-ui .game-summary p{margin:0;font-size:14px}
.compact-ui .banner{padding:16px;border-radius:5px}
.compact-ui .editor{gap:32px}
.compact-ui footer{padding-top:24px}
@media(max-width:900px){
  .compact-ui .play-layout{grid-template-columns:minmax(0,1fr);gap:16px}
  .compact-ui aside{border-top:1px solid var(--line);padding-top:20px}
}
@media(max-width:600px){
  .compact-ui header{padding-block:10px}
  .compact-ui main{padding-top:16px}
  .compact-ui h1{font-size:25px}
  .compact-ui h2{font-size:18px}
  .compact-ui .page-head{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:16px}
  .compact-ui .page-head>button{margin-top:0}
  .compact-ui .panel{padding-block:14px}
  .compact-ui .board-panel{padding:0}
  .compact-ui .board .cell{min-height:108px;font-size:14px}
  .compact-ui .board .cell.marked{padding-top:36px}
  .compact-ui .game-summary{gap:12px;flex-wrap:wrap}
  .compact-ui .game-summary>button{margin-left:auto}
  .compact-ui .hero{padding-top:12px}
}

/* Three themed areas; readable single-column flow on phones. */
.compact-ui header,.compact-ui main,.compact-ui footer{max-width:1440px}
.compact-ui .play-layout{grid-template-columns:210px minmax(0,1fr) 300px;grid-template-areas:"group board forum";gap:24px;align-items:start}
.board-column{grid-area:board;min-width:0}
.group-sidebar{grid-area:group;min-width:0}
.forum-sidebar{grid-area:forum;min-width:0;position:sticky;top:16px;max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}
.compact-ui .forum-sidebar>.panel{padding-top:0;border-bottom:0}
.forum-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;flex-wrap:wrap}
.forum-heading h2{margin:0}.forum-heading [role=status]{display:block;font-size:12px;font-weight:400;color:var(--muted)}
.forum-heading button{padding:8px 10px}
.forum-latest .community-post{padding-top:8px}
.forum-latest .community-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6;overflow:hidden;font-size:14px}
.forum-latest .community-photo{max-height:150px;width:100%;object-fit:contain}
.forum-latest .community-byline{font-size:14px;display:block}
.forum-latest .community-byline time{display:block;margin-top:3px}
.forum-latest .reactions{gap:3px}
.forum-latest .reactions button{min-width:32px;padding:4px;flex:0 0 auto}
@media(pointer:coarse){.forum-latest .reactions button{min-width:48px;min-height:48px}}
.forum-more{border-bottom:1px solid var(--line);padding-top:10px}
.forum-more>summary{display:flex;align-items:center;gap:8px;margin:0}
.forum-more>summary::before{content:"▸"}.forum-more[open]>summary::before{content:"▾"}
.forum-older{display:grid;gap:0;max-height:420px;overflow-y:auto}
.forum-older>button{display:grid;gap:4px;text-align:left;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent;padding:12px 2px;font-weight:400;min-width:0;overflow-wrap:anywhere}
.forum-older>button span{font-size:14px}.forum-older>button small{font-size:12px}
.compact-ui .group-sidebar>.community-nav{padding-top:0}
.account-menu{position:relative}
.account-menu>summary{display:flex;align-items:center;gap:6px;margin:0;min-height:48px;padding:8px 10px;font-size:14px;white-space:nowrap;color:var(--sage)}
.account-menu>summary::after{content:"▾"}
.account-popover{position:absolute;top:calc(100% + 4px);right:0;z-index:8;min-width:180px;padding:6px;background:#fffefa;border:1px solid var(--line);border-radius:5px;box-shadow:0 6px 18px #303c3314}
.account-popover>button{display:block;width:100%;text-align:left;border:0;background:transparent;margin:0;padding:10px}
.account-popover>button:hover{background:var(--light)}
.account-popover #account-game-actions>button{display:block;width:100%;text-align:left;margin:4px 0 0;padding:10px;font-size:13px}
.account-popover #account-game-actions:not(:empty){border-top:1px solid var(--line);margin-top:6px;padding-top:6px}
.account-popover #admin-game-links>button{display:block;width:100%;text-align:left;min-height:48px;margin:0;padding:10px;border:0;background:transparent;color:inherit}
.account-popover #admin-game-links>button:hover{background:var(--light)}
.account-popover #admin-game-links>button.danger{color:#793e3b}
.account-popover #admin-game-links:not(:empty){border-block:1px solid var(--line);margin-block:6px;padding-block:6px}
.game-rules{margin-top:14px}
.compact-ui .game-rules .rule-intro{font-size:14px;color:var(--muted);margin:0 0 8px}
.rule-summary{display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px}
.rule-options{display:flex;flex-wrap:wrap;gap:8px 18px;list-style:none;padding:0;margin:0}
.rule-options li{display:flex;align-items:center;gap:6px;padding:0;border:0;background:none;font-size:14px;font-weight:400;color:var(--muted)}
.rule-options svg{width:20px;height:20px;flex-shrink:0}
.rule-square{fill:none;stroke:var(--muted);stroke-opacity:.25;stroke-width:1}
.rule-square.is-line{fill:var(--sage);fill-opacity:.7;stroke:var(--sage);stroke-opacity:.7}
@media(max-width:600px){.game-rules{margin-top:12px}.rule-options{gap:8px 14px}.rule-options li{font-size:13px}.rule-options svg{width:18px;height:18px}.rule-summary{gap:8px 12px}}
#admin-panel-content>.panel{border:0;padding:0;margin:0}
@media(max-width:1150px){
  .compact-ui .play-layout{grid-template-columns:minmax(0,1fr) 280px;grid-template-areas:"board forum" "group group";gap:24px}
  .compact-ui .group-sidebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px;border-top:1px solid var(--line);padding-top:18px}
  .compact-ui .group-sidebar>button{align-self:start;justify-self:start}
}
@media(max-width:760px){
  .compact-ui .play-layout{grid-template-columns:minmax(0,1fr);grid-template-areas:"board" "forum" "group";gap:20px}
  .compact-ui .forum-sidebar{position:static;max-height:none;overflow:visible;border-top:1px solid var(--line);padding-top:18px}
  .compact-ui .group-sidebar{display:block;padding-top:18px}
  .forum-latest .community-byline{display:flex}.forum-latest .community-byline time{margin:0}
  .forum-latest .community-photo{max-height:132px}.forum-latest .community-text{-webkit-line-clamp:4}
  .forum-latest .reactions{justify-content:flex-start}.forum-latest .reactions button{flex:0 0 auto;min-width:48px}
}
@media(max-width:600px){
  header #nav{width:100%;justify-content:flex-start;gap:2px}
  header #nav>a,header #nav>button,.account-menu>summary{padding:8px;font-size:13px}
  .account-menu .account-popover{right:auto;left:0}
  #administration .account-popover{right:0;left:auto;max-width:calc(100vw - 28px);max-height:calc(100dvh - 160px);overflow-y:auto}
}

/* Align the title to the board while preserving the sidebar start below it. */
.compact-ui .game-head{display:grid;grid-template-columns:210px minmax(0,1fr) 300px;gap:24px}
.game-head>div{grid-column:2;min-width:0;text-align:left}
.game-head .rule-summary,.game-head .rule-options{justify-content:flex-start}
@media(max-width:1150px){.compact-ui .game-head{grid-template-columns:minmax(0,1fr) 280px}.game-head>div{grid-column:1}}
@media(max-width:760px){.compact-ui .game-head{grid-template-columns:minmax(0,1fr);gap:0}}

/* Private photos fill completed tiles without stretching or changing layout. */
.board .cell{overflow:hidden}
.board .cell>.cell-photo-bg{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover;object-position:center;opacity:0;pointer-events:none;z-index:-1;border-radius:inherit}
.board .cell>.cell-photo-bg.is-loaded{opacity:.28}
.board .cell>span:not(.cell-check),.board .cell>small{position:relative;z-index:1}
.board .cell>.cell-check{z-index:2}

/* A photo replaces the accent fill; only the name, check and border use it. */
.compact-ui .board .cell.marked:has(>.cell-photo-bg){background:#fffefa;border-color:var(--sage);color:var(--muted)}
.board .cell.marked:has(>.cell-photo-bg)>span:not(.cell-check){color:var(--sage)}
.board .cell.marked:has(>.cell-photo-bg)>.cell-check{color:var(--sage)}
.board .cell.marked:has(>.cell-photo-bg)>small{color:var(--muted)}

dialog.profile-dialog{width:min(960px,calc(100% - 28px));max-width:960px}
.profile-layout{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:28px;align-items:start}
.profile-layout>section{min-width:0}.profile-layout h3{margin-top:0}
.profile-bio{padding-right:24px;border-right:1px solid var(--line)}
.profile-bio .profile-photo{margin-top:0}
.profile-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 12px}
.profile-thumbnail{display:block;min-width:0;padding:0;border:0;background:transparent;text-align:left;font-weight:400}
.profile-thumbnail:hover:not(:disabled){background:transparent}
.profile-thumbnail img{display:block;width:100%;aspect-ratio:1;object-fit:cover;border-radius:5px;background:var(--light)}
.profile-thumbnail span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-top:6px;font-size:13px;line-height:1.4}
#photo-back{margin-bottom:16px}
@media(max-width:600px){
  dialog.profile-dialog{width:calc(100% - 16px);max-width:none}
  .profile-layout{grid-template-columns:minmax(0,1fr);gap:20px}
  .profile-bio{padding-right:0;padding-bottom:16px;border-right:0;border-bottom:1px solid var(--line)}
  .profile-photo-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px}
}
@media(max-width:359px){.profile-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

.game-invitation p,.game-code p{font-size:14px;color:var(--muted)}
.game-code input[readonly]{font-family:monospace;letter-spacing:.06em}
.board .cell.saving{outline:2px dashed var(--sage);outline-offset:2px}
.board-preview{display:block;width:min(100%,280px);padding:0;margin:0 0 20px;border:0;background:transparent}
.shared-board{display:grid;gap:8px;width:100%}
.shared-board.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.shared-board.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.shared-board.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.shared-board.cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.shared-board.cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.shared-board.cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.shared-board.cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}
.shared-cell{position:relative;display:flex;flex-direction:column;justify-content:space-between;gap:10px;min-width:0;min-height:110px;padding:10px;border:1px solid var(--line);border-radius:5px;background:#fffefa;text-align:left;overflow:hidden;overflow-wrap:anywhere;font-size:14px}
.shared-cell.marked{border-color:var(--sage);background:var(--light);color:var(--sage)}
.shared-cell img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.28;pointer-events:none}
.shared-cell>span,.shared-cell>small{position:relative;z-index:1}.shared-cell>small{font-size:11px;color:var(--muted)}
.shared-board.miniature{gap:4px}.miniature .shared-cell{aspect-ratio:1;min-height:0;padding:3px;font-size:12px;align-items:center;justify-content:center;gap:0}
.miniature .shared-cell img{opacity:.5}
.shared-board-scroll{overflow-x:auto;margin-top:16px;overscroll-behavior-x:contain}
@media(max-width:600px){.shared-board:not(.miniature).cols-4{min-width:400px}.shared-board:not(.miniature).cols-5{min-width:500px}.shared-board:not(.miniature).cols-6{min-width:600px}.shared-board:not(.miniature).cols-7{min-width:700px}.shared-board:not(.miniature).cols-8{min-width:800px}}
.invitation-copy{display:flex;align-items:stretch;min-width:0;border:1px solid var(--line);border-radius:5px;background:#fffefa}
.invitation-copy input[readonly]{flex:1;min-width:0;width:0;min-height:48px;border:0;border-radius:5px 0 0 5px;background:transparent;font-size:14px}
.compact-ui .invitation-copy button{flex-shrink:0;min-height:48px;border:0;border-left:1px solid var(--line);border-radius:0 5px 5px 0;margin:0;padding:10px 12px}

.mobile-game-nav{display:none}
.draft-hint{font-size:13px;color:var(--muted);padding-top:12px}
.notice button,.error-text button{margin-top:8px;min-height:48px}
dialog .gallery img,dialog .cell-photo{max-height:min(480px,42dvh);width:auto;max-width:100%;object-fit:contain}
@media(max-height:500px){
  dialog{max-height:calc(100dvh - 16px);margin-block:auto}
  dialog .gallery img,dialog .cell-photo,.community-photo{max-height:38dvh}
  dialog .dialog-head{padding-block:6px}
}
@media(max-width:760px){
  body.has-game-nav{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  .mobile-game-nav{position:fixed;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));bottom:0;left:0;right:0;z-index:9;gap:2px;padding:6px max(6px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));background:#fffefa;border-top:1px solid var(--line)}
  .mobile-game-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:52px;gap:2px;padding:4px 2px;font-size:12px;border:0;border-radius:4px;background:transparent;touch-action:manipulation}
  .mobile-game-nav button[aria-current=true]{color:var(--sage);background:var(--light)}
  .mobile-game-nav span:not(:empty){font-size:10px;line-height:1.3;min-width:18px;padding:1px 4px;border-radius:4px;background:var(--sage);color:#fff}
  .board-column,.forum-sidebar,[data-player-list],.community-nav{scroll-margin-block:16px 90px}
  .keyboard-open .mobile-game-nav{display:none}
  input[readonly],.invitation-copy input[readonly]{font-size:16px}
  .reactions button{min-width:48px;min-height:48px}
  .brand{display:inline-flex;align-items:center;min-height:44px}
}
.keyboard-open dialog{position:fixed;top:calc(var(--visible-top,0px) + 8px);bottom:auto;margin-block:0;max-height:calc(var(--visible-height,100dvh) - 16px)}
