
:root {
 --rack: #1f3a14; 
 --rack-bevel: #2f5420;
 --disc-green: #34802a;
 --disc-gold: #ffc53d;
 --disc-tomato: #e0533d;
 --disc-sky: #3d9be0;
 --disc-violet: #8a5cd6;
 --ivory: #f4efe2;
 --pip-ink: #1b1b16;
 --edge: #0c1a07;
}
.sheet--play { padding-top: clamp(.55rem, 2.2vw, 1.2rem); }
.turnline {
 display: flex; align-items: center; justify-content: center; gap: .5rem;
 min-height: 1.6rem; margin: 0 0 .35rem;
 font-family: var(--display); font-weight: 700; text-transform: uppercase;
 font-size: clamp(.9rem, 3.4vw, 1.1rem); letter-spacing: .1em; color: var(--ink);
}
.turnline__disc {
 position: relative;
 width: 1.1rem; height: 1.1rem; border-radius: 50%; flex: none;
 background: var(--disc, transparent);
 box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25);
}
.turnline.is-thinking .turnline__text::after {
 content: ''; display: inline-block; width: 1.2em; text-align: left;
 animation: dots 1.1s steps(4, end) infinite;
}
@keyframes dots {
 0% { content: ''; }
 25% { content: '.'; }
 50% { content: '..'; }
 75% { content: '...'; }
}
.play {
 display: flex; flex-direction: column; align-items: center; gap: .3rem;
 max-width: 34rem; margin: 0 auto;
}
@media (min-width: 760px) { .play { max-width: 36rem; } }
@media (max-width: 600px) and (max-height: 900px) {
 #paper .masthead { margin-bottom: .3rem; }
 #paper .masthead__logo { width: min(13rem, 58%); }
 #paper .masthead__links { margin-top: .2rem; }
}
.side {
 width: 100%; display: flex; align-items: center; gap: .45rem; min-height: 1.9rem;
 font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
 font-size: .72rem; color: var(--ink-soft);
}
.side__name { color: var(--ink); }
.side__count { font-variant-numeric: tabular-nums; }
.side--computer .opp { margin-left: auto; }
.side--player { justify-content: flex-start; }
.side--player .side__name { margin-left: auto; }
.tile {
 position: absolute; box-sizing: border-box; display: flex; margin: 0; padding: 0; list-style: none;
 left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u));
 width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u));
 border-radius: calc(var(--u) * .16);
 background: linear-gradient(160deg, #fffdf6, var(--ivory) 55%, #e6dfcc);
 --band: var(--player-disc, var(--disc-green));
 box-shadow:
 inset 0 0 0 calc(var(--u) * .08) var(--band),
 inset 0 0 0 calc(var(--u) * .08 + 1px) rgba(27, 27, 22, .55),
 0 0 0 1px var(--edge),
 0 calc(var(--u) * .08) calc(var(--u) * .16) rgba(0, 0, 0, .45);
}
.tile[data-owner="computer"] { --band: var(--computer-disc, var(--disc-gold)); }
.tile--h { flex-direction: row; }
.tile--v { flex-direction: column; }
.half { position: relative; display: block; flex: none; }
.tile .half { width: var(--u); height: var(--u); }
.tile__bar { position: absolute; background: rgba(27, 27, 22, .45); pointer-events: none; }
.tile--h .tile__bar { left: 50%; top: 14%; bottom: 14%; width: 1px; margin-left: -.5px; }
.tile--v .tile__bar { top: 50%; left: 14%; right: 14%; height: 1px; margin-top: -.5px; }
.htile .half, .mini .half { width: 100%; height: 0; padding-bottom: 100%; }
.htile .tile__bar, .mini .tile__bar { top: 50%; left: 14%; right: 14%; height: 1px; margin-top: -.5px; }
.pip {
 position: absolute; width: 19%; height: 19%; margin: -9.5% 0 0 -9.5%;
 border-radius: 50%; background: var(--pip-ink);
 box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25);
}
.pip--tl { left: 27%; top: 27%; } .pip--tr { left: 73%; top: 27%; }
.pip--ml { left: 27%; top: 50%; } .pip--c { left: 50%; top: 50%; } .pip--mr { left: 73%; top: 50%; }
.pip--bl { left: 27%; top: 73%; } .pip--br { left: 73%; top: 73%; }
.back {
 position: relative; display: inline-block; flex: none;
 width: 14px; height: 26px; border-radius: 3px;
 background: var(--computer-disc, var(--disc-gold));
 box-shadow: 0 0 0 1px var(--edge), inset 0 -2px 0 rgba(0, 0, 0, .2);
}
.back--computer::after {
 content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
 border-radius: 50%; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--computer-disc, var(--disc-gold)), #000 32%);
}
.back--bone { background: #26261f; }
.back--bone::after {
 content: ''; position: absolute; inset: 22% 12%; background: rgba(244, 239, 226, .8);
 -webkit-mask: url('../assets/globe.png') center / contain no-repeat;
 mask: url('../assets/globe.png') center / contain no-repeat;
}
.opp { display: inline-flex; }
.opp__backs { display: inline-flex; gap: 3px; }
.opp__backs--open { gap: 4px; }
.mini {
 position: relative; display: inline-flex; flex-direction: column; box-sizing: border-box;
 width: 15px; border-radius: 3px; background: var(--ivory);
 box-shadow: inset 0 0 0 1.5px var(--computer-disc, var(--disc-gold)), inset 0 0 0 2.5px rgba(27, 27, 22, .55), 0 0 0 1px var(--edge);
}
.table {
 position: relative; flex: none; overflow: hidden;
 --u: 22px; --s: 1;
 width: calc(var(--u) * 15); height: calc(var(--u) * 11);
 border-radius: 14px;
 background: var(--rack);
 box-shadow: inset 0 0 0 4px var(--rack-bevel), 0 .4rem .8rem rgba(0, 0, 0, .3);
 touch-action: manipulation;
 user-select: none; -webkit-user-select: none;
}
.table__line {
 position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: 0; padding: 0;
 transform: scale(var(--s)); transform-origin: 0 0;
 transition: transform .24s ease-out;
}
.table.is-empty::before {
 content: 'The table is empty'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
 font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
 font-size: .7rem; color: rgba(235, 235, 235, .45); white-space: nowrap;
}
.table__markers { position: absolute; inset: 0; pointer-events: none; }
.table .end, .table .end:hover {
 pointer-events: auto; position: absolute; width: 44px; height: 44px; margin: 0; padding: 0;
 left: calc(50% + var(--x) * var(--u) * var(--s)); top: calc(50% + var(--y) * var(--u) * var(--s));
 transform: translate(-50%, -50%);
 border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
 font: inherit; text-transform: none; letter-spacing: normal;
 -webkit-tap-highlight-color: transparent;
}
.end__ring {
 position: absolute; inset: 7px; border-radius: 50%;
 border: 3px solid var(--paper); background: rgba(235, 235, 235, .22);
 box-shadow: 0 0 0 2px var(--edge);
 animation: ring 1.1s ease-in-out infinite;
}
@keyframes ring { 50% { transform: scale(1.12); background: rgba(235, 235, 235, .38); } }
.end:focus-visible { outline: 3px solid var(--green-bright); outline-offset: 0; }
.table__stamps { position: absolute; inset: 0; pointer-events: none; }
.side .boneyard, .side .boneyard:hover {
 display: inline-flex; align-items: center; gap: .45rem; margin: 0; padding: .25rem .55rem .25rem .35rem;
 min-height: 34px; border: 2px solid transparent; border-radius: 8px;
 background: transparent; color: var(--ink-soft); cursor: default; opacity: 1;
 font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem;
 -webkit-tap-highlight-color: transparent;
}
.boneyard__pile { display: inline-flex; }
.boneyard__pile .back { margin-left: -8px; }
.boneyard__pile .back:first-child { margin-left: 0; }
.boneyard__count { color: var(--ink); font-variant-numeric: tabular-nums; }
.side .boneyard.is-due { border-color: var(--green); color: var(--ink); cursor: pointer; animation: due 1.1s ease-in-out infinite; }
@keyframes due { 50% { box-shadow: 0 0 0 4px rgba(68, 99, 41, .25); } }
.boneyard:focus-visible { outline: 3px solid var(--green-bright); outline-offset: 2px; }
.hand {
 display: flex; justify-content: center; gap: 5px; width: 100%;
 padding: 12px 2px 4px; box-sizing: border-box; overflow-x: auto; overflow-y: visible;
 scrollbar-width: none;
}
.hand.is-long { justify-content: flex-start; }
.htile, .hand .htile:hover {
 position: relative; flex: none; display: flex; flex-direction: column; box-sizing: border-box;
 width: clamp(22px, calc((100% - (var(--n, 7) - 1) * 5px) / var(--n, 7)), 38px);
 margin: 0; padding: 0; border: 0;
 border-radius: 5px;
 background: linear-gradient(160deg, #fffdf6, var(--ivory) 55%, #e6dfcc);
 color: var(--pip-ink);
 font: inherit; text-transform: none; letter-spacing: normal;
 box-shadow: inset 0 -4px 0 var(--player-disc, var(--disc-green)), inset 0 -5px 0 rgba(27, 27, 22, .55), 0 0 0 1px var(--edge), 0 3px 5px rgba(0, 0, 0, .3);
 cursor: default; opacity: 1;
 transition: transform .12s ease-out, opacity .12s;
 -webkit-tap-highlight-color: transparent;
}
.hand:not(.is-locked) .htile { opacity: .7; }
.hand:not(.is-locked) .htile.is-playable { opacity: 1; transform: translateY(-6px); cursor: pointer; }
.hand .htile.is-lifted { transform: translateY(-11px); box-shadow: inset 0 -4px 0 var(--player-disc, var(--disc-green)), inset 0 -5px 0 rgba(27, 27, 22, .55), 0 0 0 1px var(--edge), 0 0 0 4px var(--paper), 0 0 0 6px var(--ink), 0 8px 10px rgba(0, 0, 0, .35); }
.htile:focus-visible { outline: 3px solid var(--green-bright); outline-offset: 2px; }
.hand:not(.is-locked) .htile.is-playable { touch-action: none; }
.hand .htile.is-dragged { opacity: .3; }
.htile.htile--ghost {
 position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; margin: 0;
 box-shadow: inset 0 -4px 0 var(--player-disc, var(--disc-green)), 0 0 0 1px var(--edge), 0 12px 18px rgba(0, 0, 0, .4);
}
.back--player { background: var(--player-disc, var(--disc-green)); }
.htile .htile__back { position: absolute; inset: 0; width: auto; height: auto; border-radius: inherit; pointer-events: none; }
.back--player::after {
 content: ''; position: absolute; inset: 22% 12%;
 background: color-mix(in srgb, var(--player-disc, var(--disc-green)), #000 34%);
 -webkit-mask: url('../assets/globe.png') center / contain no-repeat;
 mask: url('../assets/globe.png') center / contain no-repeat;
}
.wash { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.wash__tile { position: absolute; left: -7px; top: -13px; }
.howto__example { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.miniline { position: relative; display: inline-block; flex: none; }
.miniline .tile { box-shadow: 0 0 0 1px var(--edge); }
.howto__caption { font-size: .85rem; line-height: 1.4; color: var(--ink-soft); flex: 1 1 12rem; }
.disc--player { --disc: var(--player-disc, var(--disc-green)); }
.disc--computer { --disc: var(--computer-disc, var(--disc-gold)); }
.turnline__disc.disc--player::after {
 content: ''; position: absolute; inset: 18%;
 background: color-mix(in srgb, var(--disc), #000 34%);
 -webkit-mask: url('../assets/globe.png') center / contain no-repeat;
 mask: url('../assets/globe.png') center / contain no-repeat;
}
.turnline__disc.disc--computer::after {
 content: ''; position: absolute; inset: 27%; border-radius: 50%;
 box-shadow: 0 0 0 .15em color-mix(in srgb, var(--disc), #000 32%), 0 1px 0 .15em rgba(255, 255, 255, .25);
}
.stamp {
 position: absolute; left: 50%; top: 50%; z-index: 5; pointer-events: none;
 transform: translate(-50%, -50%) rotate(-8deg);
 padding: .15em .5em; border: 3px solid currentColor; border-radius: 4px;
 font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
 font-size: clamp(1.3rem, 7vw, 2.2rem); line-height: 1; white-space: nowrap;
 color: #fff; background: rgba(179, 36, 31, .88);
 box-shadow: 0 .4rem 1rem rgba(0, 0, 0, .35);
 animation: stamp-out .3s ease-in 1.35s forwards;
}
.stamp--blocked { background: rgba(29, 44, 18, .92); }
.stamp--knock { font-size: clamp(1rem, 5vw, 1.5rem); background: rgba(20, 20, 15, .82); }
.table__stamps .stamp--domino, .table__stamps .stamp--blocked { animation: stamp-in .26s cubic-bezier(.2, 1.4, .4, 1) both; }
.stamp.is-dropping { animation: stamp-in .26s cubic-bezier(.2, 1.4, .4, 1) both, stamp-out .3s ease-in 1.35s forwards; }
@keyframes stamp-in { from { opacity: 0; transform: translate(-50%, -50%) rotate(-16deg) scale(1.8); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); } }
@keyframes stamp-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
 .table__line { transition: none; }
 .end__ring, .side .boneyard.is-due { animation: none; }
 .stamp, .table__stamps .stamp--domino, .table__stamps .stamp--blocked { animation: none; }
 .stamp--knock { animation: stamp-out .01s linear 1.5s forwards; }
 .htile { transition: none; }
}
:root[data-board="cherry"] { --hole-rim: #120000; --edge: #120000; }
:root[data-board="oak"] { --hole-rim: #150c07; --edge: #150c07; }
:root[data-board="birch"] { --hole-rim: #2e1c0c; --edge: #2e1c0c; }
:root[data-board="cherry"] .table { background: linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,0) 45%, rgba(0,0,0,.22)), url('../assets/boards/cherry.jpg') center / cover, var(--rack); }
:root[data-board="oak"] .table { background: linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,0) 45%, rgba(0,0,0,.22)), url('../assets/boards/oak.jpg') center / cover, var(--rack); }
:root[data-board="birch"] .table { background: linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,0) 45%, rgba(0,0,0,.22)), url('../assets/boards/birch.jpg') center / cover, var(--rack); }
:root[data-board="cherry"] .table, :root[data-board="oak"] .table, :root[data-board="birch"] .table {
 box-shadow: inset 0 0 0 4px var(--hole-rim), 0 .4rem .8rem rgba(0, 0, 0, .3);
}
:root[data-board="birch"] .table.is-empty::before { color: rgba(46, 28, 12, .55); }
.statusbar { margin-top: .55rem; align-items: center; }
.statusbar__tools { display: flex; gap: .9rem; }
.statusbar__confirm {
 display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: .3rem .8rem;
 font-size: .68rem; color: var(--ink);
}
.linky:disabled { background: none; color: var(--pencil); opacity: 1; text-decoration: none; cursor: default; }
.edition__state:empty { display: none; }
.edition__today {
 font-family: var(--display); font-weight: 700; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
 padding: .1rem .4rem; border: 1.5px solid var(--green); color: var(--green); border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
 * { scroll-behavior: auto !important; }
 .turnline.is-thinking .turnline__text::after { animation: none; content: '...'; }
}
.prefs {
 display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem;
 margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--rule);
}
.prefs__buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.prefs__label {
 font-family: var(--display); font-weight: 700; text-transform: uppercase;
 letter-spacing: .14em; font-size: .72rem; color: var(--ink-soft);
}
.picker__swatches { display: flex; gap: .45rem; }
.swatch {
 appearance: none; margin: 0; padding: 6px; width: 44px; height: 44px; border: 0; border-radius: 50%;
 background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.swatch:hover { background: transparent; }
.swatch::before {
 content: ''; display: block; width: 100%; height: 100%; border-radius: 50%;
 background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.5), rgba(255,255,255,0) 40%), var(--disc);
 box-shadow: inset 0 -2px 3px rgba(0,0,0,.25);
 transition: transform .12s ease-out;
}
.swatch[aria-checked="true"]::before { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink), inset 0 -2px 3px rgba(0,0,0,.25); }
.swatch:focus-visible { outline: 3px solid var(--green-bright); outline-offset: 1px; }
@media (hover: hover) { .swatch:hover::before { transform: scale(1.08); } }
.swatch--board { border-radius: 10px; }
.swatch--board::before { border-radius: 6px; background: var(--wood, var(--rack)) center / cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.swatch--board[aria-checked="true"]::before { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink), inset 0 0 0 1px rgba(0,0,0,.25); }
.picker__vs { font-size: .82rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: .35rem; }
.picker__vs i { display: inline-block; width: .9rem; height: .9rem; border-radius: 50%; background: var(--disc); }
.soundtoggle, .soundtoggle:hover {
 display: inline-flex; align-items: center; gap: .45rem;
 padding: .7rem .9rem; min-height: 44px;
 background: transparent; color: var(--ink-soft);
 border: 2px solid var(--rule); border-radius: 2px;
 font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem;
}
.soundtoggle:hover { color: var(--ink); border-color: var(--ink); }
.soundtoggle__icon {
 width: 1rem; height: 1rem; background: currentColor;
 -webkit-mask: var(--speaker) center / contain no-repeat; mask: var(--speaker) center / contain no-repeat;
}
:root {
 --speaker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h4l5-4v14l-5-4H3z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18 6a8.5 8.5 0 0 1 0 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
 --speaker-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h4l5-4v14l-5-4H3z'/%3E%3Cpath d='M16 9l6 6M22 9l-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.soundtoggle[aria-pressed="false"] .soundtoggle__icon { -webkit-mask-image: var(--speaker-off); mask-image: var(--speaker-off); }
.sheet--play { position: relative; }
.quip {
 position: absolute; z-index: 3; right: clamp(.6rem, 3vw, 2rem); top: clamp(-.6rem, -1vw, 0rem);
 max-width: min(15rem, 62%); margin: 0; padding: .45rem .7rem;
 font-family: var(--grid-face); font-style: italic; font-size: .92rem; line-height: 1.25; color: var(--ink);
 background: #fff; border: 2px solid var(--ink); border-radius: 12px 12px 2px 12px;
 box-shadow: 0 .35rem .8rem rgba(0,0,0,.2);
 animation: quip-in .22s ease-out;
 pointer-events: none;
}
@keyframes quip-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 30; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
 .quip { animation: none; }
}
.minihand { display: inline-flex; gap: 3px; flex: none; }
.minihand.is-dim .mini { opacity: .6; }
.minihand .mini { box-shadow: 0 0 0 1px var(--edge); }
.minihand__who { display: inline-flex; flex-direction: column; align-items: center; gap: .2rem; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .6rem; color: var(--ink-soft); }
@media (min-width: 760px) {
 #paper { max-width: min(72rem, 100%); }
 #paper .masthead { margin-bottom: .45rem; }
 #paper .masthead__logo { width: min(17rem, 40%); }
 #paper .masthead__links { margin-top: .25rem; }
 .play { max-width: none; }
 .side { font-size: .8rem; min-height: 2.3rem; }
 .htile, .hand .htile:hover { width: clamp(22px, calc((100% - (var(--n, 7) - 1) * 6px) / var(--n, 7)), 54px); }
 .hand { gap: 6px; padding-top: 14px; }
 .back { width: 18px; height: 33px; border-radius: 4px; }
 .back--computer::after { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
}
@media (min-width: 1000px) {
 .play {
 display: grid; align-items: start; gap: .6rem 1.4rem;
 grid-template-columns: minmax(0, 1fr) 17.5rem;
 grid-template-rows: auto auto 1fr;
 grid-template-areas: "table opp" "table yard" "table hand";
 }
 #table { grid-area: table; justify-self: center; }
 .side--computer { grid-area: opp; flex-wrap: wrap; }
 .side--computer .opp { margin-left: 0; }
 .side--player { grid-area: yard; }
 .side--player .side__name { margin-left: auto; }
 .hand {
 grid-area: hand; align-self: stretch; min-height: 0; overflow-y: auto; contain: size;
 flex-wrap: wrap; justify-content: flex-start; align-content: flex-start; gap: 10px 8px; padding: 12px 2px 4px;
 }
 .htile, .hand .htile:hover { width: 50px; }
}
