/* =====================================================================
   SCRAP ARENA — stylesheet (geen externe fonts of CDN's: overal te gebruiken)
   ===================================================================== */

:root {
    --bg: #0d0f12;
    --bg2: #14171c;
    --panel: #1a1e25;
    --panel2: #22272f;
    --line: #2c323c;
    --text: #e8ecf1;
    --muted: #98a2b3;
    --accent: #ff6a1f;
    --accent2: #ffb300;
    --gold: #ffc63f;
    --gem: #7ee8fa;
    --green: #4ade80;
    --red: #f2545b;
    --blue: #4c8dff;
    --radius: 10px;
    --shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px; line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: 2.1rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
small { color: var(--muted); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.tight { gap: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } h1 { font-size: 1.6rem; } }

/* ---------- Navigatie ---------- */
header.top {
    background: linear-gradient(180deg, #12151a, #0e1116);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.nav { display: flex; align-items: center; gap: 18px; padding: 12px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.15rem; color: #fff; letter-spacing: -.03em; }
.logo svg { width: 30px; height: 30px; }
.nav a.link { color: var(--muted); font-weight: 600; font-size: .93rem; }
.nav a.link:hover, .nav a.link.active { color: #fff; }
.nav .spacer { flex: 1; }

.wallet { display: flex; gap: 6px; align-items: center; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 999px; padding: 4px 11px; font-size: .85rem; font-weight: 700;
}
.chip.gold { color: var(--gold); } .chip.gem { color: var(--gem); } .chip.scrap { color: #cbb; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; display: inline-block; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--panel2); color: var(--text); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 9px 16px; font-weight: 700; font-size: .92rem;
    cursor: pointer; transition: .15s; text-decoration: none;
}
.btn:hover { border-color: #3d4450; filter: brightness(1.15); color: #fff; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #e14e00); border-color: #ff7a34; color: #fff; }
.btn.gold { background: linear-gradient(135deg, #ffc63f, #d99a00); color: #2b1d00; border-color: #ffd76e; }
.btn.gem { background: linear-gradient(135deg, #7ee8fa, #2f9fd0); color: #00222c; border-color: #a8f0ff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: .82rem; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h3 { margin-bottom: 12px; }
.panel.tight { padding: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .15s; }
.card:hover { border-color: #3c434f; transform: translateY(-2px); }
.card .body { padding: 14px; }
.card .thumb { height: 120px; background: linear-gradient(135deg, #23282f, #171b21); display: grid; place-items: center; font-size: 2.4rem; }
.badge { display: inline-block; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.badge.green { background: var(--green); color: #04220f; }
.badge.red { background: var(--red); }
.badge.gold { background: var(--gold); color: #3a2600; }
.badge.gem { background: var(--gem); color: #00222c; }
.badge.gray { background: #3a4150; }

/* ---------- Tabel ---------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
tbody tr:hover { background: #1e232b; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Formulieren ---------- */
label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
    width: 100%; background: #0e1116; color: var(--text);
    border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
    font-size: .95rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field { margin-bottom: 14px; }
.inline { display: flex; gap: 10px; }
.inline > * { flex: 1; }

/* ---------- Meldingen ---------- */
.flash { margin: 14px 0; }
.flash div { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-weight: 600; }
.flash .success { background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .4); color: #9df7bd; }
.flash .error { background: rgba(242, 84, 91, .1); border: 1px solid rgba(242, 84, 91, .4); color: #ffb0b4; }
.flash .info { background: rgba(76, 141, 255, .1); border: 1px solid rgba(76, 141, 255, .4); color: #b9d3ff; }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(1000px 400px at 15% -10%, rgba(255, 106, 31, .22), transparent 60%),
        radial-gradient(700px 300px at 90% 0%, rgba(126, 232, 250, .12), transparent 60%),
        linear-gradient(180deg, #15181e, var(--bg));
    border-bottom: 1px solid var(--line);
    padding: 64px 0 54px;
}
.hero h1 { font-size: 2.9rem; max-width: 18ch; }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }
.hero .cta { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.stat-big { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.stat-big div span { display: block; font-size: 1.7rem; font-weight: 900; color: #fff; }
.stat-big div small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
@media (max-width: 620px) { .hero { padding: 40px 0 34px; } .hero h1 { font-size: 2rem; } }

/* ---------- Garage ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: .88rem; color: var(--muted); }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.item {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; display: flex; flex-direction: column; gap: 8px; position: relative;
}
.item.owned { border-color: #2f6b45; }
.item.equipped { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.item .name { font-weight: 800; }
.item .stats { font-size: .82rem; color: var(--muted); }
.item .price { font-weight: 800; color: var(--gold); }
.tierbar { display: flex; gap: 3px; }
.pip { width: 12px; height: 6px; background: #2a2f38; border-radius: 2px; }
.pip.on { background: var(--accent); }
.lvlbar { height: 6px; background: #2a2f38; border-radius: 3px; overflow: hidden; }
.lvlbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }

/* ---------- Progressie ---------- */
.bar { height: 10px; background: #23282f; border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.bar.gold > span { background: linear-gradient(90deg, var(--gold), #ff9d00); }
.bar.gem > span { background: linear-gradient(90deg, var(--gem), #2f9fd0); }

.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bp-cell { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; font-size: .75rem; }
.bp-cell.locked { opacity: .45; }
.bp-cell.claimable { border-color: var(--green); }
.bp-cell .tier { font-weight: 900; font-size: 1rem; }

/* ---------- Ranglijst ---------- */
.rank-1 td { background: rgba(255, 198, 63, .08); }
.rank-2 td { background: rgba(192, 197, 204, .06); }
.rank-3 td { background: rgba(176, 106, 51, .06); }
.medal { font-weight: 900; }

/* ---------- Play (game) ---------- */
html.full, body.full { height: 100%; overflow: hidden; margin: 0; }
#game { position: fixed; inset: 0; background: #05070a; }
#game canvas { display: block; width: 100%; height: 100%; }
#hud { position: fixed; inset: 0; pointer-events: none; }

/* ---------- Footer ---------- */
footer.bottom { border-top: 1px solid var(--line); margin-top: 60px; padding: 30px 0 50px; color: var(--muted); font-size: .87rem; }
footer.bottom a { color: var(--muted); }
footer.bottom a:hover { color: var(--text); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Misc ---------- */
.kbd { background: #0e1116; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: .8rem; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.scroll { overflow-x: auto; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.tag { display: inline-block; background: #262c35; border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; font-size: .75rem; font-weight: 700; }
.rare-common { color: #b6c0cc; } .rare-rare { color: #6ea8ff; }
.rare-epic { color: #c084fc; } .rare-legendary { color: #ffb300; } .rare-mythic { color: #ff5ea8; }
