#ygoComboModal .modal-content {
    max-height: 98vh;
    display: flex;
    flex-direction: column;
}

#ygoComboModal .row {
    margin: 0;
}

#ygoComboModal .col-12 {
    display: flex;
    flex-direction: column;
    height: auto;
    margin: 0;
}

#ygoComboModal .combo-card {
    display: flex;
    flex-direction: column;
}

#ygoTimelineList {
    display: block;
    max-height: 14vh; 
    overflow-y: auto;
}

@media (min-width: 1200px) {
    #ygoComboModal .modal-content {
        height: 91vh;
        overflow: hidden;
    }

    #ygoComboModal .row {
        flex: 1;
        min-height: 0;
    }

    #ygoComboModal .col-12.col-xl-8, 
    #ygoComboModal .col-12.col-xl-4 {
        height: 100%;
        min-height: 0;
    }

    #ygoComboModal .combo-card {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        margin-top: 0;
    }

    #ygoTimelineList {
        flex: 1 1 0%;
        min-height: 0;
        max-height: none;
    }
}

.timeline-node {
    flex-shrink: 0;
    display: block;
    width: 100%;
    background: transparent;
    color: white;
    border: none;
    border-bottom: 1px solid #4a5568;
    padding: 0.5rem;
    text-align: left;
    font-size: 0.8rem;
}

.ygo-board-wrapper {
  background-color: #121212;
  font-family: system-ui, -apple-system, sans-serif;
}

.ygo-field-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  padding: 16px;
  background: #181818;
  border-radius: 8px;
  border: 1px solid #2d2d2d;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 1199.98px) {
  .ygo-field-grid {
    gap: 2px;
    padding: 4px;
  }
  .timeline-node {
    font-size: 0.6rem;
  }
}

.ygo-zone {
  aspect-ratio: 1 / 1.46;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed #444;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #6c757d;
  font-weight: 700;
  user-select: none;
  min-width: 0;
}

/* Grid Positioning Matrix mapping your exact layout */
.z-emz1 { grid-column: 3; grid-row: 1; }
.z-emz2 { grid-column: 5; grid-row: 1; }

.z-fz   { grid-column: 1; grid-row: 2; }
.z-m1   { grid-column: 2; grid-row: 2; }
.z-m2   { grid-column: 3; grid-row: 2; }
.z-m3   { grid-column: 4; grid-row: 2; }
.z-m4   { grid-column: 5; grid-row: 2; }
.z-m5   { grid-column: 6; grid-row: 2; }
.z-gy   { grid-column: 7; grid-row: 2; }
.z-ban  { grid-column: 7; grid-row: 1; }

.z-ed   { grid-column: 1; grid-row: 3; }
.z-st1  { grid-column: 2; grid-row: 3; }
.z-st2  { grid-column: 3; grid-row: 3; }
.z-st3  { grid-column: 4; grid-row: 3; }
.z-st4  { grid-column: 5; grid-row: 3; }
.z-st5  { grid-column: 6; grid-row: 3; }
.z-md   { grid-column: 7; grid-row: 3; }

/* Hand Container Design */
.ygo-hand-container {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border: 1px solid #222;
}

.ygo-hand-flex .ygo-zone {
  border: 0;
  background: none;
  height: 100%;
} 

.ygo-hand-flex {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  height: 12vh;
  flex-wrap: wrap;
}

.ygo-card-slot {
  width: 100%;
  height: 100%;
  position: relative;
}

.ygo-card-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
  box-sizing: border-box;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 0.38s cubic-bezier(0.25, 1, 0.5, 1);
}

.ygo-card-slot .material-card {
  position: absolute;
  top: 0;
  left: 0;
}

.z-gy, .z-ban {
    position: relative;
    overflow: visible; 
}

.card-label-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.55rem;
  text-align: center;
  padding: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Transient FX Scale Out Animations */
@keyframes effectActivation {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.9); border-color: #ffc107; }
  50% { transform: scale(1.08); box-shadow: 0 0 20px 8px rgba(255, 193, 7, 0.5); border-color: #ffc107; }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

.fx-effect-active {
  animation: effectActivation 0.8s ease-in-out infinite;
  z-index: 50;
}

.fx-text-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  text-align: center;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: #ffc107;
  border: 1px solid #ffc107;
  padding: 2px 6px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 60;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.stack-container {
  transition: transform 0.3s ease;
  position: relative;
  width: 100%;
  height: 100%;
}
.stack-container .ygo-card-slot {
  position: absolute;
  transition: transform 0.3s ease;
}
.stack-container:hover .stack-item:nth-child(2) { transform: translateY(12%) !important; }
.stack-container:hover .stack-item:nth-child(3) { transform: translateY(24%) !important; }
.stack-container:hover .stack-item:nth-child(4) { transform: translateY(36%) !important; }
.stack-container:hover .stack-item:nth-child(5) { transform: translateY(48%) !important; }
.stack-container:hover .stack-item:nth-child(6) { transform: translateY(60%) !important; }
.stack-container:hover .stack-item:nth-child(7) { transform: translateY(72%) !important; }
.stack-container:hover .stack-item:nth-child(8) { transform: translateY(84%) !important; }
.stack-container:hover .stack-item:nth-child(9) { transform: translateY(96%) !important; }
.stack-container:hover .stack-item:nth-child(10) { transform: translateY(108%) !important; }
.stack-container:hover .stack-item:nth-child(11) { transform: translateX(-80%) translateY(0%) !important; z-index: -1 !important; }
.stack-container:hover .stack-item:nth-child(12) { transform: translateX(-80%) translateY(12%) !important; z-index: 0 !important; }
.stack-container:hover .stack-item:nth-child(13) { transform: translateX(-80%) translateY(24%) !important; z-index: 1 !important; }
.stack-container:hover .stack-item:nth-child(14) { transform: translateX(-80%) translateY(36%) !important; z-index: 2 !important; }
.stack-container:hover .stack-item:nth-child(15) { transform: translateX(-80%) translateY(48%) !important; z-index: 3 !important; }
.stack-container:hover .stack-item:nth-child(16) { transform: translateX(-80%) translateY(60%) !important; z-index: 4 !important; }
.stack-container:hover .stack-item:nth-child(17) { transform: translateX(-80%) translateY(72%) !important; z-index: 5 !important; }
.stack-container:hover .stack-item:nth-child(18) { transform: translateX(-80%) translateY(84%) !important; z-index: 6 !important; }
.stack-container:hover .stack-item:nth-child(19) { transform: translateX(-80%) translateY(96%) !important; z-index: 7 !important; }
.stack-container:hover {
  transform: scale(1.5);
  z-index: 999;
}

@media (max-width: 1199px) {
  .stack-container:hover {
    transform: scale(2.0);
  }
}