:root {
    --bg: #f3f1eb;
    --surface: #fbfaf7;
    --ink: #1e1c24;
    --muted: #6e6a78;
    --accent: #d45d8b;
    --border: #1e1c24;
    --shadow: #cfc9bc;
    --font-head: "Press Start 2P", monospace;
    --font-body: "Pixelify Sans", monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 24px 16px;
    overflow-x: hidden;

    /* Minimalist pixel grid background */
    background-color: var(--bg);
    background-image:
    linear-gradient(to right, rgba(30, 28, 36, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 28, 36, 0.05) 1px, transparent 1px);
    background-size: 16px 16px;

    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: none;
}

img {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ================= HEADER (Telegram) ================= */
.site-header {
    display: flex;
    justify-content: center;
}

.tg-link {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.1s steps(2, end);
}

.tg-link:hover {
    transform: translateY(-2px);
}

.tg-link:active {
    transform: translateY(1px);
}

.tg-img {
    display: block;
    max-height: 100px; /* adjust to fit your drawn Telegram image */
    width: auto;
    user-select: none;
    -webkit-user-drag: none;
}

/* ================= MIDDLE (OC) ================= */
.site-main {
    flex: 1;
    display: grid;
    place-items: center;
    width: 100%;
}

.oc-stage {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.oc-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.oc-img {
    display: block;
    width: 180px; /* adjust to fit your OC sprite size */
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.oc-button:hover .oc-img {
    transform: translateY(-2px);
}

.oc-img.is-jumping {
    animation: ocJump 0.52s steps(6, end);
}

@keyframes ocJump {
    0%   { transform: translateY(0); }
    20%  { transform: translateY(2px); }
    50%  { transform: translateY(-22px); }
    80%  { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

/* Flying stars */
.flying-star {
    position: absolute;
    left: 50%;
    top: 45%;
    width: 26px; /* adjust to fit star_1 / star_2 / star_3 */
    height: auto;
    pointer-events: none;
    z-index: 3;
    animation: starBurst 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes starBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform:
        translate(calc(-50% + var(--tx)), calc(-50% + var(--ty)))
        scale(var(--scale))
        rotate(var(--rot));
    }
}

/* ================= FOOTER (Webring) ================= */
.site-footer {
    width: 100%;
    display: flex;
    justify-content: center;
}

.webring {
    background: var(--surface);
    border: 2px solid var(--border);
    box-shadow: 4px 4px 0 var(--shadow);
    padding: 12px 18px;
    text-align: center;
}

.webring-title {
    font-family: var(--font-head);
    font-size: 9px;
    color: var(--muted);
    margin-bottom: 10px;
}

.webring-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pixel-btn {
    background: var(--bg);
    color: var(--ink);
    border: 2px solid var(--border);
    box-shadow: 2px 2px 0 var(--shadow);
    padding: 5px 9px;
    font-family: var(--font-head);
    font-size: 9px;
    cursor: pointer;
}

.pixel-btn:hover {
    background: var(--ink);
    color: var(--surface);
}

.pixel-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.ring-status {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--accent);
    min-height: 18px;
}

.ring-status:empty {
    display: none;
}
