/* /css/mineland_modal.css */

@font-face {
  font-family: "RubikBoldLocal";
  src: url("/font/RubikBold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===== Main modal ===== */
.pickcases-modal,
.pc-info-overlay,
.pc-confirm-overlay {
  --wood:#D08D62;
  --wood-dark:#926343;
  --cream:#FEEDC6;
  --cream-2:#F1CE9A;
  --gold:#F3C285;
  --gold-2:#FFE353;
  --text:#ffffff;
  --text-wood:#6e471f;
  --overlay:rgba(0,0,0,.75);
  --radius:22px;
  --soft-shadow:0 4px 22px rgba(122,87,48,.20), 0 1px 0 rgba(255,255,255,0.13);
}

.pickcases-modal * ,
.pc-info-overlay * ,
.pc-confirm-overlay * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.pickcases-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 998;
  padding: 10px;
  background: radial-gradient(circle at top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.75) 55%, rgba(0,0,0,0.85) 100%);
  font-family: "RubikBoldLocal", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--text);
}

.pickcases-dialog {
  width: 100%;
  max-width: 460px;
  background: var(--wood);
  border-radius: 26px;
  padding: 16px 12px 14px;
  position: relative;
  color: #fff7df;
  border: 4px solid var(--gold);
  box-shadow: var(--soft-shadow);
}

.pc-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 2px solid var(--cream-2);
  background: #7f4f32;
  color: #fff7df;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
  user-select: none;
}
.pc-close:active { transform: translateY(1px); box-shadow: 0 0 0 rgba(0,0,0,0); }

.pc-header { margin-bottom: 10px; padding-right: 48px; }
.pc-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff9e7;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
}
.pc-subtitle {
  font-size: 12px;
  color: #ffe9bd;
  opacity: 0.92;
  margin-top: 4px;
  line-height: 1.25;
}

.pc-balances {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0 8px;
}
.pc-pill {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--wood-dark);
  border: 3px solid var(--cream-2);
  gap: 7px;
  color: #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.pc-pill img {
  width: 20px; height: 20px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}
.pc-pill-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #fff2c8;
  opacity: 0.85;
  line-height: 1.05;
}
.pc-pill-value {
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0,0,0,.5);
  line-height: 1.05;
}

.pc-main {
  margin-top: 6px;
  padding: 10px 10px 10px;
  border-radius: 18px;
  background: rgba(146,99,67,0.9);
  border: 3px solid #FAC791;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.pc-chest-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.pc-chest-card {
  flex: 1 1 auto;
  background: #7f4f32;
  border-radius: 18px;
  padding: 10px;
  border: 2px solid #F1CE9A;
  box-shadow: 0 2px 0 rgba(0,0,0,.4);
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.pc-chest-img {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.pc-chest-img video {
  width: 62px;
  height: 62px;
  object-fit: contain;
  pointer-events: none;
  background: transparent;
}
.pc-chest-img img { width: 62px; height: 62px; object-fit: contain; }

.pc-chest-meta { min-width: 0; }
.pc-chest-name {
  font-size: 13px;
  font-weight: 900;
  color: #fff9e7;
  margin-bottom: 2px;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}
.pc-chest-desc {
  font-size: 12px;
  color: #f5e0c0;
  opacity: 0.94;
  line-height: 1.2;
}

/* ===== Info button (PNG instead of SVG) ===== */
.pc-info-btn {
  flex: 0 0 auto;
  width: 54px;
  height: auto;
  align-self: stretch;
  border-radius: 18px;
  border: 2px solid #F1CE9A;
  background: #f5e1b8;
  color: #3b2514;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  padding: 0;
}
.pc-info-btn:active { transform: translateY(1px); box-shadow: 0 0 0 rgba(0,0,0,0); }

.pc-info-ico {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.25));
  background: transparent;
  pointer-events: none;
}

.pc-stock {
  margin-top: 10px;
  background: #7f4f32;
  border-radius: 16px;
  padding: 9px 10px 10px;
  border: 2px solid #F1CE9A;
  box-shadow: 0 2px 0 rgba(0,0,0,.4);
}
.pc-stock-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
}
.pc-stock-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #fff2c8;
  opacity: 0.92;
}
.pc-stock-num {
  font-size: 12px;
  color: #fff9e7;
  font-weight: 900;
  white-space: nowrap;
}
.pc-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.12);
  overflow: hidden;
}
.pc-bar > div {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFE353 0%, #F3C285 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  transition: width .2s ease;
}
.pc-stock-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #fbead2;
  opacity: 0.92;
  line-height: 1.2;
}

.pc-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== pack buttons x1/x3/x8 ===== */
.pc-pack-btn {
  flex: 1 1 calc(33.333% - 6px);
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 2px solid #F1CE9A;
  background: #f5e1b8;
  color: #3b2514;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
  user-select: none;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  transition: transform 0.08s ease, opacity 0.12s, box-shadow 0.1s, background 0.12s ease;
  position: relative;
}
.pc-pack-btn:active { transform: translateY(1px); box-shadow: 0 0 0 rgba(0,0,0,0); background: #efd6a5; }
.pc-pack-btn:disabled { opacity: 0.5; cursor: default; box-shadow: 0 0 0 rgba(0,0,0,0); }

.pc-pack-x { font-size: 12px; font-weight: 900; color: #2b1505; }
.pc-pack-price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  color: #2b1505;
}
.pc-pack-price img { width: 16px; height: 16px; object-fit: contain; }

/* discount icon */
.pc-discount-ico {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  background: transparent;
}
.pc-pack-btn:disabled .pc-discount-ico { opacity: 0.65; }

.pc-mycount {
  margin-top: 10px;
  background: #7f4f32;
  border-radius: 16px;
  padding: 9px 10px;
  border: 2px solid #F1CE9A;
  box-shadow: 0 2px 0 rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pc-mycount-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pc-mycount-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #fff2c8;
  opacity: 0.92;
}
.pc-mycount-value {
  font-size: 13px;
  font-weight: 900;
  color: #fff9e7;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
  white-space: nowrap;
}
.pc-mycount-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: #fff9e7;
  font-weight: 900;
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
  white-space: nowrap;
}

.pc-section-title {
  margin-top: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #fff2c8;
  opacity: 0.92;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

.pc-toplist {
  margin-top: 8px;
  background: #7f4f32;
  border-radius: 16px;
  padding: 9px 10px 10px;
  border: 2px solid #F1CE9A;
  box-shadow: 0 2px 0 rgba(0,0,0,.4);
  max-height: 132px;
  overflow-y: auto;
}
.pc-toplist::-webkit-scrollbar { width: 4px; }
.pc-toplist::-webkit-scrollbar-track { background: rgba(0,0,0,0.18); border-radius: 4px; }
.pc-toplist::-webkit-scrollbar-thumb { background: #f3c283; border-radius: 4px; }

.pc-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(255,243,221,0.28);
}
.pc-top-row:last-child { border-bottom: none; }

.pc-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.pc-rank {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff9e7;
  font-size: 12px;
  font-weight: 900;
  flex: 0 0 auto;
}
.pc-buyer {
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
  color: #fff9e7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-count {
  font-size: 12px;
  font-weight: 900;
  color: #ffecc4;
  white-space: nowrap;
}

/* ===== Info modal ===== */
.pc-info-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 10px;
  background: radial-gradient(circle at top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.78) 55%, rgba(0,0,0,0.88) 100%);
  font-family: "RubikBoldLocal", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--text);
}
.pc-info-dialog {
  width: 100%;
  max-width: 460px;
  background: var(--wood);
  border-radius: 26px;
  padding: 16px 12px 14px;
  position: relative;
  color: #fff7df;
  border: 4px solid var(--gold);
  box-shadow: var(--soft-shadow);
}
.pc-info-title {
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #fff9e7;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
  padding-right: 48px;
}
.pc-info-box {
  margin-top: 20px;
  padding: 10px 10px;
  border-radius: 18px;
  background: rgba(146,99,67,0.9);
  border: 3px solid #FAC791;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  max-height: 64vh;
  overflow-y: auto;
}
.pc-info-box::-webkit-scrollbar { width: 4px; }
.pc-info-box::-webkit-scrollbar-track { background: rgba(0,0,0,0.18); border-radius: 4px; }
.pc-info-box::-webkit-scrollbar-thumb { background: #f3c283; border-radius: 4px; }

.pc-info-text {
  font-size: 12px;
  color: #fff7df;
  line-height: 1.35;
  opacity: 0.98;
}
.pc-info-text b { color: #fff9e7; text-shadow: 0 1px 0 rgba(0,0,0,.35); }

/* ===== Confirm modal ===== */
.pc-confirm-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 10px;
  background: radial-gradient(circle at top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.78) 55%, rgba(0,0,0,0.88) 100%);
  font-family: "RubikBoldLocal", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--text);
}
.pc-confirm-dialog {
  width: 100%;
  max-width: 295px;
  background: var(--wood);
  border-radius: 26px;
  padding: 16px 12px 14px;
  position: relative;
  color: #fff7df;
  border: 4px solid var(--gold);
  box-shadow: var(--soft-shadow);
}
.pc-confirm-title {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #fff9e7;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
  padding-right: 48px;
}
.pc-confirm-text {
  margin-top: 20px;
  font-size: 12px;
  color: #ffe9bd;
  opacity: 0.95;
  line-height: 1.25;
}
.pc-confirm-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.pc-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 14px;
  border: 2px solid #F1CE9A;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  cursor: pointer;
  background: #f5e1b8;
  color: #3b2514;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
  user-select: none;
  white-space: nowrap;
}
.pc-btn:active { transform: translateY(1px); box-shadow: 0 0 0 rgba(0,0,0,0); }
.pc-btn--danger { background: #7f4f32; color: #fff7df; }
.pc-btn--ok { background: #01B372; color: #fff; border-color: #6EEF71; }

/* ===== Toast ===== */
#pc-toast {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
  box-shadow: 0 4px 6px rgba(0,0,0,.25);
}

@media (max-width: 420px) {
  .pickcases-dialog { padding: 14px 10px 12px; }
  .pc-chest-img { width: 66px; height: 66px; }
  .pc-info-btn { width: 52px; }
  .pc-info-ico { width: 22px; height: 22px; }
  .pc-pack-btn { padding: 10px 8px; }
  .pc-pack-price { font-size: 11px; }
  .pc-discount-ico {
    width: 24px;
    height: 24px;
    top: -7px;
    right: -7px;
  }
}
