/* Source-pixel rim probes: panel 24px (+4 shadow), card 14–18px, button 12–16px; rounded button ends need 24px. */
.shroom, #end.screen {
  --sh-wood-ink: #f3e6c8;
  --sh-wood-soft: #e1ceaa;
  --sh-paper-ink: #302111;
  --sh-paper-soft: #51402b;
  --sh-gold: #e5b650;
}

.shroom :is(.sh-top, .sh-team, .sh-kit, .sh-bag, .sh-pickbox), #end.screen .box {
  --sh-soft: var(--sh-wood-soft);
  color: var(--sh-wood-ink);
  background: none;
  border: 2px solid transparent;
  border-image: url(shroom-ui/kit/panel.webp) 28 fill / 8px stretch;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  filter: drop-shadow(0 3px 5px #160d0780);
}
.shroom :is(.sh-top, .sh-kit) { border-image-width: 6px; }
.shroom .sh-top { padding-inline: 32px; }
.shroom .sh-team { padding-left: 32px; }
.shroom .sh-kit { padding-right: 36px; }
.shroom .sh-pickbox, #end.screen .box { box-sizing: border-box; padding-left: 48px; padding-bottom: 48px; }
#end.screen .box { position: relative; }
.shroom .sh-boss { color: var(--sh-wood-soft); }
.shroom .sh-team :is(img, .mate > i) { border-color: #bd9557; }
.shroom .sh-team .hp {
  background: url(shroom-ui/kit/wood-tile.webp) center / 128px 128px;
  box-shadow: inset 0 0 0 1px #ad8045;
}
.shroom .sh-team .hp i { background: #c35840; }
.shroom .sh-team .out { opacity: 1; filter: none; color: var(--sh-wood-soft); }
.shroom .sh-kit img {
  box-sizing: border-box;
  padding: 3px;
  background: url(shroom-ui/kit/slot.webp) center / contain no-repeat;
}
.shroom .sh-kit span > b {
  background: url(shroom-ui/kit/parchment-tile.webp) center / 128px 128px;
  color: var(--sh-paper-ink);
}
.shroom .sh-kit .evo > b { background-color: var(--sh-gold); background-blend-mode: multiply; }
.shroom .sh-kit .evo img { box-shadow: 0 0 0 2px var(--sh-gold); }
.shroom .sh-bag .it { background: url(shroom-ui/kit/slot.webp) center / contain no-repeat; }
.shroom .sh-bag .it img { box-sizing: border-box; padding: 5px; box-shadow: 0 0 0 1px var(--r); }
.shroom .sh-bag .it:is(:hover, :focus-visible) img { box-shadow: 0 0 0 2px var(--r); }
.shroom .sh-bag .it b {
  background: url(shroom-ui/kit/key.webp) center / 100% 100% no-repeat;
  color: var(--sh-wood-ink);
  border-radius: 0;
}
.shroom .sh-bag .it.replace { outline-color: var(--sh-wood-soft); }

.shroom .sh-loot {
  --sh-soft: var(--sh-paper-soft);
  position: relative;
  padding: 12px;
  border-color: transparent;
  border-radius: 0;
  background: url(shroom-ui/kit/bark.webp) center / 100% 100% no-repeat;
  color: var(--sh-paper-ink);
  box-shadow: none;
  filter: drop-shadow(0 3px 5px #160d0780);
}
.shroom .sh-loot::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 2px solid var(--r);
  border-radius: 5px;
  pointer-events: none;
}
.shroom .sh-loot-notes:empty { display: none; }
/* Keep bark cracks out of the ink without painting over the torn silhouette. */
.shroom .sh-loot :is(.sh-loot-info, em), .shroom .sh-loot > span {
  background: url(shroom-ui/kit/parchment-tile.webp) center / 128px 128px;
}
.shroom :is(.sh-loot button, .sh-exit, .sh-ready), #end.screen button {
  color: var(--sh-wood-ink);
  background: none;
  border-style: solid;
  border-color: transparent;
  border-image: url(shroom-ui/kit/button.webp) 16 24 fill / 6px 8px stretch;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  filter: drop-shadow(0 2px 3px #160d0766);
}
.shroom .sh-loot button { padding-right: 28px; }
.shroom :is(.sh-cards, .sh-loot button) .k {
  padding: 0;
  border-radius: 0;
  background: url(shroom-ui/kit/key.webp) center / 100% 100% no-repeat;
  color: var(--sh-wood-ink);
}
.shroom .sh-loot button .k { width: 18px; height: 18px; text-align: center; line-height: 18px; }
.shroom .sh-cards button {
  --sh-soft: var(--sh-paper-soft);
  color: var(--sh-paper-ink);
  background: none;
  border: 2px solid transparent;
  border-image: url(shroom-ui/kit/card.webp) 18 fill / 8px stretch;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  filter: drop-shadow(0 3px 5px #160d0780);
}
.shroom .sh-cards button { padding-left: 22px; }
.shroom .sh-cards button::before {
  top: -10px;
  width: 12px;
  height: 18px;
  border-radius: 0;
  background: url(shroom-ui/kit/pin.webp) center / contain no-repeat;
  pointer-events: none;
}
.shroom .sh-cards button > :is(b, small) { min-width: 0; padding-right: 24px; }
.shroom .sh-cards b { font-size: 14px; font-weight: 800; letter-spacing: -.15px; word-break: normal; overflow-wrap: normal; hyphens: manual; }
.shroom .sh-cards .k { width: 22px; height: 22px; line-height: 22px; }
.shroom .sh-cards button > :is(img, i) { background: url(shroom-ui/kit/slot.webp) center / contain no-repeat; }
.shroom .sh-cards .a {
  border-top: 0;
  padding-top: 12px;
  background: url(shroom-ui/kit/divider.webp) center top / 100% 10px no-repeat;
}
.shroom .sh-cards p, .shroom .sh-toast:not(:empty) {
  color: var(--sh-wood-ink);
  background: none;
  border: 2px solid transparent;
  border-image: url(shroom-ui/kit/panel.webp) 28 fill / 5px stretch;
  padding: 4px 8px;
  text-shadow: none;
}
.shroom .sh-toast:not(:empty) { box-sizing: border-box; padding-inline: 20px; }
.shroom .sh-pick { background: #21170e88; }
.shroom .sh-pickbox .sh-cards p, .shroom .sh-wait { color: var(--sh-wood-soft); }
#end.screen p { color: var(--sh-wood-soft); }
.shroom .sh-gifts .g {
  color: var(--sh-paper-ink);
  background: none;
  border: 1px solid transparent;
  border-image: url(shroom-ui/kit/card.webp) 18 fill / 4px stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 2px 3px #160d0766);
}
.shroom :is(.sh-bar, .sh-time) {
  background: url(shroom-ui/kit/wood-tile.webp) center / 128px 128px;
  box-shadow: inset 0 0 0 2px #a77a3e;
}
.shroom :is(.sh-bar, .sh-time) i {
  background: var(--sh-gold) url(shroom-ui/kit/parchment-tile.webp) center / 128px 128px;
  background-blend-mode: multiply;
  box-shadow: inset 0 1px #f4d78c, inset 0 -1px #92591f;
}
.shroom :is(.sh-loot button, .sh-cards button, .sh-exit, .sh-ready):hover, #end.screen button:hover {
  box-shadow: none;
  filter: drop-shadow(0 2px 3px #160d0766) brightness(1.12);
}
.shroom :is(.sh-loot button, .sh-cards button, .sh-exit, .sh-ready):focus-visible, #end.screen button:focus-visible {
  outline: 3px solid var(--sh-gold);
  outline-offset: 2px;
}
.shroom :is(.sh-loot button, .sh-cards button, .sh-exit, .sh-ready):active, #end.screen button:active {
  box-shadow: none;
  filter: brightness(.92);
}
.shroom :is(.sh-loot button, .sh-cards button, .sh-exit, .sh-ready):disabled, #end.screen button:disabled {
  color: var(--sh-wood-soft);
  cursor: default;
  box-shadow: none;
  filter: none;
}
.shroom .sh-cards button:disabled { color: var(--sh-paper-soft); }

.shroom :is(.sh-top, .sh-team, .sh-kit, .sh-pickbox, .sh-cards button, .sh-toast:not(:empty))::after, #end.screen .box::after {
  content: '';
  position: absolute;
  left: -16px;
  bottom: -16px;
  width: 48px;
  height: 48px;
  background: url(shroom-ui/kit/corner-moss.webp) center / contain no-repeat;
  pointer-events: none;
}
.shroom .sh-top::after { background-image: url(shroom-ui/kit/corner-oak.webp); }
.shroom .sh-team::after { background-image: url(shroom-ui/kit/corner-fern.webp); }
.shroom .sh-kit::after { left: auto; right: -16px; transform: scale(-1, 1); }
.shroom .sh-pickbox::after, #end.screen .box::after { left: -24px; bottom: -24px; width: 72px; height: 72px; background-image: url(shroom-ui/kit/corner-ivy.webp); }
.shroom :is(.sh-cards button, .sh-toast)::after { left: -10px; bottom: -10px; width: 30px; height: 30px; background-image: url(shroom-ui/kit/corner-fern.webp); }
.shroom .sh-cards button:nth-child(2)::after { background-image: url(shroom-ui/kit/corner-oak.webp); }
.shroom .sh-cards button:nth-child(3)::after { background-image: url(shroom-ui/kit/corner-ivy.webp); }
.shroom .sh-cards p { box-sizing: border-box; min-width: 0; white-space: normal; overflow: visible; text-overflow: clip; }
.shroom .sh-cards p button { display: inline-block; min-width: 44px; min-height: 44px; padding: 4px 6px; background: var(--sh-paper); color: var(--sh-paper-ink); border: 0; border-image: none; border-radius: 8px; text-shadow: none; }
.shroom .sh-cards p button::before, .shroom .sh-cards p button::after { display: none; }
.shroom .sh-cards p button[aria-pressed="true"] { outline: 3px solid var(--sh-gold); }
@media (min-width: 600px) {
  .shroom .sh-cards button { grid-template-columns: 32px minmax(0, 1fr); column-gap: 6px; }
  .shroom .sh-cards button > :is(img, i) { width: 32px; height: 32px; font-size: 22px; line-height: 32px; }
}

@media (max-width: 599px) {
  .shroom :is(.sh-top, .sh-team, .sh-kit, .sh-bag, .sh-pickbox), #end.screen .box { border-image-width: 5px; }
  .shroom .sh-cards button { border-image-width: 5px; }
  .shroom .sh-top { width: max-content; max-width: calc(100% - 16px); box-sizing: border-box; padding: 8px 12px; gap: 2px 8px; font-size: 13px; line-height: 18px; }
  .shroom .sh-top > span { white-space: nowrap; }
  .shroom :is(.sh-lvl, .sh-clock) { font-size: 15px; }
  .shroom .sh-boss { font-size: 12px; line-height: 14px; white-space: nowrap; }
  .shroom :is(.sh-top, .sh-team, .sh-kit, .sh-pickbox, .sh-cards button, .sh-toast)::after, #end.screen .box::after { display: none; }
  .shroom .sh-exit { min-width: 52px; padding-inline: 8px; font-size: 0; }
  .shroom .sh-exit::before { content: 'Уйти'; font: 800 13px Nunito, sans-serif; }
  .shroom .sh-exit kbd { display: none; }
  .shroom :is(.sh-loot button, .sh-exit, .sh-ready), #end.screen button { border-image-width: 4px 6px; }
  .shroom .sh-gifts .g { border-image-width: 3px; }
  .shroom :is(.sh-cards p, .sh-toast) { border-image-width: 4px; }
  .shroom .sh-cards .a { padding: 0; background: none; }
  .shroom .sh-loot { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 1px 6px; padding: 6px; font-size: 13px; line-height: 14px; }
  .shroom .sh-loot[hidden] { display: none; }
  .shroom .sh-loot img { float: none; width: 24px; height: 24px; margin: 0; }
  .shroom .sh-loot .sh-loot-info { min-height: 28px; }
  .shroom .sh-loot b { font-size: 14px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .shroom .sh-loot small { font-size: 13px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .shroom .sh-loot > :is(span, em, .sh-loot-notes, .sh-loot-actions) { grid-column: 1 / -1; margin: 0; }
  .shroom .sh-loot > :is(span, em, .sh-loot-notes) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .shroom .sh-loot em { display: inline; margin: 0; font-size: 13px; line-height: 14px; }
  .shroom .sh-loot em + em::before { content: ' · '; }
  .shroom .sh-loot .sh-loot-actions { grid-template-columns: minmax(0, 1fr) max-content; }
  .shroom .sh-loot button { padding: 4px 24px 4px 6px; font-size: 12px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .shroom .sh-bar i { transition: none; }
  .shroom .sh-cards button:is(:hover, :focus-visible) { transform: none; }
}

/* Lobby skin A: omit the panel fill so the aged notice stays visible inside the wooden rim. */
.sh-lobby {
  --sh-wood-ink: #f3e6c8; --sh-wood-soft: #e1ceaa;
  --sh-paper-ink: #21170e; --sh-paper-soft: #24190f;
  --sh-gold: #e5b650; --sh-paper: #c6cabc;
  box-sizing: border-box; color: var(--sh-paper-ink);
}
.sh-lobby *, .sh-lobby *::before, .sh-lobby *::after { box-sizing: border-box; }
.sh-lobby .sh-board {
  border: 16px solid transparent;
  border-image: url(shroom-ui/kit/panel.webp) 28 / 16px stretch;
  padding: 4px 16px; overflow: visible;
  background: var(--sh-paper) url(shroom-ui/kit/parchment-tile.webp) center / 256px 256px;
  background-blend-mode: multiply; background-clip: padding-box;
  box-shadow: inset 0 0 28px #51402b60;
}
.sh-lobby .sh-stand::before, .sh-lobby .sh-stand::after { filter: brightness(.65) saturate(.65) drop-shadow(0 8px 10px #0008); }
.sh-lobby .sh-board h2 { margin: 0; font-size: 44px; line-height: 1; color: var(--sh-paper-ink); }
.sh-lobby .sh-sub { margin: 2px 0; color: var(--sh-paper-soft); font-size: 15px; line-height: 18px; }
.sh-lobby .sh-seats {
  gap: 4px; background: #b8bcaf url(shroom-ui/kit/parchment-tile.webp) center / 256px 256px;
  background-blend-mode: multiply; box-shadow: inset 0 1px 4px #51402b33; border-radius: 3px;
}
.sh-lobby .sh-seat {
  min-height: 44px; grid-template-columns: 32px minmax(0, 1fr); gap: 2px 6px;
  align-items: center; align-content: center; justify-items: start; padding: 4px; margin: 2px;
  background: none; border: 0; outline: none; border-radius: 2px;
  color: var(--sh-paper-ink); box-shadow: none;
}
.sh-lobby .sh-seat.me { box-shadow: inset 0 0 0 2px var(--sh-gold); }
.sh-lobby .sh-seat::before { display: none; }
.sh-lobby .sh-seat .face, .sh-lobby .sh-seat.free i { grid-row: 1 / 3; width: 32px; height: 32px; }
.sh-lobby .sh-seat.free { background: none; box-shadow: none; color: var(--sh-paper-ink); }
.sh-lobby .sh-seat.free b { grid-row: 1 / 3; white-space: nowrap; }
.sh-lobby .sh-seat small { color: var(--sh-paper-soft); }
.sh-lobby .sh-seat small img { width: 16px; height: 16px; }
.sh-lobby .sh-weapons { gap: 4px 12px; margin: 6px 0 2px; }
.sh-lobby .sh-weapons button { gap: 2px; color: var(--sh-paper-ink); overflow-wrap: normal; white-space: nowrap; }
.sh-lobby .sh-weapons button img {
  padding: 4px; background: url(shroom-ui/kit/slot.webp) center / contain no-repeat;
  box-shadow: none;
}
.sh-lobby .sh-weapons button.on img { transform: none; box-shadow: 0 0 0 3px var(--sh-gold), 0 0 12px #e5b65088; }
.sh-lobby .sh-about { margin: 2px 0; color: var(--sh-paper-ink); }
.sh-lobby .sh-opts { position: relative; color: var(--sh-paper-ink); }
.sh-lobby .sh-opts::before {
  content: ''; position: absolute; top: -4px; left: 10%; width: 80%; height: 4px;
  background: url(shroom-ui/kit/divider.webp) center / 100% 100% no-repeat; pointer-events: none;
}
.sh-lobby .sh-opts button, .sh-lobby .sh-go.felt, .sh-lobby .sh-solo.felt {
  min-height: 44px; border: 2px solid transparent; border-radius: 0;
  border-image: url(shroom-ui/kit/button.webp) 16 24 fill / 6px 8px stretch;
  background: none; color: var(--sh-wood-ink); outline: none; box-shadow: none;
  text-shadow: none; filter: drop-shadow(0 2px 3px #160d0766);
}
.sh-lobby .sh-opts button {
  color: var(--sh-wood-soft); filter: brightness(.55) saturate(.7) drop-shadow(0 2px 3px #160d0766);
  box-shadow: inset 0 2px 4px var(--sh-paper-ink);
}
.sh-lobby .sh-opts button.on {
  color: var(--sh-wood-ink); text-shadow: 0 1px 2px var(--sh-paper-ink); filter: none;
  box-shadow: 0 0 0 2px var(--sh-gold), 0 0 10px color-mix(in srgb, var(--sh-gold) 55%, transparent);
}
.sh-lobby .sh-opts button:hover:enabled:not(.on) { filter: brightness(.775) saturate(.85) drop-shadow(0 2px 3px #160d0766); }
.sh-lobby .sh-opts button:disabled { opacity: .6; cursor: default; }
.sh-lobby .sh-opts button.on:disabled { opacity: 1; }
.sh-lobby :is(.sh-go, .sh-solo)::before, .sh-lobby :is(.sh-go, .sh-solo)::after { display: none; }
.sh-lobby .sh-go.felt { padding: 0 24px; font-size: 24px; }
.sh-lobby .sh-solo.felt { padding: 0 14px; font-size: 16px; }
.sh-lobby :is(.sh-go, .sh-solo) kbd {
  min-width: 1.9em; height: 1.9em; padding: 0 5px; border: 0; border-radius: 0;
  background: url(shroom-ui/kit/key.webp) center / 100% 100% no-repeat;
  color: var(--sh-wood-ink); box-shadow: none; font-size: 13px;
}
.sh-lobby :is(.sh-go.felt, .sh-solo.felt):hover:enabled:not(.on) { filter: drop-shadow(0 2px 3px #160d0766) brightness(1.12); }
.sh-lobby :is(.sh-go.felt, .sh-solo.felt):active:enabled:not(.on) { filter: brightness(.92); box-shadow: none; }
.sh-lobby :is(.sh-go.felt, .sh-solo.felt):disabled { opacity: .5; cursor: default; }
.sh-lobby button:focus-visible { outline: 3px solid var(--sh-gold); outline-offset: 3px; }
.sh-lobby .sh-optabout { margin: 2px 0; color: var(--sh-paper-soft); }
.sh-lobby .sh-timer { background: url(shroom-ui/kit/bark.webp) center / 100% 100% no-repeat; border: 0; border-radius: 0; color: var(--sh-paper-ink); box-shadow: none; }
.sh-lobby .sh-timer b, .sh-lobby .sh-board > small { color: var(--sh-paper-ink); }
.sh-lobby .sh-board::before, .sh-lobby .sh-board::after {
  content: ''; position: absolute; width: 56px; height: 56px; pointer-events: none;
  background: url(shroom-ui/kit/corner-ivy.webp) center / contain no-repeat;
}
.sh-lobby .sh-board::before { left: -40px; bottom: 0; }
.sh-lobby .sh-board::after { right: -40px; top: -16px; transform: rotate(180deg); background-image: url(shroom-ui/kit/corner-fern.webp); }
@media (max-width: 599px) {
  .sh-lobby .sh-board { border-width: 10px; border-image-width: 10px; padding: 4px 6px 8px; }
  .sh-lobby .sh-board h2 { font-size: 36px; }
  .sh-lobby .sh-sub { font-size: 13px; line-height: 16px; }
  .sh-lobby .sh-seat { gap: 2px 4px; }
  .sh-lobby .sh-seat:only-child { grid-column: 1 / -1; justify-self: center; width: 200px; max-width: 100%; }
  .sh-lobby .sh-seat b { font-size: 13px; line-height: 16px; }
  .sh-lobby .sh-seat small { min-width: 0; font-size: 13px; line-height: 16px; }
  .sh-lobby .sh-weapons { gap: 4px 8px; margin: 6px 0 2px; }
  .sh-lobby .sh-weapons button { min-height: 44px; font-size: 11.5px; line-height: 14px; }
  .sh-lobby .sh-opts { gap: 4px 8px; font-size: 13px; }
  .sh-lobby .sh-opts span { gap: 3px; flex-wrap: wrap; justify-content: center; }
  .sh-lobby .sh-opts button { min-width: 44px; padding: 0 8px; }
  .sh-lobby .sh-optabout { font-size: 13px; line-height: 16px; }
  .sh-lobby .sh-foot { gap: 6px 8px; }
  .sh-lobby .sh-go.felt { padding: 0 14px; font-size: 20px; }
  .sh-lobby .sh-solo.felt { padding: 0 10px; font-size: 14px; }
  .sh-lobby .sh-timer { padding: 4px 8px; }
  .sh-lobby .sh-board > small { margin-top: 4px; font-size: 13px; line-height: 16px; }
  .sh-lobby .sh-board::before, .sh-lobby .sh-board::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sh-lobby button, .sh-lobby .sh-weapons button img { transition: none; }
  .sh-lobby button:active, .sh-lobby .sh-weapons button:hover img { transform: none; }
}
