/* Interactive Classic World crafting guide — MapleStory-inspired panels, scoped to .cr-page */
.cr-page{
  --cr-gold:#d4a017;
  --cr-gold-lt:#f3d077;
  --cr-gold-dk:#8a6410;
  --cr-ink:#3a2410;
  --cr-ink-soft:#5a3d1c;
  --cr-parchment:#f7ecd2;
  --cr-parchment-dk:#ead7ae;
  --cr-slot:#efe3c4;
  --cr-wood:#5b3a1c;
  --cr-wood-dk:#3a2412;
  --cr-orange:#e87b1a;
  --cr-orange-dk:#b85a0c;
  --cr-ok:#2e7d32;
  --cr-warn:#9a3b00;
  --cr-shadow:0 10px 24px rgba(0,0,0,.35);
  color:var(--cr-ink);
  max-width:1120px;
  margin:0 auto 40px;
}
.cr-page a{color:#7a3b00}
.cr-page a:hover{color:#b85a0c}
.cr-page .cr-muted{color:var(--cr-ink-soft)}

.cr-hero{
  position:relative;
  overflow:hidden;
  min-height:260px;
  margin:0 0 22px;
  border:3px solid var(--cr-gold);
  border-radius:14px;
  box-shadow:var(--cr-shadow), inset 0 0 0 2px #6a4a14;
  background:#1a120c;
  color:#fff8e8;
}
.cr-hero-map{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
  filter:saturate(1.05) contrast(1.05);
  transform:scale(1.08);
}
.cr-hero-shade{
  position:absolute;
  inset:0;
  background:
    linear-gradient(270deg, rgba(20,10,0,.15) 0%, rgba(20,10,0,.72) 52%, rgba(12,8,4,.88) 100%),
    linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.45));
  pointer-events:none;
}
.cr-hero-inner{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:28px 32px 32px;
  min-height:260px;
}
.cr-hero-copy{flex:1; min-width:0; text-align:right}
.cr-kicker{
  display:inline-block;
  margin:0 0 10px;
  padding:4px 14px 5px;
  background:linear-gradient(180deg,#ffd36a,#e08716);
  color:#3a2410;
  font-weight:650;
  font-size:.82rem;
  border-radius:999px;
  box-shadow:0 1px 0 #fff6, 0 2px 0 #8a4a00;
}
.cr-hero h1{
  margin:0 0 10px;
  color:#fff6dd;
  text-shadow:0 2px 0 #0008, 0 0 18px #0006;
  font-size:clamp(1.6rem, 2.4vw, 2.15rem);
  line-height:1.25;
}
.cr-hero .cr-lede{
  margin:0;
  color:#f3e6c4;
  text-shadow:0 1px 2px #0008;
  max-width:40em;
}
.cr-hero-npcs{
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:8px;
  flex:0 0 auto;
  filter:drop-shadow(0 8px 10px #0008);
}
.cr-hero-npcs img,
.cr-npc-sprite{
  width:auto;
  height:132px;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
  object-fit:contain;
}
.cr-hero-npcs.cr-hero-npcs-row img{height:108px}
.cr-hero-actions{display:flex; flex-wrap:wrap; gap:8px; margin-top:16px}
.cr-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 14px;
  border-radius:8px;
  border:2px solid #f0c14b;
  background:linear-gradient(180deg,#ffd36a 0%, #e08716 100%);
  color:#3a2410 !important;
  font-weight:700;
  text-decoration:none !important;
  box-shadow:0 2px 0 #7a4500;
  text-shadow:none;
}
.cr-btn:hover{filter:brightness(1.06); color:#1e1208 !important}
.cr-btn-ghost{
  background:linear-gradient(180deg,#4a3420,#2a1c12);
  color:#f3d077 !important;
  border-color:#c9a227;
  box-shadow:0 2px 0 #0008;
}
.cr-btn-ghost:hover{color:#fff !important}

.cr-panel{
  background:linear-gradient(180deg,#fbf3de 0%, #f0e0b8 100%);
  border:3px solid var(--cr-gold);
  border-radius:12px;
  box-shadow:var(--cr-shadow), inset 0 0 0 1px #fff6;
  margin:0 0 18px;
  overflow:hidden;
}
.cr-panel-head,
.cr-ribbon{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0;
  padding:9px 16px 10px;
  background:
    linear-gradient(180deg,#7a4e16 0%, #5b3a1c 45%, #3f2712 100%);
  color:#ffe9a8;
  text-shadow:0 1px 0 #0008;
  border-bottom:2px solid var(--cr-gold-lt);
  position:relative;
}
.cr-panel-head::before,
.cr-panel-head::after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  width:14px;
  background:linear-gradient(180deg,#f3d077,#c9a227);
  opacity:.85;
}
.cr-panel-head::before{right:0; clip-path:polygon(0 0,100% 0,100% 100%,0 100%,40% 50%)}
.cr-panel-head::after{left:0; clip-path:polygon(0 0,100% 0,60% 50%,100% 100%,0 100%)}
.cr-panel-head h2{
  margin:0;
  font-size:1.12rem;
  color:#fff4cc;
  font-weight:700;
}
.cr-panel-body{padding:16px 18px 18px}
.cr-panel .q-lines,
.cr-panel .tip-line{text-align:right; color:var(--cr-ink)}
.cr-panel .tip-line{display:block; margin:0 0 .45em}

.cr-disc-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
}
.cr-disc-card{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  text-decoration:none !important;
  color:inherit !important;
  background:linear-gradient(180deg,#fff8e8,#f1e1b8);
  border:2px solid #a67c2d;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 3px 0 #6a4a1a;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  min-height:100%;
}
.cr-disc-card:hover,
.cr-disc-card:focus-visible{
  transform:translateY(-5px);
  border-color:#f0c14b;
  box-shadow:0 0 0 2px #f0c14b, 0 14px 22px rgba(0,0,0,.28);
}
.cr-disc-art{
  position:relative;
  height:132px;
  background:#1c140e center/cover no-repeat;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  overflow:hidden;
}
.cr-disc-art img.cr-disc-map{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; image-rendering:pixelated;
  filter:brightness(.85);
}
.cr-disc-art img.cr-disc-npc{
  position:relative; z-index:1; height:118px; width:auto; image-rendering:pixelated;
  filter:drop-shadow(0 4px 6px #0008);
}
.cr-disc-body{padding:12px 14px 14px; text-align:right}
.cr-disc-body h3{margin:0 0 4px; color:#3a2410; font-size:1.05rem}
.cr-disc-body p{margin:0 0 8px; color:#5a3d1c; font-size:.92rem}
.cr-chip-row{display:flex; flex-wrap:wrap; gap:6px}
.cr-chip{
  display:inline-flex; align-items:center; gap:4px;
  background:#efe3c4; border:1px solid #c9a227; border-radius:999px;
  padding:2px 8px; font-size:.78rem; color:#5a3d1c;
}

.cr-browser{display:grid; grid-template-columns:340px minmax(0,1fr); gap:14px; align-items:start}
.cr-filters{display:flex; flex-direction:column; gap:10px}
.cr-search{
  width:100%;
  padding:10px 12px;
  border:2px solid #a67c2d;
  border-radius:8px;
  background:#fffaf0;
  color:#3a2410;
  font:inherit;
  text-align:right;
}
.cr-search:focus{outline:2px solid #e08716; border-color:#e08716}
.cr-filter-group{text-align:right}
.cr-filter-group h3,
.cr-filter-label{
  margin:0 0 6px;
  font-size:.8rem;
  font-weight:700;
  color:#5a3d1c;
  letter-spacing:.01em;
}
.cr-pills{display:flex; flex-wrap:wrap; gap:6px}
.cr-pill{
  appearance:none;
  border:1px solid #a67c2d;
  background:#fff8e8;
  color:#3a2410;
  border-radius:999px;
  padding:4px 10px;
  font:inherit;
  font-size:.82rem;
  font-weight:600;
}
.cr-pill[aria-pressed="true"],
.cr-pill.is-on{
  background:linear-gradient(180deg,#ffd36a,#e08716);
  border-color:#8a4a00;
  color:#2a1608;
}
.cr-count{font-size:.9rem; color:#5a3d1c}

.cr-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(210px, 1fr));
  gap:10px;
}
.cr-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:10px 8px 12px;
  background:linear-gradient(180deg,#fffaf0,#f3e6c4);
  border:2px solid #b8892c;
  border-radius:10px;
  box-shadow:0 2px 0 #6a4a1a;
  cursor:pointer;
  text-align:center;
  color:inherit;
  transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.cr-card:hover,
.cr-card:focus-visible{
  transform:translateY(-3px);
  border-color:#f0c14b;
  box-shadow:0 0 0 2px #f0c14b, 0 10px 16px rgba(0,0,0,.22);
}
.cr-card.is-selected{
  border-color:#e08716;
  box-shadow:0 0 0 2px #e08716, 0 8px 14px rgba(0,0,0,.2);
  background:linear-gradient(180deg,#fff3d0,#ffd9a0);
}
.cr-slot{
  width:42px; height:42px;
  display:grid; place-items:center;
  background:
    linear-gradient(180deg,#fff,#efe3c4);
  border:2px solid #7a5a22;
  border-radius:6px;
  box-shadow:inset 0 0 0 1px #fff8, inset 0 0 8px #0001;
}
.cr-slot img,
.cr-ico{
  width:32px; height:32px;
  object-fit:contain;
  image-rendering:pixelated;
}
.cr-card-name{font-weight:700; font-size:.86rem; line-height:1.25; color:#3a2410}
.cr-card-meta{font-size:.75rem; color:#5a3d1c}
.cr-badge{
  display:inline-block;
  padding:1px 6px;
  border-radius:999px;
  background:#5b3a1c;
  color:#ffe9a8;
  font-size:.7rem;
  font-weight:700;
}
.cr-badge-warn{background:#9a3b00; color:#fff3e0}

.cr-detail{
  position:sticky;
  top:84px;
  background:linear-gradient(180deg,#fffaf0,#f0e0b8);
  border:3px solid var(--cr-gold);
  border-radius:12px;
  box-shadow:var(--cr-shadow);
  min-height:280px;
}
.cr-detail-empty{
  padding:28px 18px;
  text-align:center;
  color:#5a3d1c;
}
.cr-detail-empty img{height:96px; image-rendering:pixelated; margin:0 auto 8px; display:block}
.cr-detail-head{
  display:flex; align-items:center; gap:12px;
  padding:14px 14px 10px;
  border-bottom:1px solid #d4b56a;
  text-align:right;
}
.cr-detail-head h3{margin:0; font-size:1.05rem; color:#3a2410}
.cr-detail-body{padding:12px 14px 16px; text-align:right}
.cr-stats{
  display:flex; flex-wrap:wrap; gap:6px;
  margin:0 0 12px;
  direction:ltr;
  justify-content:flex-end;
}
.cr-stat{
  background:#efe3c4; border:1px solid #c9a227; border-radius:6px;
  padding:2px 7px; font-size:.78rem; color:#3a2410;
}
.cr-mats{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px}
.cr-mat{
  display:flex; align-items:center; gap:8px;
  padding:6px 8px;
  background:#fff8e8;
  border:1px solid #d4b56a;
  border-radius:8px;
  text-align:right;
}
.cr-mat a{color:#7a3b00; font-weight:650}
.cr-mat .cr-qty{
  margin-inline-start:auto;
  font-weight:800;
  direction:ltr;
  font-variant-numeric:tabular-nums;
}
.cr-fee-row, .cr-calc-total{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; margin-top:10px; font-weight:700;
}
.cr-fee-row img, .cr-coin{width:16px; height:16px; vertical-align:middle}
.cr-num{direction:ltr; font-variant-numeric:tabular-nums; unicode-bidi:isolate}

.cr-calc{
  margin-top:14px;
  padding-top:12px;
  border-top:1px dashed #c9a227;
}
.cr-calc h4{margin:0 0 8px; font-size:.95rem}
.cr-calc-row{display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 8px}
.cr-calc input[type="number"]{
  width:92px;
  padding:6px 8px;
  border:2px solid #a67c2d;
  border-radius:6px;
  background:#fffaf0;
  color:#3a2410;
  font:inherit;
  text-align:left;
  direction:ltr;
}
.cr-have-list{display:flex; flex-direction:column; gap:6px; margin:8px 0}
.cr-have{
  display:flex; align-items:center; gap:8px;
}
.cr-have input{width:72px}
.cr-canmake{
  margin-top:8px;
  padding:8px 10px;
  background:#e8f5e9;
  border:1px solid #2e7d32;
  border-radius:8px;
  font-weight:700;
  color:#1b5e20;
}

.cr-stations{display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px}
.cr-station{
  display:flex; gap:12px; align-items:center;
  padding:10px;
  background:#fff8e8;
  border:2px solid #c9a227;
  border-radius:10px;
}
.cr-station img{height:88px; width:auto; image-rendering:pixelated}
.cr-station h3{margin:0 0 4px; font-size:.98rem}
.cr-station p{margin:0 0 8px; font-size:.88rem}

.cr-quest ol{margin:0; padding:0 1.2em 0 0}
.cr-quest li{margin:0 0 .35em}

.cr-empty{padding:20px; text-align:center; color:#5a3d1c}

.cr-note{
  font-size:.88rem;
  color:#5a3d1c;
  margin:0 0 10px;
}

.cr-banner{
  display:flex; align-items:center; gap:12px;
  margin:0 0 16px;
  padding:10px 14px;
  background:linear-gradient(180deg,#fff3d0,#ffd9a0);
  border:2px solid #e08716;
  border-radius:10px;
  color:#3a2410;
}
.cr-banner img{height:56px; image-rendering:pixelated}

/* English names / numbers stay LTR even in RTL page */
.cr-page bdi, .cr-num, .cr-card-meta, .cr-stat{unicode-bidi:isolate}

@media (max-width: 980px){
  .cr-browser{grid-template-columns:1fr}
  .cr-detail{position:static}
  .cr-disc-grid{grid-template-columns:repeat(2,1fr)}
  .cr-hero-inner{flex-direction:column; align-items:stretch}
  .cr-hero-npcs{order:-1}
}
@media (max-width: 620px){
  .cr-disc-grid{grid-template-columns:1fr}
  .cr-hero{min-height:0}
  .cr-hero-npcs img, .cr-npc-sprite{height:88px}
}

main.panel:has(.cr-page){
  width: min(100%, 1120px);
}

.cr-page .cr-hero,
.cr-page .cr-hero h1,
.cr-page .cr-hero .cr-lede,
.cr-page .cr-hero .tip-line{
  color:#fff6dd;
}
.cr-page .cr-hero .cr-lede,
.cr-page .cr-hero .tip-line{
  color:#f3e6c4;
}
.cr-page .cr-hero a.cr-btn{color:#3a2410 !important;}
.cr-page .cr-hero a.cr-btn-ghost{color:#f3d077 !important;}

.cr-disc-body p,.cr-page .tip-line,.cr-station p,.cr-quest,.cr-hero .cr-lede{direction:rtl;unicode-bidi:isolate;}

.cr-card-item{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  text-decoration:none !important; color:inherit !important;
}
.cr-card-item:hover .cr-card-name{text-decoration:underline}
.cr-obtain{display:flex; flex-direction:column; gap:16px}
.cr-mobs{list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px}
.cr-mobs a, .cr-mobs span.cr-mob{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 10px 4px 6px;
  background:#fff8e8; border:1px solid #c9a227; border-radius:999px;
  color:#7a3b00 !important; text-decoration:none !important; font-weight:650;
}
.cr-mobs a:hover{border-color:#e08716; background:#fff3d0}
.cr-mobs img{width:28px; height:28px; object-fit:contain; image-rendering:pixelated}
.cr-shops{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px}
.cr-shops li{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 10px; background:#fff8e8; border:1px solid #d4b56a; border-radius:8px;
}
.cr-rec-mini{
  display:block; padding:10px 12px; margin:0 0 8px;
  background:#fff8e8; border:1px solid #d4b56a; border-radius:10px;
  text-decoration:none !important; color:inherit !important;
}
.cr-rec-mini:hover{border-color:#e08716; background:#fff3d0}
.cr-item-hero{display:flex; align-items:center; gap:16px; text-align:right}
.cr-item-hero .cr-slot{width:64px; height:64px}
.cr-item-hero .cr-slot img{width:48px; height:48px}
.cr-none{margin:0; color:#5a3d1c}

.cr-card-meta{display:flex; flex-wrap:wrap; gap:4px; align-items:center; justify-content:center}
.cr-xp{
  display:inline-block;
  padding:1px 7px;
  border-radius:999px;
  background:#fff3d0;
  border:1px solid #c9a227;
  font-size:.72rem;
  font-weight:700;
  color:#7a3b00;
  white-space:nowrap;
}
.cr-xp.is-zero{background:#f3eee2; color:#5a3d1c; border-color:#cbb68a}

.cr-xpcalc{display:flex; flex-direction:column; gap:14px}
.cr-xpcalc-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(240px, .7fr);
  gap:16px;
  align-items:start;
}
.cr-xpcalc-form{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:12px;
  background:#fff8e8;
  border:1px solid #d4b56a;
  border-radius:12px;
}
.cr-xp-field{display:flex; flex-direction:column; gap:4px; font-weight:650; color:#3a2410}
.cr-xp-field select,
.cr-xp-field input[type="number"]{
  font:inherit;
  padding:6px 8px;
  border:1px solid #b8892c;
  border-radius:8px;
  background:#fffdf6;
  color:#3a2410;
}
.cr-xp-mode{
  border:1px solid #d4b56a;
  border-radius:10px;
  padding:8px 10px;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.cr-xp-mode legend{padding:0 6px; font-weight:700; color:#3a2410}
.cr-xp-table-wrap{overflow:auto}
.cr-xp-table{width:100%; border-collapse:collapse; font-size:.9rem}
.cr-xp-table th, .cr-xp-table td{
  padding:6px 8px;
  border-bottom:1px solid #e6d2a4;
  text-align:right;
}
.cr-xp-table th{color:#5a3d1c; font-weight:700}
.cr-xp-table .cr-num{font-variant-numeric:tabular-nums}
.cr-xp-out{display:flex; flex-direction:column; gap:12px; margin-top:4px}
.cr-xp-steps{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px}
.cr-xp-step{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:10px 12px;
  background:#fff8e8; border:1px solid #d4b56a; border-radius:10px;
}
.cr-xp-step .cr-slot{flex:0 0 auto}
.cr-xp-mats{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px}
.cr-xp-mats li{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 10px; background:#fff8e8; border:1px solid #d4b56a; border-radius:8px;
}
.cr-xp-totals{display:flex; flex-direction:column; gap:6px}
.cr-xp-warn{margin:0; color:#7a3b00}
@media (max-width: 980px){
  .cr-xpcalc-grid{grid-template-columns:1fr}
}

.cr-xp-field[hidden], [data-xp-pick-wrap][hidden]{display:none !important;}

.cr-card-plan{width:100%; margin-top:4px}
.cr-detail-plan{margin:12px 0}
.cr-detail-plan h4{margin:0 0 8px; font-size:.95rem}
.cr-lvplan{width:100%; border-collapse:collapse; font-size:.82rem}
.cr-lvplan th, .cr-lvplan td{
  padding:5px 7px;
  border-bottom:1px solid #e6d2a4;
  text-align:right;
  vertical-align:middle;
}
.cr-lvplan th{color:#5a3d1c; font-weight:700}
.cr-lvplan tr.is-locked td{color:#8a7350}
.cr-lvplan.is-compact{font-size:.68rem}
.cr-lvplan.is-compact th, .cr-lvplan.is-compact td{padding:2px 4px}
.cr-lvplan-item{display:inline-flex; align-items:center; gap:6px}
.cr-lvplan-item .cr-slot{width:32px; height:32px}
.cr-lvplan-item .cr-slot img{width:24px; height:24px}
