/* mini tufts: the one sitting on each space, and the closet. */

/* it sits a shelf above the bottom edge, where the big tuft walks */
.mini {
  position: absolute; bottom: 86px; left: 14px; z-index: 4;
  display: grid; justify-items: start; gap: 2px;
  font-size: 13px;
}
.mini.right { left: auto; right: 14px; justify-items: end; }
.mini-cat { background: none; border: 0; padding: 0; cursor: pointer; display: block; }
.mini-cat .tuft { cursor: pointer; }
.mini-tag, .mini-acts {
  background: var(--bg); border: 1px solid var(--line-up); padding: 1px 8px;
  white-space: nowrap; box-shadow: 2px 2px 0 #000;
}
.mini-tag { color: var(--dim); }
.mini-tag b { color: var(--text); font-weight: 600; }
.mini-acts { display: flex; gap: 12px; align-items: baseline; }
.mini-acts a { color: var(--accent); }
.mini-acts button[disabled] { opacity: .45; cursor: default; }
@media (pointer: coarse) { .mini-acts { padding: 3px 10px; gap: 16px; } .mini-acts > * { padding: 4px 0; } }
.mini-coins { color: #ffd84a; font-family: var(--pix); }
/* the buttons only show up when you're paying attention to it */
@media (hover: hover) {
  .mini .mini-acts { opacity: 0; transition: opacity .15s; }
  .mini:hover .mini-acts, .mini:focus-within .mini-acts { opacity: 1; }
}
.mini-back {
  position: absolute; bottom: 86px; left: 14px; z-index: 4;
  background: var(--bg); border: 1px solid var(--line-up); color: var(--faint);
  font-size: 12px; padding: 1px 8px; cursor: pointer;
}
.mini-back.right { left: auto; right: 14px; }
.mini-back:hover { color: var(--text); }

.mini-fx { position: absolute; left: 0; right: 0; top: 0; height: 0; pointer-events: none; }
.mini-fx span {
  position: absolute; top: 0; font-family: var(--pix); font-size: 20px; text-shadow: 2px 2px 0 #000;
  animation: mini-up 1.2s var(--ease) forwards;
}
.mini-fx .heart { color: var(--pink); }
.mini-fx .fish { color: #8fc7ff; }
@keyframes mini-up { from { transform: translateY(10px); opacity: 1; } to { transform: translateY(-36px); opacity: 0; } }

/* ---- closet ---------------------------------------------------------- */
.closet { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
@media (max-width: 680px) { .closet { grid-template-columns: 1fr; } }
.closet-me { position: sticky; top: 16px; display: grid; gap: 10px; justify-items: start; }
.closet-me .stand {
  width: 100%; display: grid; place-items: center; padding: 18px 0 10px;
  background: var(--bg-up); border: 1px solid var(--line);
}
.coins-big { font-family: var(--pix); font-size: 22px; color: #ffd84a; }
.closet h2 { margin-bottom: 10px; }
.coats { display: flex; flex-wrap: wrap; gap: 6px; }
.coat {
  background: var(--bg-up); border: 1px solid var(--line); padding: 4px; cursor: pointer;
  display: grid; justify-items: center; font-size: 12px; color: var(--dim);
}
.coat[aria-pressed="true"], .coat:hover { border-color: var(--accent); color: var(--text); }
.paints { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.paints label { display: grid; gap: 2px; font-size: 12px; color: var(--dim); }
.paints input[type=color] { width: 44px; height: 28px; padding: 0; border: 1px solid var(--line-up); background: none; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item {
  border: 1px solid var(--line); background: var(--bg-up); padding: 10px;
  display: grid; justify-items: center; gap: 4px; text-align: center;
}
.item.on { border-color: var(--accent); }
.item b { font-weight: 600; }
.item p { margin: 0; font-size: 12px; color: var(--faint); min-height: 2.6em; }
.item .price { font-family: var(--pix); color: #ffd84a; font-size: 14px; }
.item .btn { padding: 4px 12px; font-size: 14px; }
.slot-tabs { display: flex; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.slot-tabs button[aria-pressed="true"] { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.coinlog { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.coinlog li { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.coinlog .amt { font-family: var(--pix); width: 44px; color: #ffd84a; }
.coinlog .amt.neg { color: var(--bad); }
.coinlog .when { margin-left: auto; color: var(--faint); font-size: 13px; }
.earn { margin: 0; padding-left: 18px; color: var(--dim); font-size: 14px; }

/* ---- arcade ---------------------------------------------------------- */
.game { margin-top: 28px; }
.game h2 { margin-bottom: 4px; }
.game > p { margin: 0 0 12px; max-width: 60ch; }
.game-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-top: 10px; }
.game-left { margin-left: auto; }

.stage {
  position: relative; height: 300px; overflow: hidden; touch-action: none;
  background: linear-gradient(var(--sky), var(--bg-up) 70%, #1d2a44);
  border: 1px solid var(--line);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.stage .catcher { position: absolute; bottom: 0; }
.stage-msg {
  position: absolute; top: 12px; left: 0; right: 0; text-align: center;
  font-family: var(--pix); color: var(--dim); pointer-events: none;
}

.boxes { display: flex; gap: 14px; justify-content: center; padding: 30px 0 10px; }
/* each box is three layers: the flaps and inside, tuft, then the front */
.box {
  position: relative; width: 116px; height: 96px; padding: 0; cursor: pointer;
  background: none; border: 0; transition: transform .25s var(--ease);
}
.box[disabled] { cursor: default; }
.box .art { position: absolute; left: 0; right: 0; background: no-repeat center bottom; image-rendering: pixelated; }
.box .shut { bottom: 0; height: 80px; transition: transform .1s; }
.box:not([disabled]):hover .shut { transform: translateY(-3px) rotate(-1deg); }
.box .back { bottom: 48px; height: 28px; }
.box .front { bottom: 0; height: 52px; }
.box .peek { position: absolute; left: 18px; bottom: 38px; transform: translateY(30px); transition: transform .3s var(--ease); }
.box .back, .box .front, .box .peek { visibility: hidden; }
.box.open .shut { visibility: hidden; }
.box.open .back, .box.open .front { visibility: visible; }
.box.here .peek { visibility: visible; transform: none; }
@media (max-width: 420px) { .boxes { gap: 0; } .box { width: 108px; } .box .peek { left: 14px; } }

.paws { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 10px 0; }
.paw {
  position: relative; width: 84px; height: 76px; padding: 0; border: 0; cursor: pointer;
  background: no-repeat center; image-rendering: pixelated;
  opacity: .6; transition: opacity .1s, transform .1s;
}
.paw span { position: absolute; right: 2px; bottom: 0; font-family: var(--pix); font-size: 12px; color: var(--faint); }
.paw[disabled] { cursor: default; }
.paw:not([disabled]):hover { opacity: .85; }
.paw.lit { opacity: 1; transform: translateY(-4px) scale(1.08); }
/* four paws in one row on a phone, same as on a computer */
@media (max-width: 420px) { .paws { gap: 4px; flex-wrap: nowrap; } .paw { width: 76px; } }

/* ---- the hangout ------------------------------------------------------ */
.room {
  position: relative; height: 460px; overflow: hidden; user-select: none;
  border: 1px solid var(--line); background: #2a1f45;
}
.room .art { position: absolute; background: no-repeat center bottom / 100% 100%; image-rendering: pixelated; border: 0; padding: 0; }
.wall {
  position: absolute; left: 0; right: 0; top: 0; height: 36%;
  background: repeating-linear-gradient(90deg, #3a2a63 0 24px, #35265b 24px 48px);
  border-bottom: 4px solid var(--ink);
}
.wall .window, .sky-out { left: 30%; top: 14px; width: 120px; height: 108px; }
.sky-out { position: absolute; width: 112px; height: 84px; left: calc(30% + 4px); top: 18px; }
.wall .door { left: 2%; bottom: 0; width: 80px; height: 144px; }
.wall .bowl { left: 62%; bottom: 0; width: 64px; height: 68px; }
.room-sign {
  position: absolute; right: 4%; top: 22px; margin: 0; padding: 6px 10px; text-align: center;
  font-family: var(--pix); line-height: 1.3; color: var(--ink); background: #f6f0ff;
  box-shadow: 0 0 0 3px var(--ink), 4px 4px 0 3px #000; transform: rotate(-2deg);
}
.room-sign small { font-size: 11px; color: #5b34c4; }
.floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64%; cursor: pointer;
  background: repeating-linear-gradient(0deg, #4f3a2a 0 22px, #463325 22px 24px), #4f3a2a;
}
.floor:focus-visible { outline-offset: -3px; }
.floor .rug { left: 50%; top: 52%; width: 256px; height: 72px; transform: translate(-50%, -50%); z-index: 1; }
.floor .cushion { left: 86%; top: 20%; width: 96px; height: 32px; transform: translate(-50%, -30%); z-index: 2; }
.floor .plant { left: calc(2% + 92px); top: -12px; width: 56px; height: 72px; z-index: 3; }
.floor .yarn { width: 48px; height: 40px; transform: translate(-50%, -100%); cursor: pointer; background-color: transparent; }
.floor .yarn.rolling { animation: yarn-spin .35s steps(4) infinite; }
@keyframes yarn-spin { 50% { transform: translate(-50%, -110%) rotate(8deg); } }

.hang-mini {
  position: absolute; transform: translate(-50%, -100%); padding: 0; border: 0; background: none;
  display: grid; justify-items: center; cursor: pointer; color: inherit;
}
.hang-mini .tuft { cursor: pointer; }
.hang-mini.walking .tuft { animation: tuft-frames var(--spd) steps(4) infinite, hop .3s steps(2) infinite; }
@keyframes hop { 50% { translate: 0 -3px; } }
.hang-tag {
  font-family: var(--pix); font-size: 11px; white-space: nowrap; color: var(--dim);
  background: rgba(14, 11, 22, .7); padding: 0 4px; margin-top: -2px; pointer-events: none;
}
.hang-mini.mine .hang-tag { color: var(--accent); }
.hang-mini.host .hang-tag { color: #ffd84a; }
.hang-mini.picked .hang-tag { color: var(--text); outline: 2px solid var(--accent); }
.hang-bubble {
  position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 220px; padding: 4px 8px; font-size: 13px; line-height: 1.3;
  background: var(--text); color: #1a1222; box-shadow: 3px 3px 0 var(--ink); animation: pop .2s var(--ease);
  pointer-events: none;
}
.hang-treat { position: absolute; width: 32px; height: 16px; background: no-repeat center; image-rendering: pixelated; pointer-events: none; z-index: 2000; translate: -50% 0; }
.room-msg {
  position: absolute; top: 40%; left: 0; right: 0; text-align: center; z-index: 3000;
  font-family: var(--pix); color: var(--text); pointer-events: none;
}
.room-msg:empty { display: none; }
.room-msg button { pointer-events: auto; color: var(--accent); }
.hang-bar, .hang-pick { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 10px; }
.hang-me { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.hang-pick { padding: 8px 12px; border: 1px solid var(--line-up); background: var(--bg-up); }
.hang-pick[hidden] { display: none; }
#pickName { font-family: var(--pix); }
.btn.small { padding: 4px 10px; font-size: 14px; }
@media (max-width: 560px) {
  .room { height: 400px; }
  .wall .window { left: 26%; }
  .sky-out { left: calc(26% + 4px); }
  .wall .bowl { display: none; }
  .room-sign { right: 2%; font-size: 12px; }
  .room-sign small { font-size: 9px; }
  .floor .rug { width: 192px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  .hang-mini.walking .tuft, .floor .yarn.rolling { animation: none; }
}

/* high scores under each game. tuft's row is always first. */
.scores { margin-top: 12px; max-width: 320px; }
.scores h3 { font-size: 14px; color: var(--dim); font-weight: normal; margin: 0 0 4px; }
.scores ol { margin: 0; padding: 0; list-style: none; font-size: 14px; counter-reset: rank; }
.scores li::before { counter-increment: rank; content: counter(rank) "."; color: var(--faint); width: 18px; }
.scores li { display: flex; gap: 10px; }
.scores li b { margin-left: auto; font-family: var(--pix); font-weight: normal; color: var(--text); }
.scores li.tuft-row { color: var(--faint); font-style: italic; cursor: help; }
.scores li.tuft-row b { color: var(--faint); }
.scores li.me a { color: var(--pink); }
.scores p { margin: 4px 0 0; }

/* the /badges page */
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.stamps li { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); background: var(--bg-up); }
.stamps .art { width: 54px; flex-shrink: 0; display: grid; place-items: center; }
.stamps canvas { image-rendering: pixelated; display: block; }
.stamps li.nope canvas { filter: grayscale(1) brightness(.45); }
.stamps li.locked canvas { filter: brightness(0); opacity: .5; }
.stamps b { display: block; font-weight: 600; }
.stamps .how { font-size: 13px; color: var(--dim); }
.stamps .n { font-size: 12px; color: var(--faint); }
.stamps li.have b::after { content: " ✓"; color: var(--accent); font-weight: normal; }

/* ---- tuft cards (/cards) ---------------------------------------------- */
.pack-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 10px; background: var(--bg-up); border: 1px solid var(--line); color: var(--text);
  font: inherit; text-align: center;
}
button.card { cursor: pointer; }
button.card:hover { border-color: var(--accent); }
.card-frame { width: 78px; height: 102px; }
.card canvas { display: block; image-rendering: pixelated; }
.card b { font-size: 13px; font-weight: 600; line-height: 1.25; margin-top: 4px; }
.card .rar { font-size: 11px; color: var(--faint); letter-spacing: .06em; }
.card.r-uncommon .rar { color: #56b6e0; }
.card.r-rare .rar { color: #ff7ab6; }
.card.r-legendary .rar { color: #ffd84a; }
.card .n { position: absolute; top: 4px; right: 6px; font-family: var(--pix); font-size: 13px; color: var(--accent); }
.card .tag { position: absolute; top: 4px; left: 6px; font-size: 11px; background: var(--pink); color: var(--ink); padding: 0 5px; font-weight: 600; }
.card .sell { margin-top: 6px; font: inherit; font-size: 12px; padding: 2px 8px; border: 1px solid var(--line-up); background: none; color: var(--accent); cursor: pointer; }
.card .sell:hover { border-color: var(--accent); background: rgba(143, 111, 232, .15); }
.sell-hint { margin: 0 0 10px; }
.card.missing canvas { filter: brightness(0); opacity: .45; }
.card.missing b, .card.missing .rar { color: var(--faint); }
.card.r-legendary:not(.missing) .card-frame { position: relative; overflow: hidden; }
.card.r-legendary:not(.missing) .card-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%);
  background-size: 250% 100%; animation: shine 3s linear infinite;
}
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.pulled { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.pulled .card { width: 120px; animation: flip .5s var(--ease) both; }
@keyframes flip { from { transform: rotateY(90deg) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .pulled .card, .card.r-legendary .card-frame::after { animation: none; }
}
@media (max-width: 420px) { .cards { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; } }
.small-cards { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.trade-with { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.trade-with .field { margin-bottom: 0; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
@media (max-width: 560px) { .sides { grid-template-columns: 1fr; } }
.side { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; padding: 8px; border: 1px dashed var(--line-up); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; font: inherit; font-size: 13px;
  background: var(--bg); border: 1px solid var(--line-up); color: var(--text);
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--bad); }
.chip canvas { image-rendering: pixelated; display: block; }
.offers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.offer { padding: 12px; border: 1px solid var(--line); background: var(--bg-up); display: grid; gap: 8px; }
.offer .swap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.offer .swap > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.offer .swap > div > .faint { flex-basis: 100%; }
@media (max-width: 560px) { .offer .swap { grid-template-columns: 1fr; } }
.offer .acts { display: flex; gap: 10px; }
