/* Tidebreaker Wiki — on top of site.css: the same sea, brass and parchment. */

.wiki-page { background: radial-gradient(1200px 600px at 70% -10%, rgba(18, 70, 107, 0.45), transparent 60%), var(--abyss); }
.wiki-page .top { position: sticky; top: 0; }
.wiki-page .top .brand { opacity: 1; }
.wiki-page .top .wrap { gap: 14px; }
.wiki-mark {
  font-family: 'Pirata One', Georgia, serif; font-size: 1.6rem; line-height: 1; color: var(--gold);
  padding: 2px 10px 4px; border: 1px solid rgba(200, 145, 58, 0.45); border-radius: 10px; margin-left: -4px;
}
.wiki-mark:hover { background: rgba(242, 193, 78, 0.1); }

/* Search (header and front page) */
.wsearch, .hero-search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.wsearch input, .hero-search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 12px;
  border: 1px solid rgba(200, 145, 58, 0.35); background: rgba(4, 16, 28, 0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c8913a' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px 50% / 18px;
  color: var(--text); font: 700 0.98rem Nunito, system-ui, sans-serif;
}
.wsearch input:focus, .hero-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.18); }
.wresults {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; max-height: 70vh; overflow: auto;
  background: #06182a; border: 1px solid rgba(200, 145, 58, 0.45); border-radius: 14px; box-shadow: var(--shadow); padding: 6px;
}
.wresults a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--text); }
.wresults a:hover, .wresults a.on { background: rgba(242, 193, 78, 0.12); }
.wresults b { color: var(--gold-hi); font-weight: 900; }
.wresults small { display: block; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.wresults .hit { color: var(--foam); font-size: 0.82rem; }
.wresults .none { padding: 10px 12px; color: var(--muted); }

.wnav-btn { display: none; background: none; border: 0; color: var(--text); width: 42px; height: 42px; border-radius: 10px; cursor: pointer; }
.wnav-btn svg { width: 26px; height: 26px; }

/* Layout */
.wiki { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; padding-top: 26px; padding-bottom: 60px; }
.wnav { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
.nav-home { display: flex; align-items: center; gap: 8px; font-weight: 900; color: var(--gold-hi); padding: 8px 10px; border-radius: 10px; margin-bottom: 6px; }
.nav-home.on, .nav-home:hover { background: rgba(242, 193, 78, 0.12); }
.nav-group { margin: 14px 0 6px; }
.nav-h { font-size: 0.74rem; letter-spacing: 2px; text-transform: uppercase; font-weight: 900; color: var(--brass); padding: 0 10px 4px; }
.wnav ul { list-style: none; margin: 0; padding: 0; }
.wnav li a { display: block; padding: 6px 10px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 0.95rem; line-height: 1.35; }
.wnav li a:hover { color: var(--text); background: rgba(191, 230, 255, 0.06); }
.wnav li a[aria-current='page'] { color: var(--gold-hi); background: rgba(242, 193, 78, 0.13); box-shadow: inset 3px 0 0 var(--gold); }

.wmain { min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.86rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--gold-hi); }

.pg-head { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.pg-ic {
  flex: none; width: 84px; height: 84px; border-radius: 20px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #1b4a6e, #0a2237); border: 2px solid var(--brass); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.pg-ic img { max-width: 70px; max-height: 60px; width: auto; height: auto; object-fit: contain; }
.pg-head h1 {
  font-family: 'Pirata One', Georgia, serif; font-weight: 400; font-size: clamp(2.2rem, 4.4vw, 3.2rem); line-height: 1; margin: 0 0 6px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 50%, #b8741f); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #3a1f06);
}
.pg-head .lead, .hero-w .lead { margin: 0; color: var(--muted); font-size: 1.04rem; }

/* Contents: a row of links under the heading */
.toc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 22px; padding: 10px 12px; border-radius: 14px; background: rgba(11, 39, 64, 0.55); border: 1px solid rgba(200, 145, 58, 0.25); font-size: 0.9rem; }
.toc-h { font-weight: 900; color: var(--gold); font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase; margin-right: 4px; }
.toc ol { display: contents; list-style: none; }
.toc li { display: inline; }
.toc a { display: inline-block; padding: 4px 10px; border-radius: 999px; background: rgba(191, 230, 255, 0.06); color: var(--text); font-weight: 700; }
.toc a:hover { background: rgba(242, 193, 78, 0.14); color: var(--gold-hi); }

/* Body */
.wbody { line-height: 1.7; }
.wbody > p:first-child { font-size: 1.05rem; }
.wbody section, .wmain section { padding: 0; overflow-x: visible; scroll-margin-top: 90px; margin-top: 30px; }
.wbody h2 {
  font-family: 'Pirata One', Georgia, serif; font-weight: 400; font-size: 2rem; color: var(--gold-hi); margin: 0 0 12px;
  padding-bottom: 6px; border-bottom: 1px solid rgba(200, 145, 58, 0.35);
}
.wbody h3 { font-size: 1.1rem; font-weight: 900; color: var(--text); margin: 18px 0 6px; }
.wbody .anchor { margin-left: 10px; font-size: 1.1rem; color: rgba(200, 145, 58, 0.5); opacity: 0; transition: opacity 0.15s; }
.wbody h2:hover .anchor { opacity: 1; }
.wbody ul, .wbody ol { padding-left: 22px; }
.wbody li { margin: 4px 0; }
.wbody li::marker { color: var(--gold); }
.wbody strong { color: var(--gold-hi); }
.wbody small { color: var(--muted); font-size: 0.8em; }
img.art { display: inline-block; vertical-align: middle; object-fit: contain; }

/* Tables */
.tbl { overflow-x: auto; margin: 12px 0 16px; border-radius: 14px; border: 1px solid rgba(200, 145, 58, 0.35); background: rgba(7, 26, 43, 0.75); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.tbl caption { caption-side: top; text-align: left; padding: 10px 14px; color: var(--muted); font-weight: 700; }
.tbl thead th {
  position: sticky; top: 0; background: linear-gradient(180deg, #5a3210, #3a1f08); color: var(--gold-hi); text-align: left; font-weight: 900; font-size: 0.82rem;
  letter-spacing: 0.4px; padding: 10px 12px; white-space: nowrap; border-bottom: 2px solid var(--brass);
}
.tbl table.sortable thead th { cursor: pointer; user-select: none; }
.tbl table.sortable thead th::after { content: ' ⇅'; opacity: 0.4; font-size: 0.8em; }
.tbl table.sortable thead th[aria-sort='ascending']::after { content: ' ▲'; opacity: 0.9; }
.tbl table.sortable thead th[aria-sort='descending']::after { content: ' ▼'; opacity: 0.9; }
.tbl tbody th, .tbl tbody td { padding: 9px 12px; border-top: 1px solid rgba(159, 182, 203, 0.12); vertical-align: middle; white-space: nowrap; }
.tbl tbody th { text-align: left; font-weight: 800; color: var(--text); white-space: normal; min-width: 170px; }
.tbl tbody th img.art { float: left; margin: -2px 8px -2px 0; }
.tbl tbody th img.art { margin-right: 8px; }
.tbl tbody tr:nth-child(even) { background: rgba(191, 230, 255, 0.03); }
.tbl tbody tr:hover { background: rgba(242, 193, 78, 0.07); }

/* Prices, rarities, tags */
.pr { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; white-space: nowrap; }
.pr img.art { width: 16px; height: 16px; }
.pr.gd { color: var(--gold-hi); }
.pr.cr { color: #d9b6ff; }
.pr.free { color: #8fe3a0; }
.rar { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 900; border: 1px solid currentColor; }
.r-common { color: #c9d6e2; }
.r-rare { color: #6fb7ff; }
.r-epic { color: #c08bff; }
.r-legendary { color: #ffb84a; }
.r-mythic { color: #ff6f8e; }
.tag { display: inline-block; vertical-align: middle; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 999px; background: rgba(242, 193, 78, 0.16); color: var(--gold); margin-left: 6px; }

/* Notes */
.note { margin: 14px 0; padding: 12px 16px 12px 46px; border-radius: 12px; position: relative; font-size: 0.96rem; }
.note::before { position: absolute; left: 14px; top: 11px; font-size: 1.15rem; }
.note.tip { background: rgba(242, 193, 78, 0.09); border: 1px solid rgba(242, 193, 78, 0.35); }
.note.tip::before { content: '💡'; }
.note.info { background: rgba(18, 70, 107, 0.4); border: 1px solid rgba(111, 183, 255, 0.35); }
.note.info::before { content: 'ℹ️'; }
.note.warn { background: rgba(192, 57, 43, 0.14); border: 1px solid rgba(192, 57, 43, 0.5); }
.note.warn::before { content: '⚠️'; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 12px 0; }
.card { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, rgba(18, 70, 107, 0.45), rgba(7, 26, 43, 0.9)); border: 1px solid rgba(200, 145, 58, 0.35); color: var(--text); }
a.card:hover { border-color: var(--gold); transform: translateY(-2px); transition: transform 0.15s; }
.cd-img { display: grid; place-items: center; min-height: 110px; padding: 10px; background: radial-gradient(circle at 50% 60%, rgba(191, 230, 255, 0.12), transparent 70%); }
.cd-img img { max-height: 100px; width: auto; }
.cd-body { padding: 12px 14px 14px; }
.cd-body h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--gold-hi); }
.cd-body p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

/* Infobox */
.infobox { float: right; clear: right; width: 270px; margin: 6px 0 16px 24px; border-radius: 16px; overflow: hidden; border: 2px solid var(--brass); background: #0a2237; }
.ib-img { display: grid; place-items: center; padding: 14px; background: radial-gradient(circle at 50% 55%, #1d5880, #0a2237); }
.ib-img img { max-height: 120px; width: auto; }
.ib-title { font-family: 'Pirata One', Georgia, serif; font-size: 1.5rem; text-align: center; color: var(--gold-hi); background: linear-gradient(180deg, #5a3210, #3a1f08); padding: 6px 10px; }
.infobox dl { margin: 0; display: grid; grid-template-columns: auto 1fr; font-size: 0.9rem; }
.infobox dt, .infobox dd { margin: 0; padding: 7px 12px; border-top: 1px solid rgba(159, 182, 203, 0.14); }
.infobox dt { color: var(--muted); font-weight: 700; }
.infobox dd { text-align: right; font-weight: 800; }

.made { clear: both; display: flex; align-items: center; gap: 8px; margin-top: 34px; padding-top: 14px; border-top: 1px solid rgba(159, 182, 203, 0.15); color: var(--muted); font-size: 0.86rem; }
.pn { display: flex; justify-content: space-between; gap: 14px; margin-top: 18px; }
.pn a { flex: 1; max-width: 48%; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(200, 145, 58, 0.35); background: rgba(7, 26, 43, 0.7); color: var(--text); font-weight: 800; }
.pn a small { display: block; color: var(--gold); font-size: 0.78rem; letter-spacing: 1px; }
.pn a.next { text-align: right; margin-left: auto; }
.pn a:hover { border-color: var(--gold); }

/* Front page */
.hero-w { text-align: center; padding: 26px 0 10px; }
.hero-w .display { font-size: clamp(2.8rem, 7vw, 4.6rem); }
.hero-w .lead { max-width: 640px; margin: 12px auto 0; }
.hero-search { margin: 22px auto 0; max-width: 560px; }
.hero-search input { height: 52px; font-size: 1.05rem; }
.hero-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.hero-links a { padding: 8px 14px; border-radius: 999px; background: rgba(242, 193, 78, 0.12); border: 1px solid rgba(242, 193, 78, 0.35); font-weight: 800; }
.hg { margin-top: 30px; }
.hg h2 { font-family: 'Pirata One', Georgia, serif; font-weight: 400; font-size: 1.9rem; color: var(--gold-hi); margin: 0 0 12px; border-bottom: 1px solid rgba(200, 145, 58, 0.35); padding-bottom: 6px; }
.hcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.hcard { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto 1fr; column-gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(7, 26, 43, 0.8); border: 1px solid rgba(200, 145, 58, 0.3); color: var(--text); }
.hcard:hover { border-color: var(--gold); background: rgba(18, 70, 107, 0.45); }
.hc-ic { grid-row: 1 / 3; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #1b4a6e, #0a2237); border: 1px solid var(--brass); }
.hc-ic img { max-width: 46px; max-height: 40px; width: auto; height: auto; }
.hc-t { font-weight: 900; color: var(--gold-hi); }
.hc-d { color: var(--muted); font-size: 0.86rem; line-height: 1.4; }

/* Changelog */
.ver { position: relative; padding: 0 0 18px 28px; border-left: 2px solid rgba(200, 145, 58, 0.4); margin-left: 8px; }
.ver::before { content: ''; position: absolute; left: -9px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(242, 193, 78, 0.2); }
.ver h3 { margin: 0; font-size: 1.25rem; color: var(--gold-hi); }
.ver .when { color: var(--muted); font-size: 0.86rem; font-weight: 700; }

@media (max-width: 980px) {
  .wiki { grid-template-columns: 1fr; gap: 0; }
  .wnav {
    position: fixed; inset: 70px 0 0 auto; width: min(320px, 86vw); max-height: none; z-index: 70; padding: 14px 16px 40px;
    background: #04101c; border-left: 1px solid rgba(200, 145, 58, 0.35); transform: translateX(105%); transition: transform 0.2s; box-shadow: var(--shadow);
  }
  .wnav.open { transform: none; }
  .wnav-btn { display: grid; place-items: center; }
  .infobox { float: none; width: auto; margin: 12px 0; }
}
@media (max-width: 640px) {
  .wiki-page .top .brand { display: none; }
  .wsearch { max-width: none; }
  .wiki-page .top .lang { display: none; }
  .pg-head { gap: 12px; }
  .pg-ic { width: 64px; height: 64px; border-radius: 16px; }
  .pg-ic img { max-width: 52px; max-height: 46px; }
  .pn { flex-direction: column; }
  .pn a { max-width: none; }
}
