/**
 * FRIENDS Beta Visual Pass — art director final layer (loads last).
 * Typography treaty, disabled clarity, shop/gacha polish, mobile, slot rim.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,600&family=Syne:wght@600;700;800&display=swap');

:root {
  --friends-font-display: 'Syne', 'Segoe UI', system-ui, sans-serif;
  --friends-font-ui: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --friends-font-companion: 'Nunito', 'DM Sans', sans-serif;
  --friends-pink: #ff69b4;
  --friends-cyan: #38bdf8;
  --friends-gold: #fbbf24;
  --friends-violet: #a855f7;
  --friends-emerald: #34d399;
  --friends-glass: rgba(8, 10, 22, 0.88);
  --friends-touch-min: 44px;
}

/* ── Global typography ── */
.showcase-shell,
.showcase-shell .slot-modal-card,
.slot-hud-v2,
.player-mobile-dock {
  font-family: var(--friends-font-ui);
}

.showcase-topbar-heading,
.showcase-sidebar-heading,
.slot-hud-spin,
.bonus-intro-title,
.jackpot-intro-title,
.gacha-cx-title {
  font-family: var(--friends-font-display);
  letter-spacing: 0.04em;
}

.cat-room-panel,
.cat-room-full,
.cat-room-modal,
.gacha-cx-overlay {
  font-family: var(--friends-font-companion);
}

/* ── Slot stage ── */
.playground--player-view .game-stage-side-decor {
  opacity: 0.35;
  background:
    linear-gradient(180deg, rgba(168, 85, 247, 0.14), transparent 55%),
    repeating-linear-gradient(
      90deg,
      rgba(56, 189, 248, 0.04) 0,
      rgba(56, 189, 248, 0.04) 1px,
      transparent 1px,
      transparent 24px
    );
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.playground--player-view .game-stage-reels {
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.12),
    inset 0 -2px 12px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 105, 180, 0.12),
    0 8px 32px rgba(0, 0, 0, 0.35);
}

.playground--player-view .game-stage-reels::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07) 0%,
    transparent 18%,
    transparent 82%,
    rgba(0, 0, 0, 0.28) 100%
  );
  z-index: 2;
}

.playground--player-view [data-symbol-id='WILD'] .symbol-sprite-image {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5)) brightness(1.06);
}

.slot-idle-motion-active [data-symbol-id='WILD'] .symbol-sprite-image {
  animation: friends-wild-shimmer 4.5s ease-in-out infinite;
}

@keyframes friends-wild-shimmer {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.4)) brightness(1.04); }
  50% { filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.65)) brightness(1.1); }
}

.playground--player-view [data-symbol-id='SCATTER'] .symbol-sprite-image {
  filter: drop-shadow(0 0 10px rgba(255, 105, 180, 0.45));
}

/* ── HUD ── */
.slot-hud-v2 {
  background: linear-gradient(180deg, rgba(10, 12, 24, 0.55), rgba(6, 8, 18, 0.96));
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border-top: 1px solid rgba(255, 215, 0, 0.22);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

.slot-hud-balance strong,
.slot-hud-bet strong,
.slot-hud-win strong {
  font-family: var(--friends-font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.slot-hud-message {
  font-size: clamp(0.62rem, 1.2vw, 0.76rem);
  color: rgba(226, 232, 240, 0.88);
}

.slot-hud-spin {
  min-width: var(--friends-touch-min);
  min-height: var(--friends-touch-min);
  border-radius: 50%;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 45%, #d97706 100%);
  color: #1a0a00;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.25),
    0 4px 18px rgba(245, 158, 11, 0.45),
    inset 0 -3px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.slot-hud-spin:not(:disabled):hover {
  transform: scale(1.04);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.35),
    0 6px 24px rgba(245, 158, 11, 0.55);
}

.slot-hud-spin:not(:disabled):active {
  transform: scale(0.96);
}

.slot-hud-spin:disabled {
  opacity: 0.55;
  filter: grayscale(0.35) saturate(0.6);
  cursor: not-allowed;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ── Buttons — clear disabled vs active ── */
.btn:disabled,
.btn.disabled {
  opacity: 0.62 !important;
  filter: saturate(0.45) grayscale(0.15);
  cursor: not-allowed !important;
  pointer-events: none;
  box-shadow: none !important;
}

.btn.primary:not(:disabled) {
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.25);
}

.cat-room-claim-btn {
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cat-room-claim-btn--ready {
  background: linear-gradient(135deg, #34d399, #059669) !important;
  border-color: rgba(52, 211, 153, 0.6) !important;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.35);
  animation: friends-claim-glow 2.4s ease-in-out infinite;
}

@keyframes friends-claim-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(52, 211, 153, 0.28); }
  50% { box-shadow: 0 0 26px rgba(52, 211, 153, 0.48); }
}

.cat-room-claim-btn:disabled {
  opacity: 0.72;
  filter: none;
  background: rgba(30, 32, 48, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(148, 163, 184, 0.9) !important;
  cursor: not-allowed;
}

/* ── Bonus intro fallback (no broken letter circle look) ── */
.bonus-intro-fallback-portrait {
  width: min(280px, 72vw);
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--friends-font-display);
  font-size: 3rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 105, 180, 0.35), rgba(56, 189, 248, 0.15) 55%, rgba(8, 6, 18, 0.95)),
    linear-gradient(145deg, rgba(30, 20, 50, 0.95), rgba(8, 6, 18, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.bonus-intro-start.is-disabled {
  position: relative;
  overflow: hidden;
}

.bonus-intro-start.is-disabled::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  animation: friends-shimmer 1.4s ease-in-out infinite;
}

@keyframes friends-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Shop / collection (RC8 art pass inlined) ── */
.cat-room-shop-card--art-directed {
  position: relative;
  overflow: hidden;
}

.cat-room-shop-card--art-directed.is-owned {
  border-color: rgba(74, 222, 128, 0.5) !important;
  box-shadow:
    inset 0 0 0 1px rgba(74, 222, 128, 0.18),
    0 4px 18px rgba(74, 222, 128, 0.14);
}

.cat-room-shop-card--art-directed.is-owned::after {
  content: 'OWNED';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--friends-emerald);
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.45);
  z-index: 2;
}

.cat-room-shop-card--art-directed.is-locked {
  opacity: 0.78;
  filter: saturate(0.55);
}

.cat-room-shop-card--art-directed.is-locked::after {
  content: 'LOCKED';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(248, 113, 113, 0.95);
  z-index: 2;
}

.cat-room-shop-card--art-directed.is-locked .cat-room-shop-card-preview img,
.cat-room-shop-card--art-directed.is-locked img {
  filter: grayscale(0.35) brightness(0.85);
}

.cat-room-shop-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 0.35rem;
  padding-bottom: 0.2rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.cat-room-shop-tabs button {
  flex: 0 0 auto;
  min-height: var(--friends-touch-min);
  min-width: 4.5rem;
  font-size: 0.72rem !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 0.75rem !important;
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.cat-room-shop-tabs button.is-active {
  background: linear-gradient(135deg, rgba(255, 105, 180, 0.22), rgba(56, 189, 248, 0.16));
  border-color: rgba(255, 105, 180, 0.55);
  color: var(--friends-gold);
  box-shadow: 0 0 16px rgba(255, 105, 180, 0.2);
}

.cat-room-shop-card img,
.cat-room-shop-card-preview img {
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.35));
  border-radius: 8px;
  object-fit: contain;
}

.cat-room-shop-card img[src=''],
.cat-room-shop-card img:not([src]) {
  opacity: 0;
  min-height: 48px;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: friends-img-skeleton 1.2s ease-in-out infinite;
}

@keyframes friends-img-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Gacha ── */
.gacha-cx-overlay {
  font-family: var(--friends-font-companion);
}

.gacha-cx-title {
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 800;
  background: linear-gradient(135deg, #fde68a, #fbbf24, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gacha-cx-btn:disabled,
.gacha-cx-btn[disabled] {
  opacity: 0.55;
  filter: saturate(0.4);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.gacha-cx-backdrop {
  pointer-events: auto;
  cursor: pointer;
}

/* ── Companion room ── */
.cat-room-full-header h2 {
  font-family: var(--friends-font-display);
  font-size: 1.35rem;
  background: linear-gradient(135deg, #fff, #fbcfe8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cat-room-pet-fallback {
  background: radial-gradient(circle at 50% 60%, rgba(255, 105, 180, 0.2), rgba(8, 6, 18, 0.9));
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.cat-room-scene-bg:not(.cat-room-bg-has-image) {
  animation: friends-room-breathe 6s ease-in-out infinite;
}

@keyframes friends-room-breathe {
  0%, 100% { filter: brightness(0.95); }
  50% { filter: brightness(1.02); }
}

.companion-scene--decorate::after {
  content: 'Pick a slot';
}

/* ── Mini-games ── */
.companion-game-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(16, 12, 32, 0.95), rgba(8, 6, 18, 0.98));
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.companion-game-card:not(.is-locked):hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
}

.companion-game-card.is-locked {
  opacity: 0.65;
  filter: saturate(0.5);
}

.companion-game-card-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.65rem;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.35));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.memory-card.is-matched {
  opacity: 1 !important;
  transform: scale(0.94);
  box-shadow: inset 0 0 0 2px rgba(52, 211, 153, 0.55);
  filter: brightness(0.88) saturate(0.75);
  position: relative;
}

.memory-card.is-matched::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--friends-emerald);
  background: rgba(6, 10, 20, 0.4);
  border-radius: inherit;
  pointer-events: none;
}

.companion-minigame-overlay .companion-minigame-close {
  min-width: var(--friends-touch-min);
  min-height: var(--friends-touch-min);
}

/* ── Modals ── */
.slot-modal-card {
  font-family: var(--friends-font-ui);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.slot-modal-card .btn {
  min-height: 2.5rem;
}

/* ── Mobile dock ── */
@media (max-width: 640px) {
  .player-mobile-dock button {
    font-size: 0.62rem;
    min-height: var(--friends-touch-min);
    border-radius: 14px;
  }

  .player-mobile-dock button span.dock-icon {
    font-size: 1.5rem;
  }

  .cat-room-full-body {
    grid-template-columns: 1fr;
  }

  .cat-room-shop-list {
    max-height: min(42vh, 360px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slot-idle-motion-active [data-symbol-id='WILD'] .symbol-sprite-image,
  .cat-room-claim-btn--ready,
  .cat-room-scene-bg:not(.cat-room-bg-has-image),
  .bonus-intro-start.is-disabled::after {
    animation: none !important;
  }
}
