/* ═══════════════════════════════════════════════════════════════════════════
   GOLDEN GAMES — PREMIUM SKIN (F5)
   One design system for all 24 games: warm ivory game-table on deep navy,
   gold trim, layered depth, and a full motion language (entrance, press,
   success glow, error shake, win celebration). Senior-first: readability,
   large targets, calm motion (no flashing), respects reduced-motion.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Game stage: deep navy with a warm spotlight ─────────────────────────── */
#gameView {
  position: relative;
  padding: 8px;
}
#gameView::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(183,121,31,0.14), transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(44,82,130,0.35), transparent 70%);
  pointer-events: none;
}

/* The game table — warm ivory, linen texture, gold rim */
#gameView > div {
  background:
    linear-gradient(160deg, rgba(255,253,248,0.99), rgba(250,245,235,0.99)) !important;
  border: 1px solid rgba(183,121,31,0.35) !important;
  box-shadow:
    0 40px 90px rgba(0,0,0,0.55),
    0 12px 30px rgba(0,0,0,0.35),
    inset 0 2px 0 rgba(255,255,255,0.9),
    0 0 0 6px rgba(183,121,31,0.10),
    0 0 60px rgba(246,192,72,0.10) !important;
  animation: gg-table-in .5s cubic-bezier(.22,1,.36,1);
}
@keyframes gg-table-in {
  from { opacity: 0; transform: translateY(24px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* Title: gold-engraved */
#gameTitle {
  background: linear-gradient(115deg, #7c5210, #b7791f 40%, #e2b13c 55%, #b7791f 70%, #7c5210);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: .01em;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.7));
}
#gameView .text-center.mb-6 { position: relative; }
#gameView .text-center.mb-6::after {
  content: ''; display: block; margin: 14px auto 0;
  width: 130px; height: 3px; border-radius: 999px;
  background: linear-gradient(90deg, transparent, #b7791f, #f6c048, #b7791f, transparent);
}

/* ── Content entrance: each round breathes in ────────────────────────────── */
#gameContent > * { animation: gg-round-in .45s cubic-bezier(.22,1,.36,1) both; }
@keyframes gg-round-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ── Buttons: jewellery, not forms ───────────────────────────────────────── */
#gameContent button {
  position: relative;
  border-radius: 1.1rem !important;
  border-width: 2px !important;
  box-shadow:
    0 2px 0 rgba(0,0,0,0.04),
    0 10px 24px rgba(26,54,93,0.10),
    inset 0 1.5px 0 rgba(255,255,255,0.95);
  transition: transform .16s cubic-bezier(.22,1,.36,1), box-shadow .16s, border-color .16s, background-color .16s;
  overflow: hidden;
  cursor: pointer;
}
#gameContent button:hover {
  transform: translateY(-3px) scale(1.015);
  border-color: #d9a441 !important;
  box-shadow:
    0 4px 0 rgba(0,0,0,0.03),
    0 18px 36px rgba(26,54,93,0.16),
    0 0 0 4px rgba(246,192,72,0.18),
    inset 0 1.5px 0 rgba(255,255,255,0.95);
}
#gameContent button:active { transform: translateY(0) scale(.97); transition-duration: .06s; }
/* shine sweep on hover */
#gameContent button::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 45%;
  left: -60%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  transition: left .45s ease; pointer-events: none;
}
#gameContent button:hover::after { left: 120%; }

/* ── Feedback: success glow / error shake (hooks the classes games set) ──── */
#gameContent button[class*="border-green-500"],
#gameContent [class*="border-green-500"] {
  animation: gg-correct .6s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 0 0 5px rgba(34,197,94,0.25), 0 14px 34px rgba(34,197,94,0.25) !important;
}
@keyframes gg-correct {
  0% { transform: scale(1); }
  35% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
#gameContent button[class*="border-red-500"],
#gameContent [class*="border-red-500"] {
  animation: gg-wrong .5s cubic-bezier(.36,.07,.19,.97);
}
@keyframes gg-wrong {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* Round counter line → refined chip */
#gameContent .flex.justify-between.text-sm {
  background: rgba(26,54,93,0.05);
  border: 1px solid rgba(26,54,93,0.10);
  border-radius: 999px;
  padding: 6px 18px;
  align-items: center;
}

/* Question panels (bg-blue-50 headers in question games) */
#gameContent .bg-blue-50 {
  background: linear-gradient(165deg, #eef4fc, #e3edf9) !important;
  border: 1px solid rgba(44,82,130,0.14);
  box-shadow: inset 0 2px 6px rgba(26,54,93,0.06), 0 10px 24px rgba(26,54,93,0.07);
}

/* ── Memory cards: casino quality ────────────────────────────────────────── */
#gameContent .card-face:not(.card-back) {
  background:
    radial-gradient(circle at 30% 25%, rgba(246,192,72,0.20), transparent 55%),
    linear-gradient(150deg, #24406b, #16294a 60%, #1a365d) !important;
  border: 2px solid rgba(246,192,72,0.35) !important;
  color: #f6c048 !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  box-shadow: 0 10px 22px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}
#gameContent .card-back {
  border-color: #b7791f !important;
  box-shadow: 0 12px 26px rgba(183,121,31,0.22), inset 0 2px 0 rgba(255,255,255,0.9);
}
#gameContent .matched .card-back {
  box-shadow: 0 0 0 4px rgba(34,197,94,0.35), 0 12px 26px rgba(34,197,94,0.25);
  animation: gg-correct .6s cubic-bezier(.22,1,.36,1);
}

/* ── Win modal: award ceremony ───────────────────────────────────────────── */
#modal { backdrop-filter: blur(10px); }
#modal > div {
  background:
    radial-gradient(ellipse 120% 55% at 50% 0%, rgba(246,192,72,0.16), transparent 55%),
    linear-gradient(165deg, #fffdf8, #faf3e6) !important;
  border: 1px solid rgba(183,121,31,0.45) !important;
  border-top-width: 0 !important;
  box-shadow:
    0 50px 110px rgba(0,0,0,0.6),
    0 0 0 8px rgba(183,121,31,0.12),
    0 0 90px rgba(246,192,72,0.22),
    inset 0 3px 0 #b7791f, inset 0 5px 0 #f6c048;
  animation: gg-modal-in .55s cubic-bezier(.18,1.4,.4,1);
}
@keyframes gg-modal-in {
  from { opacity: 0; transform: translateY(40px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
#modalIcon {
  display: inline-block;
  animation: gg-trophy .9s cubic-bezier(.18,1.6,.4,1) .15s both;
  filter: drop-shadow(0 10px 24px rgba(246,192,72,0.45));
}
@keyframes gg-trophy {
  0% { transform: scale(0) rotate(-18deg); }
  60% { transform: scale(1.25) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}
#nextLevelBtn {
  background: linear-gradient(135deg, #b7791f, #e2b13c 50%, #b7791f) !important;
  color: #241705 !important;
  border: 1px solid rgba(124,82,16,0.5);
  box-shadow: 0 12px 28px rgba(183,121,31,0.4), inset 0 2px 0 rgba(255,255,255,0.55);
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
  transition: transform .15s, box-shadow .15s;
}
#nextLevelBtn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 18px 38px rgba(183,121,31,0.5), inset 0 2px 0 rgba(255,255,255,0.55); }

/* ── Home cards: gallery pieces ──────────────────────────────────────────── */
.premium-card {
  transition: transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s;
  will-change: transform;
}
.premium-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 26px 55px rgba(0,0,0,0.5),
    0 0 0 2px rgba(246,192,72,0.45),
    0 0 45px rgba(246,192,72,0.16) !important;
}
.premium-card .thumbnail-container { overflow: hidden; }
.premium-card .thumbnail-img { transition: transform .6s cubic-bezier(.22,1,.36,1); }
.premium-card:hover .thumbnail-img { transform: scale(1.08); }
.premium-card .btn-premium {
  background: linear-gradient(135deg, #1a365d, #2c5282) !important;
  box-shadow: 0 6px 16px rgba(26,54,93,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.premium-card:hover .btn-premium {
  background: linear-gradient(135deg, #b7791f, #e2b13c) !important;
  color: #241705 !important;
  box-shadow: 0 10px 22px rgba(183,121,31,0.4);
}

/* Level chip gets a soft breathing glow */
.gg-level-chip { animation: gg-chip-pop .4s ease, gg-chip-glow 3s ease-in-out 1s infinite; }
@keyframes gg-chip-glow {
  0%, 100% { box-shadow: 0 2px 10px rgba(246,192,72,0.45); }
  50%      { box-shadow: 0 2px 18px rgba(246,192,72,0.85); }
}

/* Back button: refined */
#backBtn { transition: transform .15s, box-shadow .15s, background .15s; }
#backBtn:hover { transform: translateY(-1px); background: rgba(183,121,31,0.35) !important; box-shadow: 0 6px 16px rgba(183,121,31,0.25); }

/* ── Calm for those who need it ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Design details (2026-07-07): entrance, gold sweep, press feedback ────── */
@media (prefers-reduced-motion: no-preference) {
  body.reveal-ready .premium-card { opacity: 0; transform: translateY(22px) scale(.98); }
  body.reveal-ready .premium-card.in {
    opacity: 1; transform: none;
    transition: opacity .55s ease, transform .55s cubic-bezier(.2,.7,.3,1);
  }
}
/* gold light sweep across the thumbnail on hover */
.premium-card .thumbnail-container { position: relative; }
.premium-card .thumbnail-container::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(246,192,72,.28) 50%, transparent 60%);
  transform: translateX(-120%);
}
.premium-card:hover .thumbnail-container::after { transition: transform .8s ease; transform: translateX(120%); }
/* tactile press feedback for big senior-friendly buttons */
.btn-premium:active { transform: scale(.96); }
.premium-card:active { transform: translateY(-2px) scale(.995); }
