@font-face {
  font-family: "Memory Lilita";
  src: url("/jogos/pintura/assets/fonts/LilitaOne-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Memory Baloo";
  src: url("/jogos/pintura/assets/fonts/Baloo2-Variable.ttf") format("truetype");
  font-display: swap;
}

html:has(body.memory-page),
body.memory-page {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
}

body.memory-page {
  position: relative;
  isolation: isolate;
  margin: 0;
  display: grid;
  place-items: center;
  background: #355520;
  color: #4d2569;
  font-family: "Memory Baloo", Nunito, sans-serif;
  overscroll-behavior: none;
}

body.memory-page::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: -16px;
  background:
    linear-gradient(rgba(31, 49, 20, .12), rgba(31, 49, 20, .2)),
    url("/jogos/pintura/assets/scene/painting-farm-landscape.png") center / cover no-repeat;
  filter: blur(5px) saturate(.95);
  transform: scale(1.03);
  pointer-events: none;
}

body.memory-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background: rgba(30, 42, 20, .06);
  pointer-events: none;
}

.memory-game-root {
  --memory-stage-scale: 1;
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: min(1280px, calc(100vw - 32px), calc((100dvh - 32px) * 16 / 9));
  max-width: 1280px;
  aspect-ratio: 16 / 9;
  display: grid;
  grid-template-rows: 84px minmax(0, 1fr);
  overflow: hidden;
  border: 4px solid rgba(250, 213, 119, .92);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 248, 220, .1)),
    url("/jogos/pintura/assets/scene/painting-farm-landscape.png") center / cover no-repeat;
  box-shadow: 0 24px 60px rgba(22, 28, 14, .38), inset 0 0 0 2px rgba(255, 255, 255, .38);
  user-select: none;
  -webkit-user-select: none;
}

body.memory-playing .memory-game-root {
  grid-template-rows: minmax(0, 1fr);
}

.memory-game-root,
.memory-game-root * {
  box-sizing: border-box;
}

.memory-game-root button,
.memory-game-root a {
  font-family: "Memory Baloo", Nunito, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.memory-game-root button:focus-visible,
.memory-game-root a:focus-visible {
  outline: 5px solid #2eb7ea;
  outline-offset: 3px;
}

.memory-game-root [hidden] {
  display: none !important;
}

.memory-topbar {
  position: relative;
  z-index: 50;
  min-height: 84px;
  padding: 8px 14px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 180px;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255, 250, 224, .97), rgba(246, 220, 158, .94));
  border-bottom: 4px solid #d89536;
  box-shadow: 0 6px 18px rgba(74, 45, 20, .18);
}

.memory-topbar h1 {
  grid-column: 2;
  margin: 0;
  color: #6e2caf;
  font-family: "Memory Lilita", "Memory Baloo", sans-serif;
  font-size: clamp(34px, 3.8vw, 50px);
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-shadow: 0 3px 0 #fff7cf, 0 6px 12px rgba(90, 39, 135, .2);
}

.memory-back-control {
  box-sizing: border-box;
  width: 170px;
  min-width: 170px;
  min-height: 66px;
  padding: 3px 13px 3px 4px;
  display: inline-grid;
  grid-template-columns: 58px auto;
  place-items: center;
  gap: 4px;
  border: 3px solid #dfa13a;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffbed, #f3d69b);
  color: #653b18;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 5px 0 #b96f28, 0 9px 17px rgba(70, 41, 19, .2);
  touch-action: manipulation;
}

.memory-back-control:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b96f28, 0 5px 10px rgba(70, 41, 19, .18);
}

.memory-back-control img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  pointer-events: none;
}

.memory-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 10px 18px 16px;
  overflow: hidden;
}

.memory-setup,
.memory-game {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.memory-setup {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 12px 18px 16px;
  border: 3px solid rgba(226, 170, 69, .95);
  border-radius: 28px;
  background: rgba(255, 249, 225, .92);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .5), 0 18px 44px rgba(66, 37, 19, .22);
}

.memory-selection-step {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.memory-selection-step > h2 {
  margin: 0;
  color: #6725a0;
  font-family: "Memory Lilita", "Memory Baloo", sans-serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-shadow: 0 3px 0 #fff5c8, 0 5px 10px rgba(75, 31, 105, .14);
}

.collection-grid {
  min-height: 0;
  padding: 4px 8px 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  overflow: hidden;
}

.collection-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 54px;
  border: 4px solid #dfa943;
  border-radius: 25px;
  background: #fff9df;
  color: #5f268d;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .72), 0 7px 0 #b96d27, 0 12px 22px rgba(78, 42, 20, .2);
  touch-action: manipulation;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.collection-card:active {
  transform: translateY(3px);
}

.collection-card.active {
  border-color: #7a28b6;
  box-shadow: inset 0 0 0 4px #a95bd4, 0 7px 0 #512078, 0 13px 25px rgba(84, 32, 119, .28);
}

.collection-card.premium-locked {
  filter: none;
  opacity: 1;
}

.collection-card.premium-locked::after {
  display: none;
}

.collection-art {
  min-height: 0;
  padding: 7px 16px 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(145deg, #fff4b9, #ffd6ee 55%, #d7f4ff);
}

.collection-art-animals {
  background: linear-gradient(145deg, #dff7d3, #ffe1c5 55%, #c9efff);
}

.collection-art-vehicles {
  background: linear-gradient(145deg, #dbeeff, #fff0b8 55%, #ddd1ff);
}

.collection-art-foods {
  background: linear-gradient(145deg, #ffe0e8, #fff2b7 55%, #d8f6d1);
}

.collection-art img {
  width: min(31%, 148px);
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 9px rgba(40, 16, 58, .16));
  pointer-events: none;
}

.collection-art img:nth-child(1) {
  transform: rotate(-8deg) translateX(16px);
}

.collection-art img:nth-child(2) {
  z-index: 2;
  transform: translateY(-7px);
}

.collection-art img:nth-child(3) {
  transform: rotate(8deg) translateX(-16px);
}

.collection-body {
  min-height: 54px;
  padding: 6px 82px 6px 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fffbed, #f8e8bc);
}

.collection-body strong {
  font-size: 21px;
  line-height: 1;
  text-align: center;
}

.collection-status {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 10px;
  min-width: 68px;
  min-height: 34px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 2px solid #6d279d;
  border-radius: 999px;
  background: linear-gradient(180deg, #9c49d5, #6c249f);
  color: #fff;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 3px 0 #4c176f;
}

.collection-status.is-free {
  border-color: #31834b;
  background: linear-gradient(180deg, #68d27c, #32a556);
  box-shadow: 0 3px 0 #247a3d;
}

.collection-status img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  filter: none !important;
}

.difficulty-selection-step {
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  justify-items: center;
  gap: 9px;
}

.selected-collection-preview {
  width: min(590px, 70%);
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 46px;
  overflow: hidden;
  border: 4px solid #dfa943;
  border-radius: 24px;
  background: #fff9df;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .72), 0 7px 0 #b96d27, 0 12px 22px rgba(78, 42, 20, .2);
}

.selected-collection-art {
  min-height: 0;
  padding: 4px 20px 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(145deg, #fff4b9, #ffd6ee 55%, #d7f4ff);
}

.selected-collection-art-animals {
  background: linear-gradient(145deg, #dff7d3, #ffe1c5 55%, #c9efff);
}

.selected-collection-art-vehicles {
  background: linear-gradient(145deg, #dbeeff, #fff0b8 55%, #ddd1ff);
}

.selected-collection-art-foods {
  background: linear-gradient(145deg, #ffe0e8, #fff2b7 55%, #d8f6d1);
}

.selected-collection-art img {
  width: min(30%, 166px);
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 9px rgba(40, 16, 58, .16));
}

.selected-collection-art img:nth-child(1) {
  transform: rotate(-8deg) translateX(20px);
}

.selected-collection-art img:nth-child(2) {
  z-index: 2;
  transform: translateY(-5px);
}

.selected-collection-art img:nth-child(3) {
  transform: rotate(8deg) translateX(-20px);
}

.selected-collection-preview h3 {
  margin: 0;
  padding: 5px 12px;
  display: grid;
  place-items: center;
  color: #5f268d;
  background: linear-gradient(180deg, #fffbed, #f8e8bc);
  font-size: 21px;
  line-height: 1;
  text-align: center;
}

.difficulty-grid {
  width: min(720px, 88%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.difficulty-btn {
  min-height: 70px;
  padding: 7px 14px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 3px solid #dba33c;
  border-radius: 19px;
  background: linear-gradient(180deg, #fffbea, #f5dfad);
  color: #5f268d;
  cursor: pointer;
  box-shadow: 0 4px 0 #b96e29;
  touch-action: manipulation;
}

.difficulty-btn.active,
.difficulty-btn[aria-pressed="true"] {
  border-color: #4f147c;
  background: linear-gradient(145deg, #8538c4, #5b1994);
  color: #fff;
  box-shadow: 0 5px 0 #45136c, 0 10px 18px rgba(114, 39, 184, .25);
}

.difficulty-btn strong {
  font-size: 22px;
}

.difficulty-btn small {
  font-size: 15px;
  font-weight: 900;
  opacity: .86;
}

.best-line {
  color: #694d76;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.setup-actions {
  width: min(640px, 84%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.setup-actions button {
  width: 100%;
  cursor: pointer;
  touch-action: manipulation;
}

.setup-actions .primary-btn {
  min-height: 58px;
  border: 3px solid #50127f;
  border-radius: 19px;
  background: linear-gradient(180deg, #974ad1, #69249f);
  color: #fff;
  box-shadow: 0 6px 0 #46116e, 0 10px 19px rgba(70, 18, 108, .25);
  font-size: 24px;
  font-weight: 1000;
}

.setup-actions .secondary-btn {
  min-height: 40px;
  border: 2px solid #d39a35;
  border-radius: 14px;
  color: #652991;
  background: #fff4d3;
  font-size: 17px;
  font-weight: 900;
}

body.memory-playing .memory-topbar {
  position: absolute;
  z-index: 80;
  top: 10px;
  left: 12px;
  width: 172px;
  min-height: 72px;
  padding: 0;
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.memory-playing .memory-topbar h1 {
  display: none;
}

body.memory-playing .memory-back-control {
  width: 164px;
  min-width: 164px;
  min-height: 68px;
}

body.memory-playing .memory-shell {
  padding: 8px 12px 12px;
}

.memory-game {
  display: grid;
  grid-template-rows: 76px 52px 8px minmax(0, 1fr);
  gap: 6px;
}

.memory-controls {
  min-height: 76px;
  padding-left: 184px;
  display: grid;
  grid-template-columns: repeat(5, 72px);
  justify-content: end;
  align-items: center;
  gap: 9px;
}

.memory-controls .control-btn {
  position: relative;
  width: 72px;
  min-width: 72px;
  height: 72px;
  min-height: 72px;
  padding: 2px;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #63278e;
  cursor: pointer;
  touch-action: manipulation;
}

.memory-controls .control-btn:active {
  transform: scale(.94);
}

.memory-controls .control-btn:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.memory-control-icon {
  position: absolute;
  inset: 0;
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: none !important;
  pointer-events: none;
}

.memory-controls .control-btn > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.memory-controls .control-btn.is-used {
  opacity: .52;
}

.memory-hud {
  width: min(720px, 70%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.memory-hud .hud-item {
  min-height: 52px;
  padding: 4px 10px;
  display: grid;
  grid-template-columns: auto auto;
  place-content: center;
  align-items: baseline;
  gap: 8px;
  border: 2px solid #dfa541;
  border-radius: 14px;
  background: rgba(255, 248, 217, .96);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .76), 0 4px 0 #b96e29, 0 7px 13px rgba(74, 42, 20, .14);
}

.memory-hud .hud-label {
  color: #76527e;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.memory-hud .hud-value {
  color: #6d249e;
  font-size: 23px;
  font-weight: 1000;
  line-height: 1;
}

.memory-progress {
  width: min(820px, 78%);
  height: 8px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 248, 218, .9);
  box-shadow: 0 2px 4px rgba(71, 38, 17, .2);
}

.memory-progress > div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff4f9a, #ffd34e, #49b964);
  transition: width .3s ease;
}

.memory-board-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 5px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid rgba(218, 158, 55, .9);
  border-radius: 20px;
  background: rgba(255, 247, 218, .78);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .46), 0 10px 24px rgba(68, 37, 18, .18);
  backdrop-filter: blur(2px);
}

.memory-board {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--memory-cols, 4), var(--memory-card-width, 120px));
  gap: var(--memory-gap, 7px);
  justify-content: center;
  align-content: center;
  touch-action: none;
}

.memory-card {
  position: relative;
  width: var(--memory-card-width, 120px);
  height: var(--memory-card-height, 146px);
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
  appearance: none;
  -webkit-appearance: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.memory-card-inner {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-style: preserve-3d;
  transition: transform .52s cubic-bezier(.2, .72, .22, 1);
  box-shadow: 0 7px 14px rgba(20, 5, 34, .24);
  pointer-events: none;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner,
.memory-card.peek .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  pointer-events: none;
}

.memory-card-back {
  display: grid;
  place-items: center;
  border: 3px solid #fff3c8;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, .3) 0 3px, transparent 4px),
    radial-gradient(circle at 75% 72%, rgba(255, 255, 255, .22) 0 4px, transparent 5px),
    linear-gradient(145deg, #8b38cf, #4f138d 55%, #ff4f9a);
  background-size: 56px 56px, 72px 72px, auto;
}

.memory-card-back::before {
  content: "♥";
  width: 54%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: clamp(28px, 4vw, 58px);
  box-shadow: inset 0 0 0 5px rgba(255, 211, 78, .23), 0 7px 15px rgba(31, 8, 54, .22);
}

.memory-card-front {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  border: 3px solid #fff;
  background: #fff;
}

.memory-card-art {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(#fff, #f8f3ff);
}

.memory-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  pointer-events: none;
}

.memory-card-name {
  flex: 0 0 18%;
  min-height: 18px;
  padding: 2px 4px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5f1998, #862fd0);
  color: #fff;
  font-size: clamp(8px, 1.1vw, 14px);
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.memory-card.matched {
  pointer-events: none;
}

.memory-card.matched .memory-card-inner {
  animation: memoryMatchPulse .58s ease;
  box-shadow: 0 0 0 4px #65d47c, 0 0 22px rgba(101, 212, 124, .78);
}

.memory-card.mismatch .memory-card-inner {
  animation: memoryCardShake .38s ease;
}

.memory-board.compact-cards .memory-card-name {
  display: none;
}

.memory-board.compact-cards .memory-card-art {
  height: 100%;
}

.memory-game-root.is-paused .memory-card-inner,
.memory-game-root.is-paused .memory-progress > div {
  animation-play-state: paused;
  transition-play-state: paused;
}

.pause-overlay {
  position: absolute;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(43, 14, 67, .84);
  backdrop-filter: blur(7px);
  color: #fff;
}

.memory-pause-dialog {
  display: grid;
  place-items: center;
  gap: 12px;
}

.memory-pause-dialog > img {
  width: 108px;
  height: 108px;
  object-fit: contain;
}

.memory-pause-dialog > strong {
  color: #fff8d9;
  font-family: "Memory Lilita", "Memory Baloo", sans-serif;
  font-size: 32px;
  font-weight: 400;
  text-shadow: 0 3px 0 rgba(54, 17, 79, .5);
}

.memory-resume-btn {
  width: 116px;
  height: 116px;
  padding: 4px;
  display: grid;
  place-items: center;
  border: 3px solid #e4aa42;
  border-radius: 50%;
  background: #fff6cf;
  box-shadow: 0 6px 0 #b96e29, 0 12px 24px rgba(28, 8, 43, .35);
  cursor: pointer;
  touch-action: manipulation;
}

.memory-resume-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.memory-resume-btn span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.memory-resume-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b96e29;
}

.memory-win-modal {
  position: absolute;
  z-index: 1900;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: url("/jogos/sombras/assets/victory/shadow-victory-bg.png") center / cover no-repeat;
}

.memory-win-card {
  position: relative;
  isolation: isolate;
  width: 1040px;
  max-width: 86%;
  height: 590px;
  max-height: 86%;
  overflow: hidden;
  border: 4px solid #d99b30;
  border-radius: 34px;
  color: #4d2569;
  text-align: center;
  box-shadow: 0 24px 60px rgba(49, 26, 15, .34);
}

.memory-victory-panel {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.memory-victory-content {
  position: relative;
  z-index: 2;
  width: min(72%, 720px);
  height: 100%;
  margin: 0 auto;
  padding: 24px 0 30px;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: center;
  gap: 8px;
}

.memory-victory-celebration {
  min-height: 0;
  display: grid;
  place-items: center;
}

.memory-victory-celebration img {
  width: auto;
  height: min(150px, 24vh);
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(84, 48, 13, .24));
}

.memory-victory-copy {
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 3px;
}

.memory-victory-copy h2 {
  margin: 0;
  color: #6d249d;
  font-family: "Memory Lilita", "Memory Baloo", sans-serif;
  font-size: 37px;
  font-weight: 400;
  line-height: 1;
}

.memory-victory-copy p {
  margin: 0;
  color: #6b4b75;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.new-record {
  justify-self: center;
  padding: 6px 17px;
  border: 2px solid #d39a28;
  border-radius: 999px;
  color: #7b4d00;
  background: linear-gradient(180deg, #fff7bd, #f7d976);
  box-shadow: 0 4px 0 #c18421;
  font-size: 16px;
  font-weight: 1000;
}

.win-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.win-stats div {
  min-height: 70px;
  padding: 6px 14px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 3px solid #d9a23a;
  border-radius: 18px;
  background: rgba(255, 249, 220, .94);
  box-shadow: inset 0 0 0 2px #fff, 0 5px 0 #b76b27;
}

.win-stats strong {
  color: #702ca4;
  font-size: 30px;
  line-height: 1;
}

.win-stats span {
  color: #795c79;
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

.win-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.win-actions button {
  min-width: 0;
  min-height: 58px;
  border-radius: 17px;
  font-size: 18px;
  font-weight: 1000;
  cursor: pointer;
  touch-action: manipulation;
}

.win-actions .primary-btn {
  border: 3px solid #4d1479;
  background: linear-gradient(180deg, #9345cd, #68239d);
  color: #fff;
  box-shadow: 0 5px 0 #441269;
}

.win-actions .secondary-btn {
  border: 3px solid #d2962e;
  background: linear-gradient(180deg, #fff9d9, #f1d79b);
  color: #672991;
  box-shadow: 0 5px 0 #b56b28;
}

.memory-victory-flower {
  position: absolute;
  z-index: 1;
  width: 170px;
  aspect-ratio: 1;
  background: url("/jogos/sombras/assets/victory/shadow-victory-flowers.png") 0 0 / 200% 200% no-repeat;
  pointer-events: none;
  transform: scale(.82);
}

.memory-victory-flower-top-left {
  top: -2%;
  left: -1%;
  background-position: 0 0;
  transform-origin: top left;
}

.memory-victory-flower-top-right {
  top: -2%;
  right: -1%;
  background-position: 100% 0;
  transform-origin: top right;
}

.memory-victory-flower-bottom-left {
  bottom: -2%;
  left: -1%;
  background-position: 0 100%;
  transform-origin: bottom left;
}

.memory-victory-flower-bottom-right {
  right: -1%;
  bottom: -2%;
  background-position: 100% 100%;
  transform-origin: bottom right;
}

.memory-confetti {
  position: absolute;
  z-index: 1950;
  top: -22px;
  width: 11px;
  height: 18px;
  border-radius: 3px;
  background: var(--confetti-color);
  pointer-events: none;
  animation: memoryConfettiFall var(--confetti-duration) linear forwards;
}

@keyframes memoryMatchPulse {
  50% { transform: rotateY(180deg) scale(1.08); }
}

@keyframes memoryCardShake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

@keyframes memoryConfettiFall {
  to {
    transform: translate3d(var(--confetti-drift), 760px, 0) rotate(720deg);
    opacity: .92;
  }
}

@media (max-width: 980px) and (hover: hover) {
  .memory-topbar {
    grid-template-columns: 150px minmax(0, 1fr) 150px;
  }

  .memory-back-control {
    width: 145px;
    min-width: 145px;
    font-size: 18px;
  }

  .memory-selection-step > h2 {
    font-size: 34px;
  }

  .collection-body strong {
    font-size: 17px;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  html.lila-portable-touch-game:fullscreen body.memory-page {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  html.lila-portable-touch-game:fullscreen body.memory-page.memory-mobile-stage-active .memory-game-root {
    position: fixed;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 1280px;
    min-width: 1280px;
    max-width: none;
    height: 720px;
    min-height: 720px;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    transform: translate(-50%, -50%) scale(var(--memory-stage-scale, 1));
    transform-origin: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .collection-card,
  .difficulty-btn,
  .memory-card-inner,
  .memory-progress > div {
    transition: none;
  }

  .memory-card.matched .memory-card-inner,
  .memory-card.mismatch .memory-card-inner,
  .memory-confetti {
    animation: none;
  }

  body.memory-page::before {
    filter: brightness(.88);
  }
}
