/* Classic World subsite in the main site's Maple look (only with <html data-ui="maple">).
   /maple-site.css provides the shared pieces (fonts, cursor, wooden header, status bar, NPC, effects);
   this file maps the subsite's own layout onto them. */

html[data-ui=maple]:root {
  --bg: var(--mx-page);
  --bg-2: var(--mx-paper-2);
  --surface: var(--mx-paper);
  --surface-2: var(--mx-paper-2);
  --line: #e2cfa6;
  --line-strong: var(--mx-rim);
  --ink: var(--mx-ink);
  --ink-2: var(--mx-ink-soft);
  --ink-3: #9a7a58;
  --brand: #a8672f;
  --brand-ink: #fff6dc;
  --brand-soft: #f6e7c4;
  --accent: var(--mx-orange-2);
  --accent-soft: #ffe7b8;
  --radius: 14px;
  --font: var(--mx-font);
  --font-head: var(--mx-font);
  --shadow: 0 6px 0 #00000022;
}
html[data-ui=maple][data-theme=dark]:root {
  --line: #3a4a78;
  --ink-3: #a99a80;
  --brand: #5d6f9c;
  --brand-soft: #2c3960;
  --accent: var(--mx-gold);
  --accent-soft: #3a2c1a;
}
html[data-ui=maple] body {
  font-family: var(--mx-font);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M30 18l3 7 6-3-2 7 7 1-6 4 4 5-7-1-1 7-4-6-4 6-1-7-7 1 4-5-6-4 7-1-2-7 6 3z' fill='%23d9b77a' opacity='.16'/%3E%3C/svg%3E"),
    var(--mx-page);
  background-size: auto;
}
html[data-ui=maple][data-theme=dark] body {
  background:
    radial-gradient(1px 1px at 20% 30%, #fff8 50%, transparent 51%) 0 0 / 180px 140px,
    radial-gradient(1px 1px at 70% 60%, #fff6 50%, transparent 51%) 0 0 / 230px 170px,
    var(--mx-page);
}
html[data-ui=maple] :is(h1, h2, h3) { font-family: var(--mx-font); font-weight: 900; }

/* ---------- The site header injected above the subsite ---------- */
html[data-ui=maple] #mxSiteTop {
  position: relative;
  z-index: 30;
  box-sizing: border-box;
  padding: 12px max(28px, calc((100vw - 1180px) / 2)) 0;
  backdrop-filter: none;
  border-bottom: 0;
}
html[data-ui=maple] #mxSiteTop .brand { padding: 0; gap: 11px; display: flex; align-items: center; }
html[data-ui=maple] #mxSiteTop .brand-icon { width: 39px; height: 39px; overflow: hidden; }
html[data-ui=maple] #mxSiteTop .brand-icon img { width: 100%; height: 100%; object-fit: cover; }
html[data-ui=maple] #mxSiteTop .mode-tab { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
html[data-ui=maple] #mxSiteTop .topbar-actions { display: flex; align-items: center; gap: 12px; }
html[data-ui=maple] #mxSiteTop .theme-toggle { padding: 9px 12px; cursor: var(--mx-cursor-hand); }
html[data-ui=maple] #mxSiteTop .discord-contact { font-weight: 800; }

/* ---------- The subsite's own bar (search, language) as a parchment strip ---------- */
html[data-ui=maple] .main > header.topbar {
  display: flex;
  grid-template: none;
  min-height: 0;
  padding: 10px 24px;
  font-family: var(--mx-font);
  background: var(--mx-paper-2);
  border-bottom: 3px solid var(--mx-rim-dark);
  box-shadow: inset 0 -3px 0 #e7cf9f;
  z-index: 20;
}
html[data-ui=maple] .main > header.topbar::after { display: none; }
html[data-ui=maple][data-theme=dark] .main > header.topbar { box-shadow: inset 0 -3px 0 #3a4a78; }
html[data-ui=maple] .search input {
  font-family: var(--mx-font);
  font-weight: 700;
  background: #fff;
  border: 3px solid #3b4d74;
  border-radius: 14px;
  box-shadow: inset 0 3px 0 #dfe8f7, 0 3px 0 #22304f;
}
html[data-ui=maple][data-theme=dark] .search input { background: #0f1630; border-color: #6c80b8; }
html[data-ui=maple] .search input:focus { border-color: var(--mx-orange-2); box-shadow: 0 0 0 4px #ffd54a88, 0 3px 0 #8a3a06; }
html[data-ui=maple] .seg {
  padding: 3px;
  gap: 2px;
  background: #5a2f0e;
  border: 2px solid #3d1f08;
  border-radius: 12px;
}
html[data-ui=maple] .seg button { font: 800 13px/1 var(--mx-font); color: #f3dcae; border-radius: 9px; padding: 7px 10px; }
html[data-ui=maple] .seg button.on {
  color: #fff;
  background: linear-gradient(180deg, #ffc15a, var(--mx-orange) 55%, var(--mx-orange-2));
  -webkit-text-stroke: 3px #8a3a06;
  paint-order: stroke fill;
}
html[data-ui=maple] .icon-btn {
  color: #5a3515;
  background: linear-gradient(180deg, #fffbe9, #f1d9a6);
  border: 2px solid #7a4a1f;
  border-radius: 10px;
  box-shadow: 0 3px 0 #5a2f0e;
}

/* ---------- Sidebar: a wooden board with game buttons ---------- */
html[data-ui=maple] .sidebar {
  top: 0;
  color: #fff6dc;
  background:
    repeating-linear-gradient(0deg, #ffffff0d 0 3px, transparent 3px 11px),
    linear-gradient(180deg, #b97a3f, #9a602c);
  border-right: 6px solid #5a2f0e;
  box-shadow: inset -3px 0 0 #d9a066;
}
html[data-ui=maple][data-theme=dark] .sidebar { background: repeating-linear-gradient(0deg, #ffffff08 0 3px, transparent 3px 11px), linear-gradient(180deg, #5b3d27, #45301f); }
html[data-ui=maple] .brand-mark { border: 3px solid #ffd54a; background: #5a2f0e; border-radius: 12px; box-shadow: 0 3px 0 #3d1f08; }
html[data-ui=maple] .brand-text strong { color: #fff; -webkit-text-stroke: 4px #5a2f0e; paint-order: stroke fill; font-size: 19px; }
html[data-ui=maple] :is(.brand-text small, .sidebar .nav-label, .sidebar-foot) { color: #ffe7b8; font-weight: 800; }
html[data-ui=maple] .back-main {
  color: #fff !important;
  background: #5a2f0e;
  border: 0;
  border-radius: 99px;
  font-weight: 800;
}
html[data-ui=maple] .back-main:hover { background: #3d1f08; }
html[data-ui=maple] .nav-link {
  margin: 3px 0;
  font-weight: 800;
  color: #5a3515;
  background: linear-gradient(180deg, #fff8e3, #f3dcae);
  border: 2px solid #7a4a1f;
  border-radius: 10px;
  box-shadow: 0 2px 0 #5a2f0e;
  transition: transform .12s, box-shadow .12s;
}
html[data-ui=maple] .nav-link:hover { color: #5a3515; background: linear-gradient(180deg, #fffdf2, #f8e6bf); transform: translateX(3px); }
html[data-ui=maple] .nav-link .count { font-family: var(--mx-num); color: #fff; background: #7a4a1f; border-radius: 99px; padding: 0 7px; }
html[data-ui=maple] .nav-link.active {
  color: #fff;
  background: linear-gradient(180deg, #ffc15a, var(--mx-orange) 55%, var(--mx-orange-2));
  border-color: #8a3a06;
  box-shadow: 0 2px 0 #5a2206;
  -webkit-text-stroke: 3px #8a3a06;
  paint-order: stroke fill;
}
html[data-ui=maple] .nav-link.active::before { content: none; }
html[data-ui=maple] .nav-link.active .count { background: #8a3a06; -webkit-text-stroke: 0; }
html[data-ui=maple][data-theme=dark] .nav-link:not(.active) { color: #f3ead6; background: linear-gradient(180deg, #3c4a78, #2b365c); border-color: #151c33; box-shadow: 0 2px 0 #0b0f1d; }
html[data-ui=maple] .sidebar-foot { border-top: 2px dashed #ffffff40; }

/* ---------- Content: parchment game windows ---------- */
html[data-ui=maple] .view::before { content: none; }
html[data-ui=maple] :is(.card, .launch-side, .collab, .table-wrap, .stat) {
  background: var(--mx-paper);
  border: 3px solid var(--mx-rim-dark);
  border-radius: 14px;
  outline: 0;
  box-shadow: inset 0 0 0 3px var(--mx-paper-2), inset 0 0 0 5px #e7cf9f, 0 6px 0 #00000022;
}
html[data-ui=maple][data-theme=dark] :is(.card, .launch-side, .collab, .table-wrap, .stat) { box-shadow: inset 0 0 0 3px var(--mx-paper-2), inset 0 0 0 5px #3a4a78, 0 6px 0 #0006; }
html[data-ui=maple] .launch-side { background-image: none; }
html[data-ui=maple] .collab::before { content: none; }
html[data-ui=maple] :is(.card h2, .launch-side h2) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 6px 14px;
  color: #fff;
  background: linear-gradient(180deg, #ffc15a, var(--mx-orange-2));
  border: 2px solid #8a3a06;
  border-radius: 8px 22px 22px 8px;
  -webkit-text-stroke: 4px #8a3a06;
  paint-order: stroke fill;
  font-size: 18px;
}
html[data-ui=maple] .card h2 svg { stroke: #fff; }
html[data-ui=maple] .page-head h1, html[data-ui=maple] .detail-head h1 {
  color: #fff;
  -webkit-text-stroke: 6px #5a2f0e;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 #3d1f08;
  letter-spacing: .03em;
}
html[data-ui=maple] .eyebrow { color: var(--mx-orange-2); font-weight: 800; letter-spacing: .12em; }
html[data-ui=maple] .launch-main { border: 6px solid #5a2f0e; border-radius: 16px; box-shadow: inset 0 0 0 3px #e8b27a, 0 8px 0 #0000002e; }
html[data-ui=maple] .launch-main::after { border-radius: 10px; }
html[data-ui=maple] .launch-content h1 { color: #fff; -webkit-text-stroke: 6px #5a2f0e; paint-order: stroke fill; text-shadow: 0 4px 0 #3d1f08; }
html[data-ui=maple] :is(.countdown .cd-cell, .launch-content .cd-cell, .cd-cell) { border-radius: 10px; }
html[data-ui=maple] .cd-cell b { font-family: var(--mx-num); }
html[data-ui=maple] .hero-slim { background: linear-gradient(180deg, #c8894a, #a8672f); border: 4px solid #5a2f0e; border-radius: 16px; box-shadow: inset 0 3px 0 #e8b27a, 0 6px 0 #0000002e; }
html[data-ui=maple] .hero-slim h1 { color: #fff; -webkit-text-stroke: 5px #5a2f0e; paint-order: stroke fill; }

/* Stats as quest-scroll cards */
html[data-ui=maple] a.stat { transition: transform .2s cubic-bezier(.3, 1.8, .5, 1); }
html[data-ui=maple] a.stat:hover { transform: translateY(-4px) rotate(-.6deg); background: var(--mx-paper); border-color: var(--mx-orange-2); }
html[data-ui=maple] .stat .num { font-family: var(--mx-num); color: var(--mx-orange-2); }

/* Buttons, fields, pills */
html[data-ui=maple] .btn {
  font-family: var(--mx-font);
  font-weight: 800;
  color: #5a3515;
  background: linear-gradient(180deg, #fffbe9, #f1d9a6);
  border: 2px solid #7a4a1f;
  border-radius: 10px;
  box-shadow: 0 3px 0 #5a2f0e;
}
html[data-ui=maple] .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 #5a2f0e; }
html[data-ui=maple] .btn:active { transform: translateY(3px); box-shadow: none; }
html[data-ui=maple] .btn-accent {
  color: #fff;
  background: linear-gradient(180deg, #ffc15a, var(--mx-orange) 55%, var(--mx-orange-2));
  border-color: #8a3a06;
  box-shadow: 0 3px 0 #5a2206;
  -webkit-text-stroke: 3px #8a3a06;
  paint-order: stroke fill;
}
html[data-ui=maple] .field {
  font-family: var(--mx-font);
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--mx-slot-edge);
  border-radius: 10px;
}
html[data-ui=maple][data-theme=dark] .field { background: #0f1630; }
html[data-ui=maple] .pill { border-radius: 99px; font-weight: 800; }

/* Tables and inventory-slot thumbnails */
html[data-ui=maple] .table-wrap { border-width: 3px; }
html[data-ui=maple] th { background: var(--mx-paper-2); color: var(--mx-ink-soft); font-weight: 800; border-bottom: 2px dashed #d8bd8a; }
html[data-ui=maple] td { border-bottom: 1px dashed #e2cfa6; }
html[data-ui=maple][data-theme=dark] :is(th, td) { border-color: #3a4a78; }
html[data-ui=maple] tbody tr:hover { background: var(--mx-hover); }
html[data-ui=maple] :is(.thumb, .thumb.lg) {
  border-radius: 10px;
  border: 2px solid var(--mx-slot-edge);
  background: radial-gradient(circle at 50% 40%, #fffdf4, var(--mx-slot));
  box-shadow: inset 0 3px 4px #0000001a;
}
html[data-ui=maple] tbody tr:hover .thumb { border-color: var(--mx-orange); box-shadow: 0 0 0 3px #ffd54a88, inset 0 3px 4px #0000001a; }
html[data-ui=maple] :is(.rel-list a, .list-plain a) { border-radius: 10px; }
html[data-ui=maple] .rel-list a {
  background: #fff;
  border: 2px solid var(--mx-slot-edge);
  box-shadow: 0 3px 0 #d6b98a;
  transition: transform .18s cubic-bezier(.3, 1.8, .5, 1);
}
html[data-ui=maple] .rel-list a:hover { transform: translateY(-3px); border-color: var(--mx-orange); }
html[data-ui=maple][data-theme=dark] .rel-list a { background: #1b2440; box-shadow: 0 3px 0 #0b0f1d; }
html[data-ui=maple] .kv div { border-color: #e2cfa6; }
html[data-ui=maple] .kv dt { color: var(--mx-orange-2); font-weight: 800; }
html[data-ui=maple] .notice { background: #eaf7d4; border: 2px dashed #8cbf52; border-radius: 10px; color: #3c5a19; }
html[data-ui=maple][data-theme=dark] .notice { background: #1f3320; border-color: #4f7a35; color: #cfeaa8; }
html[data-ui=maple] .foot { color: var(--mx-ink-soft); }

@media (max-width: 900px) {
  html[data-ui=maple] #mxSiteTop { padding: 12px 16px 0; }
  html[data-ui=maple] .sidebar { border-right-width: 4px; }
}

/* One bar: brand, the subsite's search, language and theme on the first row; destinations below. */
html[data-ui=maple] #mxSiteTop {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand search actions" "nav nav nav";
  column-gap: 16px;
}
html[data-ui=maple] #mxSiteTop .topbar-left { display: contents; }
html[data-ui=maple] #mxSiteTop .brand { grid-area: brand; }
html[data-ui=maple] #mxSiteTop .menu-btn { grid-area: brand; justify-self: start; }
html[data-ui=maple] #mxSiteTop .mx-cw-search { grid-area: search; width: 100%; max-width: 560px; justify-self: center; margin: 0; }
html[data-ui=maple] #mxSiteTop .topbar-actions { grid-area: actions; }
html[data-ui=maple] #mxSiteTop .seg { flex-shrink: 0; }
@media (max-width: 900px) {
  html[data-ui=maple] #mxSiteTop { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "brand actions" "search search" "nav nav"; row-gap: 10px; }
  html[data-ui=maple] #mxSiteTop .mx-cw-search { max-width: none; }
  html[data-ui=maple] #mxSiteTop .menu-btn { display: inline-grid; }
  html[data-ui=maple] #mxSiteTop .brand { margin-left: 48px; }
  html[data-ui=maple] #mxSiteTop .discord-contact { display: none; }
}
