/* ============================================================
   COVEN INVENTORY — clean CSS for new result.php HTML structure
   No !important needed — these class names don't exist in main.css
============================================================ */

/* ── Layout wrapper ── */
.ci-inv-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: 'Exo 2', 'Segoe UI', sans-serif;
  font-size: 12px;
}

/* ── Equipment row: two pairs, always side by side, centered ── */
.ci-equip-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* ── Each Equipment/Costume or Taegeuk/Hanin pair ── */
.ci-epair {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: 260px;
}

/* ── Pair tab buttons ── */
.ci-epair-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  justify-content: center;
}
.ci-etab {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: 'Exo 2', sans-serif;
  cursor: pointer;
  border: 1px solid rgba(201,168,76,.2);
  color: rgba(201,168,76,.45);
  background: rgba(8,5,15,.5);
  transition: all .18s;
  white-space: nowrap;
  user-select: none;
}
.ci-etab.ci-etab-active {
  background: rgba(201,168,76,.14);
  color: #c9a84c;
  border-color: rgba(201,168,76,.45);
}
.ci-etab:hover:not(.ci-etab-active) {
  border-color: rgba(201,168,76,.35);
  color: rgba(201,168,76,.7);
}

/* ── Tab body: slot grid, centered, fixed min-height so empty panels don't collapse ── */
.ci-etab-body {
  width: 100%;
  min-height: 54px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  align-content: flex-start;
}

/* ── Equipment slot card ── */
.ci-slot {
  position: relative;
  width: 58px;
  height: 72px;
  background: rgba(8,5,15,.6);
  border: 1px solid rgba(201,168,76,.18);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s, background .18s;
}
.ci-slot:hover {
  border-color: rgba(201,168,76,.55);
  background: rgba(201,168,76,.07);
  box-shadow: 0 0 10px rgba(201,168,76,.12);
}
.ci-slot .hint img {
  width: 32px;
  height: 32px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.ci-slot-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1px 2px;
  text-align: center;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .2px;
  text-transform: uppercase;
  color: rgba(201,168,76,.55);
  white-space: normal;
  overflow: hidden;
  line-height: 1.25;
  max-height: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  background: rgba(8,5,15,.5);
}
/* cmenu1 inside slot must not add extra layout */
.ci-slot .cmenu1 {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Double-tap support (see special.js): prevents iOS's native text-selection/
   "Copy" callout from popping up if a tap lands slightly long, so it can't
   compete visually with our custom menu. */
.cmenu1 {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Money strip ── */
#inv-money,
.ci-inv-money {
  margin-top: 8px;
  font-size: 12px;
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  color: #f7c873;
  padding: 6px 10px;
  background: rgba(201,168,76,.06);
  border: 1px solid rgba(201,168,76,.15);
  border-radius: 4px;
}
.inv-money-unit {
  font-size: 10px;
  font-weight: 600;
  opacity: .7;
  letter-spacing: .04em;
}

/* ── Bag section ── */
.ci-bag-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ci-bag-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ci-bag-tabs {
  display: flex;
  gap: 5px;
}
.ci-bag-pages {
  display: flex;
  gap: 4px;
}
/* Money pushed to the right of the bag tabs */
.ci-bag-money {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.ci-bag-money #inv-money {
  margin-top: 0 !important;
}

/* Normal / Task tab buttons — reset main.css float/width/bg-image */
#inv-tab-button, #inv-tab2-button {
  float: none !important;
  width: auto !important;
  height: auto !important;
  padding: 5px 14px !important;
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  font-family: 'Exo 2', sans-serif !important;
  cursor: pointer !important;
  border: 1px solid rgba(201,168,76,.2) !important;
  color: rgba(201,168,76,.5) !important;
  background: rgba(8,5,15,.5) !important;
  transition: all .18s !important;
  text-align: center !important;
  line-height: 1.4 !important;
  display: inline-block !important;
  background-image: none !important;
}
.inv-tab-normal, .inv-tab-quest {
  background-image: none !important;
}
.inv-tab-normal-current,
.inv-tab-quest-current {
  background: rgba(201,168,76,.14) !important;
  background-image: none !important;
  color: #c9a84c !important;
  border-color: rgba(201,168,76,.45) !important;
}

.normalinv,.questinv { cursor: pointer; }

/* ── Bag grid ── */
.ci-bag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.item-quests {
  display: none;
}
.item-quests.ci-bag-visible {
  display: contents;
}
.item-normal, .item-normal2, .item-normal3, .item-normal4 {
  display: contents;
}
.item-normal.ci-bag-hidden, .item-normal2.ci-bag-hidden,
.item-normal3.ci-bag-hidden, .item-normal4.ci-bag-hidden {
  display: none;
}

/* ── Bag item cell ── */
.ci-item {
  width: 40px;
  height: 40px;
  background: rgba(8,5,15,.5);
  border: 1px solid rgba(201,168,76,.14);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ci-item:hover {
  border-color: rgba(201,168,76,.5);
  background: rgba(201,168,76,.07);
}
.ci-item .hint img {
  width: 32px;
  height: 32px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── Storage wrapper resets (main.css uses pixel-art absolute layout) ── */
.ci-storage-pane .storage {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  background: none !important;
  display: block !important;
}
.ci-storage-pane .counts {
  position: static !important;
  top: auto !important;
  left: auto !important;
  font-size: 11px !important;
  font-family: 'Exo 2', sans-serif !important;
  color: rgba(201,168,76,.6) !important;
  margin-bottom: 8px !important;
  font-weight: 700 !important;
  display: block !important;
}
.ci-storage-pane .countitemstorage { color: #c9a84c !important; }

/* ── Money strip reset (main.css: position absolute, top:343px) ── */
#inv-money {
  position: static !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  color: #f7c873 !important;
  font-size: 12px !important;
  font-family: 'Exo 2', sans-serif !important;
  font-weight: 700 !important;
  padding: 6px 10px !important;
  background: rgba(201,168,76,.06) !important;
  border: 1px solid rgba(201,168,76,.15) !important;
  border-radius: 4px !important;
  margin-top: 8px !important;
  display: block !important;
}

/* ── Inventory container reset (main.css uses 500×418 bg image) ── */
#inv-container {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  background: none !important;
  display: block !important;
  padding: 0 !important;
}

/* ── Reset main.css absolute positions on bag grid and page nav ── */
#inv-content {
  position: static !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: auto !important;
}

/* ── Storage grid ── */
.ci-storage-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0;
}

/* ── Tooltip ── */
div.tooltip {
  position: absolute;
  z-index: 9999;
  background: rgba(6,3,12,.97);
  border: 1px solid rgba(201,168,76,.45);
  border-radius: 6px;
  padding: 10px 14px;
  max-width: 300px;
  min-width: 150px;
  box-shadow: 0 8px 32px rgba(0,0,0,.8), 0 0 18px rgba(201,168,76,.1);
  font-family: 'Exo 2', 'Segoe UI', sans-serif;
  font-size: 11.5px;
  line-height: 1.65;
  color: #c8b99a;
  pointer-events: none;
  text-align: center;
}
div.tooltip center {
  text-align: center;
  display: block;
}
div.tooltip font[color="yellow"],
div.tooltip font[color="#FFD700"],
div.tooltip font[color="#ffff00"] { color: #f7c873; }
div.tooltip font[color="orange"],
div.tooltip font[color="#FFA500"] { color: #ffa040; }
div.tooltip font[color="red"],
div.tooltip font[color="#FF0000"],
div.tooltip font[color="#ff0000"] { color: #e05065; }
div.tooltip font[color="green"],
div.tooltip font[color="#00FF00"],
div.tooltip font[color="#00ff00"] { color: #5dbf8a; }
div.tooltip font[color="white"],
div.tooltip font[color="#FFFFFF"],
div.tooltip font[color="#ffffff"] { color: #e8dcc8; }
div.tooltip font[color="#C000FF"],
div.tooltip font[color="#c000ff"] { color: #c87dff; }
div.tooltip font[color="#00ffff"],
div.tooltip font[color="#00FFFF"] { color: #7ab0ff; }
div.tooltip font[color="#99CCFF"],
div.tooltip font[color="#99ccff"] { color: #9ec8ff; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
============================================================ */

/* ── Tablet (≤ 900px): shrink equipment pairs, tighter gap ── */
@media (max-width: 900px) {
  .ci-equip-row {
    gap: 16px;
  }
  .ci-epair {
    width: 230px;
  }
}

/* ── Small tablet / large phone (≤ 700px): stack equipment pairs ── */
@media (max-width: 700px) {
  .ci-equip-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .ci-epair {
    width: 100%;
    max-width: 320px;
  }
  .ci-etab-body {
    justify-content: center;
  }
  /* Bag grid: 6 cols → 5 cols */
  .ci-bag-grid {
    justify-content: center;
  }
  .ci-item {
    width: 44px;
    height: 44px;
  }
  .ci-item .hint img {
    width: 34px;
    height: 34px;
  }
}

/* ── Phone (≤ 480px): compact everything ── */
@media (max-width: 480px) {
  .ci-epair {
    width: 100%;
    max-width: 280px;
  }
  .ci-slot {
    width: 52px;
    height: 66px;
  }
  .ci-slot .hint img {
    width: 28px;
    height: 28px;
  }
  .ci-slot-label {
    font-size: 6.5px;
  }
  .ci-item {
    width: 38px;
    height: 38px;
  }
  .ci-item .hint img {
    width: 30px;
    height: 30px;
  }
  .ci-bag-head {
    flex-wrap: wrap;
    gap: 6px;
  }
  .ci-bag-money {
    margin-left: 0;
    width: 100%;
  }
  /* Tooltip: don't overflow on mobile */
  div.tooltip {
    max-width: 90vw;
    font-size: 10.5px;
    padding: 8px 10px;
  }
}

/* ── Very small (≤ 360px): micro adjustments ── */
@media (max-width: 360px) {
  .ci-slot {
    width: 46px;
    height: 60px;
  }
  .ci-item {
    width: 34px;
    height: 34px;
  }
  .ci-item .hint img {
    width: 26px;
    height: 26px;
  }
}
