:root {
  --test-accent: #10b981;
  --test-accent-rgb: 16, 185, 129;
}

.igt-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100% !important;
  min-height: 480px;
  border-radius: 12px;
  border: 1px solid var(--color-outline);
  background: rgba(255, 255, 255, 0.01);
  padding: 32px 24px !important;
  box-sizing: border-box;
  margin-top: 0 !important;
  margin-bottom: 24px !important;
  transition: all 0.3s ease;
}

@media (max-width: 767px) {
  .igt-container {
    min-height: 320px;
    padding: 20px 16px !important;
  }
}

.igt-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.igt-hud-label {
  font-family: var(--font-h);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.igt-balance {
  font-family: var(--font-h);
  font-size: 44px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.igt-decks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 440px;
}

.igt-deck-wrapper {
  position: relative;
  perspective: 1000px;
  cursor: pointer;
}

/* Deck stack depth cards behind back */
.igt-deck-wrapper::before {
  content: '';
  position: absolute;
  inset: 2px -2px -2px 2px;
  background: #121824;
  border: 1.5px solid rgba(var(--test-accent-rgb, 108, 99, 255), 0.2);
  border-radius: 12px;
  z-index: -1;
  transform: rotate(-1.5deg);
  pointer-events: none;
}
.igt-deck-wrapper::after {
  content: '';
  position: absolute;
  inset: 4px -4px -4px 4px;
  background: #121824;
  border: 1.5px solid rgba(var(--test-accent-rgb, 108, 99, 255), 0.15);
  border-radius: 12px;
  z-index: -2;
  transform: rotate(1.5deg);
  pointer-events: none;
}

.igt-deck {
  width: 100%;
  height: 130px;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;
  outline: none;
  position: relative;
  transition: transform 0.2s;
}

.igt-deck-wrapper:hover .igt-deck:not(:disabled) {
  transform: translateY(-6px);
}

.igt-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.igt-deck.flipped .igt-card-inner {
  transform: rotateY(180deg);
}

.igt-card-back, .igt-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  border: 1.5px solid var(--color-outline);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
}

/* Card Back (playing card back pattern) */
.igt-card-back {
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 2px, transparent 2px, transparent 10px),
              repeating-linear-gradient(-45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 2px, transparent 2px, transparent 10px),
              linear-gradient(135deg, rgba(var(--test-accent-rgb, 108, 99, 255), 0.15) 0%, rgba(var(--test-accent-rgb, 108, 99, 255), 0.03) 100%),
              #121824;
  border-color: rgba(var(--test-accent-rgb, 108, 99, 255), 0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Corners for playing cards */
.igt-card-corner {
  font-family: var(--font-h);
  font-size: 11px;
  font-weight: 900;
  color: var(--text-muted);
  opacity: 0.6;
  line-height: 1;
}
.igt-card-corner.top-left {
  text-align: left;
  align-self: flex-start;
}
.igt-card-corner.bottom-right {
  text-align: right;
  align-self: flex-end;
  transform: rotate(180deg);
}

.igt-card-center {
  font-family: var(--font-h);
  font-size: 32px;
  font-weight: 900;
  color: var(--test-accent);
  text-shadow: 0 0 10px rgba(var(--test-accent-rgb, 108, 99, 255), 0.4);
}

/* Card Face */
.igt-card-face {
  background: #1a2332;
  transform: rotateY(180deg);
  border-color: var(--color-outline);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.igt-card-result-label {
  font-family: var(--font-h);
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.igt-card-value {
  font-family: var(--font-h);
  font-size: 18px;
  font-weight: 900;
  color: #10b981;
}

.igt-card-value.loss {
  color: #ef4444 !important;
}

.igt-card-penalty {
  font-family: var(--font-h);
  font-size: 13px;
  font-weight: 800;
  color: #ef4444;
}

.igt-deck:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.igt-feedback {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 52px;
  max-width: 320px;
}

.igt-feedback-main {
  font-family: var(--font-h);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.igt-feedback-sub {
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.igt-win-flash {
  color: #10b981 !important;
}

.igt-loss-flash {
  color: #ef4444 !important;
}

/* ─── VISUAL PREVIEW STYLING (GUIDELINES COMPLIANT) ─── */
.igt-preview-arena {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 160px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-outline);
  border-radius: 12px;
  margin: 20px auto 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  overflow: hidden;
}

.igt-preview-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.igt-preview-hud-label {
  font-family: var(--font-h);
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.igt-preview-balance {
  font-family: var(--font-h);
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.igt-preview-balance::after {
  content: "$2,000";
  animation: igtPreviewBalanceAnim 5s linear infinite;
}

.igt-preview-decks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 80%;
}

.igt-p-deck {
  height: 52px;
  background: rgba(var(--test-accent-rgb, 108, 99, 255), 0.1);
  border: 1px solid var(--color-outline);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-h);
  font-size: 16px;
  font-weight: 900;
  color: var(--text-muted);
  transition: all 0.2s ease;
  position: relative;
}

.igt-p-deck.col-c {
  animation: igtPreviewDeckCAnim 5s linear infinite;
}

.igt-p-deck.col-d {
  animation: igtPreviewDeckDAnim 5s linear infinite;
}

.igt-preview-click {
  position: absolute;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  animation: igtPreviewClickAnim 5s linear infinite;
}

.igt-preview-click span {
  font-size: 20px;
  line-height: 1;
  display: block;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.igt-preview-caption {
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

.igt-highlight-gain {
  color: #10b981;
  font-weight: 700;
}

/* Animations */
@keyframes igtPreviewClickAnim {
  0% { left: 50%; top: 85%; transform: translate(-35%, -15%) scale(1); }
  20% { left: 62.5%; top: 62%; transform: translate(-35%, -15%) scale(1); }
  25% { left: 62.5%; top: 62%; transform: translate(-35%, -15%) scale(0.85); }
  30% { left: 62.5%; top: 62%; transform: translate(-35%, -15%) scale(1); }
  50% { left: 87.5%; top: 62%; transform: translate(-35%, -15%) scale(1); }
  55% { left: 87.5%; top: 62%; transform: translate(-35%, -15%) scale(0.85); }
  60% { left: 87.5%; top: 62%; transform: translate(-35%, -15%) scale(1); }
  80% { left: 50%; top: 85%; transform: translate(-35%, -15%) scale(1); }
  100% { left: 50%; top: 85%; transform: translate(-35%, -15%) scale(1); }
}

@keyframes igtPreviewDeckCAnim {
  0%, 24% { border-color: var(--color-outline); background: rgba(var(--test-accent-rgb, 108, 99, 255), 0.1); color: var(--text-muted); transform: none; }
  25%, 29% { border-color: #10b981; background: rgba(16, 185, 129, 0.2); color: #fff; transform: scale(0.95); }
  30%, 100% { border-color: var(--color-outline); background: rgba(var(--test-accent-rgb, 108, 99, 255), 0.1); color: var(--text-muted); transform: none; }
}

@keyframes igtPreviewDeckDAnim {
  0%, 54% { border-color: var(--color-outline); background: rgba(var(--test-accent-rgb, 108, 99, 255), 0.1); color: var(--text-muted); transform: none; }
  55%, 59% { border-color: #10b981; background: rgba(16, 185, 129, 0.2); color: #fff; transform: scale(0.95); }
  60%, 100% { border-color: var(--color-outline); background: rgba(var(--test-accent-rgb, 108, 99, 255), 0.1); color: var(--text-muted); transform: none; }
}

@keyframes igtPreviewBalanceAnim {
  0%, 24% { content: "$2,000"; color: #fff; }
  25% { color: #10b981; }
  26%, 54% { content: "$2,050"; color: #fff; }
  55% { color: #10b981; }
  56%, 100% { content: "$2,100"; color: #fff; }
}

.t-intro-icon::before {
  content: 'casino';
}

.igt-history-container {
  width: 100%;
  max-width: 440px;
  margin-top: 18px;
  margin-bottom: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.igt-history-title {
  font-family: var(--font-h);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.igt-history-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  height: 40px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.igt-history-row::-webkit-scrollbar {
  display: none;
}

.igt-history-empty {
  font-family: var(--font-b);
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.6;
}

.igt-history-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--font-h);
  font-size: 11.5px;
  font-weight: 800;
  border: 1.5px solid var(--color-outline);
  white-space: nowrap;
  flex-shrink: 0;
  animation: badgePop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes badgePop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.igt-history-badge.gain {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: #10b981;
}

.igt-history-badge.loss {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

/* Light Theme Overrides */
.light .igt-balance {
  color: #1e293b;
  text-shadow: none;
}

.light .igt-feedback-main {
  color: #1e293b;
}

.light .igt-preview-balance {
  color: #1e293b;
}

.light .igt-preview-balance::after {
  animation: igtPreviewBalanceAnimLight 5s linear infinite;
}

.light .igt-p-deck {
  background: rgba(var(--test-accent-rgb, 108, 99, 255), 0.05);
  border-color: #cbd5e1;
}

.light .igt-preview-click span {
  color: #1e293b;
  text-shadow: none;
}

.light .igt-deck-wrapper::before,
.light .igt-deck-wrapper::after {
  background: #f8fafc;
  border-color: rgba(var(--test-accent-rgb, 108, 99, 255), 0.15);
}

.light .igt-card-back {
  background: repeating-linear-gradient(45deg, rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 2px, transparent 2px, transparent 10px),
              repeating-linear-gradient(-45deg, rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 2px, transparent 2px, transparent 10px),
              linear-gradient(135deg, rgba(var(--test-accent-rgb, 108, 99, 255), 0.1) 0%, rgba(var(--test-accent-rgb, 108, 99, 255), 0.02) 100%),
              #f8fafc;
  border-color: rgba(var(--test-accent-rgb, 108, 99, 255), 0.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.light .igt-card-face {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.light .igt-preview-arena {
  background: rgba(0, 0, 0, 0.01);
}

@keyframes igtPreviewBalanceAnimLight {
  0%, 24% { content: "$2,000"; color: #1e293b; }
  25% { color: #10b981; }
  26%, 54% { content: "$2,050"; color: #1e293b; }
  55% { color: #10b981; }
  56%, 100% { content: "$2,100"; color: #1e293b; }
}

@media (max-width: 480px) {
  .igt-decks-grid {
    gap: 8px;
  }
  .igt-deck {
    height: 90px;
  }
  .igt-card-center {
    font-size: 20px;
  }
  .igt-card-value {
    font-size: 13px;
  }
  .igt-card-penalty {
    font-size: 10px;
  }
  .igt-card-result-label {
    font-size: 7px;
  }
  .igt-card-corner {
    font-size: 8px;
  }
}


