:root { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; color: #2b1d12; background: #fff8ef; }
* { box-sizing: border-box; }
body { max-width: 1240px; margin: auto; padding: 28px 32px; }
body.playing { max-width: 1500px; }
.playing header .eyebrow, .playing header .intro { display: none; }
.playing h1 { font-size: 32px; margin: 14px 0 8px; }
a { color: #503284; text-underline-offset: 3px; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; border: 2px solid #2b1d12; border-radius: 12px; background: #fff; padding: 11px 16px; font-weight: 650; }
button:hover:not(:disabled) { background: #fff0ce; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #7044b7; outline-offset: 4px; }
[hidden] { display: none !important; }
.back { font-size: 14px; font-weight: 650; }
.eyebrow { font: 700 11px/1.6 ui-monospace, monospace; letter-spacing: .13em; margin: 32px 0 10px; color: #68543e; }
h1 { font-size: clamp(36px, 5vw, 62px); letter-spacing: -.045em; margin: 0; line-height: 1.1; }
h1 span { color: #986b40; }
.intro { font-size: 18px; line-height: 1.6; max-width: 58ch; color: #68543e; }
.welcome { display: grid; grid-template-columns: 1.3fr 1fr; gap: 36px; padding: 36px; background: #fff; border: 2px solid #2b1d12; border-radius: 22px; box-shadow: 6px 6px 0 #2b1d12; margin: 32px 0; }
.welcome .eyebrow { margin-top: 0; }
h2 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.03em; line-height: 1.15; margin: 10px 0; }
.welcome p { line-height: 1.65; max-width: 45ch; }
button.primary { background: #ffd166; box-shadow: 3px 3px 0 #2b1d12; margin: 10px 0; }
.example { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-content: center; align-items: center; text-align: center; padding: 24px; border-radius: 16px; background: #f3ecff; }
.sample { display: block; background: #fff; border: 2px solid #2b1d12; border-radius: 12px; padding: 18px 10px; font-weight: 650; }
.merged { grid-column: 1 / -1; background: #e4f5e8; }
.merged b { display: block; margin-top: 8px; font-size: 12px; color: #416349; }
.example p { grid-column: 1 / -1; margin: 6px 0 0; color: #665273; font-size: 14px; }
.message { padding: 0; font-weight: 650; line-height: 1.5; }
.message:not(:empty) { padding: 12px 16px; border-left: 4px solid #7044b7; background: #f3ecff; border-radius: 4px; }
.room-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; }
.room-bar strong { display: block; font-size: 20px; }
.room-actions { display: flex; gap: 6px; }
#connection { display: block; font-size: 13px; color: #52634a; margin-top: 4px; }
.small { font-size: 13px; color: #68543e; line-height: 1.5; }
.scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.scores div { border: 1px solid #dacdbb; border-radius: 14px; background: #fff; padding: 10px 16px; }
.scores strong { font-size: 24px; letter-spacing: -.03em; margin-right: 8px; }
.scores span { font-size: 12px; color: #68543e; }
.tools { padding: 12px 0; border-block: 1px solid #dacdbb; }
.navigation, .zoom-controls { display: flex; align-items: center; gap: 6px; }
.navigation { gap: 16px; flex-wrap: wrap; }
.tools button { padding: 7px 12px; font-size: 13px; }
.zoom-controls button { min-width: 36px; min-height: 36px; }
#location { flex: 1; font: 600 12px ui-monospace, monospace; color: #68543e; }
#zoom-level { min-width: 44px; text-align: center; font-size: 12px; }
.selection { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; margin-top: 12px; }
.selection > div { display: flex; gap: 6px; flex-shrink: 0; }
#selection { overflow-wrap: anywhere; }
.tools button:disabled { opacity: .4; }
#selection-details { font-size: 12px; margin-top: 8px; }
#selected-members { max-height: 80px; overflow: auto; line-height: 1.7; }
#game { --zoom: 1; --cw: calc(168px * var(--zoom)); --ch: calc(104px * var(--zoom)); }
.exploration { position: relative; margin-top: 16px; }
.table-panel { position: relative; min-width: 0; }
.board-hint { font-size: 12px; color: #68543e; margin: 0 0 10px; line-height: 1.5; }
#viewport { position: relative; width: 100%; height: min(62vh, 620px); min-height: 360px; overflow: auto; overflow-anchor: none; overscroll-behavior: contain; border: 2px solid #8b7763; border-radius: 14px; background: #eee2cf; }
#viewport:focus-visible { outline: 3px solid #7044b7; outline-offset: 3px; }
#board, #cursors { width: calc(45 * var(--cw)); height: calc(45 * var(--ch)); }
#board { position: relative; background-image: linear-gradient(to right, #d6c6ae 1px, transparent 1px), linear-gradient(to bottom, #d6c6ae 1px, transparent 1px); background-size: var(--cw) var(--ch); }
#cursors { position: absolute; left: 0; top: 0; pointer-events: none; }
.tile { position: absolute; left: calc(var(--x) * var(--cw) + 4px); top: calc(var(--y) * var(--ch) + 4px); width: calc(var(--cw) - 8px); height: calc(var(--ch) - 8px); padding: 8px; border: 1px solid #b7a58f; border-radius: 10px; font-size: clamp(10px, calc(13px * var(--zoom)), 18px); line-height: 1.35; font-weight: 550; overflow-wrap: anywhere; text-align: left; display: flex; flex-direction: column; justify-content: center; }
.tile-label { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .count { display: block; margin-top: 5px; font: 700 10px ui-monospace, monospace; color: #45614c; }
.tile.group { background: #e8f4e9; border-color: #709879; }
.tile[aria-pressed="true"], .tile[aria-pressed="true"]:hover { background: #e4d4ff; border: 3px solid #7044b7; padding: 6px; }
.tile.done { background: #ffd166; border: 2px solid #2b1d12; opacity: 1; }
.tile.done .count { color: #55401b; }
.wide-view .tile { padding: 4px; line-height: 1.2; }
.wide-view .tile-label { -webkit-line-clamp: 2; }
.wide-view .tile .count { font-size: 9px; margin-top: 2px; }
.wide-view .tile[aria-pressed="true"] { padding: 2px; }
.distant-view .tile { padding: 0; min-height: 0; border-radius: 3px; }
.distant-view .tile[aria-pressed="true"] { padding: 0; border-width: 2px; }
.distant-view .tile-label, .distant-view .tile .count { display: none; }
.remote-cursor { position: absolute; color: white; background: var(--player); border: 1px solid white; border-radius: 0 8px 8px; padding: 4px 6px; font-size: 11px; white-space: nowrap; box-shadow: 0 2px 6px #2b1d1233; }
.social { position: absolute; z-index: 5; top: 38px; left: 12px; width: min(310px, calc(100% - 24px)); max-height: calc(100% - 50px); overflow: auto; border: 1px solid #dacdbb; border-radius: 14px; background: #fff; padding: 14px; box-shadow: 0 4px 20px #2b1d1226; }
.social h2 { font-size: 15px; letter-spacing: -.02em; line-height: 1.4; margin: 0 0 10px; }
#map { position: absolute; z-index: 3; right: 12px; bottom: 12px; display: block; padding: 0; border: 2px solid #fff; border-radius: 6px; width: 156px; cursor: crosshair; overflow: hidden; box-shadow: 0 2px 12px #2b1d1244; }
#overview { display: block; width: 100%; aspect-ratio: 1; }
.social .small { font-size: 11px; margin: 8px 0; }
#people { display: flex; flex-wrap: wrap; gap: 6px; }
.explorer { font-size: 11px; padding: 6px 8px; border: 1px solid var(--player); color: var(--player); }
.connections { border-top: 1px solid #dacdbb; margin-top: 14px; padding-top: 14px; }
#activity { list-style: none; padding: 0; margin: 0; max-height: 245px; overflow-y: auto; }
#activity li + li { margin-top: 6px; }
#activity button { display: block; width: 100%; text-align: left; padding: 9px; border: 1px solid #e3d9cb; border-left: 3px solid var(--player); border-radius: 5px; overflow-wrap: anywhere; }
#activity strong, #activity span, #activity small { display: block; }
#activity strong { font-size: 11px; color: var(--player); }
#activity span { font-size: 12px; font-weight: 500; margin-top: 3px; }
#activity small { font-size: 10px; color: #68543e; margin-top: 4px; }
.win { padding: 20px; border: 2px solid #45614c; border-radius: 12px; background: #e8f4e9; font-weight: 700; }
.rules { margin-top: 28px; padding: 18px 0; border-block: 1px solid #dacdbb; line-height: 1.7; }
summary { cursor: pointer; font-weight: 700; }
.storage-note, footer { color: #68543e; font-size: 12px; line-height: 1.7; }
.storage-note { margin: 20px 0; }
footer { border-top: 1px solid #dacdbb; padding-top: 16px; margin-top: 24px; }
@media (max-width: 850px) {
	.welcome { gap: 20px; padding: 24px; } .example { padding: 14px; }
	body.playing { padding: 0; overflow: hidden; }
	.playing header, .playing main > .rules, .playing .storage-note, .playing footer { display: none; }
	.playing #game { position: fixed; inset: 0; height: 100dvh; }
	.playing #game > .small, .playing .board-hint { display: none; }
	.playing .exploration { position: absolute; inset: 0; margin: 0; }
	.playing .table-panel { height: 100%; }
	.playing #viewport { height: 100%; min-height: 0; border: 0; border-radius: 0; }
	.playing .room-bar { position: absolute; z-index: 4; top: max(6px, env(safe-area-inset-top)); left: max(6px, env(safe-area-inset-left)); right: max(6px, env(safe-area-inset-right)); gap: 6px; padding: 5px 8px; border-radius: 10px; background: #fff8eff2; box-shadow: 0 1px 8px #2b1d121a; }
	.playing .room-bar strong { display: none; }
	.playing #connection { margin: 0; font-size: 10px; max-width: 100px; }
	.playing .room-actions button { padding: 6px 8px; min-height: 32px; font-size: 11px; }
	.playing .tools { position: absolute; z-index: 4; top: calc(max(6px, env(safe-area-inset-top)) + 49px); left: max(6px, env(safe-area-inset-left)); right: max(6px, env(safe-area-inset-right)); padding: 0; border: 0; pointer-events: none; }
	.playing .navigation { justify-content: flex-end; }
	.playing #location { display: none; }
	.playing .zoom-controls { pointer-events: auto; gap: 2px; background: #fff8eff2; padding: 3px; border-radius: 10px; box-shadow: 0 1px 8px #2b1d121a; }
	.playing .zoom-controls button { padding: 4px 8px; min-height: 32px; min-width: 32px; }
	.playing #zoom-level { min-width: 34px; font-size: 11px; }
	.playing .selection { display: none; }
	.playing .has-selection .selection { display: block; pointer-events: auto; position: absolute; top: 0; left: 0; width: calc(100% - 124px); max-width: 320px; margin: 0; padding: 7px; border-radius: 10px; background: #fff8eff2; font-size: 11px; }
	.playing #selection { display: block; max-height: 40px; overflow: auto; }
	.playing .selection > div { margin-top: 5px; }
	.playing .selection button { padding: 5px 7px; font-size: 10px; min-height: 30px; }
	.playing #selection-details { pointer-events: auto; position: absolute; top: 94px; left: 0; max-width: calc(100% - 124px); padding: 6px; background: #fff8eff2; border-radius: 8px; }
	.playing .scores { position: absolute; z-index: 2; left: max(6px, env(safe-area-inset-left)); bottom: max(6px, env(safe-area-inset-bottom)); display: flex; gap: 8px; margin: 0; padding: 6px 8px; max-width: calc(100% - 130px); border-radius: 8px; background: #fff8eff2; pointer-events: none; }
	.playing .scores div { border: 0; padding: 0; background: none; }
	.playing .scores strong { display: block; font-size: 12px; margin: 0; }
	.playing .scores span { display: block; font-size: 8px; }
	.playing #map { right: max(6px, env(safe-area-inset-right)); bottom: max(6px, env(safe-area-inset-bottom)); width: clamp(64px, 24vw, 112px); }
	.playing .social { top: 104px; left: 6px; max-height: calc(100% - 116px); }
	.playing #message:not(:empty), .playing .win { position: fixed; z-index: 6; left: 6px; right: 6px; bottom: calc(max(6px, env(safe-area-inset-bottom)) + 122px); margin: 0; padding: 8px 12px; font-size: 12px; max-height: 80px; overflow: auto; }
}
@media (max-width: 540px) {
	body { padding: 20px 16px; }
	.intro { font-size: 16px; }
	.welcome { grid-template-columns: 1fr; margin: 24px 0; padding: 22px; }
	.example { gap: 8px; }
	.scores { gap: 6px; }
	.scores div { padding: 12px 8px; }
	.scores strong { font-size: 23px; }
	.scores strong, .scores span { display: block; }
	.scores span { font-size: 11px; }
	.room-bar { align-items: flex-start; }
	.room-bar strong { font-size: 17px; }
	.room-bar button { max-width: 145px; font-size: 13px; }
	.selection { display: block; }
	.selection > div { margin-top: 8px; }
	.social { padding: 12px; }
	.social h2 { font-size: 13px; }
}
@media (max-width: 850px) and (max-height: 450px) {
	.playing #map { width: 76px; }
	.playing .scores { max-width: calc(100% - 94px); }
}
