/* ==========================================================================
   NOIR SPIDER SOLITAIRE — Old Leather & Brass Study Edition  v2
   Art Direction: Warm Lamp Glow, Deep Mahogany, Stitched Leather & Gold Foil
   Glass Reflex Layer · Correct Card Ratio · Centred Layout · Noir BG
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Playfair+Display:ital,wght@0,600;0,800;1,400&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --wood-dark:          #0d0804;
  --leather-surface:    #1e130a;
  --brass-light:        #f7e2a9;
  --brass-gold:         #d4af37;
  --brass-shadow:       #7a5813;
  --card-ivory-light:   #fffef8;
  --card-ivory-mid:     #f6eed9;
  --card-ivory-dark:    #e8d9b8;
  --card-border-gold:   rgba(190,150,70,0.6);
  --suit-red:           #b01c1c;
  --suit-black:         #191714;
  --lamp-amber:         rgba(255,195,105,0.30);
  --card-w:             88px;
  --card-h:             123px;   /* ≈ 1 : 1.4 ratio */
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; }

/* ======================================================
   BODY — Noir Office Photography Background
   ====================================================== */
body {
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-family: 'Cinzel', Georgia, serif;
  color: #eeddbb;
  /* Layered noir room: deep wood texture + warm radial lamp glow */
  background-color: var(--wood-dark);
  background-image:
    /* Warm banker's-lamp cone from above */
    radial-gradient(ellipse 70% 48% at 50% 0%,
      rgba(255,210,130,0.22) 0%,
      rgba(190,110,30,0.10) 38%,
      rgba(10,5,2,0.80) 72%,
      rgba(5,2,1,0.97) 100%),
    /* Subtle leather texture lines */
    repeating-linear-gradient(
      103deg,
      transparent 0px, transparent 38px,
      rgba(255,210,140,0.025) 38px, rgba(255,210,140,0.025) 39px
    ),
    repeating-linear-gradient(
      167deg,
      transparent 0px, transparent 60px,
      rgba(0,0,0,0.18) 60px, rgba(0,0,0,0.18) 61px
    ),
    /* Base deep mahogany radial */
    radial-gradient(ellipse at 50% 60%,
      #2a1608 0%, #130a04 55%, #080402 100%);
  background-attachment: fixed;
}

/* ---- Ambient Screen-Blend Vignette (pointer-events:none top layer) ---- */
.ambient-lighting {
  position: fixed; inset: 0; pointer-events: none; z-index: 90;
  background:
    radial-gradient(ellipse 85% 50% at 50% 10%,
      rgba(255,195,105,0.14) 0%, transparent 60%),
    radial-gradient(ellipse at 0% 0%,   rgba(0,0,0,0.65) 0%, transparent 45%),
    radial-gradient(ellipse at 100% 0%, rgba(0,0,0,0.65) 0%, transparent 45%),
    radial-gradient(ellipse at 0% 100%, rgba(0,0,0,0.75) 0%, transparent 42%),
    radial-gradient(ellipse at 100%100%, rgba(0,0,0,0.75) 0%, transparent 42%);
  mix-blend-mode: multiply;
}

/* ======================================================
   CENTRED GAME WRAPPER  — fixed max-width, centred
   ====================================================== */
.game-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  min-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 18px 18px;
  z-index: 10;
  min-height: 100vh;
}

/* ======================================================
   ANTIQUE BRASS HEADER BAR
   ====================================================== */
.study-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 20px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #2d1e12 0%, #1a0f08 100%);
  border: 1px solid rgba(212,175,55,0.38);
  box-shadow:
    0 8px 22px rgba(0,0,0,0.75),
    inset 0 1px 1px rgba(255,240,200,0.18),
    inset 0 -2px 5px rgba(0,0,0,0.65);
}

.brand-title { display: flex; align-items: center; gap: 12px; }

.brand-badge {
  background: linear-gradient(135deg, var(--brass-light), var(--brass-gold), var(--brass-shadow));
  color: #180d04; font-weight: 900; font-size: 10px;
  letter-spacing: 2px; padding: 3px 9px; border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.6);
}

.study-title {
  font-size: 18px; font-weight: 800; letter-spacing: 2.5px;
  background: linear-gradient(180deg, #fff7df 0%, #d4af37 65%, #aa771c 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.study-stats { display: flex; gap: 20px; align-items: center; }

.stat-box {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(10,6,4,0.65); padding: 3px 12px;
  border-radius: 6px; border: 1px solid rgba(212,175,55,0.2);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.6);
}
.stat-label  { font-size: 8px; letter-spacing: 1.5px; color: #a48c68; }
.stat-value  {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 700; color: #f7e8c3;
  text-shadow: 0 0 6px rgba(247,232,195,0.3);
}

.study-actions { display: flex; gap: 8px; align-items: center; }

/* ---- Buttons ---- */
.btn-brass {
  background: linear-gradient(180deg, #f6e4b4 0%, #d4af37 40%, #aa7a1f 85%, #7a530f 100%);
  color: #180d04; border: 1px solid #ffe8aa;
  padding: 6px 14px; border-radius: 6px;
  font-family: 'Cinzel', serif; font-size: 10px; font-weight: 800;
  letter-spacing: 1.4px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.6),
    inset 0 1px 1px rgba(255,255,255,0.7),
    inset 0 -2px 3px rgba(80,50,10,0.6);
  transition: all 0.15s ease;
}
.btn-brass:hover  { transform: translateY(-1px); filter: brightness(1.08); }
.btn-brass:active { transform: translateY(1px);  filter: brightness(0.95); }

.btn-leather {
  background: linear-gradient(180deg, #382417 0%, #20140b 100%);
  color: #dfcaa2; border: 1px solid rgba(212,175,55,0.3);
  padding: 6px 12px; border-radius: 6px;
  font-family: 'Cinzel', serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1.1px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: all 0.15s ease; text-decoration: none;
}
.btn-leather:hover { background: linear-gradient(180deg, #44321d 0%, #291a0f 100%); border-color: var(--brass-gold); color: #fff; }
.btn-rain.active  { background: linear-gradient(180deg, #1b3842 0%, #0d2229 100%); border-color: #55b2cc; color: #bbf0ff; box-shadow: 0 0 10px rgba(85,178,204,0.35); }

/* ======================================================
   STITCHED SADDLE-LEATHER DESK BLOTTER
   ====================================================== */
.leather-blotter {
  position: relative; width: 100%;
  flex: 1; min-height: 560px;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(50,30,15,0.70) 0%, rgba(16,9,4,0.98) 100%);
  border-radius: 16px;
  border: 3px solid #100803;
  box-shadow:
    0 28px 60px rgba(0,0,0,0.88),
    0 0 0 1px rgba(212,175,55,0.22),
    inset 0 3px 16px rgba(0,0,0,0.88);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;

  /* Glass reflex: thin specular highlight sweeping across top-left */
  overflow: hidden;
}

/* Gold embossed leather stitching border */
.leather-blotter::before {
  content: '';
  position: absolute; inset: 7px; border-radius: 11px;
  border: 1.5px dashed rgba(212,175,55,0.30);
  pointer-events: none; z-index: 0;
}

/* ---- GLASS REFLEX LAYER ---- */
.leather-blotter::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 54%;
  border-radius: 16px 16px 60% 60% / 16px 16px 40% 40%;
  pointer-events: none; z-index: 95;
  background:
    linear-gradient(
      165deg,
      rgba(255,255,255,0.065) 0%,
      rgba(255,255,255,0.028) 28%,
      transparent 55%
    );
  /* Thin specular line at very top edge */
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.14);
}

/* Brass corner guards */
.corner-brass { position: absolute; width: 28px; height: 28px; pointer-events: none; z-index: 5; }
.corner-tl { top: 0; left: 0; border-top: 2.5px solid var(--brass-gold); border-left: 2.5px solid var(--brass-gold); border-top-left-radius: 14px; }
.corner-tr { top: 0; right: 0; border-top: 2.5px solid var(--brass-gold); border-right: 2.5px solid var(--brass-gold); border-top-right-radius: 14px; }
.corner-bl { bottom: 0; left: 0; border-bottom: 2.5px solid var(--brass-gold); border-left: 2.5px solid var(--brass-gold); border-bottom-left-radius: 14px; }
.corner-br { bottom: 0; right: 0; border-bottom: 2.5px solid var(--brass-gold); border-right: 2.5px solid var(--brass-gold); border-bottom-right-radius: 14px; }

/* ======================================================
   TOP RACK — Stock + Foundations
   ====================================================== */
.blotter-top-rack {
  display: flex; justify-content: space-between; align-items: center;
  height: var(--card-h); padding: 0 6px; position: relative; z-index: 1;
}

.stock-container { display: flex; align-items: center; gap: 14px; }

.stock-slot {
  position: relative;
  width: var(--card-w); height: var(--card-h);
  border-radius: 7px; cursor: pointer;
  border: 1.5px dashed rgba(212,175,55,0.28);
  background: rgba(0,0,0,0.25);
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.65);
  transition: transform 0.2s ease;
}
.stock-slot:hover { transform: translateY(-2px); border-color: var(--brass-gold); }

.stock-card-stack { position: absolute; inset: 0; }

.stock-card-layer {
  position: absolute; width: 100%; height: 100%; border-radius: 7px;
  background: #152219; border: 1px solid rgba(212,175,55,0.38);
  box-shadow: 0 3px 8px rgba(0,0,0,0.5);
}

.stock-info { display: flex; flex-direction: column; gap: 2px; }
.stock-label        { font-size: 9px; letter-spacing: 1.2px; color: #b89b72; }
.stock-deals-count  { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: #fff; }

/* Foundations */
.foundation-container { display: flex; gap: 8px; }

.foundation-slot {
  width: var(--card-w); height: var(--card-h);
  border-radius: 7px;
  border: 1px solid rgba(212,175,55,0.22);
  background: radial-gradient(circle at 50% 50%, rgba(28,18,10,0.6) 0%, rgba(8,4,2,0.9) 100%);
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.80);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: rgba(212,175,55,0.10);
  position: relative; overflow: hidden;
}
.foundation-slot::before { content: '♠'; }

.foundation-slot.completed {
  border-color: var(--brass-gold);
  box-shadow: 0 0 14px rgba(212,175,55,0.3), inset 0 0 10px rgba(212,175,55,0.18);
}
.foundation-slot.completed::before { content: ''; }

/* ======================================================
   TABLEAU — 10 COLUMNS
   ====================================================== */
.tableau-board {
  flex: 1; display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 10px; width: 100%; position: relative; z-index: 1;
}

.tableau-column {
  position: relative; height: 100%; min-height: 460px;
  border-radius: 7px; border: 1px dashed rgba(212,175,55,0.12);
  background: rgba(0,0,0,0.10);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
  transition: background 0.2s, border-color 0.2s;
}
.tableau-column.drag-over {
  background: rgba(212,175,55,0.08);
  border-color: var(--brass-gold);
  box-shadow: 0 0 12px rgba(212,175,55,0.22), inset 0 0 6px rgba(212,175,55,0.18);
}

/* ======================================================
   PLAYING CARDS — Proper 1:1.4 Ratio
   ====================================================== */
.solitaire-card {
  position: absolute;
  width: 100%;
  /* Enforce 1:1.4 card ratio using aspect-ratio with max clamp */
  aspect-ratio: 5 / 7;
  max-height: var(--card-h);
  border-radius: 7px;
  cursor: grab;
  transition: box-shadow 0.15s ease;
  will-change: transform;
}
.solitaire-card:active { cursor: grabbing; }
.solitaire-card.face-down { cursor: default; }

.card-inner {
  position: relative; width: 100%; height: 100%;
  border-radius: 7px; overflow: hidden;
}

/* --- FACE / BACK VISIBILITY TOGGLE ---- */
/* Both faces sit on top of each other; we toggle via z-index */
.card-face {
  position: absolute; inset: 0; border-radius: 7px;
}

/* Face-down card: back visible, front hidden */
.solitaire-card.face-down .card-front { z-index: 0; }
.solitaire-card.face-down .card-back  { z-index: 1; }

/* Face-up card: front visible, back hidden */
.solitaire-card.face-up .card-front { z-index: 1; }
.solitaire-card.face-up .card-back  { z-index: 0; }

/* ---- CARD FRONT: Antique Ivory Linen ---- */
.card-front {
  background:
    radial-gradient(ellipse at 42% 28%, #fffef9 0%, #f5ecd8 68%, #e4d3b2 100%);
  border: 1px solid var(--card-border-gold);
  box-shadow:
    0 2px 5px rgba(0,0,0,0.42),
    0 7px 14px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.90);
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 4px 5px;
  overflow: hidden;
}

/* Thin specular glass sweep across front face */
.card-front::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 48%;
  background: linear-gradient(
    160deg,
    rgba(255,255,255,0.22) 0%,
    rgba(255,255,255,0.08) 38%,
    transparent 60%
  );
  border-radius: 7px 7px 50% 50% / 7px 7px 30% 30%;
  pointer-events: none; z-index: 10;
}

/* ---- CARD BACK: Victorian Emerald & Gold Filigree ---- */
.card-back {
  background: #152219;
  border: 1px solid rgba(212,175,55,0.52);
  box-shadow: 0 2px 5px rgba(0,0,0,0.44), 0 6px 12px rgba(0,0,0,0.28);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

/* Glass specular reflex on card back too */
.card-back::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 45%;
  background: linear-gradient(155deg,
    rgba(255,255,255,0.09) 0%,
    rgba(255,255,255,0.03) 35%,
    transparent 55%
  );
  pointer-events: none; z-index: 10; border-radius: 7px;
}

.card-back-pattern { width: 100%; height: 100%; }
.card-back-border  { width: 100%; height: 100%; }
.card-back-svg     { width: 100%; height: 100%; display: block; }

/* ======================================================
   CARD TYPOGRAPHY & SUIT INDICES
   ====================================================== */
.card-corner {
  display: flex; flex-direction: column; align-items: center;
  line-height: 1; gap: 1px; position: relative; z-index: 2;
}
.card-corner.bottom-right { transform: rotate(180deg); }

.card-rank {
  font-family: 'Cinzel', serif;
  font-size: 13px; font-weight: 900; letter-spacing: -0.5px;
  line-height: 1;
}

.card-mini-suit {
  width: 11px; height: 11px;
  display: flex; align-items: center; justify-content: center;
}
.card-mini-suit svg, .card-mini-suit .suit-icon {
  width: 100%; height: 100%;
}

/* Suit tinting */
.suit-spades .card-rank, .suit-clubs .card-rank   { color: var(--suit-black); }
.suit-hearts .card-rank, .suit-diamonds .card-rank { color: var(--suit-red); }
.suit-spades  .card-corner svg, .suit-clubs  .card-corner svg { color: var(--suit-black); }
.suit-hearts  .card-corner svg, .suit-diamonds  .card-corner svg { color: var(--suit-red); }

/* ---- Card Centre Area ---- */
.card-center {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2; padding: 2px;
}

/* ======================================================
   PIPS  (rank 1–10)
   ====================================================== */
.pips-container {
  display: grid; width: 100%; height: 100%;
  align-items: center; justify-items: center;
}
.pips-container .pip-icon {
  display: flex; align-items: center; justify-content: center;
}
.pips-container .pip-icon svg { width: 100%; height: 100%; }

/* Grid templates for each count */
.pips-1  { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.pips-1  .pip-icon { width: 32px; height: 32px; }

.pips-2  { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
.pips-2  .pip-icon:nth-child(2) { transform: rotate(180deg); }
.pips-2  .pip-icon { width: 18px; height: 18px; }

.pips-3  { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr 1fr; }
.pips-3  .pip-icon:nth-child(3) { transform: rotate(180deg); }
.pips-3  .pip-icon { width: 16px; height: 16px; }

.pips-4  { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pips-4  .pip-icon:nth-child(3),.pips-4  .pip-icon:nth-child(4) { transform: rotate(180deg); }
.pips-4  .pip-icon { width: 15px; height: 15px; }

.pips-5  { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
.pips-5  .pip-icon:nth-child(1) { grid-column: 1; }
.pips-5  .pip-icon:nth-child(2) { grid-column: 2; }
.pips-5  .pip-icon:nth-child(3) { grid-column: 1 / 3; }
.pips-5  .pip-icon:nth-child(4) { grid-column: 1; transform: rotate(180deg); }
.pips-5  .pip-icon:nth-child(5) { grid-column: 2; transform: rotate(180deg); }
.pips-5  .pip-icon { width: 14px; height: 14px; }

.pips-6  { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
.pips-6  .pip-icon:nth-child(4),.pips-6  .pip-icon:nth-child(5),.pips-6  .pip-icon:nth-child(6) { transform: rotate(180deg); }
.pips-6  .pip-icon { width: 14px; height: 14px; }

.pips-7  { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr 1fr; }
.pips-7  .pip-icon { width: 12px; height: 12px; }

.pips-8  { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr 1fr; }
.pips-8  .pip-icon { width: 12px; height: 12px; }

.pips-9  { grid-template-columns: 1fr 1fr; }
.pips-9  .pip-icon { width: 11px; height: 11px; }

.pips-10 { grid-template-columns: 1fr 1fr; }
.pips-10 .pip-icon { width: 10px; height: 10px; }

/* ======================================================
   COURT CARDS  (J, Q, K)
   ====================================================== */
.court-art {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.court-svg { width: 88%; height: 82%; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12)); }
.court-title { font-size: 6px; letter-spacing: 1.4px; color: #8c6e42; font-weight: 700; margin-top: 1px; }

/* ======================================================
   DRAG & INTERACTION
   ====================================================== */
.solitaire-card.dragging {
  z-index: 1000 !important;
  transform: scale(1.05) rotate(1.2deg) translateY(-6px);
  box-shadow:
    0 22px 40px rgba(0,0,0,0.65),
    0 8px 16px rgba(0,0,0,0.42);
  pointer-events: none;
}

.drag-ghost-container { position: fixed; pointer-events: none; z-index: 9999; }

.solitaire-card.hint-highlight {
  animation: hintGlow 1.3s infinite alternate;
}
@keyframes hintGlow {
  from { box-shadow: 0 0 4px rgba(212,175,55,0.35); }
  to   { box-shadow: 0 0 18px rgba(212,175,55,0.95), 0 0 32px rgba(255,220,120,0.55); }
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.solitaire-card.shake { animation: shake 0.3s ease; }

/* ======================================================
   MODALS & TOAST
   ====================================================== */
.study-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(6,3,1,0.84);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.study-modal-backdrop.open { opacity: 1; pointer-events: auto; }

.study-modal {
  width: 92%; max-width: 440px;
  background: radial-gradient(circle at 50% 20%, #2f1d12 0%, #160d07 100%);
  border: 2px solid var(--brass-gold); border-radius: 14px;
  box-shadow: 0 28px 55px rgba(0,0,0,0.88), 0 0 28px rgba(212,175,55,0.22);
  padding: 28px 24px; text-align: center; position: relative;
}

.modal-title {
  font-size: 22px; font-weight: 900; letter-spacing: 2.5px;
  background: linear-gradient(180deg, #fff4d1 0%, #d4af37 60%, #aa771c 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}
.modal-desc { font-size: 12px; line-height: 1.6; color: #c9b48c; margin-bottom: 20px; }

.difficulty-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.diff-btn {
  background: rgba(14,8,4,0.7); border: 1px solid rgba(212,175,55,0.28);
  padding: 10px 16px; border-radius: 7px; color: #eed7aa; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: all 0.18s ease; font-family: 'Cinzel', serif;
}
.diff-btn:hover { background: rgba(212,175,55,0.14); border-color: var(--brass-gold); transform: translateX(3px); }
.diff-btn.selected {
  background: linear-gradient(90deg, rgba(212,175,55,0.22) 0%, rgba(14,8,4,0.8) 100%);
  border-color: var(--brass-gold); color: #fff;
  box-shadow: inset 0 0 10px rgba(212,175,55,0.25);
}
.diff-badge {
  font-size: 9px; letter-spacing: 1.2px;
  background: var(--brass-gold); color: #140a04;
  padding: 2px 7px; border-radius: 3px; font-weight: 800;
}

.study-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(16,8,4,0.95); border: 1px solid var(--brass-gold);
  color: #f7e8c3; padding: 8px 20px; border-radius: 28px;
  font-size: 12px; letter-spacing: 0.8px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.75);
  opacity: 0; pointer-events: none;
  transition: all 0.28s cubic-bezier(0.2,0.8,0.2,1); z-index: 999;
}
.study-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 1100px) {
  :root { --card-w: 76px; --card-h: 106px; }
  .game-wrapper { padding: 8px 12px 12px; }
  .study-title  { font-size: 15px; }
}
@media (max-width: 860px) {
  :root { --card-w: 64px; --card-h: 90px; }
  .tableau-board { gap: 6px; }
}
