/* craft.css — Thiên Công Đường · Sở Diệp Phong (Thần Binh Rèn Đúc Modal) */

.craft-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 16px;
  animation: crFadeIn 0.25s ease-out;
}

.craft-modal * {
  pointer-events: auto;
}

.craft-modal.hidden {
  display: none !important;
  pointer-events: none !important;
}

@keyframes crFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.cr-window {
  width: 100%;
  max-width: 960px;
  height: 600px;
  max-height: 94%;
  min-height: 0;
  background: linear-gradient(175deg, #0d1222 0%, #080c16 100%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f1f5f9;
  font-family: 'Handjet', 'Be Vietnam Pro', monospace;
}

/* Header */
.cr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.15), rgba(15, 23, 42, 0.6) 50%, rgba(14, 165, 233, 0.05));
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}

.cr-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cr-title-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #38bdf8;
  text-transform: uppercase;
}

.cr-title-main {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #f8fafc;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.cr-wallet-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cr-stone-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #fde047;
  background: rgba(253, 224, 71, 0.1);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(253, 224, 71, 0.25);
}

.cr-stone-badge .ic-linhthach {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
}

.cr-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s;
}

.cr-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #f87171;
}

/* 2-Column Body Layout */
.cr-body {
  display: grid;
  grid-template-columns: 310px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left Column: Recipe list */
.cr-recipe-pane {
  background: rgba(10, 15, 30, 0.65);
  border-right: 1px solid rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cr-recipe-filter {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cr-filter-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.cr-filter-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.cr-filter-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.15));
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.cr-recipe-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.cr-recipe-list::-webkit-scrollbar {
  display: block !important;
  width: 4px !important;
}
.cr-recipe-list::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4) !important;
  border-radius: 4px !important;
}
.cr-recipe-list::-webkit-scrollbar-track {
  background: transparent !important;
}

.cr-recipe-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.cr-recipe-item:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateX(3px);
}

.cr-recipe-item.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 0.8));
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.22);
}

.cr-item-ic {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--tc, #38bdf8);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--tc, rgba(56, 189, 248, 0.3));
}

.cr-item-ic img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.cr-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cr-item-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-item-tier {
  font-size: 11px;
  color: #94a3b8;
}

/* Right Column: Forging Stage & Altar */
.cr-detail-pane {
  display: flex;
  flex-direction: column;
  padding: 18px 24px;
  overflow-y: auto;
  gap: 16px;
  background: radial-gradient(circle at 50% 25%, rgba(14, 165, 233, 0.08), transparent 70%);
  scrollbar-width: thin !important;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.cr-detail-pane::-webkit-scrollbar {
  display: block !important;
  width: 4px !important;
}
.cr-detail-pane::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4) !important;
  border-radius: 4px !important;
}
.cr-detail-pane::-webkit-scrollbar-track {
  background: transparent !important;
}

/* Showcase Banner */
.cr-showcase-box {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.75), rgba(30, 41, 59, 0.4));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.cr-showcase-ic {
  position: relative;
  width: 58px;
  height: 58px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--tc, #38bdf8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--tc, rgba(56, 189, 248, 0.4));
}

.cr-showcase-ic img {
  width: 44px;
  height: 44px;
  image-rendering: pixelated;
}

.cr-showcase-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cr-showcase-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--tc, #f8fafc);
  text-shadow: 0 0 10px var(--tc, rgba(56, 189, 248, 0.4));
}

.cr-showcase-desc {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

/* Stats Badges */
.cr-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cr-stat-pill {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cr-stat-pill b {
  color: #38bdf8;
}

/* Forging Altar Box (Nguyên Liệu & Đúc Tạo) */
.cr-altar-box {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(8, 12, 22, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.cr-altar-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fde047;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

/* Ingredients Grid */
.cr-mats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.cr-mat-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.cr-mat-card.ready {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.cr-mat-card.missing {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.cr-mat-ic {
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cr-mat-ic img {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
}

.cr-mat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cr-mat-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-mat-qty {
  font-size: 11.5px;
  color: #94a3b8;
}

.cr-mat-qty.ok {
  color: #4ade80;
  font-weight: 700;
}

.cr-mat-qty.bad {
  color: #f87171;
  font-weight: 700;
}

/* Footer Action Bar */
.cr-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cr-cost-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cr-cost-label {
  font-size: 11px;
  color: #94a3b8;
}

.cr-cost-val {
  font-size: 15px;
  font-weight: 800;
  color: #fde047;
}

.cr-btn-forge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid #38bdf8;
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.cr-btn-forge:hover:not(:disabled) {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.cr-btn-forge:disabled,
.cr-btn-forge.disabled {
  opacity: 0.5;
  filter: grayscale(0.5);
  box-shadow: none;
}

/* Mode Switcher Tabs */
.cr-mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}
.cr-mode-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cr-mode-btn:hover {
  color: #e2e8f0;
}
.cr-mode-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.85), rgba(2, 132, 199, 0.95));
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.4);
}

/* Item sub row & tags in enhance list */
.cr-item-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}
.cr-status-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.cr-status-tag.worn {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}

/* Enhancement badges on list items */
.cr-item-ic {
  position: relative;
}
.cr-enh-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  font-size: 9px;
  font-weight: 900;
  color: #fde047;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #eab308;
  border-radius: 4px;
  padding: 0 4px;
  line-height: 13px;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.6);
  z-index: 2;
}
.cr-enh-badge.high {
  color: #e879f9;
  border-color: #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.8);
}
.cr-enh-badge.max {
  color: #fca5a5;
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
  animation: enhFlame 1.5s infinite alternate;
}
.cr-enh-plus {
  color: #fde047;
  font-weight: 900;
  margin-left: 4px;
  text-shadow: 0 0 6px rgba(250, 204, 21, 0.6);
}

/* Enhancement Showcase & Progress */
.cr-showcase-enh {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 13px;
  font-weight: 900;
  color: #fde047;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #eab308;
  border-radius: 6px;
  padding: 1px 7px;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.8);
  z-index: 3;
}
.cr-enh-prog-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 12.5px;
  color: #cbd5e1;
}
.cr-enh-boost {
  color: #4ade80;
}
.cr-enh-boost b {
  color: #86efac;
}

/* Compare Grid */
.cr-enh-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.cr-stat-compare-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12.5px;
}
.cr-sc-label {
  color: #cbd5e1;
  font-weight: 700;
}
.cr-sc-cur {
  color: #94a3b8;
  font-weight: 700;
}
.cr-sc-arrow {
  color: #fde047;
  font-size: 11px;
}
.cr-sc-next {
  color: #4ade80;
  font-weight: 900;
}
.cr-sc-next.max {
  color: #c084fc;
}

/* Rate bar */
.cr-enh-rate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.cr-enh-rate-lbl {
  font-size: 12px;
  color: #94a3b8;
}
.cr-enh-rate-val {
  font-size: 13px;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 6px;
}
.cr-enh-rate-val.safe {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.cr-enh-rate-val.mid {
  color: #fde047;
  background: rgba(253, 224, 71, 0.15);
  border: 1px solid rgba(253, 224, 71, 0.3);
}
.cr-enh-rate-val.low {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.cr-btn-enhance {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%) !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4) !important;
}
.cr-btn-enhance:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  box-shadow: 0 6px 22px rgba(251, 191, 36, 0.6) !important;
}

.cr-enh-max-banner {
  text-align: center;
  padding: 16px;
  color: #e879f9;
  font-weight: 800;
  font-size: 14px;
  background: rgba(192, 132, 252, 0.1);
  border: 1px dashed rgba(192, 132, 252, 0.4);
  border-radius: 8px;
}
.cr-cost-val.bad {
  color: #f87171 !important;
}

/* 3-Slot Refine Cauldron */
.cr-refine-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cr-refine-slots-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}
.cr-refine-slot-card {
  position: relative;
  background: rgba(15, 23, 42, 0.65);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 128px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.cr-refine-slot-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(15, 23, 42, 0.9);
}
.cr-refine-slot-card.filled {
  border: 2px solid var(--tc, #38bdf8);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.9) 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(56, 189, 248, 0.08);
}
.cr-refine-slot-card.main-slot {
  border-style: solid;
  border-width: 2px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(234, 179, 8, 0.1);
}
.cr-refine-slot-header {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  text-transform: uppercase;
  color: #94a3b8;
}
.cr-refine-slot-header.main {
  color: #fde047;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
}
.cr-refine-slot-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 5;
}
.cr-refine-slot-remove:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.15);
}
.cr-refine-empty-icon {
  font-size: 24px;
  color: #64748b;
  margin-bottom: 4px;
}
.cr-refine-empty-text {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.35;
}

/* ==========================================================================
   Responsive for Mobile Landscape & Small Screen Viewports
   ========================================================================== */
@media (max-height: 620px), (max-width: 860px) {
  .craft-modal {
    padding: 4px !important;
  }

  .cr-window {
    width: 100% !important;
    max-width: 98% !important;
    height: 98% !important;
    max-height: 98% !important;
    min-height: 0 !important;
    border-radius: 12px !important;
  }

  /* Header */
  .cr-header {
    padding: 5px 12px !important;
    gap: 8px !important;
  }

  .cr-header-title {
    gap: 0 !important;
    min-width: 0;
  }

  .cr-title-badge {
    display: none !important;
  }

  .cr-title-main {
    font-size: 13.5px !important;
    white-space: nowrap !important;
    letter-spacing: 0.02em !important;
  }

  .cr-mode-tabs {
    padding: 2px !important;
    gap: 2px !important;
    border-radius: 8px !important;
  }

  .cr-mode-btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
    gap: 4px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
  }

  .cr-wallet-bar {
    gap: 6px !important;
  }

  .cr-stone-badge {
    padding: 3px 8px !important;
    font-size: 11px !important;
    gap: 4px !important;
    border-radius: 12px !important;
  }

  .cr-stone-badge .ic-linhthach {
    width: 13px !important;
    height: 13px !important;
  }

  .cr-close-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    flex-shrink: 0;
  }

  /* Body Grid Layout */
  .cr-body {
    grid-template-columns: 220px 1fr !important;
    min-height: 0 !important;
  }

  /* Left Column: Recipe & Filter */
  .cr-recipe-filter {
    padding: 4px 6px !important;
    gap: 4px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cr-filter-btn {
    padding: 3px 2px !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }

  .cr-recipe-list {
    padding: 6px !important;
    gap: 5px !important;
  }

  .cr-recipe-item {
    padding: 5px 8px !important;
    gap: 6px !important;
    border-radius: 8px !important;
  }

  .cr-item-ic {
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
  }

  .cr-item-ic img {
    width: 24px !important;
    height: 24px !important;
  }

  .cr-item-name {
    font-size: 11.5px !important;
  }

  .cr-item-tier {
    font-size: 9.5px !important;
  }

  .cr-status-tag {
    font-size: 8.5px !important;
    padding: 0 4px !important;
  }

  /* Right Column: Showcase & Altar */
  .cr-detail-pane {
    padding: 8px 12px !important;
    gap: 8px !important;
  }

  .cr-showcase-box {
    padding: 8px 10px !important;
    gap: 10px !important;
    border-radius: 8px !important;
  }

  .cr-showcase-ic {
    width: 42px !important;
    height: 42px !important;
    border-radius: 8px !important;
  }

  .cr-showcase-ic img {
    width: 32px !important;
    height: 32px !important;
  }

  .cr-showcase-enh {
    font-size: 10.5px !important;
    top: -5px !important;
    right: -5px !important;
    padding: 0 5px !important;
  }

  .cr-showcase-name {
    font-size: 13.5px !important;
  }

  .cr-showcase-desc {
    font-size: 10.5px !important;
    line-height: 1.3 !important;
  }

  .cr-enh-prog-badge {
    font-size: 11px !important;
    gap: 8px !important;
    margin-top: 2px !important;
  }

  .cr-stats-row {
    gap: 4px !important;
  }

  .cr-stat-pill {
    padding: 2px 8px !important;
    font-size: 10.5px !important;
  }

  .cr-altar-box {
    padding: 8px 12px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }

  .cr-altar-title {
    font-size: 11px !important;
  }

  /* Ingredients Grid */
  .cr-mats-grid {
    gap: 6px !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
  }

  .cr-mat-card {
    padding: 4px 6px !important;
    gap: 6px !important;
    border-radius: 6px !important;
  }

  .cr-mat-ic {
    width: 26px !important;
    height: 26px !important;
  }

  .cr-mat-ic img {
    width: 20px !important;
    height: 20px !important;
  }

  .cr-mat-name {
    font-size: 10.5px !important;
  }

  .cr-mat-qty {
    font-size: 9.5px !important;
  }

  /* Enhance Compare & Rate Bar */
  .cr-enh-compare-grid {
    gap: 6px !important;
    margin-bottom: 6px !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  }

  .cr-stat-compare-card {
    padding: 5px 8px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }

  .cr-enh-rate-bar {
    padding: 5px 8px !important;
    margin-bottom: 6px !important;
    border-radius: 6px !important;
  }

  .cr-enh-rate-lbl {
    font-size: 10.5px !important;
  }

  .cr-enh-rate-val {
    font-size: 11.5px !important;
    padding: 1px 8px !important;
  }

  /* Refine (Luyện hoá) board */
  .cr-refine-board {
    gap: 8px !important;
  }

  .cr-refine-slots-row {
    gap: 6px !important;
  }

  .cr-refine-slot-card {
    min-height: 85px !important;
    padding: 6px 4px !important;
    border-radius: 8px !important;
  }

  .cr-refine-empty-icon {
    font-size: 18px !important;
  }

  .cr-refine-empty-text {
    font-size: 9.5px !important;
  }

  /* Action Bar */
  .cr-action-bar {
    padding-top: 6px !important;
  }

  .cr-cost-label {
    font-size: 10px !important;
  }

  .cr-cost-val {
    font-size: 13px !important;
  }

  .cr-btn-forge {
    padding: 6px 16px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
  }
}

/* Narrow portrait phone */
@media (max-width: 600px) {
  .cr-body {
    grid-template-columns: 1fr !important;
  }

  .cr-recipe-pane {
    max-height: 180px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.15) !important;
  }
}
