@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Space+Grotesk:wght@400;500;600;700&display=swap");

/* ── DESIGN TOKENS ── */
:root {
    --bg:       #0a1a1f;
    --bg-soft:  #10252d;
    --glass:    rgba(12, 32, 40, 0.7);
    --text:     #e7f7fb;
    --muted:    #b3d5dd;
    --accent:   #00d8ff;
    --accent-2: #8ff4ff;
    --shadow:   rgba(0, 0, 0, 0.35);
    --red:      #ff6b6b;
    --gold:     #f5c842;
    --silver:   #a8c1cc;
    --bronze:   #c8875e;
    --radius-card: 22px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: "Space Grotesk", "Noto Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 10% -10%, #114b5f 0%, transparent 60%),
        radial-gradient(1000px 500px at 95% 10%, #0b3440 0%, transparent 55%),
        linear-gradient(160deg, var(--bg) 0%, #081318 100%);
    min-height: 100vh;
}

/* ── NAVBAR ── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(120deg, rgba(5,20,26,0.92) 0%, rgba(10,38,48,0.88) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(14px);
}

.app-nav {
    max-width: 1160px;
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    flex-shrink: 0;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: conic-gradient(from 120deg, var(--accent), var(--accent-2), var(--accent));
    box-shadow: 0 12px 24px -12px rgba(0,216,255,0.85);
}

.brand-name {
    font-family: "Playfair Display", serif;
    font-size: 1.15rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
    flex: 1;
}

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* User area */
.nav-user {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.xp-badge {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0,216,255,0.12);
    border: 1px solid rgba(0,216,255,0.25);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-2);
    white-space: nowrap;
}

.avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.avatar-ring {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
}

.avatar-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 160px;
    background: rgba(10,30,38,0.97);
    border: 1px solid rgba(0,216,255,0.2);
    border-radius: 14px;
    padding: 10px 0;
    box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
}

.user-dropdown[hidden] { display: none; }

.user-dropdown a {
    display: block;
    padding: 10px 18px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.9rem;
    transition: color 0.2s, background 0.2s;
}

.user-dropdown a:hover { color: var(--accent); background: rgba(0,216,255,0.07); }

.user-dropdown hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 6px 0;
}

.logout-link { color: var(--red) !important; }

/* ── HERO BOAS-VINDAS ── */
.hero-welcome {
    position: relative;
    overflow: hidden;
    padding: 80px 28px 60px;
    text-align: center;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.hero-title {
    font-family: "Playfair Display", serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin: 10px 0 16px;
    line-height: 1.2;
}

.accent-text {
    color: var(--accent);
    text-shadow: 0 0 24px rgba(0,216,255,0.5);
}

.hero-sub {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,216,255,0.12), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ── MAIN / SECTIONS ── */
.app-main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 28px 100px;
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.section { position: relative; }

.section-header {
    margin-bottom: 32px;
}

.section-title {
    font-family: "Playfair Display", serif;
    font-size: 1.8rem;
    margin: 6px 0 0;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3rem;
    font-size: 0.7rem;
    color: var(--accent-2);
    margin: 0 0 8px;
}

/* ── JOGOS ── */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.game-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 26px;
    border-radius: var(--radius-card);
    background: rgba(8,19,24,0.85);
    border: 1px solid rgba(0,216,255,0.14);
    box-shadow: 0 16px 40px -28px var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 50px -28px rgba(0,216,255,0.25);
    border-color: rgba(0,216,255,0.35);
}

.game-card--locked {
    opacity: 0.65;
}

.game-card--locked:hover {
    transform: none;
    box-shadow: 0 16px 40px -28px var(--shadow);
    border-color: rgba(0,216,255,0.14);
}

.game-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.game-icon--quiz  { background: rgba(0,216,255,0.15); }
.game-icon--forca { background: rgba(143,244,255,0.12); }
.game-icon--banco { background: rgba(245,200,66,0.12); }
.game-icon--lab   { background: rgba(0,216,255,0.10); }

.game-info h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
}

.game-info p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
}

.tag--xp {
    background: rgba(0,216,255,0.15);
    color: var(--accent-2);
}

.tag--soon {
    background: rgba(245,200,66,0.15);
    color: #f5c842;
}

.btn-play {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 12px 0;
    border-radius: 12px;
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #081318;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    box-shadow: 0 8px 20px -12px rgba(0,216,255,0.8);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: auto;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -14px rgba(0,216,255,1);
}

.btn-play--disabled {
    cursor: not-allowed;
    background: rgba(255,255,255,0.08);
    color: var(--muted);
    box-shadow: none;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 12px 0;
    border-radius: 12px;
    width: 100%;
    margin-top: auto;
}

/* ── NOTÍCIAS ── */
.news-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 22px;
}

@media (max-width: 860px) {
    .news-grid { grid-template-columns: 1fr; }
}

.news-card {
    padding: 26px;
    border-radius: var(--radius-card);
    background: rgba(8,19,24,0.85);
    border: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.25s, transform 0.25s;
}

.news-card:hover {
    border-color: rgba(0,216,255,0.3);
    transform: translateY(-3px);
}

.news-card--featured {
    border-color: rgba(0,216,255,0.25);
    background: linear-gradient(140deg, rgba(0,216,255,0.08), rgba(8,19,24,0.95));
}

.news-badge {
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent);
    color: #081318;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.news-date {
    color: var(--muted);
    font-size: 0.78rem;
    margin: 0;
}

.news-card h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
}

.news-body {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.65;
    margin: 0;
    flex: 1;
}

.news-link {
    align-self: flex-start;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.news-link:hover { color: var(--accent-2); }

/* ── RANKING ── */
.ranking-wrapper {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 760px) {
    .ranking-wrapper { grid-template-columns: 1fr; }
}

/* Pódio */
.podium {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    justify-content: center;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 80px;
}

.podium-crown {
    font-size: 1.4rem;
    line-height: 1;
}

.podium-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(255,255,255,0.1);
}

.podium-1 .podium-avatar { border-color: var(--gold); box-shadow: 0 0 18px rgba(245,200,66,0.4); }
.podium-2 .podium-avatar { border-color: var(--silver); }
.podium-3 .podium-avatar { border-color: var(--bronze); }

.podium-name {
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

.podium-xp {
    font-size: 0.78rem;
    color: var(--muted);
}

.podium-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px 10px 0 0;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 12px 0;
}

.podium-bar--1 { height: 80px; background: linear-gradient(180deg, rgba(245,200,66,0.4), rgba(245,200,66,0.1)); color: var(--gold); }
.podium-bar--2 { height: 56px; background: linear-gradient(180deg, rgba(168,193,204,0.3), rgba(168,193,204,0.1)); color: var(--silver); }
.podium-bar--3 { height: 40px; background: linear-gradient(180deg, rgba(200,135,94,0.3), rgba(200,135,94,0.1));  color: var(--bronze); }

/* Tabela ranking */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(8,19,24,0.85);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-card);
    padding: 20px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 32px 1fr 100px 60px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.ranking-row:hover { background: rgba(0,216,255,0.05); }

.ranking-row--header {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 4px;
}

.ranking-row--header:hover { background: transparent; }

.ranking-row--me {
    background: rgba(0,216,255,0.08);
    border: 1px solid rgba(0,216,255,0.22);
    font-weight: 700;
}

.rank-pos { color: var(--muted); font-weight: 700; text-align: center; }
.rank-player { font-weight: 600; }
.rank-xp { color: var(--accent-2); font-weight: 700; }
.rank-games { color: var(--muted); text-align: right; }

/* ── FOOTER ── */
.app-footer {
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ── REVEAL ANIMATION ── */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUp 0.7s ease forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .app-nav { gap: 14px; }
    .nav-links { display: none; }
    .xp-badge { display: none; }
    .games-grid { grid-template-columns: 1fr; }
    .app-footer { flex-direction: column; gap: 6px; text-align: center; }
}
