:root {
    --bg: #0e1410;
    --bg-elevated: #161e18;
    --bg-panel: #1a241c;
    --bg-soft: #222c24;
    --border: rgba(180, 210, 170, 0.12);
    --text: #e7f0e4;
    --text-muted: #9aaf9a;
    --accent: #7dcb5c;
    --accent-strong: #9fe07a;
    --accent-dim: rgba(125, 203, 92, 0.15);
    --danger: #e05a4f;
    --nether: #e06a55;
    --end: #b48cff;
    --overworld: #7dcb5c;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --radius: 14px;
    --font: "Sora", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(125, 203, 92, 0.12), transparent 55%),
        radial-gradient(900px 500px at 90% 0%, rgba(90, 140, 80, 0.08), transparent 50%),
        linear-gradient(180deg, #101710 0%, var(--bg) 40%, #0b100d 100%);
    background-attachment: fixed;
}

a {
    color: var(--accent-strong);
    text-decoration: none;
}

a:hover {
    color: #c6f0ad;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.container.narrow {
    width: min(720px, calc(100% - 2rem));
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(14, 20, 16, 0.82);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 1rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo:hover {
    color: var(--text);
}

.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #5aa63d 0%, #9fe07a 45%, #3d6b2e 100%);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 20px rgba(125, 203, 92, 0.25);
}

.logo-text {
    font-size: 1.15rem;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: inline-block;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: var(--accent-dim);
}

.nav-cta {
    background: var(--accent) !important;
    color: #0e1410 !important;
    font-weight: 600;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--accent-strong);
    font-weight: 600;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    padding: 0.4rem;
    cursor: pointer;
}

.hamburger-line {
    width: 22px;
    height: 2px;
    background: var(--text);
}

/* Hero */
.hero {
    position: relative;
    padding: 5.5rem 0 4rem;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    inset: 10% 15% auto;
    height: 280px;
    background: radial-gradient(circle, rgba(125, 203, 92, 0.18), transparent 70%);
    filter: blur(10px);
    pointer-events: none;
    animation: pulseGlow 6s ease-in-out infinite;
}

.hero-inner {
    position: relative;
    text-align: center;
}

.eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    margin: 0 0 1rem;
}

.hero-brand {
    margin: 0;
    font-size: clamp(3rem, 8vw, 5.5rem);
    letter-spacing: -0.04em;
    line-height: 0.95;
    background: linear-gradient(180deg, #f3ffe9 0%, #9fe07a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: riseIn 0.8s ease both;
}

.hero-lead {
    max-width: 34rem;
    margin: 1.25rem auto 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    animation: riseIn 0.9s ease 0.08s both;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    animation: riseIn 1s ease 0.14s both;
}

.feature-strip {
    padding: 1rem 0 4rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.feature-grid article {
    background: rgba(26, 36, 28, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
}

.feature-grid h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.feature-grid p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
    font-size: 0.95rem;
}

/* App pages */
.app-main,
.auth-page {
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 140px);
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    letter-spacing: -0.03em;
}

.page-subtitle {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-form label,
.stack-form label span,
.auth-form label span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    font: inherit;
}

select:focus,
input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(125, 203, 92, 0.55);
    box-shadow: 0 0 0 3px rgba(125, 203, 92, 0.12);
}

textarea {
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.7rem 1.15rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(180deg, var(--accent-strong), var(--accent));
    color: #102010;
}

.btn-secondary {
    background: var(--bg-soft);
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-danger {
    background: rgba(224, 90, 79, 0.15);
    border-color: rgba(224, 90, 79, 0.35);
    color: #ffb1aa;
}

.btn-google {
    background: #fff;
    color: #222;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 0.9rem 1.4rem;
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.panel h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
}

.stack-form {
    display: grid;
    gap: 0.9rem;
}

.stack-form label,
.auth-form label {
    display: grid;
    gap: 0.35rem;
}

.stack-form em {
    font-style: normal;
    opacity: 0.7;
}

/* Feed */
.shot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.shot-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.shot-card:hover {
    transform: translateY(-3px);
    border-color: rgba(125, 203, 92, 0.35);
}

.shot-media {
    display: block;
    aspect-ratio: 16 / 10;
    background: #0a0f0c;
    overflow: hidden;
}

.shot-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shot-body {
    padding: 0.95rem 1rem 1.1rem;
    display: grid;
    gap: 0.45rem;
}

.shot-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dim-tag,
.world-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.dim-overworld {
    background: rgba(125, 203, 92, 0.16);
    color: var(--overworld);
}

.dim-nether {
    background: rgba(224, 106, 85, 0.16);
    color: var(--nether);
}

.dim-end {
    background: rgba(180, 140, 255, 0.16);
    color: var(--end);
}

.world-chip {
    background: var(--bg-soft);
    color: var(--text-muted);
}

.coords {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: #d7ecd0;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
}

.biome,
.shot-desc,
.shot-body time {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.shot-desc {
    color: var(--text);
}

/* Worlds */
.world-list {
    display: grid;
    gap: 1rem;
}

.world-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}

.world-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.world-head h3 {
    margin: 0 0 0.3rem;
}

.world-head p,
.muted,
.hint {
    color: var(--text-muted);
    margin: 0;
}

.world-stats {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ip-block h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.ip-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ip-list code,
.token-box code,
.code-hint code {
    font-family: var(--mono);
    font-size: 0.85rem;
}

.ip-list code {
    display: inline-block;
    padding: 0.3rem 0.55rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form input {
    flex: 1 1 220px;
}

/* Upload */
.dropzone {
    position: relative;
    border: 1.5px dashed rgba(125, 203, 92, 0.35);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.18);
    min-height: 180px;
    overflow: hidden;
}

.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone-inner {
    display: grid;
    place-content: center;
    gap: 0.35rem;
    min-height: 180px;
    text-align: center;
    color: var(--text-muted);
    pointer-events: none;
}

.upload-preview {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
}

.coord-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

/* Profile */
.kv {
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.kv > div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.75rem;
}

.kv dt {
    color: var(--text-muted);
    margin: 0;
}

.kv dd {
    margin: 0;
}

.token-box {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.token-box code {
    flex: 1 1 240px;
    word-break: break-all;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem;
}

.code-hint {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.code-hint h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

/* Auth */
.auth-card {
    width: min(420px, 100%);
    margin: 1rem auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 1.6rem;
    box-shadow: var(--shadow);
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-brand .logo-mark {
    display: inline-block;
    margin-bottom: 0.6rem;
}

.auth-brand h1 {
    margin: 0;
    font-size: 1.7rem;
}

.auth-brand p {
    margin: 0.4rem 0 0;
    color: var(--text-muted);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-bottom: 1rem;
    background: var(--bg);
    padding: 0.25rem;
    border-radius: 999px;
}

.auth-tabs a {
    text-align: center;
    padding: 0.55rem;
    border-radius: 999px;
    color: var(--text-muted);
}

.auth-tabs a.active {
    background: var(--bg-soft);
    color: var(--text);
}

.auth-form {
    display: grid;
    gap: 0.85rem;
}

.auth-divider {
    display: grid;
    place-items: center;
    margin: 1.1rem 0;
    color: var(--text-muted);
    position: relative;
}

.auth-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    position: relative;
    background: var(--bg-panel);
    padding: 0 0.6rem;
    font-size: 0.85rem;
}

/* Empty / flash / footer */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(26, 36, 28, 0.45);
}

.empty-state h2 {
    margin: 0 0 0.4rem;
}

.empty-state p {
    color: var(--text-muted);
    margin: 0 0 1.2rem;
}

.empty-actions {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.flash {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.flash-success {
    background: rgba(125, 203, 92, 0.12);
    border-color: rgba(125, 203, 92, 0.35);
}

.flash-error {
    background: rgba(224, 90, 79, 0.12);
    border-color: rgba(224, 90, 79, 0.35);
}

.flash-info {
    background: rgba(255, 255, 255, 0.04);
}

.main-footer {
    border-top: 1px solid var(--border);
    padding: 1.4rem 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-brand {
    font-weight: 600;
    color: var(--text);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-muted);
}

.legal p {
    color: var(--text-muted);
    line-height: 1.6;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.65; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

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

    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(14, 20, 16, 0.97);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem;
    }

    .nav-links.open {
        display: flex;
    }

    .coord-row,
    .kv > div {
        grid-template-columns: 1fr;
    }
}
