/* Painted tokens use a common outline, like pieces in the same tabletop set. */
:root {
  --game-ink:#352e24;
  --game-parchment:#f8e6b9;
  --game-serif:"BiauKai","Kaiti TC","Songti TC","Noto Serif TC",serif;
  --piece-sheet:url(./game-pieces.webp);
}
.piece,.quick-box::before,.tilt-switch::before,.viewer-sound::before {
  display:inline-block;flex:none;width:25px;height:25px;pointer-events:none;
  background:var(--piece-sheet) var(--piece-x,0%) var(--piece-y,0%) / 400% 400% no-repeat;
}
.piece-chest,.piece-sound,.piece-storm,.piece-close {--piece-x:33.33333%}
.piece-book,.piece-muted,.piece-pixels,.piece-tilt {--piece-x:66.66667%}
.piece-cards,.piece-settings,.piece-herb,.piece-inspect {--piece-x:100%}
.piece-arrow,.piece-sound,.piece-muted,.piece-settings {--piece-y:33.33333%}
.piece-crystal,.piece-storm,.piece-pixels,.piece-herb {--piece-y:66.66667%}
.piece-skip,.piece-close,.piece-tilt,.piece-inspect {--piece-y:100%}
#sound[aria-pressed=false] .piece-sound,.viewer-sound[aria-pressed=false]::before {--piece-x:66.66667%}
.party-portrait {display:block;flex:none;width:36px;height:36px;background:url(./party-faces.webp) 0 100%/400% 100% no-repeat}
.party-portrait[data-id="002"]{background-position-x:33.33333%}
.party-portrait[data-id="003"]{background-position-x:66.66667%}
.party-portrait[data-id="004"]{background-position-x:100%}

/* A red lacquer drawer pull is reserved for the action that progresses the game. */
.game-press,.pack-entry.game-press,.view-entry-button.game-press {
  display:inline-flex;position:relative;align-items:center;justify-content:center;gap:9px;
  box-sizing:border-box;min-height:50px;padding:1px 19px 3px 13px;
  border:2px solid #533324;border-radius:10px 16px 10px 15px / 14px 9px 14px 10px;
  color:#fff5d4;background-color:#aa3c2d;
  background-image:radial-gradient(ellipse at 78% 0,#ee785044,transparent 66%),repeating-linear-gradient(-12deg,transparent 0 5px,#622e210d 6px 7px);
  box-shadow:inset 0 0 0 2px #f2ba81,inset 0 -5px #8b3328,0 3px 0 #503525,0 5px 0 #30291f66;
  font:800 18px/1.1 var(--game-serif);letter-spacing:.09em;text-shadow:0 1px #62382b;
  transition:translate .12s ease,rotate .12s ease;touch-action:manipulation;
}
.game-press .piece{width:32px;height:32px;filter:drop-shadow(0 1px 0 #5a332c)}
.game-press::after{content:"";display:block;height:19px;width:5px;flex:none;margin-left:4px;background:radial-gradient(circle at 50% 3px,#ffe2a7 0 1px,#733928 1.5px 2px,transparent 2.5px),radial-gradient(circle at 50% 16px,#ffe2a7 0 1px,#733928 1.5px 2px,transparent 2.5px)}
.action #action-label{font:inherit;white-space:nowrap}
.game[data-phase=opening] .action,.game[data-phase=unboxing] .action{background-color:#385f50}
.game[data-phase=opening] .action .piece,.game[data-phase=unboxing] .action .piece{width:25px;height:25px}
@media(hover:hover){.game-press:not(:disabled):hover{translate:0 -2px;rotate:-.7deg}}
.game-press:not(:disabled):active,.pack-entry.game-press:active,.view-entry-button.game-press:active{
  translate:0 3px;rotate:0deg;box-shadow:inset 0 0 0 2px #f2ba81,inset 0 2px #813227,0 1px 0 #503525
}

/* Tabs resemble the labels of apothecary drawers. Unselected labels recede. */
.pack-modes,.switch,.face-picker {
  display:inline-flex;align-items:center;gap:3px;padding:2px 3px;
  border:0;border-bottom:2px solid #a4885b;border-radius:0;background:none;
}
.pack-modes button,.switch button,.face-picker button {
  display:inline-flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap;
  min-height:44px;padding:0 10px;border:1px solid transparent;border-radius:7px 9px 2px 2px;
  font-weight:700;letter-spacing:.04em;background:transparent;
}
.pack-modes button{color:#fff0d2;text-shadow:0 1px 3px #102e25;background:#193a33b8}
.pack-modes button[aria-pressed=true],.switch button[aria-pressed=true],.face-picker button[aria-pressed=true] {
  color:#402e1f;background:#f7d894;border:1px solid #705137;box-shadow:inset 0 2px #fff2c9,inset 0 -3px #d8aa60;
  text-shadow:none;transform:rotate(-1.4deg);transform-origin:50% 100%;
}
.pack-modes .piece,.switch .piece,.switch .party-portrait{width:24px;height:24px}
.finishes{
  background:#102b26d9;border:0;border-bottom:1px solid #b39b6a87;
  border-radius:9px 8px 5px 6px;margin-top:6px;padding:0 3px;gap:2px;
}
.finishes span{gap:3px;min-height:44px;padding:0 8px;border-radius:7px 6px 5px 3px;font-weight:600;letter-spacing:.02em}
.finishes .piece{width:22px;height:22px}
.finishes input:checked+span,.game[data-phase=sealed] .finishes input:checked+span{
  color:#2b342c;background:#f3e2b9;box-shadow:inset 0 -3px #bb995e
}
.pack-review select{
  min-height:44px;color:#fff0cf;background-color:#2a493e;border:1px solid #b19a6c;border-radius:6px 9px 5px 4px
}
.tools button,#close-album,.herb-top .alternative,.herb-top .backlink,.tilt-switch,.viewer-sound,.jump {
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  min-width:44px;min-height:44px;height:auto;line-height:1.2;font-weight:650;
  border:1px solid transparent;border-radius:6px 10px 5px 8px;
}
.tools button,#close-album,.viewer-sound,.tilt-switch{color:#fff2d7}
.tools #open-album,#close-album,body[data-mode=view] .alternative {
  background:#23453d;border:1px solid #a79369;box-shadow:inset 0 -2px #142f29;padding-inline:9px
}
.tools #sound{padding-inline:5px}
#close-album .piece{width:22px;height:22px}
.quick-box{display:inline-flex;align-items:center;justify-content:center;gap:4px;vertical-align:middle;
  margin-left:6px;padding:0 8px;min-height:44px;border:1px solid #907d5d;border-radius:6px 8px 4px 6px;background:#24483b;color:#fff0cc;
  font-size:13px;font-weight:650;text-decoration:none;box-shadow:inset 0 -2px #16392e;white-space:nowrap}
.quick-box::before{content:"";width:20px;height:20px;--piece-x:33.33333%}
.console .action{vertical-align:middle;min-width:142px;margin-block:5px 4px}
.top .tools button:active,.quick-box:active,.finishes label:active span,.pack-modes button:active,.switch button:active,.neighbor:active{translate:0 2px}
@media(max-width:365px){
  .top .tools{gap:2px}.tools #sound{padding:0;width:44px}
  .tools #sound [data-sound-label]{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .console{padding-inline:7px}.console .action{min-width:128px;padding-inline:9px;gap:4px;font-size:16px}
  .quick-box{font-size:12px;padding-inline:5px;margin-left:3px}
  .finishes span{padding-inline:5px}.pack-review select{max-width:100px}
}
@media(orientation:landscape) and (max-height:560px){
  .game .heading,.game .console{min-width:0}.heading .finishes{max-width:100%}
  .finishes span{padding-inline:4px;font-size:11px}.finishes .piece{width:17px;height:17px}
  .console .action{padding-inline:10px;min-width:124px;font-size:16px}
  .quick-box{padding-inline:5px;font-size:12px;margin-inline:2px}
}

/* The party travels on the collection cover, then becomes the paging controls. */
.banner{background-color:#e9ebd8;border-color:#a9a482}
.intro{display:grid;position:relative;grid-template-columns:1fr minmax(0,.85fr);align-items:center;gap:12px;
  min-height:214px;padding-block:22px}
.intro-copy{z-index:1}.intro h1{color:#244d3b}.party-art{width:100%;height:auto;max-height:310px;object-fit:contain;align-self:end;filter:drop-shadow(1px 6px 2px #4f422b32)}
.pack-entry.game-press{margin-top:16px;min-width:140px}
.jump{border-color:#9b9678;background:#eee8cc;padding:0 10px;font-size:14px}
.print i.piece-inspect{z-index:1;width:27px;height:27px;right:7px;bottom:8px;border:1px solid #786441;border-radius:5px 7px 4px 7px;
  background:var(--piece-sheet) 100% 100% / 400% 400% no-repeat,#f6dfa6;display:block;transform:rotate(-4deg)}
@media(max-width:785px){
  .intro{grid-template-columns:minmax(0,1.18fr) minmax(0,1fr);gap:0;min-height:187px;padding-block:21px}
  .intro h1{font-size:clamp(33px,6.4vw,47px);letter-spacing:.01em;white-space:nowrap}
  .intro-copy p{margin-top:7px;max-width:94%;line-height:1.5}
  .party-art{width:111%;max-width:none;justify-self:end;align-self:end;margin:0 -8px 4px 0}
  .pack-entry.game-press{font-size:16px;min-height:46px;min-width:118px;margin-top:12px}
  .switch button{padding-inline:8px}
}
@media(max-width:365px){.intro h1{font-size:29px}.party-art{width:111%}.toolbar h2{gap:4px}.switch button{padding-inline:5px}}

/* Character tabs show the destination before a player turns the page. */
.siblings{gap:14px}
.siblings .neighbor{
  display:grid;grid-template-columns:18px 31px auto;justify-content:center;align-items:center;gap:5px;
  min-width:111px;min-height:48px;padding:3px 10px 5px 6px;background:#f3dfaf;color:#362f24;
  border:2px solid #51402b;border-radius:13px 6px 7px 12px;box-shadow:inset 0 1px #fff4ce,inset 0 -3px #d3b178,0 2px #504530;font:inherit;
}
.siblings .neighbor[rel=next]{grid-template-columns:auto 31px 18px;padding:3px 6px 5px 10px;border-radius:6px 13px 12px 7px}
.neighbor .piece-arrow{width:22px;height:22px}
.neighbor[rel=prev] .piece-arrow{transform:scaleX(-1)}
.neighbor[rel=next] .piece-arrow{order:3}
.neighbor[rel=next] .party-portrait{order:2}
.neighbor .party-portrait{width:34px;height:34px}
.siblings .neighbor-label{display:grid;gap:2px;font:inherit;line-height:1;text-align:left}
.neighbor-label small{font:600 10px/1.1 system-ui,sans-serif;color:#685338}
.neighbor-label strong{font:750 16px/1.1 var(--game-serif);letter-spacing:.06em}
.siblings .neighbor:focus-visible,.game-press:focus-visible{outline:3px solid #6ddabe;outline-offset:3px}
.herb-top .backlink,.herb-top .alternative{padding-inline:8px;white-space:nowrap;font-size:13px}
body[data-mode=view] .herb-top .backlink{background:#182c25bd;color:#f9e9c8}
body[data-mode=settings] .alternative{background:#ede2bb;color:#314537;border-color:#a2916d}
.tilt-switch,.viewer-sound{padding:0 7px;background:#223b30;border:1px solid #8c9070;white-space:nowrap;font-size:12px}
.tilt-switch::before,.viewer-sound::before{content:"";width:19px;height:19px}
.tilt-switch::before{--piece-x:66.66667%;--piece-y:100%}
.viewer-sound::before{--piece-x:33.33333%;--piece-y:33.33333%}
.herb-top .piece{width:21px;height:21px}
.herb-bottom{gap:5px}
.view-entry-button.game-press{max-width:340px}.depth-toggle{border-radius:6px 8px 5px 7px;min-height:44px}
.depth-toggle[aria-expanded=true]{background:#e3eddb;color:#274b3b;border-color:#7b9679}
@media(max-width:365px){
  .viewer-top.herb-top{padding-inline:4px;gap:2px}
  .herb-top .alternative,.herb-top .backlink,.tilt-switch{padding-inline:4px;gap:3px;font-size:12px}
  .herb-top .piece{width:17px;height:17px}.view-actions{gap:2px}
}
@media(orientation:landscape) and (max-height:540px){
  .herb-bottom .siblings{gap:6px}.siblings .neighbor,.siblings .neighbor[rel=next]{min-width:75px;padding-inline:4px;grid-template-columns:auto auto;gap:2px}
  .neighbor .party-portrait{display:none}
}
@media(prefers-reduced-motion:reduce){
  .game-press,.neighbor,.switch button,.pack-modes button{transition:none}
  .game-press:not(:disabled):hover,.game-press:not(:disabled):active,.top .tools button:active,.quick-box:active,.finishes label:active span,.pack-modes button:active,.switch button:active,.neighbor:active{translate:none;rotate:none}
}
[hidden]{display:none!important}

.top .brand,.tools button,.quick-box{white-space:nowrap}
.game:is([data-phase=sealed],[data-phase=carton]) .floor-shadow::before{
  content:"";position:absolute;inset:-45% -6%;border-radius:50%;border:2px solid #dcc28d57;outline:1px dashed #dfc7935e;outline-offset:5px;
  background:radial-gradient(ellipse at center,transparent 58%,#adcfa31a 61%,transparent 69%);pointer-events:none
}
.pack-modes button[aria-pressed=true] .piece,.finishes input:checked+span .piece{animation:token-seat .26s ease-out}
@keyframes token-seat{0%{transform:translateY(-3px) rotate(-16deg)}65%{transform:rotate(5deg)}100%{transform:none}}
@media(hover:hover){
  .game-press:hover .piece,.neighbor:hover .party-portrait{transform:rotate(-6deg) translateY(-1px)}
  .piece,.party-portrait{transition:transform .15s ease-out}
}
@media(max-width:365px){
  body:has(.game)>.top{padding-inline:8px}
  .top .brand{font-size:15px;letter-spacing:.04em}
  .tools #open-album{padding-inline:5px}
}
@media(prefers-reduced-motion:reduce){
  .pack-modes button[aria-pressed=true] .piece,.finishes input:checked+span .piece{animation:none}
  .game-press:hover .piece,.neighbor:hover .party-portrait{transform:none}
}
@media(orientation:landscape) and (max-height:540px){
  .top .band{height:49px}.intro{min-height:146px;padding-block:9px}
  .intro h1{font-size:clamp(30px,5vw,47px)}.intro-copy p{margin-top:5px}
  .intro .pack-entry{margin-top:8px;min-height:44px;font-size:16px}
  .intro .party-art{max-height:153px;width:100%;align-self:center}
  .catalog{padding-top:12px}.catalog .toolbar{padding-bottom:7px;margin-bottom:12px}
}
