/* ============================================================
   Single OPTCG Cards – Full "Box" Layout, Centered at All Sizes
   ============================================================ */

/* ─── 0) CENTER THE WHOLE AREA ON THE PAGE ───────────────────────────────────────────── */
.content-container {
  display: flex;
  justify-content: center;  /* center .main-content horizontally */
  padding: 20px;            /* optional space around the content */
}

.main-content {
  width: 100%;
  max-width: 1200px;        /* caps the content area so it never exceeds 1200px */
}

/* Wrap each individual card‐container so that we can center it easily */
.card-post-container {
  display: flex;
  flex-direction: column;
  align-items: center;     /* any .card-container child sits in the horizontal middle */
  width: 100%;
}

/* ─── 1) THE CARD "BOX" ITSELF ─────────────────────────────────────────────────────── */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
align-items: stretch !important;
  /* Use width:100% so it fills .main-content up to its max-width */
  width: 100%;
  max-width: 1200px;
  margin: 20px auto 40px;         /* vertical 20px, horizontal auto = centered */
  background-color: transparent; /* or remove if not needed */
}

/* ─── 2) LEFT: CARD IMAGE ─────────────────────────────────────────────────────────── */
.display-card-image {
  flex: 1.2;
  max-width: 100%;
    position: relative; /* establish positioning context */
  overflow: visible;
}

.display-card-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.display-card-image img:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 20px 4px rgba(75, 163, 242, 0.7),
    0 8px 16px rgba(0, 0, 0, 0.3);
}

/* ─── 3) RIGHT: ENTIRE DETAILS PANEL ──────────────────────────────────────────────── */
.card-details-panel {
  flex: 1.8;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  background-color: #1a1a1a;
  border-radius: 15px;
  overflow: hidden;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 3px rgba(255, 255, 255, 0.05);
}

/* ─── 4) HEADER BAR (ID + TYPE) ──────────────────────────────────────────────────── */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  color: #ffffff;
}

.card-header .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-header .header-card-id {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.card-header .header-card-type {
  font-size: 1.4rem;
  font-weight: 800;
}

/* ─── 5) GRID OF DETAIL FIELDS ───────────────────────────────────────────────────── */
.card-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  padding: 20px 24px;
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1.6;
}

.detail-field {
  background-color: #2a2a2a;
  border-radius: 6px;
  padding: 10px 14px;
}
.detail-field strong {
  display: inline-block;
  color: #ffffff;
  font-weight: 700;
  margin-right: 6px;
}

/* Make "Effect" span two columns */
.effect-field {
  grid-column: span 2;
}

/* Equip effect stays in one column so equip might sits beside it */
.effect-field.equip-effect-cell {
  grid-column: span 1;
}

.card-effect-icon-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #fff;
  color: #000;
  font-size: 16px;      /* bump or lower to taste */
  font-weight: bold;
  /* tweak line-height to nudge the digit up/down */
  line-height: 18px;    /* 22px container − 4px = 18px → lifts text 2px */
}

.card-details .detail-field.effect-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 14px;
  white-space: pre-wrap !important;
  word-break: break-word;
}
.detail-field.effect-field > strong {
  flex-shrink: 0;
}
.detail-field.effect-field .effect-text {
  white-space: pre-wrap;     /* honor newlines */
  word-break: break-word;    /* wrap very long words if needed */
  flex: 1;                   /* take up the rest of the row */
}

/* 2) Make sure your icons stay inline with text */
.card-details .detail-field.effect-field img.card-effect-icon {
  display: inline-block;
 vertical-align: text-top;
  position: relative;
  width: 26px;              /* same as your PHP width */
  height: 26px;
}

.card-details .detail-field.flavor-field {
  grid-column: 1 / -1;
}

.card-effect-icon-white {
  filter: brightness(0) invert(1);
}
/* ─── ICON STYLING IN THE DETAILS GRID ─────────────────────────────────────── */
.card-details .detail-field {
  display: flex;
  align-items: center;
}

/* generic icon inside any detail field */
.card-details .detail-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* specific tweaks if you'd like slightly larger type/color icons */
.card-details .type-icon,
.card-details .color-icon,
.card-details .might-icon {
  width: 24px;
  height: 24px;
}

/* ─── HOVER STATE FOR THE WHOLE PANEL (optional) ─────────────────────────── */
.card-details-panel:hover {
  box-shadow: 0 8px 24px rgba(0, 159, 212, 0.2),
              inset 0 1px 3px rgba(255, 255, 255, 0.05);
}

/* ─── BUTTON-LIKE LINKS IN THE DETAILS GRID (e.g. card-link) ─────────────── */
.card-details-panel a.card-detail-link {
  display: inline-block;
  margin-top: auto;
  color: #00bfff;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid #00bfff;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}
.card-details-panel a.card-detail-link:hover {
  background-color: #00bfff;
  color: #111;
}
.card-details .color-icon {
  width: 28px;
  height: 28px;
}

.card-details .power-icon {
  width: 28px;
  height: 28px;
  margin-right: 4px;
}
.card-details .color-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ─── EFFECT KEYWORD HIGHLIGHTS (fixed) ────────────────────────── */
/* 1) Base keyword on the host */
.card-details .detail-field.effect-field .keyword {
  position: relative;
  display: inline-block;
  padding: 2px 6px;
  margin: 0 4px 2px 0;
  font-size: 0.9em;
  font-weight: bold;
  font-style: italic;
  color: #fff;               /* default text color */
  border-radius: 4px;
  z-index: 1;                /* sit above ::before */
  overflow: visible;         /* ensure nothing is clipped */
}

/* 2) Skewed background behind the host, forced behind via z-index:-1 */
.card-details .detail-field.effect-field .keyword::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform: skew(-12deg);
  border-radius: 4px;
  background: #26705f;       /* fallback */
  z-index: -1;               /* behind the text for sure */
}

/* Arrow shape: keyword[>] — skewed left + arrow point on the right */
.card-details .detail-field.effect-field .keyword-arrow {
    padding-right: 8px;
    margin-right: 6px;
}
.card-details .detail-field.effect-field .keyword-arrow::before {
    transform: skew(0deg);
    right: -8px;
    width: auto;
    border-radius: 0;
    clip-path: polygon(5px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
}

/* 3) Per-keyword backgrounds */
.card-details .detail-field.effect-field .keyword-accelerate::before { background: #26705f; }
.card-details .detail-field.effect-field .keyword-legion::before     { background: #26705f; }
.card-details .detail-field.effect-field .keyword-hidden::before     { background: #26705f; }
.card-details .detail-field.effect-field .keyword-action::before     { background: #26705f; }

.card-details .detail-field.effect-field .keyword-deflect::before    { background: #94b331; }
.card-details .detail-field.effect-field .keyword-ganking::before    { background: #93af34; }
.card-details .detail-field.effect-field .keyword-temporary::before    { background: #93af34; }
.card-details .detail-field.effect-field .keyword-deathknell { color: #000; }
.card-details .detail-field.effect-field .keyword-deathknell::before { background: #93af34; }
.card-details .detail-field.effect-field .keyword-hunt { color: #000; }
.card-details .detail-field.effect-field .keyword-hunt::before       { background: #93af34; }
.card-details .detail-field.effect-field .keyword-ambush::before     { background: #1ba17f; }
.card-details .detail-field.effect-field .keyword-predict::before    { background: #696c64; }
.card-details .detail-field.effect-field .keyword-backline::before   { background: #bb2f65; }
.card-details .detail-field.effect-field .keyword-stun::before       { background: #696c64; }

/* Level */
.card-details .detail-field.effect-field .keyword-level { color: #000; }
.card-details .detail-field.effect-field .keyword-level::before { background: #93af34; }

.card-details .detail-field.effect-field .keyword-assault::before    { background: #bb2f65; }
.card-details .detail-field.effect-field .keyword-shield::before     { background: #bb2f65; }
.card-details .detail-field.effect-field .keyword-tank::before       { background: #bb2f65; }

.card-details .detail-field.effect-field .keyword-reaction::before   { background: #1ba17f; }
.card-details .detail-field.effect-field .keyword-quickdraw::before   { background: #1ba17f; }
.card-details .detail-field.effect-field .keyword-add::before        { background: #696c64; }
.card-details .detail-field.effect-field .keyword-unique::before        { background: #696c64; }
.card-details .detail-field.effect-field .keyword-weaponmaster::before        { background: #696c64; }
.card-details .detail-field.effect-field .keyword-vision::before        { background: #696c64; }
.card-details .detail-field.effect-field .keyword-mighty::before     { background: #696c64; }
.card-details .detail-field.effect-field .keyword-buff::before       { background: #696c64; }
.card-details .detail-field.effect-field .keyword-equip {
    position: relative;
    display: inline-block;
    padding: 2px 8px;
    margin: 0 4px 2px 0;
    font-size: 0.9em;
    font-weight: bold;
    font-style: italic;
    color: #fff;    
    border-radius: 4px;
    z-index: 1;
    overflow: visible;
}

.card-details .detail-field.effect-field .keyword-equip::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: skew(-12deg);
    border-radius: 4px;
    background: #696c64;  /* Grey background - removed !important */
    z-index: -1;
}

/* Icons inside EQUIP keyword box - more specific selector */
.card-details .detail-field.effect-field .keyword-equip img.equip-token-icon {
    display: inline-block;
    vertical-align: middle;
    width: 22px;
    height: 22px;
    margin: 0 2px;  /* Reduced margin for tighter spacing */
    filter: brightness(0) invert(1); /* Make white */
}

/* Number circles inside EQUIP keyword box */
.card-details .detail-field.effect-field .keyword-equip .equip-number-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #fff;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    line-height: 18px;
    margin: 0 2px;  /* Reduced margin for tighter spacing */
}

.card-details .detail-field.effect-field .keyword-equip .equip-number-icon,
.card-details .detail-field.effect-field .keyword-equip .equip-token-icon {
    font-style: normal;
}

/* ─── REPEAT KEYWORD STYLING ────────────────────────── */
.card-details .detail-field.effect-field .keyword-repeat {
    position: relative;
    display: inline-block;
    padding: 2px 8px;
    margin: 0 4px 2px 0;
    font-size: 0.9em;
    font-weight: bold;
    font-style: italic;
    color: #fff;
    border-radius: 4px;
    z-index: 1;
    overflow: visible;
}

.card-details .detail-field.effect-field .keyword-repeat::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: skew(-12deg);
    border-radius: 4px;
    background: #1ba17f;  /* Same as REACTION */
    z-index: -1;
}

/* Icons inside REPEAT keyword box */
.card-details .detail-field.effect-field .keyword-repeat img.repeat-token-icon {
    display: inline-block;
    vertical-align: middle;
    width: 22px;
    height: 22px;
    margin: 0 2px;
    filter: brightness(0) invert(1); /* Make white */
}

/* Number circles inside REPEAT keyword box */
.card-details .detail-field.effect-field .keyword-repeat .repeat-number-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #fff;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    line-height: 18px;
    margin: 0 2px;
}

/* Prevent italic styling for icons and numbers inside REPEAT keyword */
.card-details .detail-field.effect-field .keyword-repeat .repeat-number-icon,
.card-details .detail-field.effect-field .keyword-repeat .repeat-token-icon {
    font-style: normal;
}

/* 4) Dark text on light backgrounds */
.card-details .detail-field.effect-field .keyword-deflect,
.card-details .detail-field.effect-field .keyword-ganking,
.card-details .detail-field.effect-field .keyword-temporary {
  color: #000;
}

/* ─── Alt Art CSS ──────────────────────────────────────────────────── */
/* under .display-card-image */
.alternate-art-container {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.alternate-art-container .alternate-art {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.alternate-art-container .alternate-art:hover {
  transform: scale(1.05);
}

/* ─── RELATED DECKS SECTION ──────────────────────────────────────────────────── */

.related-decks-container {
  width: 100%;
  max-width: 1200px;      /* match your page max */
  margin: 10px auto 80px;
  padding: 0 20px;         /* match your page padding */
  box-sizing: border-box;
}

.related-decks-header {
  border-radius: 12px 12px 0 0;   /* match your other card‐header rounding */
  padding: 12px 20px;            /* adjust for your desired spacing */
  color: #fff;                   /* ensure text is readable */
  margin-bottom: 20px;           /* space before the grid */
}

/* Make sure the <h4> itself doesn't inherit extra flex styles: */
.related-decks-header h4 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Use the same grid layout as all-decks but specifically for related decks */
.related-decks-container .all-decks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 0; /* Remove margin since we have it on the container */
}

/* Ensure deck boxes in related section use the same styling */
.related-decks-container .all-deck-box-wrapper {
  /* All styles inherited from the main all-deck-box-wrapper styles */
}

/* ─── MOBILE RESPONSIVE FOR RELATED DECKS ───────────────────────────────────── */
@media screen and (min-width: 1200px) {
  .related-decks-container .all-decks {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .related-decks-container .all-decks {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .related-decks-container {
    margin: 20px auto 40px;
    padding: 0 10px;
  }
  
  .related-decks-header {
    padding: 10px 16px;
  }
  
  .related-decks-header h4 {
    font-size: 1.1rem;
  }
}

/* ─── RESPONSIVE ADJUSTMENTS ──────────────────────────────────────────────────── */

/* Smaller tablets / large phones (≤ 768px): stack image above details */
@media (max-width: 768px) {
  .card-container {
	  display: flex;
    flex-direction: column;
    max-width: 800px;         /* narrower cap on smaller screens */
    margin: 20px auto;
  }
    .display-card-image {
     display: contents;
    position: relative;
  }

  /* 1) First: the main card image (your <img>) */
  .display-card-image > img:first-child {
    order: 1;
    width: 100%;      /* ensure it still fills container */
    max-width: 100%;
  }

  /* 2) Then: your details panel */
  .card-details-panel {
    order: 2;
  }

/* ─── Alt Art CSS ──────────────────────────────────────────────────── */
/* under .display-card-image */
.alternate-art-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  order: 3;
  width: 100%;
}

.alternate-art-container .alternate-art {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.alternate-art-container .alternate-art:hover {
  transform: scale(1.05);
}

  .display-card-image,
  .card-details-panel {
    flex: 1;
    max-width: 100%;
  }
  .card-details {
    gap: 10px;
    padding: 16px 20px;
  }
  .detail-field {
    padding: 8px 12px;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .card-header .header-card-id {
    font-size: 1.2rem;
  }
  .card-header .header-card-type {
    font-size: 1.3rem;
  }
}

/* Phone (≤ 480px): turn grid into a single column for detail fields */
@media (max-width: 480px) {
  .card-container {
    max-width: 100%;           /* allow full width on very small phones */
  }
  .card-details {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }
  .detail-field {
    padding: 6px 10px;
    font-size: 0.95rem;
  }
  .effect-field {
    grid-column: span 1;       /* single‐column on very narrow screens */
  }
  .card-header {
    padding: 12px 16px;
  }
  .card-header .header-card-id {
    font-size: 1.1rem;
  }
  .card-header .header-card-type {
    font-size: 1.2rem;
  }
}