* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "DynaPuff", system-ui;

}

html,
body {
    height: 100%;
}

body {
    overflow: auto;
}

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

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 16px;
    z-index: 1000;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    color: #111;
    border: 2px solid #111;
    padding: .5rem .75rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 4px 4px 0 #111;
}

.icon-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: 8px; height: 36px; width: 36px; border: 2px solid #111; border-radius: 10px; background: #fff; box-shadow: 4px 4px 0 #111; cursor: pointer; }
.icon-btn img { height: 28px; width: auto; }

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.screen {
    position: static;
    width: 100%;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.home-hero h1 {
    font-size: clamp(1.6rem, 3.5vw, 3rem);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

/* home modern layout */
.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-align: center;
    padding: 0;
    width: 100%;
    max-width: 600px;
    margin-bottom: 1rem;
}

.brand .logo {
    font-size: 3rem;
    opacity: .9;
    margin-bottom: .5rem;
}

.home-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.home-hero p {
    opacity: .8;
    margin-top: .5rem;
}

.cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 500px;
}

.chip {
    display: inline-block;
    padding: 1rem 2rem;
    border: 2px solid #000000;
    border-radius: 10px;
    margin-right: .5rem;
    opacity: .95;
    color: #00AEE2;
    background: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    width: 100%;
    max-width: 500px;
}

.home-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 1rem 2rem;
    min-height: 100vh;
}

.home-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 600px;
}

.panel {
    background: #ffffff;
    border: 2px solid #111111;
    border-radius: 14px;
    padding: 1.25rem;
    max-width: 600px;
    width: 100%;
}

.panel h3 {
    margin-bottom: .75rem;
    opacity: .9;
}

.list .leaderboard-item,
.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem .75rem;
    margin-bottom: .5rem;
    background: #ffffff;
    border: 2px solid #111111;
    border-radius: 10px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.bullets {
    list-style: none;
    opacity: .9;
    display: grid;
    gap: .4rem;
}

.bullets {
    font-size: clamp(0.9rem, 1.8vw, 1rem);
}

.leaderboard-item {
    font-size: clamp(0.85rem, 1.6vw, 1rem);
}

.rank {
    font-weight: bold;
    min-width: 2rem;
}

.wallet {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
}

.earnings {
    font-weight: bold;
    color: #00AEE2;
}

.primary-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Neo-brutal button */
#connect-wallet {
    background: #b19cff;
    color: #fff;
    border: 2px solid #111111;
    box-shadow: 6px 6px 0 #111111;
    transform: translate(0, 0);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

#connect-wallet:hover {
    transform: translate(-1px, -1px);
    box-shadow: 7px 7px 0 #111111;
}

#connect-wallet:active {
    transform: translate(6px, 6px);
    box-shadow: 0 0 0 #111111;
}

.primary-btn,
.secondary-btn {
    background: #ffffff;
    border: 2px solid #111111;
    color: #111111;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-2px);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible {
    outline: 3px solid #00AEE2;
    outline-offset: 2px;
}

#player-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 2px solid #111111;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 500px;
}

/* Accent Join Game button */
#join-game {
    background: #00AEE2;
    color: #ffffff;
    border: 2px solid #111111;
    box-shadow: 6px 6px 0 #111111;
    transform: translate(0, 0);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    width: 100%;
    max-width: 500px;
}
#join-game:hover { transform: translate(-1px, -1px); box-shadow: 7px 7px 0 #111111; }
#join-game:active { transform: translate(6px, 6px); box-shadow: 0 0 0 #111111; }

.lobby-status {
    text-align: center;
    margin: 2rem 0;
}

.player-count {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.waiting-message {
    font-size: 1.2rem;
    color: #0B3E48;
}

.players-alive {
    font-weight: 800;
    color: #0B3E48;
}

.modal {
    background: rgba(0, 0, 0, 0.7);
}

.loading {
    color: #0B3E48;
}

.lobby-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-item h3 {
    margin-bottom: 1rem;
    color: #4ade80;
}

.info-item p {
    margin-bottom: 0.5rem;
    text-align: left;
}

#game-screen {
    background: transparent;
}

.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

.ui-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.items {
    display: flex;
    gap: 1rem;
}

.item {
    height: 28px;
    opacity: .5;
    filter: grayscale(1) contrast(1.2);
    image-rendering: pixelated;
}

.item.active {
    opacity: 1;
    animation: bob 1.2s ease-in-out infinite;
    filter: none;
}

@keyframes bob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

#game-canvas {
    width: 100%;
    height: 100vh;
    display: block;
    background: repeating-linear-gradient(0deg, #fff, #fff 6px, #f0f0f0 6px, #f0f0f0 12px);
    cursor: crosshair;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    border: 2px solid #111111;
    max-width: 400px;
    color: #111111;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.inline-icon { height:28px; vertical-align: -3px; margin-right: 6px;}

.modal-content h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.modal-content p {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    opacity: 0.9;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: left;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #111;
    transition: transform 0.1s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    transform: scale(1.02);
    transition: transform 0.1s ease;
}

.social-link:active {
    transform: translateY(0);
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.separator {
    color: #111;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 !important;
}

.socials {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-decoration: none;
    color: #111;
    width: 100%;

}



.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0.7;
}

.primary-btn img {
    height: 20px;
    width: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.wallet {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bullets {
    list-style: none;
    opacity: .9;
    display: grid;
    gap: .4rem;
    line-height: 1.25;
}

#home-screen {
    position: static;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.controls-card {
    width: min(560px, 92vw);
    margin: 0.75rem auto 1rem;
    background: #ffffff;
    border: 2px solid #111111;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.controls-card h3 {
    margin: 0 0 0.25rem 0;
}

.controls-card .bullets {
    gap: .25rem;
    line-height: 1.2;
}

.leaderboard-section {
    margin-top: 1rem;
    width: 100%;
}

/* Logo bob */
.brand .logo img {
    display: block;
    animation: logoBob 3s ease-in-out infinite;
}

@keyframes logoBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@media (min-width: 900px) {
    .home-wrap {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4rem;
        padding: 4.5rem 2rem 2rem;
    }

    .home-hero {
        max-width: 520px;
        margin-bottom: 0;
    }

    .home-panels {
        max-width: 420px;
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .home-wrap {
        padding: 1.5rem 1rem;
    }

    .home-hero {
        padding: 0;
    }

    .home-hero h1 {
        font-size: 2rem;
    }

    .home-panels {
        width: 100%;
        max-width: 500px;
    }

    .panel {
        padding: 1rem;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        padding: .9rem 1.2rem;
        font-size: 1rem;
    }

    .player-count {
        font-size: 2rem;
    }
}

@media (max-width: 1280px),
(max-height: 800px) {
    .players-alive {
        font-size: 1rem;
    }

    .game-ui {
        padding: .6rem;
    }

    .item {
        height: 24px;
    }

    .modal-content {
        padding: 1.75rem;
    }
}

/* Manifesto page tweaks */
.page-wrap {
    width: min(960px, 92vw);
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-large {
    height: clamp(48px, 8vw, 70px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    color: #111;
    border: 2px solid #111;
    padding: .5rem .75rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 4px 4px 0 #111;
}

.back-link img {
    height: 20px;
    width: 20px;
}

.manifesto-title {
    font-size: clamp(1.8rem, 6vw, 3rem);
    margin: 0;
}

.manifesto-sub {
    opacity: .8;
    margin-top: .25rem;
    line-height: 1.3;
}

.roadmap {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.rm-item {
    background: #fff;
    border: 2px solid #111;
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.rm-item h4 {
    margin: 0 0 .35rem 0;
    font-size: 1.05rem;
}

.rm-item p {
    margin: 0;
    line-height: 1.25;
}

.thesis {
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}

.thesis h1 {
    font-size: clamp(1.4rem, 4.5vw, 2rem);
    margin: 0;
}

.thesis h2 {
    font-size: clamp(1.1rem, 3.8vw, 1.4rem);
    margin: .4rem 0 .2rem;
}

.thesis p {
    line-height: 1.5;
    margin: .25rem 0;
}

.thesis ul {
    margin: .25rem 0 .5rem 1.2rem;
}

.thesis li {
    margin: .2rem 0;
}

.page-footer { margin-top: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; border-top: 2px solid #111; padding-top: 1rem; }
.footer-link { text-decoration: none; color: #111; border: 2px solid #111; padding: .35rem .6rem; border-radius: 10px; background: #fff; box-shadow: 3px 3px 0 #111; }
.footer-copy { opacity: .8; }

@media (min-width: 1000px) {
    .roadmap {
        grid-template-columns: 1fr 1fr;
    }
}