/* ============================================================
   ARENADLE — style.css
   Dark Arena aesthetic: deep slate bg, gold accents, rarity colors
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0e0f14;
  --bg-surface:   #16181f;
  --bg-card:      #1e2029;
  --border:       #2e3040;

  --gold:         #c8972a;
  --gold-light:   #e8b84b;
  --text:         #e2e4ef;
  --text-muted:   #7a7f9a;

  /* Status colors */
  --correct:      #3a7d44;
  --correct-bg:   #1e3d25;
  --partial:      #8a6a1a;
  --partial-bg:   #3d2e08;
  --wrong:        #6b2020;
  --wrong-bg:     #2a1616;

  /* Fonts */
  --font-display: 'Cinzel', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Sizing / Animation defaults */
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --shadow:       0 8px 24px rgba(0, 0, 0, 0.5);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Typography & Headers ─────────────────────────────────── */
header {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
    linear-gradient(to bottom, #0c0e18 0%, #12141c 40%, var(--bg) 100%);
  border-bottom: 1px solid rgba(200, 151, 42, 0.15);
  padding: 36px 20px 32px;
  text-align: center;
  position: relative;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow:
    0 0 40px rgba(200, 151, 42, 0.35),
    0 0 80px rgba(200, 151, 42, 0.12);
}

.logo-accent {
  color: var(--gold);
}

.tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 5px;
}

/* ── Decorative header divider ─────────────────────────────── */
.header-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.header-divider-line {
  height: 1px;
  width: 120px;
  background: linear-gradient(to right, transparent, rgba(200, 151, 42, 0.6), transparent);
}

.header-divider-line.left {
  background: linear-gradient(to right, transparent, rgba(200, 151, 42, 0.6));
}

.header-divider-line.right {
  background: linear-gradient(to left, transparent, rgba(200, 151, 42, 0.6));
}

.header-divider-diamond {
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(200, 151, 42, 0.8);
}

.header-divider-dot {
  width: 3px;
  height: 3px;
  background: var(--gold-light);
  transform: rotate(45deg);
  flex-shrink: 0;
  opacity: 0.6;
}

main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

/* ── Input Box & Autocomplete Search ───────────────────────── */
#search-container {
  max-width: 500px;
  margin: 0 auto 40px;
  position: relative;
}

#guess-input {
  width: 100%;
  background-color: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 14px 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#guess-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(200, 151, 42, 0.2);
}

#autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow);
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: rgba(200, 151, 42, 0.1);
}

.autocomplete-item img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.autocomplete-item span {
  font-weight: 500;
}

/* ── Grid Layout Headers ───────────────────────────────────── */
.grid-header {
  display: grid;
  grid-template-columns: 54px 1.5fr 1fr 1fr 1.2fr 0.9fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.grid-header .cell {
  background: transparent !important;
  border: none !important;
  color: var(--text-muted) !important;
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0;
  opacity: 1 !important;
  transform: none !important;
  min-height: auto !important;
}

#guess-grid {
  display: flex;
  flex-direction: column;
}

.guess-row {
  display: grid;
  grid-template-columns: 54px 1.5fr 1fr 1fr 1.2fr 0.9fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
}

/* ── Suspense-Filled Interactive Blocks ────────────────────── */
.cell {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 64px;
  position: relative;
  color: var(--text);
}

/* Suspense Flip Animation applied ONLY to property columns */
.cell:not(.cell-icon):not(.cell-name) {
  color: transparent;
  opacity: 0;
  transform: scale(0.4) rotateX(-90deg);
  animation: suspenseFlip 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

@keyframes suspenseFlip {
  0% {
    opacity: 0;
    transform: scale(0.4) rotateX(-90deg);
    color: transparent;
  }
  45% {
    color: transparent;
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateX(0deg);
    color: var(--text);
  }
}

/* Base Trait Status Classes (Targets Property Cards primarily) */
.cell.status-correct {
  background-color: var(--correct-bg);
  border-color: var(--correct);
}

.cell.status-partial {
  background-color: var(--partial-bg);
  border-color: var(--partial);
}

.cell.status-wrong {
  background-color: var(--wrong-bg);
  border-color: var(--wrong);
}

/* Base state for Name cell: forces it to look default gray initially */
.cell-name {
  background-color: var(--bg-surface) !important;
  border-color: var(--border) !important;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

/* Activates coloring on the Name card ONLY when JavaScript applies '.revealed' */
.cell-name.revealed.status-correct {
  background-color: var(--correct-bg) !important;
  border-color: var(--correct) !important;
}

.cell-name.revealed.status-wrong {
  background-color: var(--wrong-bg) !important;
  border-color: var(--wrong) !important;
}

/* Icon Cell Style */
.cell-icon {
  background-color: transparent !important;
  border: none !important;
  padding: 0;
}

.cell-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.cell .direction {
  font-size: 0.8rem;
  margin-top: 2px;
  opacity: 0.8;
}

/* ── Win Block Interface (LoLdle-Style Inline Flow) ─────────── */
#win-screen {
  width: 100%;
  margin-top: 40px; /* Gives nice breathing room below the grid layout */
  display: none; 
  justify-content: center;
  align-items: center;
}

/* Overrides default display hidden rules when the element is activated */
#win-screen:not(.hidden) {
  display: flex !important;
}

.win-card {
  background-color: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(200, 151, 42, 0.15),
    0 0 30px rgba(200, 151, 42, 0.08);
  max-width: 540px;
  width: 100%;
  padding: 34px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: winCardSlideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
}

/* Shimmer sweep across the win card on reveal */
.win-card::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -75%;
  width: 50%;
  height: 220%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(200, 151, 42, 0.12) 50%,
    rgba(232, 184, 75, 0.22) 52%,
    rgba(200, 151, 42, 0.12) 54%,
    transparent 64%
  );
  transform: skewX(-15deg);
  animation: winCardShimmer 0.9s ease-out 0.5s forwards;
  pointer-events: none;
}

@keyframes winCardShimmer {
  0%   { left: -75%; opacity: 1; }
  100% { left: 140%;  opacity: 1; }
}

/* A smooth inline slide-and-fade reveal instead of an abrupt screen pop */
@keyframes winCardSlideUp {
  0% { 
    transform: translateY(30px); 
    opacity: 0; 
  }
  100% { 
    transform: translateY(0); 
    opacity: 1; 
  }
}

.win-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.win-badge {
  background-color: var(--correct);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 16px;
}

#win-icon {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-md);
  border: 2px solid var(--gold);
  margin-bottom: 14px;
}

#win-name {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-light);
}

#win-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.win-stats {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 26px;
}

#share-btn {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold-light);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 32px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
  width: 100%;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

#share-btn:hover {
  background: rgba(200, 151, 42, 0.1);
  border-color: var(--gold-light);
  color: var(--gold-light);
}
#share-btn:active { transform: scale(0.97); }

.win-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timer {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
}

/* ── Win card: next mode section ──────────────────────────── */
.win-next-mode {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.win-next-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.win-next-btn {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background 0.2s, border-color 0.2s;
}

.win-next-btn:hover {
  background: rgba(200, 151, 42, 0.1);
  border-color: var(--gold-light);
}

.win-next-btn-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.win-next-btn-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Win card: mode switcher bar ──────────────────────────── */
.win-mode-bar {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: center;
}

.win-mode-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 18px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.win-mode-pill:hover {
  border-color: var(--gold);
  color: var(--text);
}

.win-mode-pill.active {
  background: rgba(200, 151, 42, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ── Responsive Scaling Rules ──────────────────────────────── */
@media (max-width: 900px) {
  .grid-header,
  .guess-row {
    grid-template-columns: 48px 1fr 82px 110px 110px 80px 110px;
    gap: 12px;
  }
  
  .cell {
    font-size: 0.85rem;
    padding: 8px 4px;
    min-height: 56px;
  }
  
  .logo {
    font-size: 2.3rem;
  }
}

@media (max-width: 680px) {
  main {
    padding: 16px 10px;
  }
  
  .grid-header,
  .guess-row {
    width: 760px;
    gap: 12px;
  }
  
  #guess-grid {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 10px;
  }
  
  .grid-header {
    overflow-x: hidden;
  }
}

/* Prismatic Specific Styles */
.cell-icon img.blurred {
  filter: blur(15px);
  transition: filter 0.3s ease;
}

.cell-icon img.revealed {
  filter: blur(0px);
}


/* ── Mode Selector Tabs ────────────────────────────────────── */
#mode-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 28px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.mode-tab:hover {
  border-color: var(--gold);
  color: var(--text);
}

.mode-tab.active {
  background: rgba(200, 151, 42, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ── Prismatic Mode Layout ─────────────────────────────────── */
#g2-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 28px;
  gap: 16px;
  margin-top: -10px;
}

.g2-frame {
  border-radius: calc(var(--radius-lg) + 4px);
  padding: 4px;
  background: var(--bg);
  box-shadow:
    0 0 0 2px rgba(200, 151, 42, 0.7),
    0 0 0 4px rgba(160, 80, 220, 0.4),
    0 0 0 5px rgba(200, 151, 42, 0.25),
    0 0 24px rgba(160, 80, 220, 0.2),
    0 0 40px rgba(200, 151, 42, 0.15);
  animation: framePulse 3s ease-in-out infinite;
}

@keyframes framePulse {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(200, 151, 42, 0.7),
      0 0 0 4px rgba(160, 80, 220, 0.4),
      0 0 0 5px rgba(200, 151, 42, 0.25),
      0 0 24px rgba(160, 80, 220, 0.2),
      0 0 40px rgba(200, 151, 42, 0.15);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(200, 151, 42, 0.9),
      0 0 0 4px rgba(160, 80, 220, 0.55),
      0 0 0 5px rgba(200, 151, 42, 0.35),
      0 0 32px rgba(160, 80, 220, 0.3),
      0 0 56px rgba(200, 151, 42, 0.25);
  }
}

#g2-item-image {
  width: 220px;
  height: 220px;
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  display: block;
}


.g2-counter {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

/* ── Prismatic Guess Rows ──────────────────────────────────── */
#g2-guess-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 500px;
  margin: 0 auto 30px;
}

.g2-guess-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  animation: slideInRow 0.25s ease forwards;
}

@keyframes slideInRow {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.g2-guess-row img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.g2-guess-row span {
  flex: 1;
  font-weight: 500;
}

.g2-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  flex-shrink: 0;
}

.g2-correct {
  border-color: var(--correct) !important;
  background: var(--correct-bg) !important;
}

.g2-correct .g2-badge {
  background: var(--correct);
  color: #fff;
}

.g2-wrong {
  border-color: var(--wrong);
  background: var(--wrong-bg);
}

.g2-wrong .g2-badge {
  background: var(--wrong);
  color: #fff;
}

/* ── Win screen in prismatic ───────────────────────────────── */
#g2-win-screen {
  width: 100%;
  margin-top: 20px;
  display: none;
  justify-content: center;
  align-items: center;
}

#g2-win-screen:not(.hidden) {
  display: flex !important;
}

/* Disabled input after winning */
#guess-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--border);
}

/* ── Contextual mode hint ──────────────────────────────────── */
.mode-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-display);
  margin-bottom: 28px;
  transition: opacity 0.2s ease;
}

.mode-hint::before,
.mode-hint::after {
  content: '';
  flex: 1;
  max-width: 180px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border));
}

.mode-hint::after {
  background: linear-gradient(to left, transparent, var(--border));
}

/* ── Confetti canvas ───────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ── All-done overlay popup ────────────────────────────────── */
.all-done-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeInOverlay 0.25s ease forwards;
}

.all-done-overlay.hidden {
  display: none;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.all-done-card {
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  animation: winCardSlideUp 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.all-done-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.all-done-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-light);
  margin-top: 4px;
}

.all-done-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.all-done-close {
  margin-top: 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 8px 24px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.all-done-close:hover {
  border-color: var(--gold);
  color: var(--text);
}
/* ── Footer ────────────────────────────────────────────────── */
footer {
  border-top: 1px solid rgba(200, 151, 42, 0.08);
  padding: 32px 20px;
  background: linear-gradient(to top, #0c0e18, var(--bg));
}

.footer-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 260px;
}

.footer-divider-line {
  flex: 1;
  height: 1px;
}

.footer-divider-line.left {
  background: linear-gradient(to right, transparent, rgba(200, 151, 42, 0.35));
}

.footer-divider-line.right {
  background: linear-gradient(to left, transparent, rgba(200, 151, 42, 0.35));
}

.footer-divider-diamond {
  width: 5px;
  height: 5px;
  background: rgba(200, 151, 42, 0.5);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  opacity: 0.7;
  max-width: 560px;
}

.footer-links {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.04em;
}

/* ── Header layout with help button ───────────────────────── */
.header-top {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.help-btn {
  position: absolute;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 151, 42, 0.5);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.help-btn:hover {
  background: rgba(200, 151, 42, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ── How to Play Modal ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeInOverlay 0.2s ease forwards;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), 0 0 40px rgba(200, 151, 42, 0.1);
  padding: 36px 32px;
  max-width: 480px;
  width: 90%;
  position: relative;
  animation: winCardSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
  padding: 4px 8px;
}

.modal-close:hover { color: var(--text); }

.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-light);
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}

.modal-section {
  margin-bottom: 22px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 8px;
  opacity: 0.85;
}

.modal-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-text.muted {
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}

/* ── Color indicator cells inside modal ────────────────────── */
.modal-indicators {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.modal-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 60px;
}

.indicator-cell {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid;
}

.indicator-cell.correct {
  background-color: var(--correct-bg);
  border-color: var(--correct);
  color: var(--text);
}

.indicator-cell.partial {
  background-color: var(--partial-bg);
  border-color: var(--partial);
  color: var(--text);
}

.indicator-cell.wrong {
  background-color: var(--wrong-bg);
  border-color: var(--wrong);
  color: var(--text);
}

#g2-item-image {
  -webkit-user-drag: none; /* Disables dragging in Chrome/Safari */
  user-select: none;       /* Disables highlighting */
  pointer-events: none;    /* Blocks clicks passing through to the image */
}
/* ── Daily win counter ─────────────────────────────────────── */
.win-count {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 6px;
  opacity: 0.7;
}

.win-count.hidden {
  display: none;
}

/* ── Streak toast ──────────────────────────────────────────── */
.streak-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 30px rgba(200, 151, 42, 0.2), var(--shadow);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
}

.streak-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.streak-toast-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.streak-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-toast-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold-light);
  letter-spacing: 0.05em;
}

.streak-toast-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ── Header streak display ─────────────────────────────────── */
.streak-display {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(200, 151, 42, 0.08);
  border: 1.5px solid rgba(200, 151, 42, 0.3);
  border-radius: 20px;
  padding: 4px 10px 4px 8px;
  cursor: default;
  transition: border-color 0.2s, background 0.2s;
}

.streak-display:hover {
  background: rgba(200, 151, 42, 0.14);
  border-color: rgba(200, 151, 42, 0.5);
}

.streak-display.hidden {
  display: none;
}

.streak-display-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.streak-display-count {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.03em;
  line-height: 1;
}