:root {
    --body: #262626;
    --panel: #1c1c1c;
    --tile: #232323;
    --icon-box: #333333;
    --orange: #ff6b3d;
    --salmon: #ff7655;
    --yellow: #e6e84a;
    --cyan: #19d9f2;
    --magenta: #ff4fd8;
    --purple: #c158f0;
    --blue: #3d8bff;
    --gold: #fdbf3b;
    --lime: #9ccf2a;
    --grey: #8a8a8a;
    --text: #ffffff;
    --muted: #b3b3b3;
    --cut: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: #111214;
    color: var(--text);
    font-family: "Oswald", "Arial Narrow", sans-serif;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; }

/* Centered phone column */
.app {
    position: relative;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--body);
    overflow: hidden;
    padding-bottom: 90px; /* room for anchor ad */
}

/* ---------- Header ---------- */
.header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 10px;
}
.header h1 {
    flex: 1;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}
.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--salmon);
    box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px var(--salmon);
    color: #fff;
    font-size: 18px;
}
.header .spacer { width: 40px; }

/* ---------- Ad slots ---------- */
.ad-slot { margin: 14px 16px; min-height: 100px; text-align: center; }
.ad-slot::before {
    content: "Advertisement";
    display: block;
    font-family: Arial, sans-serif;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.ad-placeholder {
    height: 250px;
    display: grid;
    place-items: center;
    border: 1px dashed #555;
    border-radius: 10px;
    color: #777;
    font-size: 13px;
}

/* ---------- HUD frame (cut corners + neon border + stripes) ---------- */
.hud-wrap { position: relative; padding: 6px 4px; --c: var(--orange); }
.hud-wrap::before, .hud-wrap::after {
    content: "";
    position: absolute;
    z-index: 1;
    pointer-events: none;
}
/* hatched stripe top-right */
.hud-wrap::before {
    top: 1px;
    right: 22%;
    width: 46px;
    height: 6px;
    background: repeating-linear-gradient(-45deg, var(--c) 0 3px, transparent 3px 7px);
}
/* hatched stripe on left edge */
.hud-wrap::after {
    left: 0;
    bottom: 22%;
    width: 5px;
    height: 34px;
    background: repeating-linear-gradient(-45deg, var(--c) 0 3px, transparent 3px 7px);
}
.hud-wrap.stripe-bottom::before { top: auto; bottom: 1px; }
.hud-wrap.stripe-right::after { left: auto; right: 0; top: 22%; bottom: auto; }

.hud {
    --shape: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
    display: block;
    height: 100%;
    padding: 2px;
    background: var(--c);
    clip-path: var(--shape);
    filter: drop-shadow(3px 4px 0 #000);
    transition: transform 0.12s;
}
.hud:active { transform: scale(0.97); }
.hud-in {
    height: 100%;
    background: var(--tile);
    clip-path: var(--shape);
    padding: 18px;
}

.c-orange { --c: var(--orange); }
.c-yellow { --c: var(--yellow); }
.c-cyan { --c: var(--cyan); }
.c-magenta { --c: var(--magenta); }
.c-purple { --c: var(--purple); }
.c-blue { --c: var(--blue); }
.c-gold { --c: var(--gold); }
.c-lime { --c: var(--lime); }
.c-grey { --c: var(--grey); }
.c-sky { --c: #5aaee6; }

.icon-box {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    background: var(--icon-box);
    display: grid;
    place-items: center;
    font-size: 34px;
    color: #fff;
}
.label { font-size: 19px; font-weight: 500; letter-spacing: 0.2px; }

/* ---------- Hex button ---------- */
.hex-btn {
    --hex: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
    display: block;
    padding: 2px;
    background: var(--btn-edge, var(--salmon));
    clip-path: var(--hex);
    text-align: center;
}
.hex-btn span {
    display: block;
    padding: 10px 18px;
    background: var(--btn, var(--salmon));
    clip-path: var(--hex);
    color: #fff;
    font-size: 19px;
    font-weight: 500;
}
.hex-btn.big { margin: 18px 10px 4px; }
.hex-btn.big span { font-size: 21px; padding: 10px; }

/* ---------- Index: quiz box ---------- */
.hero {
    margin: 10px 16px 16px;
    padding: 26px 18px;
    border-radius: 16px;
    background:
        linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
        url("../assets/images/quiz-bg.webp") center / cover no-repeat,
        radial-gradient(70% 60% at 80% 20%, rgba(255, 107, 61, 0.35), transparent 70%),
        radial-gradient(60% 50% at 10% 90%, rgba(25, 217, 242, 0.25), transparent 70%),
        linear-gradient(160deg, #0d0d0f, #1a1420);
    font-family: Arial, Helvetica, sans-serif;
}
.quiz-question { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 18px; line-height: 1.35; }
.quiz-options { display: grid; gap: 12px; }
.quiz-option {
    padding: 11px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 14px;
    transition: background 0.2s;
}
.quiz-option.correct { background: #1f9d55; border-color: #1f9d55; }
.quiz-option.wrong { background: #c53030; border-color: #c53030; }
.quiz-option:disabled { cursor: default; }
.quiz-meta { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255, 255, 255, 0.7); margin-bottom: 10px; }

.btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    border-radius: 30px;
    background: var(--salmon);
    color: #fff;
    font-size: 18px;
    text-align: center;
}
.btn.secondary { background: rgba(255, 255, 255, 0.12); }
.wrap { padding: 0 16px; }

/* 3 small HUD tiles on index */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 12px; }
.trio .hud-in { padding: 14px 10px; display: flex; flex-direction: column; gap: 14px; }
.trio .icon-box { width: 44px; height: 44px; font-size: 20px; border-radius: 8px; }
.trio .label { font-size: 14px; text-align: center; }

/* About text on index */
.about { padding: 24px 36px 10px; font-family: Arial, Helvetica, sans-serif; color: var(--muted); }
.about h2 { font-size: 22px; margin: 14px 0 8px; color: #9a9a9a; }
.about ul { padding-left: 18px; line-height: 1.4; }
.about p { line-height: 1.45; }

/* ---------- Home: banner ---------- */
.banner {
    position: relative;
    height: 200px;
    padding: 0 12px 10px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    background:
        linear-gradient(180deg, transparent 35%, var(--body) 95%),
        url("../assets/images/banner.webp") center top / cover no-repeat,
        repeating-linear-gradient(-60deg, transparent 0 46px, rgba(255, 107, 61, 0.9) 46px 92px, transparent 92px 120px),
        linear-gradient(180deg, #2b2b2b, #3a1d14);
}
.banner .chars {
    position: absolute;
    inset: 14px 0 auto;
    display: flex;
    justify-content: space-around;
    font-size: 54px;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.6));
}
.banner h2 { font-size: 22px; font-weight: 700; line-height: 1.1; position: relative; }
.banner h2 small { display: block; font-size: 17px; font-weight: 400; letter-spacing: 5px; }
.banner .hex-btn span { font-size: 16px; padding: 6px 18px; }
.banner .hex-btn { position: relative; margin-bottom: 18px; }

/* Tip box (replaces fake diamonds box) */
.tip-box {
    margin: 14px 16px;
    padding: 16px;
    border: 1px solid #777;
    border-radius: 14px;
    text-align: center;
}
.tip-box p { font-family: Arial, sans-serif; font-size: 14px; line-height: 1.45; color: #e6e6e6; min-height: 40px; }
.tip-box button {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border-radius: 30px;
    background: #7a3a28;
    color: #fff;
    font-size: 15px;
    letter-spacing: 0.5px;
}
.tip-box button i { color: var(--gold); margin-right: 6px; }

/* 2x2 HUD grid */
.hud-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 12px; }
.hud-grid .hud-wrap { height: 190px; }
.hud-grid .hud-in { display: flex; flex-direction: column; justify-content: space-between; }
.hud-grid .center .hud-in { align-items: center; justify-content: center; gap: 16px; }

/* Cyan panel with big icons */
.panel {
    margin: 16px 12px;
    padding: 8px 4px;
    border-radius: 6px;
    background: #1e2a2c;
}
.panel .hud-grid { margin: 0; }
.panel .hud-wrap { height: 180px; --c: var(--cyan); }
.panel .hud-in { padding: 10px; align-items: center; justify-content: flex-end !important; gap: 6px; }
.panel .big-icon { font-size: 78px; color: #fff; margin: auto 0; }
.panel .label { font-family: Arial, sans-serif; font-size: 13px; font-weight: 700; }

/* ---------- Category list ---------- */
.list { display: grid; gap: 10px; margin: 10px 12px; }
.row {
    --rshape: polygon(18px 0, 55% 0, calc(55% + 18px) 14px, 100% 14px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
    padding: 2px;
    background: var(--c);
    clip-path: var(--rshape);
}
.row-in {
    background: linear-gradient(90deg, #151515, #262626 60%);
    clip-path: var(--rshape);
    padding: 22px 14px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.row .thumb {
    flex: 0 0 120px;
    height: 64px;
    display: grid;
    place-items: center;
    font-size: 42px;
    color: var(--c);
    overflow: visible;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 35%, transparent), transparent);
}
.row .thumb img { width: 130px; max-height: 70px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.6)); }
.row .name { flex: 1; font-size: 15px; font-weight: 500; align-self: flex-end; }
.row .hex-btn { --btn: var(--c); --btn-edge: #fff; flex: 0 0 104px; }
.row .hex-btn span { padding: 6px 10px; font-size: 15px; color: #fff; }
.row-detail {
    display: none;
    width: 100%;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    padding: 0 16px 16px;
}
.row.open .row-detail { display: block; }
.row.open .row-in { flex-wrap: wrap; }
.intro { margin: 0 16px; font-family: Arial, sans-serif; font-size: 13px; color: var(--muted); line-height: 1.5; text-align: center; }

/* ---------- Generic content (about, privacy, calculator) ---------- */
.content {
    margin: 16px;
    padding: 18px;
    border-radius: 14px;
    background: var(--panel);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    font-size: 14px;
}
.content h2 { font-family: "Oswald", sans-serif; font-weight: 500; font-size: 19px; margin: 14px 0 6px; color: var(--salmon); }
.content h2:first-child { margin-top: 0; }
.content ul { padding-left: 20px; color: var(--muted); }
.content p { color: var(--muted); margin-bottom: 8px; }

.calc label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.calc input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #444;
    background: #111;
    color: #fff;
    font-size: 16px;
}
.calc .result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-weight: 700;
    text-align: center;
}

/* Rewarded unlock box */
.locked {
    margin: 16px;
    padding: 18px;
    border-radius: 14px;
    border: 1px dashed var(--salmon);
    text-align: center;
}
.locked p { font-family: Arial, sans-serif; color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---------- Footer ---------- */
.footer {
    margin: 24px 16px 0;
    padding-top: 16px;
    border-top: 1px solid #3a3a3a;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: var(--muted);
}
.footer a { margin: 0 8px; text-decoration: underline; }
.footer p { margin-top: 10px; line-height: 1.5; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 110px;
    transform: translateX(-50%) translateY(20px);
    background: #111;
    border: 1px solid var(--salmon);
    color: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    opacity: 0;
    transition: 0.25s;
    pointer-events: none;
    z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
