
.ei-rpg-shop-wrap{position:relative;border:1px solid #222;background-size:cover;background-position:center;padding:12px;
  --ei-panel-bg: rgba(0,0,0,0.35);
  --ei-panel-text: #ffffff;
  --ei-panel-border: rgba(255,255,255,0.35);
  --ei-detail-bg: rgba(0,0,0,0.35);
  --ei-merchant-dialog-bg: rgba(0,0,0,0.65);
  --ei-merchant-dialog-text: #ffffff;
  --ei-merchant-img-max-h: 0px;
}
.ei-rpg-shop-inner{display:flex;gap:12px}
.ei-rpg-shop-wrap.is-entry .ei-rpg-shop-inner{visibility:hidden;pointer-events:none}
.ei-shop-merchant{width:36%;min-width:240px;background:rgba(0,0,0,.55);color:#fff;padding:10px;border-radius:8px}
.ei-merchant-img{width:100%;height:auto;display:block;border-radius:8px;margin-bottom:8px}
.ei-rpg-shop-wrap[style*="--ei-merchant-img-max-h"] .ei-merchant-img{max-height:var(--ei-merchant-img-max-h);object-fit:contain}
.ei-merchant-img.placeholder{width:100%;height:220px;background:rgba(255,255,255,.1);border-radius:8px}
.ei-merchant-name{font-weight:700;margin:6px 0}
.ei-merchant-expression{display:inline-block;margin:2px 0 0;padding:2px 8px;border:1px solid rgba(255,255,255,.35);border-radius:999px;font-size:12px;opacity:.95;background:rgba(0,0,0,.35)}
.ei-merchant-dialog{margin-top:8px;padding:10px;border-radius:10px;line-height:1.5;background:var(--ei-merchant-dialog-bg);color:var(--ei-merchant-dialog-text)}
.ei-merchant-dialog.ei-merchant-box-dq{border:2px solid rgba(255,255,255,.65);box-shadow:0 2px 0 rgba(0,0,0,.35)}
.ei-merchant-dialog.ei-merchant-box-plain{border:1px solid rgba(255,255,255,.35)}
.ei-merchant-line{opacity:.98;min-height:48px;white-space:pre-wrap}

.ei-shop-panel{flex:1;background:var(--ei-panel-bg);color:var(--ei-panel-text);border-radius:10px;padding:10px;position:relative;border:1px solid var(--ei-panel-border);backdrop-filter: blur(2px)}
.ei-shop-topbar{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}
.ei-shop-balance{font-weight:700;opacity:.95}
.ei-shop-topbar button{cursor:pointer}
.ei-shop-columns{display:flex;gap:10px}
.ei-shop-items{width:52%;border:1px solid var(--ei-panel-border);border-radius:8px;overflow:auto;max-height:420px;padding:6px;outline:none;background:var(--ei-detail-bg)}
.ei-item-row{display:flex;align-items:center;justify-content:space-between;padding:8px;border-radius:6px;cursor:pointer}
.ei-item-row:hover{background:rgba(255,255,255,.08)}
.ei-item-row.is-selected{background:rgba(255,255,255,.16)}
.ei-item-row-left{display:flex;align-items:center;gap:8px}
.ei-item-row img{width:38px;height:38px;object-fit:cover;border-radius:6px;border:1px solid rgba(255,255,255,.35)}
.ei-item-price{font-weight:700}
.ei-item-price.free{color:#7CFFB2}

.ei-shop-detail{flex:1;border:1px solid var(--ei-panel-border);border-radius:8px;padding:10px;min-height:420px;display:flex;flex-direction:column;background:var(--ei-detail-bg)}
.ei-detail-title{font-weight:800;font-size:18px;margin-bottom:6px}
.ei-detail-price{font-weight:700;opacity:.95;margin-bottom:8px}
.ei-detail-desc,.ei-detail-note{white-space:pre-wrap;min-height:72px}
.ei-detail-actions{margin-top:auto;display:flex;gap:10px;align-items:center;justify-content:center;flex-wrap:wrap}

/* Keep action buttons from forcing awkward column widths on narrower desktops */
.ei-detail-actions .ei-action-btn{min-width:140px;max-width:240px;flex:1}
.ei-detail-actions .ei-buy-btn,
.ei-detail-actions .ei-go-btn{
  padding:8px 12px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.6);
  background:rgba(0,0,0,.55);
  color:var(--ei-panel-text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

.ei-rpg-shop-wrap.is-closed{display:none}

.ei-shop-entry{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.55);border-radius:10px}
.ei-enter-btn{padding:10px 16px;border-radius:10px;border:1px solid #fff;background:#fff;cursor:pointer}


/* v1.2.6 additions */
.ei-item-prefix{
  display:inline-block;
  margin-right:6px;
  opacity:0.9;
  font-size:12px;
}

.ei-shop-audio-toggle{
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--ei-panel-border, rgba(255,255,255,0.35));
  color: var(--ei-panel-text, #fff);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
}
.ei-shop-audio-toggle:hover,
.ei-shop-custom-btn:hover{
  filter: brightness(1.08);
}
.ei-shop-custom-buttons{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
}

.ei-rpg-shop-inner.ei-buy-center .ei-buy-btn{
  margin-left:auto;
  margin-right:auto;
  display:block;
}


.ei-item-row.is-owned{
  opacity:0.6;
}
.ei-item-row.is-owned::after{
  content:'✓';
  float:right;
  opacity:0.8;
}

/* Confirm modal (扣點購買二次確認) */
.ei-rpg-shop-wrap .ei-shop-confirm{
  position:absolute;
  inset:0;
  display:none;
  z-index: 9999;
}
.ei-rpg-shop-wrap .ei-shop-confirm.is-open{ display:block; }
.ei-rpg-shop-wrap .ei-shop-confirm-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.55);
}
.ei-rpg-shop-wrap .ei-shop-confirm-panel{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 24px));
  background: rgba(20,20,20,0.92);
  border: 1px solid var(--ei-panel-border, rgba(255,255,255,0.35));
  border-radius: 14px;
  padding: 14px 14px 12px;
  color: var(--ei-panel-text, #fff);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.ei-rpg-shop-wrap .ei-shop-confirm-title{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.ei-rpg-shop-wrap .ei-shop-confirm-desc{
  font-size: 13px;
  opacity: 0.92;
  line-height: 1.55;
  margin-bottom: 12px;
}
.ei-rpg-shop-wrap .ei-shop-confirm-actions{
  display:flex;
  gap: 10px;
  justify-content: flex-end;
}
.ei-rpg-shop-wrap .ei-shop-confirm-actions button{
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--ei-panel-border, rgba(255,255,255,0.35));
  color: var(--ei-panel-text, #fff);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.ei-rpg-shop-wrap .ei-shop-confirm-actions button:hover{
  filter: brightness(1.08);
}


.ei-shop-level{display:flex;align-items:center;gap:6px;font-size:14px;}
.ei-shop-level .ei-level-prefix{opacity:.9;}
.ei-item-row.is-locked{opacity:.55;}
.ei-item-row.is-locked .ei-item-price{filter:grayscale(1);}

/* Mobile layout: auto stack into Top / Middle / Bottom (v1.2.22) */
@media (max-width: 768px){
  .ei-rpg-shop-inner{flex-direction:column;gap:10px;}
  .ei-shop-merchant{width:100%;min-width:0;padding:10px;}
  .ei-shop-panel{padding:10px;}

  /* Panel -> 3 layers: topbar / items / detail */
  .ei-shop-columns{flex-direction:column;gap:10px;}
  .ei-shop-items{width:100%;max-height:240px;}
  .ei-shop-detail{min-height:auto;}

  /* Make actions easier to tap */
  .ei-detail-actions{flex-wrap:wrap;gap:8px;}
  .ei-detail-actions .ei-buy-btn,
  .ei-detail-actions .ei-go-btn{flex:1;justify-content:center;text-align:center;}

  /* Slightly smaller merchant dialog to avoid crowding */
  .ei-merchant-dialog{padding:10px;}
}

/* Narrow desktop / tablet landscape: keep merchant on the left, but stack items over detail
   to avoid the list being squeezed too thin. */
@media (max-width: 1100px){
  .ei-shop-columns{flex-direction:column;gap:10px;}
  .ei-shop-items{width:100%;max-height:280px;}
  .ei-shop-detail{min-height:auto;}
  .ei-detail-actions{gap:8px;}
  .ei-detail-actions .ei-buy-btn,
  .ei-detail-actions .ei-go-btn{flex:1;}
}


/* v1.2.30: Make go button visually identical to buy button, override theme link styles */
.ei-rpg-shop-wrap .ei-detail-actions .ei-go-btn{
  -webkit-appearance:none !important;
  appearance:none !important;
  font: inherit !important;
  line-height: 1.2 !important;
  text-decoration:none !important;
  padding:8px 12px !important;
  border-radius:8px !important;
  border:1px solid rgba(255,255,255,.6) !important;
  background:rgba(0,0,0,.55) !important;
  color:var(--ei-panel-text) !important;
  cursor:pointer !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}



/* --- EI Action Button (dialogue / battle / shop) --- */
.ei-action-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  margin: 18px 0 22px;
}

.ei-action-btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--ei-panel-border, rgba(255,255,255,0.35));
  background: rgba(0,0,0,0.35);
  color: var(--ei-panel-text, #fff);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration:none;
  cursor:pointer;
  line-height:1;
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, opacity .15s ease;
  min-width: 170px;
  justify-content:center;
}

.ei-action-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,0,0,.32);
}

.ei-action-btn:active{
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0,0,0,.22);
}

.ei-action-btn .ei-action-icon{
  font-size: 16px;
  line-height: 1;
}

.ei-action-btn.is-battle{ background: rgba(139,47,47,.55); }
.ei-action-btn.is-shop{ background: rgba(47,107,90,.55); }
.ei-action-btn.is-dialogue{ background: rgba(58,92,139,.55); }
.ei-action-btn.is-link{ background: rgba(44,53,67,.55); }
.ei-action-btn.is-hash{ background: rgba(110,88,160,.50); }

.ei-action-btn.is-disabled,
.ei-action-btn:disabled{
  opacity: .45;
  cursor: not-allowed;
  transform:none !important;
  box-shadow: none !important;
  filter: grayscale(40%);
}

/* Make topbar custom buttons look like action buttons and stay centered */
.ei-shop-topbar{
  flex-wrap: wrap;
  gap: 10px;
}
