:root { --gold:#F5C869; --edge:#806643; --wood:#201a14; --muted:#c2ac8c }
#partyEntry { margin-left:auto; padding:0 .6rem; height:calc(32px * var(--s)); color:var(--gold); background:var(--wood); border:1px solid var(--gold); border-radius:999px; box-shadow:0 0 6px #f5c86930; font-size:.85rem; white-space:nowrap }
#partyEntry + #gardenBtn { margin-left:0 }
#partyEntry:focus-visible, #bar [data-exit]:focus, .tt-card button:focus-visible { outline:2px solid var(--gold); outline-offset:-2px }
.tt-bottom,.tt-opposite { display:flex; align-items:center; gap:clamp(4px,1vw,14px) }
#bar [data-exit],.tt-seat { border:1px solid var(--edge); background:var(--wood); border-radius:999px; padding:.42em .8em; white-space:nowrap }
#bar [data-exit] { border-color:#584a39; min-height:36px }
.tt-opposite { transform:rotate(180deg); flex-direction:row-reverse }
.tt-bottom { width:max-content; max-width:calc(100% - 8px); margin:0 auto max(3px,.35em); padding:.27em; border:1px solid #9a7f57; border-radius:999px; background:#1b150e }
[data-player="0"],[data-owner="0"] { --wrap:#ab503b; --tint:#f0b09a }
[data-player="1"],[data-owner="1"] { --wrap:#4a5e96; --tint:#b7c8f3 }
[data-player="2"],[data-owner="2"] { --wrap:#956c16; --tint:#f4d68b }
[data-player="3"],[data-owner="3"] { --wrap:#426f4c; --tint:#b2d9b2 }
[data-player="4"],[data-owner="4"] { --wrap:#785080; --tint:#dfb6df }
[data-player="5"],[data-owner="5"] { --wrap:#a15b20; --tint:#ffce9c }
.tt-seat { display:inline-flex; justify-content:center; align-items:center; gap:.2em; font-variant-numeric:tabular-nums; line-height:1.25; color:var(--tint); background:color-mix(in srgb,var(--wrap) 23%,#151210); border-color:color-mix(in srgb,var(--wrap) 74%,#211b17) }
.tt-seat.active { color:#fff9ef; background:var(--wrap); border-color:var(--tint); box-shadow:0 0 7px var(--wrap); font-weight:700 }
.tt-seat svg { display:none; width:1em; height:1em }
.tt-seat.active svg { display:block }
.tt-turn { display:flex; align-items:center; justify-content:center; gap:.28em; padding:0 .55em; white-space:nowrap; color:#d5b98c }
.tt-left::before { content:"· "; }
#field[data-rows] .cell { min-width:0; min-height:0 }
.at-table #field .dug { color:var(--gold); opacity:1 }
.at-table #field button:is(:active,:focus-visible,.selected) { box-shadow:inset 0 0 0 3px var(--gold),0 0 8px #f5c86970; z-index:1 }
#field[data-rows] .scanned { outline:1px dashed #b79a65; outline-offset:-3px }
#field[data-rows] .tt-crystal { display:block; width:94% !important; height:94% !important; object-fit:contain; min-height:0 }
#field[data-rows] .scanned canvas { position:absolute; z-index:3; pointer-events:none; filter:brightness(0) saturate(100%) invert(80%) sepia(40%); opacity:.5 }
#field[data-rows] svg { width:45%; height:45% }
#field[data-rows] small { position:absolute; z-index:5; bottom:4%; right:8%; color:#e3c18a; font-size:clamp(10px,1.6vw,19px) }
.tt-magnet { position:fixed; inset:0 auto auto 0; width:30px; color:var(--gold); pointer-events:none }
.tt-card :is([aria-pressed=true],[data-start]) { background:var(--gold); color:#32230e }
.tt-count,.tt-key { display:flex; gap:.35em }
.tt-count button { flex:1; padding:.4em .15em }
.tt-key { justify-content:space-between; font-size:.85em }
.tt-key span { display:flex; align-items:center; gap:.22em }
.tt-key svg { width:1.15em; height:1.15em; color:var(--gold) }
.tt-card ol,.tt-card ul { padding:0; list-style:none }
.tt-card li { display:flex; justify-content:space-between; gap:.8em; border-bottom:1px solid #4e3f2d; padding:.35em 0 }
@media (max-width:600px) {
  .tt-seat { padding:.45em .42em }
  .tt-bottom { font-size:clamp(12px,3.4vw,17px) }
  .tt-bottom:has([data-player="4"]) .tt-turn { flex-direction:column; gap:0; line-height:1.1; padding:0 .12em }
  .tt-bottom:has([data-player="4"]) .tt-left::before { content:"" }
}
@media (max-width:374px) {
  .tt-bottom { font-size:12px; gap:2px }
  .tt-seat { padding:.45em .28em }
}
.tt-bottom { width:calc(100% - 8px); max-width:96%; justify-content:space-between }
.tt-turn { flex:1 }
@media (min-width:600px) {
  .tt-bottom:has([data-player="4"]) { font-size:.8em }
}

#field[data-rows] .selected::after { content:""; position:absolute; inset:0; z-index:6; border:2px solid var(--gold); border-radius:inherit; pointer-events:none }

.at-table #bar > :not([data-exit],.tt-opposite) { display:none }
.at-table #bar { justify-content:space-between }
#bar [data-exit] { font:inherit; color:var(--muted); cursor:pointer }
#partyScores { position:fixed; bottom:env(safe-area-inset-bottom); left:50%; transform:translateX(-50%); height:var(--bar); box-sizing:border-box; z-index:20; align-items:center }
.at-table #field { bottom:calc(var(--bar) + env(safe-area-inset-bottom)); padding-bottom:calc(2px * var(--s)) }
.tt-magnet { z-index:25 }
.tt-card { max-width:26em; margin:auto }
.tt-count { margin-top:.8em }
.tt-count button { min-height:40px; font:inherit; border:1px solid var(--edge); background:var(--wood); color:var(--muted); border-radius:999px }
.at-table #toast { display:none }

.at-table #partyScores { margin-bottom:0 }

@media (max-width:599px) and (orientation:portrait) {
  .at-table .cell:not(.hit) .crust { transform:scale(1.20) }
}

/* 镐的透明画布以镐尖为落点，两侧玩家各自朝向矿区。 */
.tt-handle { display:none; position:relative; flex:none; width:clamp(29px,4.5vw,46px); height:32px; border:0; padding:0; background:transparent; touch-action:none; cursor:grab }
.tt-seat.active { touch-action:none; padding-block:0 }
.tt-seat.active .tt-handle { display:block }
.tt-handle::after { content:""; position:absolute; inset:-6px -2px }
.tt-handle img { width:100%; height:100%; object-fit:contain; pointer-events:none }
.tt-flying-pick { position:fixed; z-index:65; width:clamp(66px,16vw,108px); aspect-ratio:1; transform-origin:0 0; pointer-events:none }
.tt-flying-pick img { position:absolute; left:-7%; top:-42%; width:100%; height:100%; transform-origin:79% 90%; filter:drop-shadow(0 3px 2px #0008) }
#field .aimed::after { content:""; position:absolute; inset:1px; z-index:6; border:2px solid var(--gold); border-radius:inherit; box-shadow:inset 0 0 10px #f5c86960; pointer-events:none }
.party-result ol,.party-result ul { margin:.5em 0 }
.party-result li { align-items:center; text-align:left; padding:.19em .35em }
.party-result li span:last-child,.party-result li b:last-child { margin-left:auto }
.party-result ul img { width:1.9em;height:1.9em;object-fit:contain }
.rank-num { color:var(--gold); font-family:var(--serif); font-size:1.2em }
.party-stock { background:linear-gradient(130deg,#44321f,#2d2016); border:2px solid #725534; border-radius:7px; padding:4px; gap:4px }
.party-bin { display:flex; flex-direction:column; align-items:center; justify-content:center; background:#201a15; color:#dfc8a6; font:inherit; font-size:.78em; border:1px solid #58412c; border-radius:4px; padding:.3em; min-width:0 }
.receipt { color:var(--gold); margin:.45em 0 }
.party-book-link { background:transparent; border:0; color:var(--ore-2); padding:.55em; font:inherit; cursor:pointer }
.specimen { max-width:100%;object-fit:contain }
@media(max-width:420px) { .tt-bottom:has([data-player="4"]) .tt-seat { font-size:12px; padding-inline:.22em } }
.tt-seat.active { cursor:grab }
.tt-seat.lifted img { opacity:.22 }
.party-stamps { padding:0; margin:.7em auto;max-width:27em;list-style:none }
.party-stamps li { display:flex;align-items:center;gap:.8em;padding:.6em;border-bottom:1px solid var(--line);text-align:left }
.party-stamps img { width:3em;height:3em;object-fit:contain }
.party-stamps small { display:block;color:var(--ink-2);font-size:.82em }
.party-stamps em { margin-left:auto;color:var(--gold);white-space:nowrap;font:inherit }
.party-stamps .locked img { filter:grayscale(1);opacity:.35 }
.harvest-tray { margin:.8em 0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;padding:5px;background:linear-gradient(110deg,#855e39,#49301e 35%,#745333);border:1px solid #957342;border-radius:7px }
.harvest-tray .party-bin { overflow:visible }
.harvest-tray canvas { position:relative;z-index:2 }
.deposit-box { width:max-content;margin:.75em auto 0;padding:.45em 1.3em;border:1px solid #9e784a;border-radius:5px;background:linear-gradient(#48301c,#23180f);color:var(--gold);box-shadow:inset 0 2px #77563a }
.deposit-box svg { width:1em;vertical-align:middle }
.party-result ol li:first-child { background:linear-gradient(90deg,#41321f,transparent);border-radius:4px;color:var(--gold) }

#field .tt-soil-cut { position:absolute;inset:-25%;width:150%;height:150%;pointer-events:none;z-index:4 }
#field .dug > :is(.tt-crystal,svg) { position:relative;z-index:1 }

#field .tt-pit, #field .tt-pit-lip { position:absolute; inset:2%; background:center/100% 100% no-repeat url("art/party-pit.jpg"); pointer-events:none }
#field .tt-pit { z-index:0 }
#field .tt-pit-lip { z-index:2; clip-path:polygon(0 82%,9% 88%,18% 83%,24% 81%,31% 85%,38% 87%,47% 87%,53% 83%,60% 85%,67% 84%,73% 77%,80% 74%,85% 78%,92% 79%,100% 84%,100% 100%,0 100%) }
#field .pit-mirrored > :is(.tt-pit,.tt-pit-lip) { transform:scaleX(-1) }
#field .tt-ore-gleam { position:absolute; left:16%; top:49%; width:68%; height:24%; z-index:3; pointer-events:none; border-bottom:2px solid #ffdd87; border-radius:50%; filter:drop-shadow(0 1px 3px #f5ab40); transform:rotate(-13deg); animation:pit-glint .48s ease-out both }
@keyframes pit-glint { 0% {clip-path:inset(0 100% 0 0);opacity:0} 42% {clip-path:inset(0);opacity:1} 100% {clip-path:inset(0 0 0 92%);opacity:0} }
#field[data-rows] .revealed.selected::after { opacity:0 }
.at-table #field .revealed.selected { box-shadow:none }
#field .revealed small { top:0; bottom:auto; right:1px; line-height:1.15; font-size:clamp(9px,1.45vw,16px); padding:1px 3px; background:#23190ee8; border-radius:4px }

.at-table #field .dug { background:#000 }

#field .revealed small[data-owner] { min-width:1.4em; text-align:center; color:#fff9ef; background:var(--wrap); border:1px solid var(--tint) }
#field .tt-ore-name, #field .tt-ore-points { position:absolute; z-index:3; line-height:1.1; pointer-events:none; text-shadow:0 1px 2px #000 }
#field .tt-ore-name { inset:auto 1px 0; padding:2px 1px; text-align:center; color:#f3e5d1; background:#100d0be8; border-radius:0 0 3px 3px; font-size:clamp(10px,2.6vw,17px); overflow-wrap:anywhere }
#field .tt-ore-points { top:1px;left:2px;color:var(--gold);font-size:clamp(11px,2.8vw,18px);font-weight:700 }
.at-table #toast:has(.party-medal-progress) { display:block;bottom:calc(var(--bar) + env(safe-area-inset-bottom) + 5px) }
.tt-guide { position:fixed;inset:0;z-index:45;pointer-events:none }
.tt-guide > svg { position:absolute;inset:0;width:100%;height:100%;opacity:.8 }
.tt-guide-hint { position:absolute;transform:translateX(-50%);max-width:90vw;padding:.38em .72em;border-radius:8px;color:#ffdf9c;background:#231a11f5;border:1px solid #947245;font:600 clamp(12px,2.8vw,18px)/1.35 var(--sans);text-align:center }
.tt-guide-hand { position:absolute;width:clamp(20px,5vw,32px);animation:guide-swing 2s ease-in-out 2 both }
.tt-guide-hand svg { width:100%;display:block;margin:-10% 0 0 -32%;filter:drop-shadow(0 1px 2px black) }
@keyframes guide-swing { 0%,12% {transform:translate(0,0);opacity:0} 25% {opacity:.9} 72%,88% {transform:translate(var(--dx),var(--dy));opacity:.9} 100% {transform:translate(var(--dx),var(--dy));opacity:0} }
#field .tt-guide-target { outline:2px dashed #e3bd76;outline-offset:-2px }
@media(prefers-reduced-motion:reduce){ .tt-guide-hand {animation:none;display:none} }
