/* One set of copper and honey faces for every game action. */
:root{
 --ui-size:48px;
 --face-left:url("/art/action-clay-left.webp");--face-right:url("/art/action-clay-right.webp");
 --face-middle:url("/art/action-clay-middle.webp");
 --key-clay:url("/art/key-clay.webp");--key-honey:url("/art/key-honey.webp");
 --board:url("/art/control-board.webp");--key-icons:url("/art/key-symbols.svg");
 --cream:#fff0cf;--brown:#54291f;--shade:rgba(50,19,19,.48);
}
.control-symbol{
 --symbol:0;display:inline-block;width:1.25em;height:1.25em;flex:0 0 auto;
 filter:drop-shadow(0 1.5px 0 #5a2d249c);
}
.control-symbol::before,button[data-glyph]::before{
 content:"";display:block;width:100%;height:100%;background:currentColor;
 mask:url("/art/controls-icons.webp") calc(var(--symbol,0)*100%/11) center / 1200% 100% no-repeat;
}
[data-symbol=pick]{--symbol:1}[data-symbol=duel]{--symbol:2}[data-symbol=cards]{--symbol:3}
[data-symbol=friends]{--symbol:5}[data-symbol=trophy]{--symbol:6}
[data-symbol=help]{--symbol:7}[data-symbol=home],[data-glyph=home]{--symbol:8}
.control-symbol:is([data-symbol=menu],[data-symbol=settings],[data-symbol=back],[data-symbol=close],[data-symbol=pause],[data-symbol=sound])::before,
button[data-glyph]:not([data-glyph=home])::before{
 mask:var(--key-icons) calc(var(--mark,0)*100%/12) center / 1300% 100% no-repeat;
}
[data-symbol=menu],[data-glyph=list]{--mark:1}[data-symbol=settings]{--mark:2}
[data-symbol=back],[data-glyph=back]{--mark:3}[data-glyph=play]{--mark:4}[data-glyph=next]{--mark:5}
[data-symbol=close],[data-glyph=close]{--mark:6}[data-symbol=pause]{--mark:7}[data-glyph=check]{--mark:8}
[data-symbol=sound]{--mark:9}#sound-button.muted .control-symbol{--mark:10}
[data-glyph=copy]{--mark:11}[data-glyph=share]{--mark:12}
button[data-glyph]{display:inline-flex;align-items:center;justify-content:center;gap:.45em}
button[data-glyph]::before{width:.99em;height:.99em;flex:none}
:is(#game,#dialog) button:not(.kr-plot-column),#summary .kr-disclosure>summary{
 --cap:min(44%,calc(var(--ui-size)*.5));appearance:none;border:0;border-radius:0;
 /* Overlap the middle beneath both caps so fractional sizes leave no hairlines. */
 background:var(--face-left) left center / var(--cap) 100% no-repeat,
            var(--face-right) right center / var(--cap) 100% no-repeat,
            var(--face-middle) center / calc(100% - var(--cap) - var(--cap) + 3px) 100% no-repeat;
 box-shadow:none;color:var(--cream);font-family:var(--font-game);font-weight:650;line-height:1.17;
 text-shadow:0 1px 1px #642a21b3;filter:drop-shadow(0 2px 1px var(--shade));touch-action:manipulation;
 transition:filter .12s ease,transform .12s ease;
}
:is(#game,#dialog) button:is(.start-game,.main-mode,.modal-action.primary,.dig-btn,.next-btn,.kr-primary){
 --face-left:url("/art/action-honey-left.webp");--face-right:url("/art/action-honey-right.webp");
 --face-middle:url("/art/action-honey-middle.webp");color:var(--brown);text-shadow:0 1px #fff3c480;font-weight:750;
}
@media(hover:hover) and (pointer:fine){
 :is(#game,#dialog) button:not(.kr-plot-column):not(:disabled):hover,#summary .kr-disclosure>summary:hover{
  filter:brightness(1.075) drop-shadow(0 3px 2px var(--shade));transform:translateY(-1px);
 }
}
:is(#game,#dialog) button:not(.kr-plot-column):not(:disabled):active,#summary .kr-disclosure>summary:active{
 transform:translateY(2px);filter:brightness(.96) drop-shadow(0 1px 1px var(--shade));
}
:is(#game,#dialog) button:focus-visible,#summary summary:focus-visible,#dialog input[type=checkbox]:focus-visible{outline:3px solid #ffedb5;outline-offset:2px}
#game button.icon,#dialog button.plain-icon{
 display:grid;place-items:center;--key-size:clamp(44px,3.8vw,58px);width:var(--key-size);height:var(--key-size);
 border-image:none;border-radius:35%;padding:0 0 calc(var(--key-size)*.105);
 background:var(--key-clay) center / 100% 100% no-repeat;
}
#corners{inset:max(8px,1.1vh,env(safe-area-inset-top)) max(12px,1.1vw,env(safe-area-inset-right)) auto max(12px,1.1vw,env(safe-area-inset-left))}
#corners .right-corner{gap:4px}
#game .icon .control-symbol,#dialog .plain-icon .control-symbol{width:calc(var(--key-size)*.49);height:calc(var(--key-size)*.49)}
#game :is(.dig-btn,.next-btn,.kr-result-btn,.kr-small-btn),#dialog .modal-action{padding:.56em 1.02em .72em;min-height:44px}
#game .next-btn{--ui-size:54px;padding:.58em 1.5em .78em}
#game .text-button{--ui-size:38px;min-height:38px;padding:.34em 1.02em .54em}
#game .kr-results :is(.kr-result-btn,.kr-small-btn){border-radius:0}
#game #prompt,#game .counter,#game #word,#game #timer{
 background:linear-gradient(155deg,#462d31ed,#2a2029f2);border-color:#c99264;
}
#game #word.bad{border-color:#ff8c84}
#game #round[data-step=accepting] #word{border-color:var(--accent)}
#game #timer.amber{border-color:#ffc074}#game #timer.low{border-color:#ff8389}

#dialog{
 width:min(91vw,35rem);max-height:min(87dvh,54rem);padding:8px 8px 12px;overflow:auto;scrollbar-width:thin;scrollbar-color:#e9ae70 #93462b;
 border:0 solid transparent;outline:0;border-radius:0;border-image:var(--board) 10 13 14 13 fill / 15px 17px 21px / 0 stretch;
 background:transparent;color:#fff0d4;box-shadow:none;filter:drop-shadow(0 9px 10px #220e1a9e);font-family:var(--font-game);
 --muted:#f3d5b5;
}
#dialog[data-view=menu]{width:min(91vw,39rem)}
#dialog::backdrop{background:#25151a77;backdrop-filter:blur(1.4px)}
#dialog .modal-bar{
 padding:.72rem 1.12rem .86rem;gap:.7rem;background:#a04c2b;
 border:0;border-bottom:2px solid #d17d4b;border-radius:9px;box-shadow:inset 0 -4px 8px #74371e30;
}
#dialog .modal-bar h2{font:750 clamp(1.7rem,2.6vw,2.52rem)/1.12 var(--font-game);letter-spacing:0;color:#fff0cf;text-shadow:0 3px 2px #682d22}
#dialog[data-view=menu] .modal-bar h2{font-size:clamp(1.9rem,3vw,2.95rem)}
#dialog #modal-body{padding:.7rem 1.1rem .74rem}
#dialog .menu-grid{display:grid;gap:clamp(5px,1vh,10px)}
#dialog .menu-link{
 --ui-size:clamp(48px,7.3vh,69px);display:grid;grid-template-columns:clamp(2.25rem,4.6vw,3.8rem) minmax(0,1fr) 1.25rem;gap:.65em;align-items:center;
 min-height:clamp(48px,7.3vh,69px);padding:.27em .77em .44em .68em;text-align:left;
 font-size:clamp(1.22rem,2.05vw,1.95rem);font-weight:650;
}
#dialog .menu-link.main-mode{font-weight:800}
#dialog .menu-link .control-symbol{width:1.65em;height:1.65em;max-width:100%;justify-self:center}
#dialog .menu-link::after{
 content:"";width:.35em;height:.35em;border:solid currentColor;border-width:.135em .135em 0 0;
 transform:rotate(45deg);color:inherit;font-size:inherit;justify-self:center;opacity:.9;
}
#dialog .item-list{gap:.44rem}
#dialog .list-button{padding:.72em 1em .86em;min-height:48px}
#dialog .score-tag,#dialog .short-code,#dialog .caption{color:#ffe6ac}
#dialog .modal-input,#dialog select{background:#38232a;color:#fff0d7;border:1px solid #df9969;border-radius:5px}
#dialog .room-question,#dialog .compare-round{border-color:#e1a275}
#dialog :is(.room-question,.person-row.turn){color:#fff0c3}
#dialog .room-note{color:#f6d2af}
#dialog .person-row{border-bottom-color:#d78c5b70}
#dialog #modal-status{background:#7d3827;border-radius:4px;color:#fff1dd}
#dialog .setting-row{min-height:44px;cursor:pointer}
#dialog .setting-row input[type=checkbox]{
 appearance:none;display:grid;place-items:center;flex:none;width:28px;height:28px;margin:0;padding:0 0 3px;
 background:var(--key-clay) center / contain no-repeat;border:0;border-radius:34%;cursor:pointer;
}
#dialog .setting-row input:checked{background-image:var(--key-honey)}
#dialog .setting-row input:checked::before{
 content:"";width:54%;height:56%;background:var(--brown);
 mask:var(--key-icons) calc(8*100%/12) center / 1300% 100% no-repeat;
}
#summary .kr-disclosure{margin:.4rem 0;border:0}
#summary .kr-disclosure>summary{display:flex;align-items:center;gap:.7em;list-style:none;cursor:pointer;padding:.68em 1.25em .85em}
#summary .kr-disclosure>summary::-webkit-details-marker{display:none}
#summary .kr-disclosure>summary::before{
 content:"";flex:none;width:.78em;height:.78em;background:currentColor;
 mask:var(--key-icons) calc(4*100%/12) center / 1300% 100% no-repeat;
}
#summary .kr-disclosure[open]>summary::before{transform:rotate(90deg)}
#summary .kr-round-number{
 left:50%;right:auto;translate:-50% 0;display:grid;place-items:center;
 width:1.68rem;height:1.68rem;padding:0 0 .16rem;color:var(--cream);
 background:var(--key-clay) center / contain no-repeat;
}
#summary .kr-plot-column:is(:focus-visible,[aria-expanded=true]) .kr-round-number{background-image:var(--key-honey);color:var(--brown)}
@media(forced-colors:active){
 #dialog .setting-row input[type=checkbox]{appearance:auto}
 #dialog .setting-row input:checked::before{display:none}
 :is(#game,#dialog) button:not(.kr-plot-column),#summary .kr-disclosure>summary{border:1px solid ButtonText;background:ButtonFace;color:ButtonText}
}
#dialog .plain-icon#back-button{font-size:1.85rem}

@media(max-width:650px){
 #corners{inset:max(6px,env(safe-area-inset-top)) max(7px,env(safe-area-inset-right)) auto max(7px,env(safe-area-inset-left))}
 #dialog{max-height:90dvh}#dialog #modal-body{padding:.5rem .5rem .6rem}
 #dialog .modal-bar{padding:.45rem .55rem .65rem}
 #dialog .menu-link{min-height:48px}
}
@media(max-height:550px) and (min-aspect-ratio:6/5){
 #dialog{max-height:96dvh}#dialog .menu-link{--ui-size:39px;min-height:39px;padding:.19em .8em .35em;font-size:1.03rem}
 #dialog .menu-grid{gap:3px}#dialog .modal-bar{padding:3px 10px 5px}
 #dialog .modal-bar h2,#dialog[data-view=menu] .modal-bar h2{font-size:1.45rem}
 #dialog button.plain-icon,#game button.icon{--key-size:36px}
}
