/* =====================================================================
   IntelliDeck Mana Calculator — SINGLE CLEAN STYLESHEET
   - Radiant outer frame (conic gradient) with safe default colors
   - TOP STRIP is a 3-column grid: [Left Commander] [Center] [Right Commander]
   - Center contains: Commander inputs + cost/gems + Top inputs + (optional) Colors pill mount
   - Body + Results span full width under the top strip
   - Land images render as a 5-column grid on desktop (responsive)
   ===================================================================== */

/* =====================================================================
   GLOBAL VARS (clean)
   ===================================================================== */
:root{
  --id-radius: 16px;
  --id-border: rgba(0,0,0,.10);
  --id-shadow: 0 12px 28px rgba(0,0,0,.10);
  --id-muted: rgba(17,24,39,.65);
  --id-heading: #2f7fdc;

  /* Mana colors */
  --mana-w: #f3f1e6;
  --mana-u: #2f7fdc;
  --mana-b: #1f2937;
  --mana-r: #d14b3a;
  --mana-g: #2f8f5b;

  /* Inner paper */
  --paper: rgba(255,255,255,.96);

  /* Warning colors */
  --warn-red: #C9373F;
  --warn-bg: rgba(201,55,63,.08);
  --warn-border: rgba(201,55,63,.25);

  /* Layout knobs */
  --frame-pad: 30px;
  --dock-w: 280px;
  --gap: 18px;

  /* ✅ Default frame colors (NO commander selected) = parchment */
  --id-frame-c1: #efe6cf;
  --id-frame-c2: #f9f4e8;
  --id-frame-c3: #e6d9bc;
  --id-frame-c4: #f1e7d2;
  --id-frame-c5: #d8c6a2;
}

/* =====================================================================
   OUTER FRAME (radiant border)
   ===================================================================== */
.entry-content .id-mana-calc,
[data-id-mana-calc],
.id-mana-calc{
  width: 100%;
  max-width: 1600px;
  margin: 28px auto;
  box-sizing: border-box;

  position: relative;
  border-radius: 22px;
  overflow: hidden;

  padding: var(--frame-pad);

  background: conic-gradient(
    from 210deg,
    var(--id-frame-c1),
    var(--id-frame-c2),
    var(--id-frame-c3),
    var(--id-frame-c4),
    var(--id-frame-c5),
    var(--id-frame-c1)
  );

  box-shadow:
    0 18px 45px rgba(0,0,0,.18),
    0 0 0 2px rgba(255,255,255,.18) inset;
}

/* Subtle bevel + texture inside the frame */
.id-mana-calc::before,
.id-mana-calc::after{
  content:"";
  position:absolute;
  left: var(--frame-pad);
  right: var(--frame-pad);
  top: var(--frame-pad);
  bottom: var(--frame-pad);
  border-radius: calc(22px - var(--frame-pad));
  pointer-events:none;
  z-index:0;
}

.id-mana-calc::before{
  background: radial-gradient(
    1200px 800px at 15% 0%,
    rgba(255,255,255,.14),
    rgba(255,255,255,0)
  );
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.18),
    inset 0 0 0 2px rgba(255,255,255,.16);
}

.id-mana-calc::after{
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,.05) 0px,
      rgba(255,255,255,.05) 2px,
      rgba(0,0,0,.03) 2px,
      rgba(0,0,0,.03) 4px
    );
  mix-blend-mode: overlay;
  opacity: .22;
}


/* =====================================================================
   BASE “WINDOWS” (white cards inside frame)
   ===================================================================== */
.id-card-skin{
  position: relative;
  z-index: 1;
}

.id-card-body,
.id-card-textbox{
  background: var(--paper);
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  padding: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.08),
    0 8px 20px rgba(0,0,0,.10);
}

/* =====================================================================
   TOP STRIP LAYOUT (3 columns)
   ===================================================================== */
.id-top-strip{
  position: relative;
  z-index: 5;               /* important for autocomplete dropdown */
  display: grid;
  grid-template-columns: var(--dock-w) minmax(0,1fr) var(--dock-w);
  gap: var(--gap);
  align-items: start;
  margin-bottom: 12px;
  overflow: visible;        /* allow dropdown to escape */
}

.id-top-strip__center{
  min-width: 0;
  overflow: visible;
}

/* Responsive: stack top strip */
@media (max-width: 1100px){
  .id-top-strip{
    grid-template-columns: 1fr;
  }
  .id-cmd-dock{
    justify-self: center;
  }
}

/* =====================================================================
   COMMANDER DOCK CARDS (NO radiant frame; uses land-card style)
   ===================================================================== */
.id-cmd-dock{
  align-self: start;
  overflow: visible;
}

.id-cmd-dock .id-cmd-card{
  width: 100%;
  max-width: var(--dock-w);
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #efe6cf;
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
}

.id-cmd-dock .id-cmd-thumb{
  width: 100%;
  aspect-ratio: 745 / 1040;
  overflow: hidden;
  background: rgba(0,0,0,.03);
}

.id-cmd-dock .id-cmd-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.id-cmd-dock .id-cmd-title{
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, #f9f4e8, #efe6cf);
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 8px 10px;
  font-weight: 900;
  font-size: 13px;
  text-align: center;
  color: #3a2f1c;
}

/* =====================================================================
   CENTER HEADER (names + costs/gems)
   ===================================================================== */
.id-card-header{
  position: relative;
  z-index: 10;            /* above everything for dropdown */
  overflow: visible;

  display: grid;
  grid-template-columns: minmax(260px, 1fr) 360px; /* left names, right costs */
  gap: 14px;
  align-items: start;

  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  padding: 12px;
}

@media (max-width: 900px){
  .id-card-header{
    grid-template-columns: 1fr;
  }
}

/* Left: commander names stack */
.id-header-left{
  position: relative;     /* anchor for autocomplete */
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* Right: cost rows stack (primary + secondary) */
.id-header-right{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

/* Inputs in header */
.id-commander-name,
.id-commander-cost{
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.14);
  padding: 10px 12px;
  font-weight: 700;
  background: #fff;
  box-sizing: border-box;
}

/* =====================================================================
   COST + GEMS ROW (fix spill / allow wrap for 5c)
   ===================================================================== */
.id-cost-row{
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 96px 1fr; /* cost box + pill */
  gap: 10px;
  align-items: center;
}

/* Cost input stays compact */
.id-cost-row .id-commander-cost{
  width: 96px;
  max-width: 96px;
}

/* Gems pill (both rows) */
.id-card-header__gems,
[data-id-card-gems],
[data-id-card-gems2]{
  min-width: 0;
  max-width: 100%;
  overflow: hidden;        /* safety */
  display: flex;
  flex-wrap: wrap;         /* ✅ wraps instead of spilling */
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  min-height: 38px;
}

/* Make gems a hair smaller so WUBRG fits cleanly */
.id-gem--cost{ width: 34px; height: 34px; }
.id-gem--num{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.18);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

/* =====================================================================
   TOP INPUT GRID (Land tier / colors count / avg cmc / land slots)
   ===================================================================== */
.id-grid{
  display: grid;
  gap: 14px;
}

.id-grid--two{
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

@media (max-width: 1100px){
  .id-grid--two{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  .id-grid--two{
    grid-template-columns: 1fr;
  }
}

/* Align baseline heights in top grid */
.id-grid--two .id-field{
  display: flex;
  flex-direction: column;
}
.id-grid--two .id-field label{ min-height: 22px; }
.id-grid--two .id-input,
.id-grid--two select.id-input{
  height: 44px;
  min-height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.id-grid--two .id-help{
  display: block;
  min-height: 28px;
  margin-top: 8px;
  line-height: 1.25;
}

/* =====================================================================
   FIELDS + INPUTS
   ===================================================================== */
.id-field label{
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.id-input{
  width: 100%;
  padding: 12px 12px;
  border: 1px solid rgba(17,24,39,.14);
  border-radius: 12px;
  background: #fff;
  transition: box-shadow .15s ease, border-color .15s ease, opacity .15s ease;
  box-sizing: border-box;
}

.id-input:focus{
  outline: none;
  border-color: rgba(47,127,220,.55);
  box-shadow: 0 0 0 4px rgba(47,127,220,.18);
}

.id-input:disabled{
  opacity: .45;
  cursor: not-allowed;
}

.id-help{
  display: block;
  margin-top: 6px;
  font-size: 12px;
  opacity: .75;
  color: var(--id-muted);
}

/* =====================================================================
   TYPOGRAPHY
   ===================================================================== */
.id-section__title,
.id-results__title{
  color: var(--id-heading);
}

.id-section__sub{
  margin: 0 0 12px;
  color: var(--id-muted);
}

.id-hr{
  margin: 18px 0;
  border: 0;
  border-top: 1px solid rgba(0,0,0,.10);
}

/* =====================================================================
   COLORS PILL CHECKBOXES
   ===================================================================== */
.id-color-picks{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 8px;
}

.id-check{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--id-border);
  background: rgba(255,255,255,.85);
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, opacity .15s ease;
}

.id-check:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
}

.id-check input[type="checkbox"]{
  width: 14px;
  height: 14px;
}

/* Filled pills (JS toggles is-W / is-U / etc. on label) */
.id-check.is-W{ background: var(--mana-w); color:#111; }
.id-check.is-U{ background: var(--mana-u); color:#fff; }
.id-check.is-B{ background: var(--mana-b); color:#fff; }
.id-check.is-R{ background: var(--mana-r); color:#fff; }
.id-check.is-G{ background: var(--mana-g); color:#fff; }

/* Optional: when JS locks them, add a visual cue if you set .is-locked */
.id-check.is-locked{
  opacity: .70;
  cursor: not-allowed;
}
.id-check.is-locked:hover{
  transform: none;
  box-shadow: none;
}

/* =====================================================================
   GEMS (colored dots used in pips + header pills)
   ===================================================================== */
.id-label-gem{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.id-gem{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-block;
  position: relative;
  border: 1px solid rgba(0,0,0,.10);
  box-shadow:
    inset 0 2px 6px rgba(255,255,255,.35),
    inset 0 -4px 10px rgba(0,0,0,.25),
    0 6px 14px rgba(0,0,0,.12);
  flex: 0 0 auto;
}

.id-gem::after{
  content:"";
  position:absolute;
  top: 6px;
  left: 7px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
}

/* Jewel color mapping */
.id-gem[data-gem="W"]{ background: radial-gradient(circle at 30% 30%, #fff 0%, var(--mana-w) 55%, #d6d1c2 100%); }
.id-gem[data-gem="U"]{ background: radial-gradient(circle at 30% 30%, #8fc5ff 0%, var(--mana-u) 55%, #1c4fd6 100%); }
.id-gem[data-gem="B"]{ background: radial-gradient(circle at 30% 30%, #777 0%, var(--mana-b) 55%, #000 100%); }
.id-gem[data-gem="R"]{ background: radial-gradient(circle at 30% 30%, #ffb0b0 0%, var(--mana-r) 55%, #b21818 100%); }
.id-gem[data-gem="G"]{ background: radial-gradient(circle at 30% 30%, #a9f0c3 0%, var(--mana-g) 55%, #0e7a3d 100%); }
.id-gem[data-gem="C"]{
  background: radial-gradient(circle at 30% 30%, #f5f5f5, #bcbcbc 60%, #7a7a7a);
  border: 2px solid #666;
  box-shadow: 0 0 4px rgba(0,0,0,0.35) inset, 0 6px 14px rgba(0,0,0,.12);
}

/* =====================================================================
   PIPS GRID (6 columns desktop)
   ===================================================================== */
.id-pips-grid{
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
  margin-top: 10px;
}

.id-pips-grid .id-field{ margin: 0 !important; padding: 0 !important; }

.id-pips-grid .id-field label{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 900;
  font-size: 14px;
  margin: 0 0 8px 0 !important;
  line-height: 1.1;
  text-align: center;
}

.id-pips-grid .id-field .id-input{
  width: 100%;
  padding: 8px 6px;
  min-height: 38px;
  text-align: center;
}

.id-pips-grid .id-field small.id-help{ display: none; }

@media (max-width: 820px){
  .id-pips-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
.id-actions{ margin-top: 18px; margin-bottom: 24px; }

.id-actions--row{
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.id-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.id-btn--primary{
  padding: 10px 18px;
  font-size: 14px;
  background: #F0C15A;
  color: #111827;
  box-shadow: 0 14px 28px rgba(240,193,90,.35);
}

.id-btn--primary:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(240,193,90,.42);
}

.id-btn--reset{
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  background: var(--warn-red);
  color: #fff;
  box-shadow: 0 12px 22px rgba(201,55,63,.28);
  opacity: .92;
}

.id-btn--reset:hover{ opacity: 1; filter: brightness(1.05); }

/* =====================================================================
   RESULTS + LAND IMAGES (side-by-side on desktop)
   ===================================================================== */
.id-results{
  border: 1px solid var(--id-border);
  border-radius: var(--id-radius);
  background: rgba(255,255,255,.80);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  padding: 18px 18px 20px;

  opacity: 0;
  transform: translateY(14px);
  transition: opacity .35s ease, transform .35s ease;
  will-change: opacity, transform;
}
.id-results.is-visible{ opacity: 1; transform: translateY(0); }

.id-results ul{ margin: 10px 0 12px; padding-left: 18px; }
.id-results li{ margin: 6px 0; }

.id-results-layout{
  display: grid;
  gap: 22px;
  align-items: start;
}

@media (min-width: 980px){
  .id-results-layout{ grid-template-columns: minmax(340px, 420px) 1fr; }
}

/* =====================================================================
   WARNINGS / NOTES
   ===================================================================== */
.id-warning{
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  border-radius: 14px;
  padding: 12px 14px;
  color: rgba(17,24,39,.92);
}
.id-warning strong{ color: var(--warn-red); }

.id-note{
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.03);
  line-height: 1.35;
  font-size: 14px;
}

/* =====================================================================
   LAND GRID – 5 columns desktop
   ===================================================================== */
.id-land-grid{
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 12px;
}

@media (max-width: 1400px){
  .id-land-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px){
  .id-land-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px){
  .id-land-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

[data-id-land-image-mount] .id-land-card{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  transition: transform .18s ease, box-shadow .18s ease;
  background-color: #efe6cf;
  display: flex;
  flex-direction: column;
}

[data-id-land-image-mount] .id-land-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0,0,0,.12);
}

[data-id-land-image-mount] .id-land-thumb{
  width: 100%;
  aspect-ratio: 745 / 1040;
  overflow: hidden;
  background: rgba(0,0,0,.03);
}

[data-id-land-image-mount] .id-land-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

[data-id-land-image-mount] .id-land-fallback{
  padding: 18px 10px;
  font-weight: 900;
  text-align: center;
  opacity: .75;
}

[data-id-land-image-mount] .id-land-meta{
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, #f9f4e8, #efe6cf);
  border-top: 1px solid rgba(0,0,0,0.08);
  min-height: 32px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

[data-id-land-image-mount] .id-land-name{
  font-weight: 800;
  font-size: 0.95rem;
  color: #3a2f1c;
  margin: 0;
  line-height: 1.1;
}

[data-id-land-image-mount] .id-land-qty{
  flex: 0 0 auto;
  background: rgba(0,0,0,0.06);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* =====================================================================
   COMMANDER AUTOCOMPLETE (dropdown must escape the field)
   ===================================================================== */
.id-ac-box{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 99999;

  background: #1f6fd6;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(0,0,0,.25);
}

.id-ac-item{
  width: 100%;
  text-align: left;
  color: #fff;
  background: transparent;
  font-weight: 800;
  font-size: 15px;
  padding: 10px 14px;
  border: 0;
  cursor: pointer;
  transition: background .15s ease;
}

.id-ac-item:hover,
.id-ac-item:focus{
  background: rgba(255,255,255,.18);
}

.id-ac-item + .id-ac-item{
  border-top: 1px solid rgba(255,255,255,.12);
}

/* =========================================
   1) Make sure the frame texture overlays are BEHIND the UI
   (prevents the overlay from tinting the content)
   ========================================= */
.id-mana-calc{ position: relative; z-index:0}

.id-mana-calc::before,
.id-mana-calc::after{
  z-index: 0;              /* force behind */
}

.id-card-skin{
  position: relative;
  z-index: 1;              /* content above the overlays */
}


/* =========================================
   COLORS IN YOUR DECK — solid card background
   Works in BOTH locations:
   - when moved into .id-top-colors-mount
   - when still in the body
   ========================================= */
[data-id-colors-section]{
  background: #fff;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  padding: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.08),
    0 8px 20px rgba(0,0,0,.10);
}

.id-card-skin{
  position: relative;
  z-index: 1;
}

/* -------------------------------------------------------
   FIX: Top Options bar looks transparent after being moved
   ------------------------------------------------------- */

/* Give the mount area a real panel background */
.id-top-options-mount {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

/* In case the grid itself has transparency */
.id-top-options-mount .id-grid--two {
  background: transparent; /* let the mount provide the panel */
}

/* If your .id-field cards are semi-transparent, force them solid */
.id-top-options-mount .id-field {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 12px;
}

/* Optional: tighten spacing so it looks intentional in the header */
.id-top-options-mount .id-grid--two {
  margin: 0;
}
.id-section,
.id-results,
.id-top-strip,
.id-body{
  background: var(--paper);
  border-radius: 14px;
  box-shadow:
    0 6px 18px rgba(0,0,0,.08),
    inset 0 0 0 1px rgba(0,0,0,.05);
}
.id-check{
  transition: all .15s ease;
}

.id-check:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.15);
}
.id-btn--primary{
  position: relative;
  overflow: hidden;
}

.id-btn--primary::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,.25) 0%,
    rgba(255,255,255,0) 40%
  );
  opacity:0;
  transition: opacity .2s ease;
}

.id-btn--primary:hover::after{
  opacity:1;
}
/* ==========================================================
   Mana Gem Polish Fix
   - Slightly smaller gems
   - Proper light gray colorless
   - Perfectly centered numbers
   ========================================================== */

.id-gem{
  width: 22px;          /* was larger */
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.35),
    inset 0 -3px 6px rgba(0,0,0,.35),
    0 2px 4px rgba(0,0,0,.25);
}

/* WUBRG colors (keep your existing ones if defined elsewhere) */
.id-gem[data-gem="W"]{ background: var(--mana-w); }
.id-gem[data-gem="U"]{ background: var(--mana-u); }
.id-gem[data-gem="B"]{ background: var(--mana-b); }
.id-gem[data-gem="R"]{ background: var(--mana-r); }
.id-gem[data-gem="G"]{ background: var(--mana-g); }

/* FIX: Colorless should be light gray, not white */
.id-gem[data-gem="C"],
.id-gem--num{
  background: #cfd4da; /* light neutral gray */
  color: #1f2937;
}

/* PERFECT number centering */
.id-gem--num{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: -0.3px;
}
/* ==========================================================
   Header mana row sizing tweaks
   - Bigger number gem
   - Mana pill 10% narrower
   - Mana cost input 20% wider (relative)
   ========================================================== */

/* 3) Make the mana-cost cell ~20% wider (and rebalance the row) */
.id-cost-row{
  grid-template-columns: 116px 1fr; /* was 96px; ~20%+ wider */
}

/* keep the input matching the column */
.id-cost-row .id-commander-cost{
  width: 116px;
  max-width: 116px;
}

/* 2) Make the mana pill 10% narrower */
.id-card-header__gems,
[data-id-card-gems],
[data-id-card-gems2]{
  width: 90%;          /* 10% narrower */
  margin-left: auto;   /* keep it aligned right */
  height: auto;        /* do NOT change height */
}

/* 1) Bigger number “gem” (the generic mana like 4) */
.id-gem--num{
  font-size: 14px;     /* bigger number */
  font-weight: 900;
  width: 28px;         /* slightly larger circle */
  height: 28px;
}
/* =========================================
   Normalize Mana Symbol Sizes (All Equal)
   ========================================= */

/* Base gem size (this controls ALL symbols) */
.id-gem,
.id-gem--cost{
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Remove any inherited scaling differences */
.id-gem[data-gem]{
  transform: none;
}

/* =========================================================
   Commander mana pill ONLY (don’t affect pips/intensity)
   ========================================================= */

/* Restore the big gems in Pips + Intensity (if they got changed) */
.id-pips-grid .id-gem{
  width: 36px;
  height: 36px;
}

/* Commander header gems: make them smaller + uniform */
.id-card-header__gems .id-gem--cost{
  width: 22px;
  height: 22px;
}

/* Make the highlight/shadow “centered” on the commander pill gems */
.id-card-header__gems .id-gem--cost::after{
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;   /* tweak if you want */
  height: 10px;  /* tweak if you want */
  opacity: .45;  /* tweak if you want */
}

/* Colorless symbol in the commander pill should be light gray */
.id-card-header__gems .id-gem--cost[data-gem="C"]{
  background: radial-gradient(circle at 30% 30%, #f5f5f5, #d0d0d0 60%, #9a9a9a);
  border: 1px solid rgba(0,0,0,.22);
}

/* The "number gem" (ex: 4) in the commander pill:
   make the number BLACK + DOUBLE the current size */
.id-card-header__gems .id-gem--num{
  color: #000;
  font-size: 20px;     /* ~2x-ish vs your current ~13px */
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================
   Increase label text next to mana symbols (Pips sections)
   ========================================================= */

/* Target ONLY the labels inside the pips grids */
.id-pips-grid .id-label-gem{
  font-size: 1.7em;   /* ~70% larger */
  font-weight: 700;   /* optional but looks cleaner */
}

/* If you want just the color name (White/Blue/etc) bigger */
.id-pips-grid .id-label-gem strong{
  font-size: 1.7em;
}

/* =========================================================
   Land Package Grid – Clean Vertical Alignment
   ========================================================= */

.id-top-options-mount .id-grid--two{
  align-items: stretch;   /* equal column heights */
}

/* Each column */
.id-top-options-mount .id-field{
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Label pinned to top */
.id-top-options-mount .id-field > label{
  text-align: center;
  margin-bottom: 6px;
}

/* This pushes the input DOWN evenly across all columns */
.id-top-options-mount .id-input{
  margin-top: auto;   /* aligns inputs to same level */
}

/* Optional: center help text */
.id-top-options-mount .id-help{
  text-align: center;
  margin-top: 6px;
}
/* =========================================================
   Color Pills – Increase WIDTH only (not height)
   W/U/B/R/G = +10% width
   Leave Colorless alone
   ========================================================= */

/* Base pill stays as-is */
.id-color-picks .id-check{
  box-sizing: border-box;
}

/* Increase horizontal padding ONLY for W/U/B/R/G */
.id-color-picks .id-check:has(input[value="W"]),
.id-color-picks .id-check:has(input[value="U"]),
.id-color-picks .id-check:has(input[value="B"]),
.id-color-picks .id-check:has(input[value="R"]),
.id-color-picks .id-check:has(input[value="G"]){
  padding-left: 1.2em;   /* increase from default */
  padding-right: 1.2em;
}

/* Explicitly leave Colorless untouched */
.id-color-picks .id-check:has(input[value="C"]){
  padding-left: 1.1em;
  padding-right: 1.1em;
}

/* =========================================================
   Color Pills – Make W/U/B/R/G 10% Larger (leave C alone)
   ========================================================= */

/* Target only colored mana pills */
.id-color-picks .id-check.is-W,
.id-color-picks .id-check.is-U,
.id-color-picks .id-check.is-B,
.id-color-picks .id-check.is-R,
.id-color-picks .id-check.is-G{
  transform: scale(1.1);
  transform-origin: center;
}

/* Prevent layout shift */
.id-color-picks{
  align-items: center;
}
/* Increase intro sentence size by 35% */
.id-mana-calc__intro{
  font-size: 1.35em;   /* 35% larger */
  line-height: 1.6;   /* keeps it readable */
}
/* Increase intro text for Pips + Intensity sections by 35% */
.id-grid--two-sections .id-section__sub{
  font-size: 1.35em;   /* 35% larger */
  line-height: 1.6;
}
/* Center the main intro text */
.id-mana-calc__intro{
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
/* Increase font size for mana pip + intensity number inputs */
.id-pips-grid .id-input{
  font-size: 1.3rem;   /* ~30% larger */
  font-weight: 700;    /* makes numbers feel stronger */
  text-align: center;  /* keeps them visually balanced */
}
/* Increase text size inside Land Package input fields only */
.id-grid--two .id-input{
  font-size: 1.2rem;   /* ~20% larger */
  font-weight: 600;    /* slightly stronger but not too bold */
}

/* New stuff to make mobile look pretty */
/* ==========================================================
   MOBILE PATCH (paste at bottom of mana-calculator.css)
   Goal: readable + compact + no overflow on phones
   ========================================================== */

@media (max-width: 640px){

  /* 1) Outer frame: reduce padding + margins */
  .entry-content .id-mana-calc,
  [data-id-mana-calc],
  .id-mana-calc{
    margin: 14px auto;
    padding: 14px;              /* was 30px */
    border-radius: 18px;
  }

  /* Keep the bevel/texture aligned with new padding */
  .id-mana-calc::before,
  .id-mana-calc::after{
    left: 14px;
    right: 14px;
    top: 14px;
    bottom: 14px;
    border-radius: calc(18px - 14px);
  }

  /* 2) Cards: less padding so content fits */
  .id-card-body,
  .id-card-textbox{
    padding: 12px;
    border-radius: 14px;
  }

  /* 3) Top strip: single column ALWAYS on mobile */
  .id-top-strip{
    grid-template-columns: 1fr !important;
    gap: 12px;
    margin-bottom: 10px;
  }

  /* 4) Commander docks: make them smaller + avoid huge vertical scroll */
  .id-cmd-dock .id-cmd-card{
    max-width: 220px;          /* smaller than --dock-w */
  }
  .id-cmd-dock .id-cmd-title{
    font-size: 12px;
    padding: 6px 8px;
  }

  /* Optional: show left+right docks as a row if both exist (safe) */
  .id-top-strip{
    display: grid;
  }
  .id-cmd-dock{
    justify-self: center;
  }

  /* 5) Header grid: stack + reduce padding */
  .id-card-header{
    grid-template-columns: 1fr !important;
    padding: 10px;
    gap: 10px;
  }
  .id-header-right{
    align-items: stretch;       /* so the cost row fits width */
  }

  /* 6) Cost row: let it breathe on mobile */
  .id-cost-row{
    grid-template-columns: 112px 1fr; /* compact but usable */
    gap: 8px;
  }
  .id-cost-row .id-commander-cost{
    width: 112px;
    max-width: 112px;
    font-size: 14px;
    padding: 10px 10px;
  }

  /* Gems pill: full width and wrap nicely */
  .id-card-header__gems,
  [data-id-card-gems],
  [data-id-card-gems2]{
    width: 100% !important;
    justify-content: flex-start; /* feels better on mobile */
    padding: 8px 10px;
    gap: 6px;
  }

  /* 7) Top options mount: reduce “panel thickness” */
  .id-top-options-mount{
    padding: 10px;
  }
  .id-top-options-mount .id-field{
    padding: 0;                 /* avoid extra padding stacking */
  }
  .id-top-options-mount .id-help{
    min-height: 0;
    margin-top: 6px;
  }

  /* 8) Intro text: keep larger, but don’t overrun */
  .id-mana-calc__intro{
    font-size: 1.15em;          /* was 1.35em */
    line-height: 1.55;
    padding: 0 6px;
  }

  /* 9) Section subtitles (pips/intensity): tone down on mobile */
  .id-grid--two-sections .id-section__sub{
    font-size: 1.05em;          /* was 1.35em */
    line-height: 1.5;
  }

  /* 10) Color pills: allow clean wrap + smaller padding */
  .id-color-picks{
    gap: 10px 10px;
  }
  .id-check{
    padding: 8px 10px;          /* slightly tighter */
    font-size: 14px;
  }

  /* IMPORTANT: Your :has(...) rules won’t work on some older mobile browsers.
     This keeps pills sane even if :has is ignored. */
  .id-color-picks .id-check{
    transform: none !important; /* prevents the 1.1 scaling from exploding layout */
  }

  /* 11) Top input grid: single column (already) + better touch sizing */
  .id-grid--two .id-input,
  .id-grid--two select.id-input{
    height: 46px;
    min-height: 46px;
    font-size: 1.05rem;         /* was 1.2rem */
  }

  /* 12) Pips grids: switch to 2 columns on phones */
  .id-pips-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 10px;
  }

  /* Labels: your 1.7em is too large on phones */
  .id-pips-grid .id-label-gem,
  .id-pips-grid .id-label-gem strong{
    font-size: 1.05em !important;
    font-weight: 800;
  }

  /* Keep gems readable but not huge */
  .id-pips-grid .id-gem{
    width: 28px;
    height: 28px;
  }

  /* Inputs in pips/intensity: large enough to tap, not gigantic */
  .id-pips-grid .id-input{
    font-size: 1.15rem;         /* was 1.3rem */
    min-height: 44px;
    padding: 10px 8px;
  }

  /* 13) Buttons: full width stack (mobile-friendly) */
  .id-actions--row{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .id-btn{
    width: 100%;
  }
  .id-btn--primary{
    padding: 12px 16px;
    font-size: 15px;
  }
  .id-btn--reset{
    padding: 12px 16px;
    font-size: 14px;
  }

  /* 14) Results: reduce padding */
  .id-results{
    padding: 14px;
  }

  /* 15) Land grid: 2 columns on most phones, 1 column on very small screens */
  .id-land-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
  }
  @media (max-width: 380px){
    .id-land-grid{
      grid-template-columns: 1fr !important;
    }
  }

  /* Land meta text: slightly smaller so names don't wrap weird */
  [data-id-land-image-mount] .id-land-name{
    font-size: 0.9rem;
  }
  [data-id-land-image-mount] .id-land-qty{
    font-size: 12px;
    padding: 3px 7px;
  }

  /* 16) Prevent any accidental horizontal scroll */
  .id-mana-calc,
  .id-card-skin,
  .id-card-body,
  .id-card-textbox{
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* =====================================================================
   LAND CARD — v2.1.0 LAYOUT
   Full-bleed image, uniform rounded corners, no styling under the card
   Just price text + plain TCGPlayer/Card Kingdom links below
   ===================================================================== */

/* Card shell — transparent, no box */
[data-id-land-image-mount] .id-land-card,
[data-id-utility-grid]     .id-land-card {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  background: transparent;
  transition: transform .18s ease;
}

[data-id-land-image-mount] .id-land-card:hover,
[data-id-utility-grid]     .id-land-card:hover {
  transform: translateY(-2px);
}

/* ── Name — hidden, it's printed on the card art ─────────────────── */
[data-id-land-image-mount] .id-land-name,
[data-id-utility-grid]     .id-land-name {
  display: none;
}

/* ── Thumb — full bleed with uniform rounded corners ─────────────── */
[data-id-land-image-mount] .id-land-thumb,
[data-id-utility-grid]     .id-land-thumb {
  width: 100%;
  aspect-ratio: 745 / 1040;
  overflow: hidden;
  background: #2a2a2a;
  flex-shrink: 0;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

[data-id-land-image-mount] .id-land-thumb img,
[data-id-utility-grid]     .id-land-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Clips all images to MTG card corner radius regardless of scan style */
  border-radius: 6% / 4.3%;
}

[data-id-land-image-mount] .id-land-thumb a,
[data-id-utility-grid]     .id-land-thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

[data-id-land-image-mount] .id-land-fallback,
[data-id-utility-grid]     .id-land-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 80px;
  padding: 10px;
  box-sizing: border-box;
  font-weight: 900;
  font-size: 0.78rem;
  text-align: center;
  color: rgba(255,255,255,.7);
}

/* ── Footer — no box, no background, plain text only ─────────────── */
[data-id-land-image-mount] .id-land-footer,
[data-id-utility-grid]     .id-land-footer {
  width: 100%;
  box-sizing: border-box;
  background: none;
  border: none;
  box-shadow: none;
  padding: 5px 2px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Price — centered, subtle */
[data-id-land-image-mount] .id-land-price,
[data-id-utility-grid]     .id-land-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(17,24,39,.65);
  text-align: center;
}

/* Qty badge — basics only */
[data-id-land-image-mount] .id-land-qty,
[data-id-utility-grid]     .id-land-qty {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(17,24,39,.65);
  text-align: center;
}

/* Buy links — TCGPlayer left, Card Kingdom right, no pills, no box */
[data-id-land-image-mount] .id-land-buy,
[data-id-utility-grid]     .id-land-buy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.id-buy-btn {
  display: inline;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  transition: opacity .15s ease;
  cursor: pointer;
}
.id-buy-btn:hover { opacity: .6; }

.id-buy-btn--tcg { color: #1a6fb5; text-align: left; }
.id-buy-btn--ck  { color: #b01020; text-align: right; }

/* Neutralise old .id-land-meta structure */
[data-id-land-image-mount] .id-land-meta { display: none !important; }

/* =====================================================================
   UTILITY SECTION
   ===================================================================== */
.id-utility-section { margin-top: 8px; }
.id-utility-title { font-size: 1.1rem; font-weight: 900; color: var(--id-heading); margin: 0 0 8px; }
.id-utility-notice { font-weight: 700; margin: 0 0 6px; font-size: 0.95rem; }
.id-utility-caveat { font-size: 0.85rem; opacity: .72; margin: 0 0 14px; font-style: italic; }

/* =====================================================================
   PIP INPUT LOCK
   ===================================================================== */
.id-pips-grid .id-input[data-locked],
.id-pips-grid .id-input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(0,0,0,.04);
}

/* =====================================================================
   MOBILE
   ===================================================================== */
@media (max-width: 640px) {
  .id-buy-btn { font-size: 0.65rem; }
  [data-id-land-image-mount] .id-land-footer,
  [data-id-utility-grid]     .id-land-footer { padding: 4px 2px 0; }
}
