/* ---------- night palette (same Mario look as kokogecko.dev, after dark) ---------- */
:root {
    --sky-top: #0a0e2a;
    --sky-bottom: #26357e;
    --panel: #1a2050;
    --ink: #05061a;            /* the dark outlines */
    --text: #e8ebff;
    --dim: #9aa3d6;
    --moon: #fff3b0;
    --yellow: #ffd23f;
    --red: #e63b43;
    --blue: #2f6fe0;
    --green: #5ce65c;          /* brighter green so it pops on dark */
    --sell: #ff6b6b;
    --brick: #7a2e0a;          /* darker brick for night */
    --grass: #2a7a30;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Nunito", system-ui, sans-serif;
    color: var(--text);
    background: var(--brick);
}

.sky {
    position: relative;
    min-height: calc(100vh - 48px);
    background: linear-gradient(var(--sky-top), var(--sky-bottom));
    padding: 0 16px 60px;
    overflow: hidden;
}

.ground {
    position: relative;
    height: 48px;
    border-top: 10px solid var(--grass);
    background:
        repeating-linear-gradient(90deg, transparent 0 46px, var(--ink) 46px 48px),
        repeating-linear-gradient(0deg, transparent 0 22px, var(--ink) 22px 24px),
        var(--brick);
}

/* everything real sits ABOVE the decorations */
main, nav { position: relative; z-index: 2; }

/* ---------- stars ---------- */
.stars { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.stars i {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    background: #fff;
    opacity: .85;
    animation: twinkle 2.6s ease-in-out var(--delay) infinite;
}
@keyframes twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .15; } }

/* ---------- moon (a circle + two craters) ---------- */
.moon {
    position: absolute;
    z-index: 0;
    top: 70px;
    right: 9%;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--moon);
    border: 4px solid #e8d77a;
    box-shadow: 0 0 40px 12px rgba(255, 243, 176, .35);
}
.moon::before, .moon::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: #e8d77a;
}
.moon::before { width: 16px; height: 16px; top: 14px; left: 14px; }
.moon::after  { width: 10px; height: 10px; bottom: 14px; right: 16px; }

/* ---------- dark drifting clouds ---------- */
.cloud {
    position: absolute;
    z-index: 0;
    background: rgba(150, 160, 230, .22);
    border-radius: 999px;
    animation: drift 14s ease-in-out infinite alternate;
}
.cloud::before, .cloud::after {
    content: "";
    position: absolute;
    background: rgba(150, 160, 230, .22);
    border-radius: 50%;
}
.cloud::before { width: 50%; height: 140%; left: 15%; bottom: 30%; }
.cloud::after  { width: 35%; height: 110%; right: 15%; bottom: 35%; }
.c1 { width: 120px; height: 36px; top: 110px; left: 6%; }
.c2 { width: 160px; height: 46px; top: 260px; right: 10%; animation-duration: 19s; animation-direction: alternate-reverse; }
.c3 { width: 90px;  height: 28px; top: 430px; left: 62%; animation-duration: 23s; }
@keyframes drift { from { transform: translateX(-24px); } to { transform: translateX(24px); } }

/* ---------- boxes + pixel text ---------- */
.box {
    background: var(--panel);
    border: 4px solid var(--ink);
    border-radius: 12px;
    box-shadow: 6px 6px 0 var(--ink);
}
.pixel-title, .badge, .btn, .topbar, label, th, .group {
    font-family: "Press Start 2P", monospace;
}

/* ---------- login ---------- */
.login-wrap { max-width: 380px; margin: 0 auto; padding-top: 10vh; text-align: center; }
.badge {
    display: inline-block;
    background: var(--ink);
    color: var(--yellow);
    font-size: .6rem;
    padding: 8px 12px;
    margin: 0;
}
.pixel-title {
    font-size: clamp(2.2rem, 12vw, 3.6rem);
    line-height: 1.25;
    color: #fff;
    margin: 16px 0 28px;
    text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--ink);
}
.login-box { padding: 24px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
label { font-size: .6rem; margin-top: 8px; color: var(--yellow); }
input {
    font: inherit;
    font-size: 1rem;
    padding: 10px 12px;
    color: var(--text);
    background: #0d1236;
    border: 3px solid var(--ink);
    border-radius: 8px;
    outline: none;
}
input:focus { border-color: var(--yellow); }
.error { color: var(--sell); font-weight: 800; margin: 6px 0 0; }

.btn {
    display: inline-block;
    margin-top: 16px;
    padding: 14px 18px;
    font-size: .75rem;
    color: #fff;
    background: var(--red);
    border: 4px solid var(--ink);
    border-radius: 8px;
    box-shadow: 4px 4px 0 var(--ink);
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translate(4px, 4px); box-shadow: none; }
.btn.go { background: var(--blue); }

/* ---------- dashboard ---------- */
.topbar {
    max-width: 820px;
    margin: 0 auto;
    padding: 18px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .65rem;
    color: #fff;
    text-shadow: 2px 2px 0 var(--ink);
}
.topbar .logo { color: var(--yellow); font-size: .85rem; }
.topbar a { color: #fff; }

.dash { max-width: 820px; margin: 0 auto; }

.panel { padding: 16px 16px 8px; margin: 0 0 26px; border-top-width: 12px; }
.group { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; }
.panel:has(.group.hold)  { border-top-color: var(--green); }   /* Hold  = green  */
.panel:has(.group.swing) { border-top-color: var(--yellow); }  /* Swing = yellow */
.panel:has(.group.watch) { border-top-color: #6b8cff; }        /* Watch = blue   */

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    padding: 10px 8px;
    font-size: .5rem;
    color: var(--dim);
    border-bottom: 3px solid var(--ink);
}
td {
    padding: 10px 8px;
    border-bottom: 1px dashed #3a4585;
    font-weight: 800;
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
td.tick { font-family: "Press Start 2P", monospace; font-size: .7rem; color: #fff; }

.buy  { color: var(--green); }
.sell { color: var(--sell); }
.hold { color: var(--dim); }
.group.hold, .group.swing, .group.watch { color: #fff; }   /* the group name keeps its colour class; text is white */

.updated {
    text-align: center;
    color: var(--dim);
    font-weight: 800;
    font-size: .9rem;
    margin: 20px 0 0;
}
.center { text-align: center; }

/* ---------- the gecko running along the grass ---------- */
.lane {
    position: absolute;
    left: 0; right: 0;
    bottom: calc(100% + 6px);
    height: 80px;
    overflow: hidden;
    pointer-events: none;
}
.walker { position: absolute; bottom: 0; left: 0; animation: walk 22s linear infinite; }
.gecko  { display: block; width: 84px; image-rendering: pixelated; animation: bob .5s steps(2) infinite; }
@keyframes walk { from { transform: translateX(-120px); } to { transform: translateX(100vw); } }
@keyframes bob  { from { transform: translateY(0); } to { transform: translateY(-4px); } }

/* ---------- pop-in ---------- */
.dash > * { animation: pop .45s ease-out backwards; }
.dash > :nth-child(2) { animation-delay: .08s; }
.dash > :nth-child(3) { animation-delay: .16s; }
.dash > :nth-child(4) { animation-delay: .24s; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* phones: hide the two average columns so the signal stays visible */
@media (max-width: 560px) {
    .opt { display: none; }
    .moon { width: 52px; height: 52px; right: 6%; top: 76px; }
    td.tick { font-size: .6rem; }
    td.sig { white-space: normal; font-size: .85rem; line-height: 1.25; }   /* signal text may wrap on a phone */
    th, td { padding-left: 6px; padding-right: 6px; }
}

/* anyone who asked their phone for less motion gets none */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
