/* Holo Deck Labs v2 — dark, art-forward */
:root {
  --bg: #151726;
  --panel: #1e2135;
  --panel-2: #272b45;
  --ink: #eef0fb;
  --sub: #a4aac4;
  --line: #343957;
  --brand: #6b97ff;
  --deck: var(--brand);
  --deck-ink: #fff;
  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --max: 1160px;
}
.c-red    { --deck: #ef4f55; }
.c-green  { --deck: #2fb874; }
.c-blue   { --deck: #3f8cff; }
.c-purple { --deck: #9b6dff; }
.c-yellow { --deck: #f0b31a; --deck-ink: #1b1d2c; }
.c-white  { --deck: #c9cfdf; --deck-ink: #1b1d2c; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
button { font: inherit; color: inherit; }

h1, h2, h3 { font-family: var(--display); font-stretch: 115%; font-weight: 800; line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.7rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: 1.12rem; font-stretch: 105%; }
p { margin: 0 0 1em; max-width: 68ch; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.lead { font-size: 1.15rem; color: var(--sub); }
.muted { color: var(--sub); }
main { padding: 40px 0 80px; overflow-x: clip; }
section + section { margin-top: 64px; }
.lead + section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { margin: 0; }

/* Top bar */
.top { background: rgba(21, 23, 38, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font: 800 1.2rem/1 var(--display); font-stretch: 125%; white-space: nowrap; }
.logo-mark { width: 30px; height: 40px; position: relative; flex: none; }
.logo-mark span { position: absolute; inset: 0; border-radius: 5px; border: 2px solid var(--ink); }
.logo-mark span:nth-child(1) { transform: rotate(-13deg) translateX(-5px); background: #ef4f55; }
.logo-mark span:nth-child(2) { transform: rotate(-2deg); background: #3f8cff; }
.logo-mark span:nth-child(3) { transform: rotate(10deg) translateX(5px); background: #f0b31a; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--sub); text-decoration: none; padding: 8px 13px; border-radius: 999px; white-space: nowrap; font-weight: 700; }
.nav a:hover { color: var(--ink); background: var(--panel); }
.nav a[aria-current="page"] { color: #10121e; background: var(--ink); }
@media (max-width: 720px) { .top .wrap { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; } .nav { margin: 6px -20px 0; padding: 0 16px 10px; } }

/* Buttons and chips */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #10121e; text-decoration: none; font-weight: 700; padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer; }
.btn:hover { background: var(--brand); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--ink); background: transparent; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--sub); padding: 7px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #10121e; }
.tier { display: inline-grid; place-items: center; min-width: 2.1em; height: 2.1em; padding: 0 .35em; border-radius: 8px; font: 800 .95rem/1 var(--display); font-stretch: 110%; color: #14161f; }
.tier-S { background: #ff8a8a; } .tier-Ap { background: #ffc58a; } .tier-A { background: #ffe08a; }
.tier-B { background: #c4f58a; } .tier-C { background: #8af0f0; } .tier-D { background: #8ac2ff; }
.chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--panel-2); color: var(--ink); }
.chip.jp { background: #ef4f55; color: #fff; } .chip.rg { justify-self: start; white-space: nowrap; } .chip.en { background: #3f8cff; color: #fff; }

/* Home hero */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: center; padding: 20px 0 10px; }
.hero h1 { max-width: 14ch; }
.hero-stat { display: flex; gap: 14px; align-items: center; margin: 18px 0 26px; color: var(--sub); }
.hero-stat strong { font: 800 2.4rem/1 var(--display); font-stretch: 110%; color: var(--deck); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cards { position: relative; height: 400px; }
.hero-cards img { position: absolute; width: 220px; border-radius: 11px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
.hero-cards img:nth-child(1) { left: 0; top: 50px; transform: rotate(-12deg); }
.hero-cards img:nth-child(2) { left: 120px; top: 0; transform: rotate(6deg); z-index: 2; }
.hero-glow { position: absolute; inset: -40px -10% auto auto; width: 520px; height: 520px; background: radial-gradient(closest-side, color-mix(in srgb, var(--deck) 35%, transparent), transparent); pointer-events: none; z-index: -1; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; gap: 8px; } .hero-cards { height: 270px; order: -1; } .hero-cards img { width: 150px; } .hero-cards img:nth-child(2) { left: 90px; } }

/* Deck tiles */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; color: var(--ink); text-decoration: none; overflow: hidden; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--deck); }
a.tile:hover { border-color: var(--deck); background: var(--panel-2); }
.tile-top { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.tile-top img { border-radius: 6px; }
.tile h3 { margin: 0 0 6px; }
.tile .meta { display: flex; gap: 10px; align-items: center; color: var(--sub); font-size: .9rem; flex-wrap: wrap; }
.tile .meta b { color: var(--ink); font-family: var(--display); font-size: 1.05rem; }
.tile-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile-keys img { border-radius: 6px; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 22%; }
.tile-plan { color: var(--sub); font-size: .93rem; margin: 0; }
.tile .status { font-weight: 700; font-size: .9rem; color: var(--deck); }
.tile.soon .status { color: var(--sub); }

/* News feed */
.feed { display: grid; gap: 12px; }
.news { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; color: var(--ink); text-decoration: none; }
a.news:hover { border-color: var(--brand); background: var(--panel-2); }
.news-thumb { width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.news-thumb span { font: 800 1.6rem/1 var(--display); font-stretch: 125%; color: var(--sub); }
.news h3 { margin: 6px 0 4px; }
.news p { margin: 0; color: var(--sub); font-size: .93rem; }
.news .line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--sub); }
.news[hidden] { display: none; }
.cat-Release { background: #2fb874; color: #0f1a14; } .cat-Tournament { background: #f0b31a; color: #1b1d2c; }
.cat-Event { background: #9b6dff; color: #fff; } .cat-Decks { background: #ef4f55; color: #fff; }

/* Recipe header: blurred oshi art behind */
.r-head { position: relative; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.r-head::before { content: ""; position: absolute; inset: -40px; background: var(--art) center 25% / cover; filter: blur(28px) saturate(1.3); opacity: .55; z-index: -2; }
.r-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, color-mix(in srgb, var(--deck) 55%, var(--bg)) 0%, rgba(21, 23, 38, .7) 55%, var(--bg) 100%); z-index: -1; }
.r-head .wrap { display: grid; grid-template-columns: 250px 1fr; gap: 44px; align-items: center; padding-top: 44px; padding-bottom: 44px; }
.r-head .oshi { border-radius: 12px; transform: rotate(-4deg); box-shadow: 0 22px 44px rgba(0, 0, 0, .6); }
.r-head .tagline { font-size: 1.2rem; max-width: 46ch; }
.r-facts { display: flex; flex-wrap: wrap; gap: 12px 30px; margin-top: 22px; }
.r-facts div { display: flex; flex-direction: column; gap: 4px; }
.r-facts b { font: 800 1.7rem/1.1 var(--display); font-stretch: 110%; }
.r-facts > div > span { font-size: .88rem; color: var(--sub); }
@media (max-width: 720px) { .r-head .wrap { grid-template-columns: 1fr; gap: 18px; } .r-head .oshi { width: 160px; } }
@media (prefers-reduced-motion: no-preference) {
  .r-head .oshi { animation: deal .65s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes deal { from { opacity: 0; transform: rotate(-16deg) translate(-40px, 60px); } }
}

/* Deck list */
.deck-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.group-title { font: 800 1rem/1 var(--display); font-stretch: 105%; margin: 28px 0 16px; color: var(--sub); }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 24px 16px; list-style: none; padding: 0; margin: 0; }
.deck-grid li { min-width: 0; }
.card-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; }
.stack { position: relative; border-radius: 7px; }
.stack img { position: relative; border-radius: 7px; width: 100%; }
.q2 .stack { box-shadow: 5px -5px 0 -1px #4a5070; }
.q3 .stack { box-shadow: 5px -5px 0 -1px #4a5070, 10px -10px 0 -2px #3c4260; }
.q4 .stack { box-shadow: 5px -5px 0 -1px #4a5070, 10px -10px 0 -2px #3c4260, 15px -15px 0 -3px #31364f; }
.qty { position: absolute; left: 6px; bottom: 6px; min-width: 34px; height: 30px; padding: 0 7px; border-radius: 8px; background: rgba(16, 18, 30, .9); color: #fff; display: grid; place-items: center; font: 800 1rem/1 var(--display); box-shadow: 0 0 0 2px var(--deck); }
.card-name { display: block; font-size: .82rem; color: var(--sub); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-btn:hover .card-name { color: var(--ink); }
.text-list { display: none; }
.text-list table td:first-child { width: 3em; font-family: var(--display); font-weight: 800; }
[data-view="text"] .deck-grid, [data-view="text"] .group-title.pic { display: none; }
[data-view="text"] .text-list { display: block; }
.deck-totals { margin-top: 26px; color: var(--sub); }
@media (max-width: 560px) { .deck-grid { grid-template-columns: repeat(3, 1fr); gap: 20px 12px; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #10121e; padding: 10px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.toast.show { opacity: 1; }

/* Card zoom */
dialog.zoom { position: fixed; border: 0; padding: 0; background: transparent; max-width: min(420px, 92vw); color: var(--ink); }
dialog.zoom::backdrop { background: rgba(8, 9, 16, .82); backdrop-filter: blur(4px); }
dialog.zoom img { border-radius: 14px; width: 100%; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
dialog.zoom p { text-align: center; margin: 12px auto 0; font-weight: 700; }
dialog.zoom .close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ink); color: #10121e; font-size: 1.4rem; line-height: 1; cursor: pointer; }

/* Key cards */
.key-list { display: grid; gap: 18px; }
@media (min-width: 900px) { .key-list { grid-template-columns: 1fr 1fr; } }
.key { display: grid; grid-template-columns: 130px 1fr; gap: 20px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.key .card-btn img { border-radius: 7px; }
.key p { color: var(--sub); }
.key .how { color: var(--ink); border-left: 4px solid var(--deck); padding-left: 12px; margin: 0; }
.warn { background: color-mix(in srgb, var(--deck) 18%, var(--panel)); border: 1px solid color-mix(in srgb, var(--deck) 45%, var(--line)); border-radius: 14px; padding: 16px 20px; margin-top: 18px; max-width: none; }

/* Game plan: a real sequence of phases */
.plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.phase { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; border-top: 5px solid var(--deck); }
.phase .when { color: var(--sub); font-weight: 700; margin-bottom: 4px; }
.phase ol { padding-left: 1.2em; margin: 0; } .phase li { margin-bottom: .55em; }
@media (max-width: 860px) { .plan { grid-template-columns: 1fr; } }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--display); font-stretch: 105%; font-weight: 800; color: var(--sub); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gain { color: #6fe0a3; font-weight: 700; }

/* Tier list groups */
.tier-group { display: grid; grid-template-columns: 110px 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.tier-group + .tier-group { margin-top: 14px; }
.tier-label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #14161f; font: 800 2.2rem/1 var(--display); }
.tier-label small { font: 700 .8rem/1 var(--body); }
.tier-rows { display: grid; }
.tier-row { display: grid; grid-template-columns: 40px 52px minmax(0, 1fr) 80px 190px 92px; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tier-row:last-child { border-bottom: 0; }
a.tier-row:hover { background: var(--panel-2); }
.tier-row img { width: 52px; height: 52px; object-fit: cover; object-position: 50% 22%; border-radius: 8px; }
.tier-row .rank { color: var(--sub); font-weight: 700; }
.tier-row .nm b { display: block; }
.tier-row .nm span { color: var(--sub); font-size: .85rem; }
.tier-row .win { font: 800 1.15rem/1 var(--display); }
.tier-row .train { color: var(--sub); font-size: .88rem; }
@media (max-width: 720px) {
  .tier-group { grid-template-columns: 1fr; }
  .tier-label { flex-direction: row; padding: 10px; font-size: 1.5rem; gap: 10px; }
  .tier-row { grid-template-columns: 30px 44px minmax(0, 1fr) 64px; }
  .tier-row img { width: 44px; height: 44px; }
  .tier-row .train, .tier-row .rg { display: none; }
}

.com-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 18px; }
.com { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; color: var(--ink); text-decoration: none; }
a.com:hover { border-color: var(--brand); background: var(--panel-2); }
.com h3 { margin: 4px 0 0; }
.com p { color: var(--sub); margin: 0; flex: 1; }
.com .go { color: var(--brand); font-weight: 700; }
.chip.kind { align-self: flex-start; }
.how-to { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 18px 40px; margin: 18px 0 0; max-width: 720px; }
.how-to li { margin-bottom: .4em; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0 44px; font-size: .9rem; color: var(--sub); }
.foot p { max-width: 90ch; }

/* Newest deck on the home page */
.newest .section-head time{color:var(--muted,#a9b0cc);font-size:.95rem}
.newest-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:stretch}
.newest-text{background:var(--panel);border-radius:16px;padding:24px;display:flex;flex-direction:column;gap:10px;justify-content:center}
.newest-text h3{font-family:Archivo,sans-serif;font-size:1.6rem;margin:0}
.newest-text p{margin:0}
.newest-date{color:var(--brand);font-weight:700}
.newest-text .btn{align-self:flex-start;margin-top:6px}
@media (max-width:760px){.newest-grid{grid-template-columns:minmax(0,1fr)}}

/* Round robin (JP): head-to-head line, recipe matchups */
.rr-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .88rem; color: var(--sub); }
.rr-line .tier { min-width: 1.8em; height: 1.8em; font-size: .8rem; }
.rr-line b { color: var(--ink); font: 800 1rem/1 var(--display); }
.rr-line.sm { margin: 3px 0; }
.rr-line.sm .tier { min-width: 1.6em; height: 1.6em; font-size: .72rem; }
.tier-row .nm .rr-line span { font-size: .8rem; }
.mu-cols { display: grid; gap: 18px; margin: 20px 0 24px; }
@media (min-width: 800px) { .mu-cols { grid-template-columns: 1fr 1fr; } }
.mu-list { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.mu-list.good { border-left: 6px solid #2fb874; }
.mu-list.bad { border-left: 6px solid #ef4f55; }
.mu-list ol { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.mu-list li a { font-weight: 700; }
.mu-list li b { float: right; font-family: var(--display); }
.mu-list li span { display: block; clear: both; color: var(--sub); font-size: .86rem; }
.mu-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.mu-pick label { font-weight: 700; }
.mu-pick select { font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: min(100%, 340px); }
.mu-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.mu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mu-head h3 { margin: 0; }
.mu-win { font: 800 2rem/1 var(--display); }
.mu-bar { height: 10px; border-radius: 6px; background: #ef4f55; overflow: hidden; margin: 12px 0 14px; }
.mu-bar i { display: block; height: 100%; background: #2fb874; }
.mu-facts { color: var(--sub); }
.mu-note { border-left: 3px solid var(--deck); padding-left: 12px; }
.mu-card p:last-child { margin-bottom: 0; }
.tier-row .nm .rr-line .tier, .tile .rr-line .tier { color: #14161f; font-size: .72rem; }
.heatmap { display: block; width: 100%; height: 1500px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
