:root {
    --bg: #060a14;
    --panel: #0e1728;
    --panel2: #111d33;
    --text: #e8f0ff;
    --muted: #93a4c8;
    --blue: #4f8cff;
    --violet: #9b5cff;
    --cyan: #37e7ff;
    --red: #ff5f72;
    --green: #4dff91;
    --gold: #ffd05a;
}

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

html,
body {
    width: 100%;
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    font-family: Inter, system-ui, Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, #122047 0, #060a14 42%, #03050b 100%);
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: env(safe-area-inset-top);
}

a {
    text-decoration: none;
    color: inherit;
}

h1,
h2,
h3,
p {
    margin: 0;
}

/* APP SHELL */
.app-shell {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    position: relative;
    overflow: hidden;
}

/* BACKGROUND GRID */
.app-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 80%);
    mask-image: linear-gradient(to bottom, black, transparent 80%);
    z-index: 0;
}

.app-shell > * {
    position: relative;
    z-index: 1;
}

/* DESKTOP ONLY: PHONE FRAME */
@media (min-width: 768px) {
    .app-shell {
        max-width: 430px;
        margin: 0 auto;
        border-left: 1px solid rgba(255, 255, 255, 0.05);
        border-right: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* TOPBAR */
.topbar {
    height: 78px;
    padding: 18px 18px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(to bottom, rgba(6, 10, 20, 0.98), rgba(6, 10, 20, 0.72), transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.topbar h1 {
    font-size: 22px;
    letter-spacing: 0.5px;
}

.eyebrow {
    text-transform: uppercase;
    color: var(--cyan);
    font-size: 11px;
    letter-spacing: 1.5px;
    font-weight: 800;
}

.content {
    padding: 12px 16px 96px;
}

.page-enter {
    animation: pageIn 0.55s ease both;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* PANELS */
.panel {
    background: linear-gradient(145deg, rgba(17, 29, 51, 0.92), rgba(9, 15, 28, 0.92));
    border: 1px solid rgba(148, 174, 255, 0.14);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25),
        inset 0 0 24px rgba(79, 140, 255, 0.035);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

.border-glow {
    box-shadow:
        0 0 0 1px rgba(79, 140, 255, 0.25),
        0 0 28px rgba(79, 140, 255, 0.18),
        inset 0 0 32px rgba(155, 92, 255, 0.08);
}

.shimmer::after {
    content: "";
    position: absolute;
    top: -80%;
    left: -40%;
    width: 35%;
    height: 260%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transform: rotate(25deg);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0%,
    45% {
        left: -70%;
    }
    70%,
    100% {
        left: 130%;
    }
}

/* ICON BUTTON */
.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    display: grid;
    place-items: center;
    font-size: 22px;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    50% {
        box-shadow: 0 0 18px rgba(79, 140, 255, 0.45);
    }
}

/* HERO */
.hero-card {
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 164px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at right top, rgba(155, 92, 255, 0.35), transparent 35%),
        linear-gradient(135deg, rgba(79, 140, 255, 0.12), transparent);
    opacity: 0.9;
}

.avatar-frame {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: #09101f;
}

.avatar,
.full-avatar,
.battle-scene {
    background: linear-gradient(135deg, #101827, #080b13), radial-gradient(circle, #4f8cff, transparent);
    position: relative;
}

.avatar::before,
.full-avatar::before {
    content: "";
    position: absolute;
    inset: 14px 28px 6px;
    border-radius: 48% 48% 22% 22%;
    background: linear-gradient(#151515, #030306);
    box-shadow: 0 0 24px rgba(79, 140, 255, 0.5);
}

.avatar {
    width: 100%;
    height: 100%;
}

.aura {
    filter: drop-shadow(0 0 18px rgba(79, 140, 255, 0.75));
}

.hero-info {
    position: relative;
    z-index: 1;
    flex: 1;
}

.rank-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(155, 92, 255, 0.16);
    border: 1px solid rgba(155, 92, 255, 0.5);
    color: #c9b2ff;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.hero-info h2 {
    margin-top: 8px;
    font-size: 24px;
}

.hero-info p {
    color: var(--muted);
    margin: 3px 0 12px;
}

/* PROGRESS */
.progress-label {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.bar {
    height: 9px;
    background: #18233a;
    border-radius: 999px;
    overflow: hidden;
}

.bar.mini {
    height: 6px;
    margin-top: 9px;
}

.bar-fill {
    height: 100%;
    display: block;
    border-radius: 999px;
    width: var(--value);
    animation: fillBar 1.1s ease forwards;
}

@keyframes fillBar {
    from {
        width: 0;
    }
    to {
        width: var(--value);
    }
}

.xp {
    background: linear-gradient(90deg, var(--blue), var(--violet));
    box-shadow: 0 0 14px var(--blue);
}

.fatigue {
    background: linear-gradient(90deg, var(--violet), var(--red));
    box-shadow: 0 0 12px var(--red);
}

.agi-fill {
    background: var(--cyan);
}

.gold-fill {
    background: var(--gold);
}

.rec-fill {
    background: var(--green);
}

.int-fill {
    background: var(--violet);
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.stat-card {
    text-align: center;
    padding: 12px 6px;
    border-radius: 16px;
}

.stat-icon {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.str {
    color: var(--red);
}

.agi {
    color: var(--cyan);
}

.vit {
    color: var(--gold);
}

.int {
    color: var(--violet);
}

.rec {
    color: var(--green);
}

.stat-card small {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.stat-card strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
}

.hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 10px;
}

/* SECTIONS */
.section-title,
.loot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.section-title b,
.loot-row strong {
    color: var(--cyan);
}

/* QUESTS */
.quest-row {
    display: flex;
    align-items: center;
    gap: 13px;
}

.quest-row:not(.no-border) {
    margin-bottom: 12px;
}

.quest-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.red {
    color: var(--red);
}

.cyan {
    color: var(--cyan);
}

.gold {
    color: var(--gold);
}

.green {
    color: var(--green);
}

.violet {
    color: var(--violet);
}

.grow {
    flex: 1;
}

.quest-row h3 {
    font-size: 16px;
}

.quest-row p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.quest-meta {
    text-align: right;
}

.quest-meta b {
    display: inline-block;
    border: 1px solid currentColor;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
}

.quest-meta span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 10px;
}

/* TABS */
.tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.tabs button {
    padding: 11px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-weight: 800;
}

.tabs .active {
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.28), rgba(155, 92, 255, 0.24));
    color: white;
    border-color: rgba(79, 140, 255, 0.55);
}

/* BUTTONS */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-small {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 15px;
    min-height: 52px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--violet));
    color: white;
    box-shadow: 0 0 24px rgba(79, 140, 255, 0.38);
}

.btn-secondary {
    background: rgba(79, 140, 255, 0.11);
    border: 1px solid rgba(79, 140, 255, 0.35);
    color: #cfe0ff;
    margin-top: 12px;
}

.btn-danger {
    background: rgba(255, 95, 114, 0.08);
    border: 1px solid rgba(255, 95, 114, 0.28);
    color: #ff9aaa;
    margin-top: 12px;
}

.btn-small {
    padding: 10px 18px;
    min-height: 42px;
    background: linear-gradient(135deg, var(--blue), var(--violet));
    color: white;
    font-size: 12px;
}

.magnetic {
    transition:
        0.18s transform,
        0.18s filter;
}

.magnetic:active {
    transform: scale(0.96);
    filter: brightness(1.25);
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 76px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(9, 15, 28, 0.88);
    border-top: 1px solid rgba(148, 174, 255, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 10;
     padding-bottom: env(safe-area-inset-bottom);
}

/* DESKTOP NAV ALIGN */
@media (min-width: 768px) {
    .bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        width: 430px;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #647294;
    font-size: 20px;
}

.nav-item small {
    font-size: 10px;
    text-transform: uppercase;
}

.nav-item.active {
    color: var(--blue);
    text-shadow: 0 0 15px var(--blue);
}

.nav-item.active span {
    animation: navPop 0.4s ease;
}

@keyframes navPop {
    50% {
        transform: translateY(-5px) scale(1.15);
    }
}

/* TIMER */
.timer-wrap {
    display: grid;
    place-items: center;
    padding: 24px 0;
}

.timer-ring {
    --deg: 0deg;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--blue) var(--deg), #1c2740 0);
    box-shadow: 0 0 40px rgba(79, 140, 255, 0.2);
    position: relative;
}

.timer-ring::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: #07101f;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-ring > div {
    position: relative;
    text-align: center;
}

.timer-ring span,
.timer-ring small {
    display: block;
    color: var(--cyan);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
}

.timer-ring strong {
    display: block;
    font-size: 48px;
    letter-spacing: 1px;
    margin: 10px 0;
}

.reps-card {
    text-align: center;
}

.reps-card strong {
    display: block;
    font-size: 42px;
    margin: 8px 0;
}

.stepper {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.stepper button {
    width: 54px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 26px;
}

.quality-card {
    text-align: center;
}

.stars {
    font-size: 32px;
    color: var(--gold);
    letter-spacing: 4px;
    margin: 12px 0;
}

.quality-card b {
    color: var(--gold);
}

/* CHARACTER */
.character-hero {
    min-height: 450px;
}

.full-avatar {
    height: 260px;
    border-radius: 22px;
    margin-bottom: 14px;
    background:
        radial-gradient(circle at center, rgba(155, 92, 255, 0.38), transparent 45%),
        linear-gradient(135deg, #0d1424, #05070d);
}

.full-avatar::before {
    inset: 24px 120px 18px 90px;
    transform: skew(-5deg);
}

.char-sheet ul {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
}

.char-sheet li {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.char-sheet b {
    color: var(--muted);
}

/* EQUIPMENT */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.equipment-grid div,
.rewards div {
    height: 58px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: rgba(155, 92, 255, 0.1);
    border: 1px solid rgba(155, 92, 255, 0.35);
    font-size: 24px;
}

/* DUNGEONS */
.dungeon-card {
    min-height: 130px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    background:
        linear-gradient(90deg, rgba(8, 15, 29, 0.95), rgba(12, 35, 46, 0.72)),
        radial-gradient(circle at right, rgba(55, 231, 255, 0.22), transparent 35%);
}

.dungeon-card h3 {
    font-size: 18px;
}

.dungeon-card p,
.dungeon-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 7px;
}

.locked {
    filter: grayscale(0.65);
    opacity: 0.65;
}

.currency {
    font-size: 12px;
    color: var(--gold);
}

/* RESULT */
.result-screen {
    padding-top: 36px;
}

.victory {
    text-align: center;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.victory h1 {
    font-size: 44px;
    color: var(--green);
    text-shadow: 0 0 24px rgba(77, 255, 145, 0.55);
    margin: 10px 0;
}

.victory p {
    color: #c6d6f7;
    max-width: 290px;
    line-height: 1.5;
}

.battle-scene {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin-top: 28px;
    background: radial-gradient(circle, var(--green), transparent 12%), linear-gradient(#07101f, #03060a);
}

.battle-scene::before {
    content: "";
    position: absolute;
    inset: 45px 75px 28px;
    border-radius: 50% 50% 18% 18%;
    background: #030406;
    box-shadow: 0 0 38px rgba(77, 255, 145, 0.7);
}

.rewards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.rewards div {
    height: 74px;
    align-content: center;
    font-size: 18px;
}

.rewards span {
    font-size: 12px;
    color: var(--muted);
}

/* SMALL MOBILE */
@media (max-width: 360px) {
    .content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .hero-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        gap: 6px;
    }

    .timer-ring {
        width: 210px;
        height: 210px;
    }

    .timer-ring strong {
        font-size: 40px;
    }
}

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.input-group label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.input-group input,select,textarea {
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  transition: .2s;
}

.input-group input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 12px rgba(79,140,255,.3);
}

/* petit effet stylé au hover */
.input-group input:hover {
  border-color: rgba(79,140,255,.4);
}

option
{
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .04);
}


.notif {
  position: fixed;
  top: -100px; /* cachée au départ */
  left: 50%;
  transform: translateX(-50%);
  
  background: #1e1e1e;
  color: white;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  
  width: 90%;
  max-width: 350px;
  
  transition: top 0.4s ease;
  z-index: 9999;
}

.notif.show {
  top: 20px; /* descend comme une notif */
}