/* Hero Crafter: Tower Defense — the guide site. Dark Dota look, gold accents; Arabic (RTL) and English. */
:root {
    --bg: #07090d;
    --panel: #10161e;
    --panel2: #161e28;
    --line: #26323f;
    --text: #dfe6ee;
    --muted: #8fa1b3;
    --gold: #f0d27a;
    --gold2: #c89a30;
    --orange: #ffb84a;
    --red: #ff5a4a;
    --green: #5ae06a;
    --blue: #5ab0ff;
    --purple: #b98bff;
    --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; overflow-x: hidden; }
body { overflow-x: hidden; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.65 "Cairo", "Segoe UI", Tahoma, sans-serif;
}

/* One language at a time (switched on <html lang>). */
html[lang="ar"] .en { display: none !important; }
html[lang="en"] .ar { display: none !important; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ---------------------------------------------------------------- top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 24px;
    background: #07090de8;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 900;
    font-size: 18px;
    letter-spacing: .5px;
    color: var(--gold);
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}
.nav a:hover, .nav a.active { color: var(--gold); background: #f0d27a14; text-decoration: none; }

.lang {
    border: 1px solid var(--gold2);
    background: transparent;
    color: var(--gold);
    padding: 6px 14px;
    border-radius: 20px;
    font: 700 14px "Cairo", sans-serif;
    cursor: pointer;
}
.lang:hover { background: #f0d27a1f; }

/* ---------------------------------------------------------------- hero */
.hero {
    position: relative;
    min-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 70px 24px;
    background: radial-gradient(ellipse at center, #07090dcc 0%, #07090d99 60%, #07090dee 100%), linear-gradient(180deg, #07090d00 60%, #07090d 98%), url("img/hero_bg.jpg?v=2") center/cover;
}

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 64px);
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 4px 30px #000;
}
.hero h1 span.gold { color: var(--gold); }

.hero p {
    max-width: 760px;
    margin: 18px auto 28px;
    font-size: 18px;
    color: #d2dae2;
    text-shadow: 0 2px 10px #000;
}

.buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 800;
    background: linear-gradient(180deg, var(--gold), var(--gold2));
    color: #1a1206;
    box-shadow: 0 6px 24px #f0d27a33;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn.ghost { background: #0009; color: var(--gold); border: 1px solid var(--gold2); box-shadow: none; }

.pills { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: #000a;
    border: 1px solid var(--line);
    font-size: 14px;
    color: var(--text);
}
.pill b { color: var(--gold); }

/* ---------------------------------------------------------------- sections */
main { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }

section { padding-top: 56px; }

.section-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.section-title h2 { margin: 0; font-size: 32px; font-weight: 900; color: #fff; }
.section-title .tag {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--orange);
}
.lead { color: var(--muted); margin: 0 0 22px; max-width: 860px; }

h3 { color: var(--gold); margin: 26px 0 10px; font-size: 21px; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }

.card {
    background: linear-gradient(180deg, var(--panel2), var(--panel));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.card h4 { margin: 0 0 6px; color: #fff; font-size: 18px; }
.card p { margin: 0; color: #c2ccd6; font-size: 15px; }
.card ul { margin: 6px 0 0; padding-inline-start: 20px; color: #c2ccd6; font-size: 15px; }
.card li { margin: 3px 0; }

/* Numbered steps of a match. */
.steps { counter-reset: step; }
.step { position: relative; padding-inline-start: 58px; }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    inset-inline-start: 16px;
    top: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #1a1206;
    background: var(--gold);
}

/* ---------------------------------------------------------------- bosses */
.boss { display: flex; gap: 14px; align-items: flex-start; }
.boss img {
    width: 92px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    flex: none;
}
.boss .where { font-size: 13px; color: var(--orange); font-weight: 700; }
.boss .reward { margin-top: 6px; font-size: 14px; color: var(--green); }
.card.final { border-color: #ff5a4a88; box-shadow: 0 0 22px #ff5a4a22; }
.card.elite { border-color: #b98bff77; }

/* ---------------------------------------------------------------- items */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 16px; }
.filters button {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
    font: 700 14px "Cairo", sans-serif;
    cursor: pointer;
}
.filters button.on { color: #1a1206; background: var(--gold); border-color: var(--gold); }

.item { display: flex; flex-direction: column; gap: 8px; }
.item-head { display: flex; gap: 12px; align-items: center; }
.item-head img { width: 88px; height: 64px; border-radius: 6px; border: 1px solid #000; flex: none; }
.item-head .price { color: var(--gold); font-weight: 800; font-size: 14px; }
.role { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 1px; padding: 1px 8px; border-radius: 6px; }
.role.physical { color: #ff8a4c; background: #ff8a4c1a; }
.role.magic { color: #7fb2ff; background: #7fb2ff1a; }
.role.tank { color: #7ddc7a; background: #7ddc7a1a; }
.role.support { color: #f0c75e; background: #f0c75e1a; }
.role.movement { color: #c8d2dc; background: #c8d2dc1a; }
.recipe { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.recipe img { width: 44px; height: 32px; border-radius: 4px; border: 1px solid #000; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stats span { font-size: 13px; padding: 2px 8px; border-radius: 6px; background: #ffffff0d; color: #e6edf3; }
.effects { margin: 0; padding-inline-start: 18px; font-size: 14px; color: #c2ccd6; }
/* Legendary items (boss drops), jungle and neutral items. */
.role.legendary { color: #ffb43a; background: #ffb43a1f; }
.card.legendary { border-color: #ffb43a88; box-shadow: 0 0 22px #ffb43a22; }
.card .where { font-size: 13px; color: var(--orange); font-weight: 700; margin: 2px 0 8px; }
.tag-new { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #1a1206; background: var(--gold); padding: 1px 8px; border-radius: 6px; vertical-align: middle; }

/* Void Lance path. */
.path { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.path .node { text-align: center; font-size: 13px; color: var(--muted); }
.path .node img { width: 88px; height: 64px; border-radius: 6px; border: 1px solid #000; display: block; margin: 0 auto 4px; }
.path .arrow { color: var(--gold); font-size: 22px; }
html[lang="ar"] .path .arrow { transform: scaleX(-1); }

/* ---------------------------------------------------------------- rank */
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.medal { text-align: center; padding: 12px 8px; }
.medal img { width: 72px; height: 72px; }
.medal .name { font-weight: 800; color: #fff; }
.medal .mmr { font-size: 13px; color: var(--muted); }
.medal .hard { margin-top: 4px; font-size: 13px; font-weight: 800; color: var(--red); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: start; }
th { color: var(--gold); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
td b { color: #fff; }
.table-wrap { overflow-x: auto; }

.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .vs { grid-template-columns: 1fr; } }
.vs .card.mmr { border-top: 3px solid var(--blue); }
.vs .card.rp { border-top: 3px solid var(--orange); }

.tomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; }
.tome { text-align: center; }
.tome img { width: 100%; max-width: 264px; border-radius: 10px; }
.tome .place { display: inline-block; margin-top: 8px; padding: 2px 12px; border-radius: 10px; font-weight: 900; color: #1a1206; }
.tome.t1 { border-color: #f0d27a; } .tome.t1 .place { background: #f0d27a; }
.tome.t2 { border-color: #ff5a6a; } .tome.t2 .place { background: #ff8a96; }
.tome.t3 { border-color: #5ee8ff; } .tome.t3 .place { background: #7ef4ff; }
.tome.t4 { border-color: #7cff9c; } .tome.t4 .place { background: #8affa8; }
.tome h4 { margin-top: 8px; }

.ach { display: flex; gap: 12px; align-items: center; }
.ach img { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--gold); flex: none; object-fit: cover; }
.ach .reward { font-size: 13px; font-weight: 800; color: var(--green); }

.note {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #ffb84a12;
    border: 1px solid #ffb84a44;
    color: #ffd9a0;
    font-size: 15px;
}

code, .cmd {
    font-family: Consolas, monospace;
    background: #000;
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 6px;
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
}

/* ---------------------------------------------------------------- updates */
.updates { display: flex; flex-direction: column; gap: 16px; }
.update { border-inline-start: 4px solid var(--gold); }
.update .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.update .ver { font-size: 22px; font-weight: 900; color: #fff; }
.update .date { color: var(--muted); font-size: 14px; }
.update .group { margin-top: 10px; }
.update .group b { color: var(--orange); }
.update.latest { box-shadow: 0 0 26px #f0d27a22; }
.badge-new { margin-inline-start: 8px; padding: 1px 8px; border-radius: 8px; font-size: 12px; font-weight: 900; background: var(--green); color: #062a0c; }

footer {
    border-top: 1px solid var(--line);
    padding: 26px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 640px) {
    .topbar { padding: 10px 14px; gap: 10px; }
    .brand { font-size: 15px; }
    main { padding: 0 16px 60px; }
    .section-title h2 { font-size: 26px; }
}
.medal .hard.zero { color: var(--muted); }

/* The road to victory: numbered steps in a row that wraps. */
.road { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.road-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.road-step img { width: 78px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.road-step h4 { font-size: 16px; }
.road-step p { font-size: 14px; }
.road-n { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 900; color: #1a1206; background: var(--orange); }

/* Record a party match (its sealed code). */
.card.record { display: flex; flex-direction: column; gap: 12px; }
.card.record textarea { width: 100%; box-sizing: border-box; background: #0b0f14; color: #e6edf3; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 13px/1.4 Consolas, monospace; resize: vertical; }
.card.record .btn { align-self: flex-start; font: 800 15px "Cairo", sans-serif; cursor: pointer; }
.record-ok { color: var(--green); font-weight: 700; }
.record-bad { color: #ff7a6a; font-weight: 700; }
.gain { color: var(--green); }
.loss { color: #ff7a6a; }
