/* =========================================================
   Portfólio Murilo Medeiros — Estilos públicos
   Tema escuro · verde profundo · destaque laranja
   ========================================================= */

/* ---------- Variáveis ---------- */
:root {
    --bg:           #0a1410;
    --bg-2:         #0d1a14;
    --bg-3:         #102119;
    --surface:      #12261c;
    --surface-2:    #17301f;
    --border:       #1e3b2a;
    --border-2:     #24452f;

    --text:         #e6efe9;
    --text-muted:   #94a89c;
    --text-dim:     #6d8377;

    --green:        #1f7a4d;
    --green-2:      #2a9e63;
    --green-3:      #46c98a;
    --green-glow:   rgba(70, 201, 138, 0.15);

    --accent:       #ff8a3d;
    --accent-2:     #ff6a1a;
    --accent-glow:  rgba(255, 138, 61, 0.18);

    --radius:       12px;
    --radius-lg:    18px;
    --radius-sm:    8px;

    --shadow-sm:    0 2px 8px rgba(0,0,0,.25);
    --shadow:       0 8px 24px rgba(0,0,0,.35);
    --shadow-lg:    0 20px 50px rgba(0,0,0,.5);

    --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width:    1160px;

    --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--green-3); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}
.container.narrow { max-width: 760px; }

.section { padding: 80px 0; position: relative; }
.section-alt { background: var(--bg-2); }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.section-head h2 { margin: 0 0 6px; }
.section-head p { color: var(--text-muted); margin: 0; }

.center { text-align: center; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---------- Skip link ---------- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--green);
    color: #fff;
    padding: 12px 20px;
    z-index: 999;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 20, 16, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}
.site-header.scrolled {
    background: rgba(10, 20, 16, 0.95);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    letter-spacing: -.01em;
}
.brand:hover { color: var(--text); }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-2) 100%);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -.5px;
    box-shadow: 0 4px 12px var(--green-glow);
}
.brand-mark.small { width: 28px; height: 28px; font-size: 11px; }
.brand-text { font-size: 15px; }

/* Navegação */
.main-nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0; padding: 0;
}
.main-nav a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14.5px;
    font-weight: 500;
    transition: all var(--transition);
}
.main-nav a:hover { color: var(--text); background: var(--surface); }
.main-nav a.active { color: var(--green-3); }
.nav-cv {
    border: 1px solid var(--border-2) !important;
    color: var(--text) !important;
    margin-left: 6px;
}
.nav-cv:hover { border-color: var(--accent) !important; color: var(--accent) !important; }

/* Mobile toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 24px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.2;
}
.btn-primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-2) 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(31, 122, 77, 0.35);
}
.btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(70, 201, 138, 0.4);
}
.btn-outline {
    border-color: var(--border-2);
    color: var(--text);
    background: transparent;
}
.btn-outline:hover {
    border-color: var(--green-3);
    color: var(--green-3);
    background: var(--surface);
}
.btn-ghost {
    color: var(--text-muted);
    background: transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn.full { width: 100%; }

/* ---------- Hero ---------- */
.hero {
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -20%; right: -10%;
    width: 700px; height: 700px;
    background: radial-gradient(circle, var(--green-glow) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.hero-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--green-3);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 20px;
    letter-spacing: .02em;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 .accent {
    background: linear-gradient(135deg, var(--green-3) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.hero-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: 32px;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.hero-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-muted);
}
.hero-links a { color: var(--green-3); font-weight: 500; }
.hero-links a:hover { color: var(--accent); }

/* Code card */
.code-card {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px 24px;
    box-shadow: var(--shadow-lg);
    font-family: var(--font-mono);
    font-size: 13.5px;
    position: relative;
    overflow: hidden;
}
.code-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, var(--green-glow), transparent 60%);
    pointer-events: none;
}
.code-card-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}
.code-card-bar span {
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--border-2);
}
.code-card-bar span:nth-child(1) { background: #ff5f56; }
.code-card-bar span:nth-child(2) { background: #ffbd2e; }
.code-card-bar span:nth-child(3) { background: #27c93f; }
.code-card pre { margin: 0; white-space: pre-wrap; line-height: 1.7; }
.code-card code { color: var(--text); }
.tk-key  { color: #ff8a3d; }
.tk-cls  { color: #46c98a; }
.tk-str  { color: #9ecbff; }
.tk-var  { color: #e6efe9; }
.tk-fn   { color: #d2a8ff; }

/* ---------- Página hero ---------- */
.page-hero {
    padding: 60px 0 40px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
}
.page-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--green-3);
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 12px;
}
.page-hero h1 { margin-bottom: 12px; }
.page-lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0;
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.card:hover {
    border-color: var(--border-2);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.card-feature .card-icon {
    font-size: 26px;
    margin-bottom: 14px;
    display: inline-block;
}
.card-feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card-feature p { color: var(--text-muted); font-size: 14.5px; margin: 0; }

/* ---------- Project card ---------- */
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
}
.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-2);
    box-shadow: var(--shadow);
}
.project-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-3);
    overflow: hidden;
    display: block;
}
.project-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.project-card:hover .project-cover img { transform: scale(1.04); }

.cover-placeholder {
    width: 100%; height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--bg-3) 100%);
    color: var(--green-3);
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
}
.cover-placeholder.small { font-size: 1.5rem; }
.cover-placeholder.large { font-size: 5rem; aspect-ratio: 16/9; }

.project-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(10, 20, 16, .85);
    color: var(--green-3);
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-2);
    backdrop-filter: blur(6px);
}
.project-badge.featured {
    left: auto; right: 12px;
    color: var(--accent);
    border-color: rgba(255, 138, 61, .35);
}

.project-body {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.project-cat {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--green-3);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 8px;
}
.project-body h3 { font-size: 1.15rem; margin-bottom: 10px; }
.project-body h3 a { color: var(--text); }
.project-body h3 a:hover { color: var(--green-3); }
.project-body p {
    color: var(--text-muted);
    font-size: 14.5px;
    margin-bottom: 16px;
    flex: 1;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0; margin: 0 0 16px;
}
.tech-tags li {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
    background: var(--bg-3);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 999px;
}
.tech-tags.big li { font-size: 13px; padding: 6px 14px; }

.link-arrow {
    color: var(--green-3);
    font-weight: 500;
    font-size: 14.5px;
    margin-top: auto;
}
.link-arrow:hover { color: var(--accent); }

/* ---------- Post card ---------- */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
}
.post-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-2);
    box-shadow: var(--shadow);
}
.post-cover {
    aspect-ratio: 16/9;
    background: var(--bg-3);
    overflow: hidden;
    display: block;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 22px; }
.post-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.post-meta.big { font-size: 14.5px; }
.post-body h3 { font-size: 1.1rem; margin-bottom: 8px; }
.post-body h3 a { color: var(--text); }
.post-body h3 a:hover { color: var(--green-3); }
.post-body p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 12px; }

/* ---------- Filtros ---------- */
.filters {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    align-items: center;
}
.filter-cats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.chip {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}
.chip.small { font-size: 12px; padding: 5px 12px; }

.filter-search {
    display: flex;
    gap: 8px;
    align-items: center;
}
.filter-search input {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-sans);
    min-width: 220px;
    transition: border-color var(--transition);
}
.filter-search input:focus {
    outline: none;
    border-color: var(--green-3);
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius-lg);
}

/* ---------- Tech strip ---------- */
.tech-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    list-style: none;
    padding: 0; margin: 0 0 24px;
}
.tech-strip li {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 999px;
    transition: all var(--transition);
}
.tech-strip li:hover { color: var(--green-3); border-color: var(--green); }

.tech-card .tech-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.tech-card .tech-icon {
    font-size: 24px;
    line-height: 1;
}
.tech-card h3 { margin: 0; font-size: 1.05rem; }
.tech-card p { color: var(--text-muted); font-size: 14px; margin: 0; }
.tech-level {
    display: flex;
    gap: 4px;
    margin-top: 14px;
}
.tech-level span {
    width: 26px; height: 4px;
    border-radius: 2px;
    background: var(--border-2);
    transition: background var(--transition);
}
.tech-level span.on { background: var(--green-3); }

/* ---------- Projeto individual ---------- */
.breadcrumb {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--green-3); }

.project-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 48px;
    align-items: center;
}
.project-hero-cover img,
.project-hero-cover .cover-placeholder {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.project-meta {
    list-style: none;
    padding: 0; margin: 0 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--text-muted);
}
.project-meta strong { color: var(--text); }

.project-content { max-width: 900px; margin: 0 auto; }
.project-block { margin-bottom: 48px; }
.project-block h2 {
    font-size: 1.4rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.prose {
    color: var(--text);
    line-height: 1.75;
    font-size: 15.5px;
}
.prose p { margin-bottom: 1.2em; }
.prose a { color: var(--green-3); text-decoration: underline; text-decoration-color: rgba(70, 201, 138, .4); }
.prose a:hover { color: var(--accent); }
.prose ul, .prose ol { padding-left: 24px; }
.prose code {
    font-family: var(--font-mono);
    font-size: .9em;
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--border);
}
.prose pre {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    overflow-x: auto;
}
.prose img { border-radius: var(--radius); margin: 16px 0; }
.prose blockquote {
    border-left: 3px solid var(--green-3);
    padding-left: 16px;
    margin: 20px 0;
    color: var(--text-muted);
    font-style: italic;
}

.feature-list {
    list-style: none;
    padding: 0;
}
.feature-list li {
    padding: 10px 0 10px 28px;
    position: relative;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green-3);
    font-weight: 700;
}

/* Galeria */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.gallery-item {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.gallery-item:hover {
    border-color: var(--green-3);
    transform: translateY(-2px);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* Vídeo */
.video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}
.video-wrap iframe,
.video-wrap video {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* ---------- Post individual ---------- */
.post-hero { text-align: left; }
.post-cover-full {
    margin-top: 40px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}
.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* ---------- Contato ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 60px;
    align-items: start;
}
.contact-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
}
.contact-list li {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.contact-list strong {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-family: var(--font-mono);
    margin-bottom: 6px;
}

.contact-form .field,
.admin-form .field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.field input,
.field textarea,
.field select {
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 14.5px;
    transition: all var(--transition);
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--green-3);
    box-shadow: 0 0 0 3px var(--green-glow);
}
.field small.muted { color: var(--text-dim); font-size: 12.5px; }

/* Honeypot */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* Alertas */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 14.5px;
    border: 1px solid;
}
.alert ul { margin: 0; padding-left: 20px; }
.alert.success {
    background: rgba(70, 201, 138, .08);
    border-color: rgba(70, 201, 138, .35);
    color: var(--green-3);
}
.alert.error {
    background: rgba(255, 90, 90, .08);
    border-color: rgba(255, 90, 90, .35);
    color: #ff9b9b;
}

/* ---------- Sobre ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 60px;
    align-items: start;
}
.photo-placeholder {
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg-3) 100%);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius-lg);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 24px;
}
.photo-placeholder span {
    display: block;
    font-size: 1.05rem;
    color: var(--green-3);
    margin-bottom: 8px;
    font-weight: 600;
}
.photo-placeholder small {
    color: var(--text-dim);
    font-size: 13px;
    display: block;
}
.about-text h2 { margin-top: 0; }
.about-text h3 { margin-top: 28px; color: var(--green-3); font-size: 1.05rem; }
.about-text p { color: var(--text-muted); }

/* Foto "Sobre" */
.about-photo-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: block;
}

/* ---------- CTA ---------- */
.cta-section {
    background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-3) 100%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.cta-inner {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}
.cta-inner h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.cta-inner p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 28px; }
.cta-inner .hero-actions { justify-content: center; }

/* ---------- 404 ---------- */
.error-hero { text-align: center; padding: 100px 0; }
.error-code {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--green-3), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 16px;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    display: grid;
    place-items: center;
    z-index: 9999;
    padding: 40px;
    cursor: zoom-out;
}

/* Correção importante: garante que o lightbox fique oculto quando tem [hidden] */
.lightbox[hidden] {
    display: none !important;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.lightbox-close {
    position: absolute;
    top: 20px; right: 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    padding-bottom: 60px;
}
.footer-brand h3 { margin: 14px 0 10px; font-size: 1.15rem; }
.footer-brand p { color: var(--text-muted); font-size: 14.5px; max-width: 380px; }
.footer-col h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-dim);
    font-family: var(--font-mono);
    margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
    color: var(--text-muted);
    font-size: 14.5px;
}
.footer-col a:hover { color: var(--green-3); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 24px 0;
}
.footer-bottom p {
    margin: 0;
    color: var(--text-dim);
    font-size: 13.5px;
}

/* ---------- Conteúdo rico (Sobre e posts) ---------- */
.rich-content {
    color: var(--text);
    line-height: 1.75;
    font-size: 15.5px;
}
.rich-content h2 { font-size: 1.45rem; margin: 0 0 16px; }
.rich-content h3 {
    font-size: 1.15rem;
    margin: 32px 0 12px;
    color: var(--green-3);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.rich-content h3:first-child { margin-top: 0; }
.rich-content h4 { font-size: 1rem; margin: 24px 0 10px; color: var(--text); }
.rich-content p { margin: 0 0 1.1em; color: var(--text-muted); }
.rich-content strong { color: var(--text); font-weight: 600; }
.rich-content em { color: var(--text-muted); }
.rich-content a {
    color: var(--green-3);
    text-decoration: underline;
    text-decoration-color: rgba(70, 201, 138, .4);
}
.rich-content a:hover { color: var(--accent); }
.rich-content ul,
.rich-content ol {
    padding-left: 22px;
    margin: 0 0 1.2em;
    color: var(--text-muted);
}
.rich-content li { margin-bottom: 6px; }
.rich-content li::marker { color: var(--green-3); }
.rich-content code {
    font-family: var(--font-mono);
    font-size: .9em;
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--border);
    color: var(--green-3);
}
.rich-content pre {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.6;
    margin: 0 0 1.2em;
}
.rich-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text);
}
.rich-content blockquote {
    border-left: 3px solid var(--green-3);
    padding: 4px 0 4px 16px;
    margin: 16px 0;
    color: var(--text-muted);
    font-style: italic;
}
.rich-content img {
    border-radius: var(--radius);
    margin: 16px 0;
    border: 1px solid var(--border);
}
.rich-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* ---------- Animações de scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .7s ease, transform .7s ease;
    will-change: opacity, transform;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   RESPONSIVO
   ========================================================= */

/* Tablet grande */
@media (max-width: 980px) {
    .hero-inner,
    .project-hero-grid,
    .contact-grid,
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    .footer-brand { grid-column: 1 / -1; }
    .section { padding: 60px 0; }
    .hero { padding: 70px 0 50px; }
    .about-grid .about-photo { max-width: 300px; }
}

/* Tablet / Mobile */
@media (max-width: 760px) {
    .container { padding: 0 20px; }

    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed;
        top: 72px;
        left: 0; right: 0;
        background: var(--bg-2);
        border-bottom: 1px solid var(--border);
        padding: 20px;
        transform: translateY(-120%);
        transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }
    .main-nav.open { transform: translateY(0); }
    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .main-nav a {
        padding: 14px 16px;
        font-size: 15.5px;
        border-radius: var(--radius);
    }
    .nav-cv { margin-left: 0; text-align: center; }

    .hero { padding: 60px 0 40px; }
    .hero-lead { font-size: 1rem; }
    .hero-actions { width: 100%; }
    .hero-actions .btn { flex: 1 1 auto; min-width: 0; }

    .section-head { margin-bottom: 28px; }
    .section { padding: 50px 0; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        padding-bottom: 40px;
    }

    .filters { flex-direction: column; align-items: stretch; }
    .filter-search input { flex: 1; min-width: 0; }

    .project-meta { flex-direction: column; gap: 6px; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
    .lightbox { padding: 20px; }

    .page-hero { padding: 40px 0 30px; }
    .post-cover-full { margin-top: 24px; }
}

/* Celular */
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .header-inner { height: 64px; }
    .main-nav { top: 64px; max-height: calc(100vh - 64px); }
    .brand-text { display: none; }

    .hero h1 { font-size: 1.85rem; }
    .hero-eyebrow { font-size: 11.5px; padding: 5px 10px; }
    .btn { padding: 11px 18px; font-size: 14px; }

    .card { padding: 22px 18px; }
    .project-body, .post-body { padding: 18px; }

    .gallery { grid-template-columns: 1fr; }
    .project-block { margin-bottom: 32px; }
    .project-block h2 { font-size: 1.2rem; }

    .tech-strip li { font-size: 12px; padding: 6px 12px; }
}

/* =========================================================
   Timeline — Histórico de desenvolvimento
   ========================================================= */
.timeline {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    position: relative;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: linear-gradient(180deg, var(--green-3) 0%, var(--border-2) 100%);
    opacity: .5;
    border-radius: 2px;
}
.timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 22px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: 4px;
    top: 14px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--green-3);
    box-shadow: 0 0 0 4px var(--green-glow);
    z-index: 1;
}
.timeline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: border-color var(--transition), transform var(--transition);
}
.timeline-card:hover {
    border-color: var(--border-2);
    transform: translateX(2px);
}
.timeline-date {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--green-3);
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.timeline-title {
    font-size: 1.05rem;
    margin: 0 0 6px;
    color: var(--text);
}
.timeline-desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .timeline-item { padding-left: 32px; }
    .timeline::before { left: 9px; }
    .timeline-dot { left: 2px; width: 14px; height: 14px; }
    .timeline-card { padding: 14px; }
}

/* =========================================================
   Modal do jogo (CheerpJ)
   ========================================================= */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.game-modal[hidden] { display: none !important; }

.game-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 12, 8, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: gameModalFadeIn .25s ease forwards;
}

.game-modal-panel {
    position: relative;
    width: 100%;
    max-width: 1080px;
    max-height: calc(100vh - 48px);
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gameModalIn .3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes gameModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes gameModalIn {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.game-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
    flex-shrink: 0;
}
.game-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -.01em;
}
.game-modal-close {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: all var(--transition);
}
.game-modal-close:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface-2);
}

.game-modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    background: #000;
}

.game-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.game-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.game-display canvas,
.game-display > div {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.game-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #000;
    color: var(--text);
    z-index: 2;
    pointer-events: none;
}
.game-loading[hidden] { display: none !important; }

.game-loading-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(70, 201, 138, 0.18);
    border-top-color: var(--green-3);
    animation: gameSpin 0.9s linear infinite;
}
@keyframes gameSpin {
    to { transform: rotate(360deg); }
}
.game-loading-text {
    margin: 0;
    font-size: 15px;
    color: var(--text);
    font-weight: 500;
}
.game-loading-sub {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-dim);
}

.game-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #000;
    color: var(--text);
    padding: 32px;
    text-align: center;
    z-index: 3;
}
.game-error[hidden] { display: none !important; }
.game-error-title {
    margin: 0;
    color: #ff9b9b;
    font-weight: 600;
    font-size: 1rem;
}
.game-error-msg {
    margin: 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
}
.game-error-hint {
    margin: 6px 0 0;
    color: var(--text-dim);
    font-size: 13px;
    max-width: 420px;
}

.game-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    flex-shrink: 0;
}
.game-modal-hint {
    font-size: 12.5px;
    color: var(--text-dim);
}
.game-modal-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

body.game-modal-open {
    overflow: hidden;
}

@media (max-width: 760px) {
    .game-modal { padding: 12px; }
    .game-modal-panel { max-height: calc(100vh - 24px); }
    .game-modal-head { padding: 12px 16px; }
    .game-modal-foot { padding: 10px 16px; }
    .game-modal-hint { display: none; }
    .game-stage { min-height: 55vh; }
    .game-modal-title { font-size: 0.95rem; }
    .game-modal-close { width: 32px; height: 32px; font-size: 20px; }
}

@media (max-width: 480px) {
    .game-modal-panel { border-radius: var(--radius); }
    .game-modal-body { background: #000; }
    .game-stage { min-height: 50vh; }
}

@media (prefers-reduced-motion: reduce) {
    .game-modal-backdrop,
    .game-modal-panel { animation: none; }
    .game-loading-spinner { animation: none; }
}

/* =========================================================
   Modais CheerpJ — aviso + jogo
   ========================================================= */

/* ---------- AVISO PRÉVIO ---------- */
.game-warning {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.game-warning[hidden] { display: none !important; }

.game-warning-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 12, 8, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: gameModalFadeIn .25s ease forwards;
}

.game-warning-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gameModalIn .3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.game-warning-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
    flex-shrink: 0;
}
.game-warning-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -.01em;
}
.game-warning-close {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: all var(--transition);
}
.game-warning-close:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface-2);
}

.game-warning-body {
    padding: 24px 22px 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.game-warning-text {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
}
.game-warning-text strong { color: var(--text); font-weight: 600; }
.game-warning-text em { color: var(--text); font-style: normal; text-decoration: underline dotted; }
.game-warning-text.game-warning-small {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
}
.game-warning-steps {
    margin: 0 0 16px;
    padding-left: 22px;
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
}
.game-warning-steps li { margin-bottom: 10px; }
.game-warning-steps strong { color: var(--text); }

.game-warning-flag {
    display: flex;
}

/* =========================================================
   Modais CheerpJ — aviso prévio + modal do jogo
   ========================================================= */

/* =========================================================
   1) MODAL DE AVISO (aparece antes do jogo)
   ========================================================= */
.game-warning {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.game-warning[hidden] { display: none !important; }

.game-warning-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 12, 8, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: gameModalFadeIn .25s ease forwards;
}

.game-warning-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gameModalIn .3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.game-warning-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
    flex-shrink: 0;
}
.game-warning-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -.01em;
}
.game-warning-close {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: all var(--transition);
}
.game-warning-close:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface-2);
}

.game-warning-body {
    padding: 24px 22px 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.game-warning-text {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
}
.game-warning-text strong { color: var(--text); font-weight: 600; }
.game-warning-text em {
    color: var(--text);
    font-style: normal;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}
.game-warning-text.game-warning-small {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
}
.game-warning-steps {
    margin: 0 0 16px;
    padding-left: 22px;
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
}
.game-warning-steps li { margin-bottom: 10px; }
.game-warning-steps strong { color: var(--text); }

.game-warning-flag {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}
.game-warning-flag code {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--green-3);
    word-break: break-all;
    background: transparent;
    padding: 0;
}
.game-warning-copy {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.game-warning-copy:hover {
    color: var(--green-3);
    border-color: var(--green-3);
    background: var(--surface-2);
}

.game-warning-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    flex-shrink: 0;
}

/* =========================================================
   2) MODAL DO JOGO
   ========================================================= */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.game-modal[hidden] { display: none !important; }

.game-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 12, 8, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: gameModalFadeIn .25s ease forwards;
}

.game-modal-panel {
    position: relative;
    width: 100%;
    max-width: 1080px;
    max-height: calc(100vh - 48px);
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gameModalIn .3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes gameModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes gameModalIn {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.game-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
    flex-shrink: 0;
}
.game-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -.01em;
}
.game-modal-close {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: all var(--transition);
}
.game-modal-close:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface-2);
}

.game-modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    background: #000;
}

.game-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.game-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.game-display canvas,
.game-display > div {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* Tela "Carregando jogo..." */
.game-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #000;
    color: var(--text);
    z-index: 2;
    pointer-events: none;
}
.game-loading[hidden] { display: none !important; }

.game-loading-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(70, 201, 138, 0.18);
    border-top-color: var(--green-3);
    animation: gameSpin 0.9s linear infinite;
}
@keyframes gameSpin {
    to { transform: rotate(360deg); }
}
.game-loading-text {
    margin: 0;
    font-size: 15px;
    color: var(--text);
    font-weight: 500;
}
.game-loading-sub {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-dim);
}

/* Tela de erro */
.game-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #000;
    color: var(--text);
    padding: 32px;
    text-align: center;
    z-index: 3;
}
.game-error[hidden] { display: none !important; }
.game-error-title {
    margin: 0;
    color: #ff9b9b;
    font-weight: 600;
    font-size: 1rem;
}
.game-error-msg {
    margin: 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
}
.game-error-hint {
    margin: 6px 0 0;
    color: var(--text-dim);
    font-size: 13px;
    max-width: 460px;
    line-height: 1.6;
}
.game-error-hint code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--green-3);
}

.game-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    flex-shrink: 0;
}
.game-modal-hint {
    font-size: 12.5px;
    color: var(--text-dim);
}
.game-modal-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Bloqueia scroll do fundo quando algum modal está aberto */
body.game-modal-open {
    overflow: hidden;
}

/* =========================================================
   Responsivo
   ========================================================= */
@media (max-width: 760px) {
    .game-warning { padding: 12px; }
    .game-warning-head { padding: 12px 16px; }
    .game-warning-body { padding: 20px 16px 8px; }
    .game-warning-foot { padding: 12px 16px; flex-direction: column-reverse; }
    .game-warning-foot .btn { width: 100%; justify-content: center; }

    .game-modal { padding: 12px; }
    .game-modal-panel { max-height: calc(100vh - 24px); }
    .game-modal-head { padding: 12px 16px; }
    .game-modal-foot { padding: 10px 16px; }
    .game-modal-hint { display: none; }
    .game-stage { min-height: 55vh; }
    .game-modal-title { font-size: 0.95rem; }
    .game-modal-close { width: 32px; height: 32px; font-size: 20px; }
}

@media (max-width: 480px) {
    .game-warning-panel { border-radius: var(--radius); }
    .game-modal-panel { border-radius: var(--radius); }
    .game-stage { min-height: 50vh; }
    .game-warning-title { font-size: 0.95rem; }
    .game-warning-close { width: 32px; height: 32px; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .game-warning-backdrop,
    .game-warning-panel,
    .game-modal-backdrop,
    .game-modal-panel { animation: none; }
    .game-loading-spinner { animation: none; }
}

/* =========================================================
   Timeline — mídia (imagem / vídeo)
   ========================================================= */
.timeline-media {
    display: block;
    margin-top: 14px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}
.timeline-media-image {
    transition: border-color var(--transition), transform var(--transition);
}
.timeline-media-image:hover {
    border-color: var(--green-3);
    transform: translateY(-1px);
}
.timeline-media-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: cover;
}

.timeline-media-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-top: 14px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.timeline-media-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.timeline-media-link {
    margin: 14px 0 0;
    font-size: 14px;
}
.timeline-media-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--green-3);
    font-weight: 500;
}
.timeline-media-link a:hover { color: var(--accent); }

/* Quando o card tem mídia, dar um respiro extra */
.timeline-card:has(.timeline-media) {
    padding-bottom: 18px;
}

@media (max-width: 480px) {
    .timeline-media-image img { max-height: 240px; }
}
    