/* Teacakes Galore — dashboard mini-game shell */

.tcg-root {
  --tcg-pink: #f472b6;
  --tcg-cream: #fff7ed;
  --tcg-brown: #78350f;
  --tcg-panel: rgba(255, 255, 255, 92%);
  --tcg-cell-size: 50px;
  max-width: 520px;
  margin: 0 auto;
  min-height: 640px;
  padding: 16px;
  border-radius: 16px;
  background-color: #fde68a;
  /* Tile image set inline from /teacakes-match-assets (manifest) or fallback URL in JS */
  background-image: none;
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 100% auto;
  box-shadow: 0 16px 40px rgba(120, 53, 15, 0.2);
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--tcg-brown);
  position: relative;
  overflow: hidden;
}

.tcg-root::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.88) 0%, rgba(255, 247, 237, 0.55) 40%, rgba(255, 247, 237, 0.75) 100%);
  pointer-events: none;
  z-index: 0;
}

.tcg-root > * {
  position: relative;
  z-index: 1;
}

.tcg-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin: 8px 0 4px;
  text-shadow: 0 1px 0 #fff;
  letter-spacing: 0.02em;
}

.tcg-by {
  text-align: center;
  font-size: 0.95rem;
  margin-bottom: 16px;
  opacity: 0.9;
}

.tcg-panel {
  background: var(--tcg-panel);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 2px solid rgba(120, 53, 15, 0.15);
}

.tcg-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.tcg-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(180deg, #f9a8d4, var(--tcg-pink));
  color: #5b0b2e;
  box-shadow: 0 4px 0 #be185d;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.tcg-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #be185d;
}

.tcg-btn.secondary {
  background: linear-gradient(180deg, #fef3c7, #fcd34d);
  color: #78350f;
  box-shadow: 0 4px 0 #b45309;
}

.tcg-btn.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.tcg-hud {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.tcg-hud--play {
  flex-wrap: wrap;
  align-items: center;
}

.tcg-hud-bricks {
  white-space: nowrap;
}

.tcg-hud-gems {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  margin: -2px 0 8px;
}

.tcg-obj-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(120, 53, 15, 0.12);
}

.tcg-obj-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.tcg-obj-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: block;
}

.tcg-obj-dot--0 { background: #fb7185; }
.tcg-obj-dot--1 { background: #4ade80; }
.tcg-obj-dot--2 { background: #38bdf8; }
.tcg-obj-dot--3 { background: #fbbf24; }
.tcg-obj-dot--4 { background: #c084fc; }

.tcg-obj-count {
  color: var(--tcg-brown);
  font-variant-numeric: tabular-nums;
}

.tcg-board-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}

.tcg-board {
  display: grid;
  gap: 4px;
  padding: 8px;
  background: rgba(120, 53, 15, 0.12);
  border-radius: 12px;
  touch-action: none;
}

.tcg-cell {
  width: var(--tcg-cell-size);
  height: var(--tcg-cell-size);
  border-radius: 10px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.35);
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.14s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.1s ease;
  position: relative;
}

.tcg-cell:active {
  cursor: grabbing;
}

.tcg-cell.tcg-dragging {
  transition: none;
  z-index: 3;
  filter: brightness(1.06);
}

.tcg-cell.tcg-swap-target {
  outline: 3px solid #d97706;
  outline-offset: 1px;
}

@keyframes tcg-tile-disintegrate {
  0% {
    transform: scale(1);
    opacity: 1;
    filter: brightness(1) blur(0);
    box-shadow:
      inset 0 -3px 0 rgba(0, 0, 0, 0.12),
      0 0 0 0 rgba(251, 191, 36, 0);
  }
  28% {
    filter: brightness(1.45) blur(0.5px);
    box-shadow:
      inset 0 -3px 0 rgba(0, 0, 0, 0.08),
      0 0 18px 6px rgba(251, 191, 36, 0.75);
  }
  100% {
    transform: scale(0.12) rotate(14deg);
    opacity: 0;
    filter: brightness(2) blur(7px);
    box-shadow: none;
  }
}

.tcg-cell.tcg-disintegrate {
  animation: tcg-tile-disintegrate 0.44s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
  z-index: 4;
  transition: none;
}

.tcg-cell-face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tcg-tile-img--powerup {
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
}

.tcg-tile-img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.tcg-cell.selected {
  outline: 3px solid #c026d3;
  outline-offset: 2px;
  filter: brightness(1.08);
}

.tcg-kind-0 { background: linear-gradient(180deg, #fecdd3, #fb7185); color: #881337; }
.tcg-kind-1 { background: linear-gradient(180deg, #bbf7d0, #4ade80); color: #14532d; }
.tcg-kind-2 { background: linear-gradient(180deg, #bfdbfe, #38bdf8); color: #0c4a6e; }
.tcg-kind-3 { background: linear-gradient(180deg, #fde68a, #fbbf24); color: #713f12; }
.tcg-kind-4 { background: linear-gradient(180deg, #e9d5ff, #c084fc); color: #4c1d95; }

/* Play board: gems read as icons only; bricks & powerups keep a light panel */
.tcg-root--play .tcg-cell:not(.tcg-brick):not([class*="tcg-pu-"]) {
  background: transparent;
  border-color: rgba(120, 53, 15, 0.14);
  box-shadow: none;
}

.tcg-root--play .tcg-cell[class*="tcg-pu-"] {
  background: rgba(255, 255, 255, 0.35);
}

.tcg-brick {
  background: linear-gradient(145deg, #9a3412, #7c2d12 40%, #451a03);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35);
}

.tcg-brick--cracked {
  background: linear-gradient(145deg, #b45309, #92400e 45%, #78350f);
  opacity: 0.92;
}

.tcg-brick-glyph {
  font-size: calc(var(--tcg-cell-size, 50px) * 0.52);
  line-height: 1;
  color: rgba(254, 243, 199, 0.95);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  font-weight: 800;
}

.tcg-kind-strip {
  box-shadow: 0 0 0 2px #fff, 0 0 8px 2px rgba(250, 204, 21, 0.9);
}

.tcg-kind-bomb {
  box-shadow: 0 0 0 2px #fff, 0 0 10px 3px rgba(236, 72, 153, 0.95);
}

.tcg-level-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tcg-level-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid rgba(120, 53, 15, 0.2);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-weight: 700;
}

.tcg-level-btn:hover {
  border-color: var(--tcg-pink);
}

.tcg-level-btn.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Map level select: full-height art inside a large scrollable viewport */
/* Play mode: same 520px card as other screens; board grows to fill the card via JS + flex */
.tcg-root.tcg-root--play {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  min-height: 640px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.tcg-root.tcg-root--play .tcg-hud {
  flex-shrink: 0;
}

.tcg-root.tcg-root--play .tcg-board-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  margin: 6px 0 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

.tcg-root.tcg-root--play .tcg-board {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.tcg-root.tcg-root--play .tcg-row {
  flex-shrink: 0;
}

.tcg-activity-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0 0 10px;
}

.tcg-activity-nav-btn {
  flex: 1;
  max-width: 200px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px solid rgba(120, 53, 15, 0.25);
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--tcg-brown);
}

.tcg-activity-nav-btn.is-active {
  background: linear-gradient(180deg, #f9a8d4, var(--tcg-pink));
  border-color: #be185d;
  color: #5b0b2e;
}

.tcg-root--activity-lb .tcg-lb-panel {
  padding: 10px 12px;
}

.tcg-lb-scroll {
  max-height: min(52vh, 420px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.tcg-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.tcg-lb-table th,
.tcg-lb-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(120, 53, 15, 0.12);
}

.tcg-lb-table th {
  font-weight: 800;
  position: sticky;
  top: 0;
  background: rgba(255, 247, 237, 0.95);
}

.tcg-lb-rank {
  width: 2rem;
  font-variant-numeric: tabular-nums;
}

.tcg-lb-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tcg-lb-row--me {
  background: rgba(244, 114, 182, 0.15);
  font-weight: 700;
}

.tcg-root.tcg-root--map {
  max-width: min(720px, calc(100vw - 16px));
  width: 100%;
  padding: 8px 10px 12px;
  min-height: unset;
}

.tcg-root.tcg-root--map .tcg-title {
  margin-bottom: 4px;
}

.tcg-root.tcg-root--map .tcg-by {
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.tcg-map-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 6px;
}

.tcg-map-tab {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 220px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid rgba(120, 53, 15, 0.28);
  background: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--tcg-brown);
  box-shadow: 0 2px 0 rgba(120, 53, 15, 0.12);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.tcg-map-tab:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.72);
}

.tcg-map-tab.is-active {
  background: linear-gradient(180deg, #f9a8d4, var(--tcg-pink));
  border-color: #be185d;
  color: #5b0b2e;
  box-shadow: 0 3px 0 #be185d;
}

.tcg-map-tab.is-active:hover:not(:disabled) {
  filter: brightness(1.02);
}

.tcg-map-tab.is-locked:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.tcg-map-chapter2-hint {
  text-align: center;
  margin: 0 0 6px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.tcg-map-wrap {
  margin-bottom: 8px;
  flex: 1;
  min-height: 0;
}

.tcg-map-viewport {
  width: 100%;
  border-radius: 16px;
  border: 2px solid rgba(120, 53, 15, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 8px 28px rgba(120, 53, 15, 0.18);
  background: #87ceeb;
  box-sizing: border-box;
}

.tcg-map-viewport--scroll {
  max-height: min(92vh, calc(100vh - 120px));
  max-height: min(92dvh, calc(100dvh - 120px));
  min-height: min(320px, 45vh);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

.tcg-map-scroller {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  line-height: 0;
}

.tcg-map-bg {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.tcg-map-bg--fallback {
  min-height: 420px;
  background: linear-gradient(180deg, #bae6fd, #fde68a 55%, #86efac);
}

.tcg-map-overlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.tcg-map-connector {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  width: clamp(36px, 10vw, 56px);
  height: auto;
  pointer-events: none;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tcg-map-decor {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

.tcg-map-clouds {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.42;
  mix-blend-mode: soft-light;
}

.tcg-map-node-wrap {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 6px;
}

/* Selected avatar + pack frame, floated above the next playable level */
.tcg-map-player-pin {
  position: absolute;
  z-index: 7;
  transform: translate(-50%, calc(-50% - clamp(46px, 12vw, 64px)));
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tcg-map-player-stack {
  position: relative;
}

/* Picture-style box: your avatar fills the inner window (no pawn PNG). */
.tcg-map-player-stack--boxed {
  width: clamp(52px, 15vw, 74px);
  height: clamp(52px, 15vw, 74px);
  padding: 4px;
  box-sizing: border-box;
  background: linear-gradient(165deg, #fffbeb 0%, #fef3c7 40%, #fde68a 100%);
  border: 3px solid rgba(120, 53, 15, 0.55);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 8px rgba(180, 83, 9, 0.1),
    0 5px 14px rgba(0, 0, 0, 0.28);
  filter: drop-shadow(0 4px 10px rgba(120, 53, 15, 0.2));
}

.tcg-map-player-avatar--boxed {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
}

.tcg-map-player-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 36px;
  font-size: 1.25rem;
  font-weight: 800;
  color: rgba(120, 53, 15, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
}

/* Optional manifest PNG: true frame with transparent center over a smaller avatar */
.tcg-map-player-stack--png-overlay {
  width: clamp(58px, 17vw, 86px);
  height: clamp(58px, 17vw, 86px);
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.28));
}

.tcg-map-player-stack--png-overlay .tcg-map-player-avatar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 54%;
  height: 54%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 0;
}

.tcg-map-player-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  pointer-events: none;
}

.tcg-map-stars {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: clamp(4px, 1.2vw, 8px);
  margin-top: 2px;
  pointer-events: none;
  position: relative;
  z-index: 6;
}

.tcg-map-star--glyph {
  font-size: clamp(22px, 6.2vw, 34px);
  line-height: 1;
  display: inline-block;
  font-weight: 800;
}

.tcg-map-star--on {
  color: #fde047;
  text-shadow:
    0 0 1px #b45309,
    0 1px 0 #92400e,
    0 -1px 1px rgba(255, 255, 255, 0.45);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.tcg-map-star--off {
  color: rgba(88, 45, 12, 0.22);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tcg-map-avatar {
  width: clamp(48px, 14vw, 72px);
  height: auto;
  margin-bottom: -6px;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
  position: relative;
}

.tcg-map-node {
  position: relative;
  pointer-events: auto;
  width: clamp(56px, 16vw, 80px);
  height: clamp(56px, 16vw, 80px);
  min-width: 52px;
  min-height: 52px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 10px 18px rgba(255, 255, 255, 0.38),
    inset 0 -14px 22px rgba(0, 0, 0, 0.12),
    0 5px 0 rgba(255, 255, 255, 0.95),
    0 8px 14px rgba(41, 37, 36, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  /* Default = cleared (blue candy dome); .current / .locked override */
  background:
    radial-gradient(ellipse 95% 80% at 50% 28%, rgba(255, 255, 255, 0.75) 0%, transparent 52%),
    radial-gradient(ellipse 88% 78% at 50% 42%, #60a5fa 0%, #2563eb 52%, #1e40af 100%);
}

.tcg-map-node.current {
  background:
    radial-gradient(ellipse 95% 80% at 50% 28%, rgba(255, 255, 255, 0.78) 0%, transparent 52%),
    radial-gradient(ellipse 88% 78% at 50% 42%, #4ade80 0%, #22c55e 52%, #15803d 100%);
}

.tcg-map-node.locked {
  background:
    radial-gradient(ellipse 95% 80% at 50% 28%, rgba(255, 255, 255, 0.35) 0%, transparent 52%),
    radial-gradient(ellipse 88% 78% at 50% 42%, #d1d5db 0%, #9ca3af 55%, #6b7280 100%);
  box-shadow:
    inset 0 6px 12px rgba(255, 255, 255, 0.22),
    inset 0 -10px 18px rgba(0, 0, 0, 0.1),
    0 5px 0 rgba(255, 255, 255, 0.75),
    0 6px 12px rgba(41, 37, 36, 0.22);
}

.tcg-map-node-num {
  position: relative;
  z-index: 1;
  font-size: clamp(0.82rem, 3.2vw, 1.05rem);
  font-weight: 800;
  color: #fff;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.75);
}

.tcg-map-node:hover:not(:disabled) {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.tcg-map-node:active:not(:disabled) {
  transform: scale(0.96);
}

.tcg-map-node.current:not(.locked) {
  filter:
    drop-shadow(0 0 5px rgba(34, 197, 94, 0.65))
    drop-shadow(0 0 12px rgba(250, 204, 21, 0.5));
}

.tcg-map-node.cleared:not(.current):not(.locked) {
  filter: drop-shadow(0 2px 5px rgba(37, 99, 235, 0.4));
}

.tcg-map-node.locked {
  cursor: not-allowed;
  opacity: 0.9;
  filter: saturate(0.92) brightness(0.98);
}

.tcg-map-node.locked .tcg-map-node-num {
  opacity: 0.95;
}

.tcg-row--menu-main {
  align-items: center;
}

.tcg-menu-avatar-btn {
  position: relative;
  width: clamp(80px, 24vw, 108px);
  height: clamp(80px, 24vw, 108px);
  min-width: 80px;
  min-height: 80px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  background-color: transparent;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  box-shadow:
    0 5px 0 #be185d,
    0 10px 20px rgba(120, 53, 15, 0.22);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.tcg-menu-avatar-btn:not([style*="background-image"]) {
  background: linear-gradient(180deg, #f9a8d4, var(--tcg-pink));
}

.tcg-menu-avatar-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 #be185d,
    0 4px 12px rgba(120, 53, 15, 0.2);
}

.tcg-menu-avatar-btn-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
  padding: 12% 10%;
  box-sizing: border-box;
  pointer-events: none;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 40%);
}

.tcg-menu-avatar-preview {
  position: relative;
  width: 52%;
  max-height: 44%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* No inner ring or circular crop—just the art on the pink button */
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.tcg-menu-avatar-preview img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.tcg-menu-avatar-btn-text {
  font-size: clamp(0.62rem, 2.8vw, 0.78rem);
  font-weight: 800;
  color: #5b0b2e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  text-align: center;
  line-height: 1.05;
  letter-spacing: 0.02em;
}

.tcg-root--avatars .tcg-title {
  margin-bottom: 4px;
}

.tcg-avatar-panel {
  padding: 12px 10px;
  margin-bottom: 10px;
}

.tcg-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 12px 10px;
  justify-items: center;
  max-height: min(58vh, 480px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.tcg-avatar-pick {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  width: 100%;
  max-width: 72px;
  border-radius: 50%;
  transition: transform 0.1s ease;
}

.tcg-avatar-pick:hover {
  transform: scale(1.06);
}

.tcg-avatar-pick:focus-visible {
  outline: 2px solid #be185d;
  outline-offset: 3px;
}

.tcg-avatar-pick-ring {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-sizing: border-box;
  border: 3px solid rgba(120, 53, 15, 0.28);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.65),
    0 4px 10px rgba(120, 53, 15, 0.18);
  background: linear-gradient(145deg, #fff7ed, #fde68a);
}

.tcg-avatar-pick--selected .tcg-avatar-pick-ring {
  border-color: #16a34a;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.85),
    0 0 0 3px rgba(34, 197, 94, 0.45),
    0 4px 12px rgba(22, 163, 74, 0.35);
}

.tcg-avatar-pick-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: top;
}

.tcg-avatar-pick-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  font-size: clamp(0.75rem, 3.5vw, 1rem);
  font-weight: 800;
  color: rgba(120, 53, 15, 0.55);
  background: rgba(255, 255, 255, 0.5);
}

.tcg-muted {
  font-size: 0.82rem;
  opacity: 0.85;
  font-weight: 500;
}

.tcg-settings label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-weight: 600;
}

/* Activity iframe loads only this stylesheet (not styles.css): keep text visible on #0f172a. */
#teacakesActivityRoot .muted {
  color: #94a3b8;
}
#teacakesActivityRoot .hint-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #e2e8f0;
  line-height: 1.5;
}
#teacakesActivityRoot .hint-box h3 {
  color: #f8fafc;
}

@media (max-width: 540px) {
  .tcg-root {
    --tcg-cell-size: 42px;
  }

  .tcg-cell {
    font-size: 1.1rem;
  }
}
