/* Varb and BDP's Cobbleverse
   Theme: the whole page is a Poké Ball. Red header, ink seam with a button, light body. */

:root {
    --red: #dc3029;
    --red-deep: #b9251f;
    --ink: #1b2340;
    --white: #f7f5f0;
    --page: #eef1f8;
    --blue: #3a6fd8;
    --blue-deep: #2a54ad;
    --grass: #6bc45a;
    --grass-deep: #3f9a38;
    --ghost: #c3c8da;
    --muted: #4a5273;
    --screen: #14342f;
    --font-display: 'Pixelify Sans', 'Trebuchet MS', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --ball:
        radial-gradient(circle, #fff 0 20%, var(--ink) 21% 36%, transparent 37%),
        linear-gradient(var(--red) 0 42%, var(--ink) 42% 58%, #fff 58%);
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--page);
    color: var(--ink);
    font: 400 1.0625rem/1.65 var(--font-body);
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; }
a { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- Header: top half of the ball ---------- */

.ball-header {
    background: var(--red);
    padding: 32px 20px 46px;
    text-align: center;
}

.brand {
    display: inline-block;
    font: 700 clamp(2rem, 6.5vw, 3.6rem)/1.05 var(--font-display);
    color: #fff;
    text-decoration: none;
    text-wrap: balance;
    text-shadow:
        3px 0 var(--ink), -3px 0 var(--ink), 0 3px var(--ink), 0 -3px var(--ink),
        3px 3px var(--ink), -3px -3px var(--ink), 3px -3px var(--ink), -3px 3px var(--ink),
        0 6px var(--ink), 3px 6px var(--ink), -3px 6px var(--ink);
}
.brand:focus-visible { outline-color: #fff; }

.ball-header h1 {
    display: inline-block;
    margin: 22px 0 0;
    padding: 0.2em 1.1em;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--white);
    border: 3px solid var(--ink);
    border-radius: 999px;
    box-shadow: 0 4px 0 var(--ink);
}

/* ---------- Seam and centre button ---------- */

.ball-seam { position: relative; height: 16px; background: var(--ink); }

.ball-button {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--white);
    border: 7px solid var(--ink);
    box-shadow: inset 0 0 0 5px #dfe3ee;
    transform: translate(-50%, -50%);
    animation: wobble 1.2s ease-in-out 0.5s 1;
}

@keyframes wobble {
    0%, 100% { transform: translate(-50%, -50%) rotate(0); }
    15% { transform: translate(-50%, -50%) rotate(-24deg); }
    30% { transform: translate(-50%, -50%) rotate(20deg); }
    45% { transform: translate(-50%, -50%) rotate(-12deg); }
    60% { transform: translate(-50%, -50%) rotate(8deg); }
    75% { transform: translate(-50%, -50%) rotate(0); }
}

/* ---------- Layout ---------- */

.container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 64px 20px 56px;
    flex: 1;
}

.section {
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 20px;
    box-shadow: 0 6px 0 var(--ink);
    padding: 28px 30px;
    margin: 0 0 36px;
}

.section > h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 18px;
    font-size: 1.65rem;
}
.section > h2::before {
    content: "";
    flex: none;
    width: 1.1em;
    height: 1.1em;
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: var(--ball);
}

.prose { max-width: 720px; }
.prose p { margin: 0 0 16px; }
.prose h3 { margin: 30px 0 12px; font-size: 1.25rem; color: var(--blue-deep); }

.actions { margin-top: 28px; }
.help-text { margin: 14px 0 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Lists ---------- */

.ball-list { list-style: none; margin: 0 0 8px; padding: 0; }
.ball-list li { position: relative; margin: 0.45rem 0; padding-left: 1.9rem; }
.ball-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.4em;
    width: 1em;
    height: 1em;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--ball);
}

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; margin: 0.55rem 0; padding-left: 2.5rem; }
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font: 700 0.95rem/1.7rem var(--font-display);
    text-align: center;
}

.faq-item { padding: 22px 0; border-top: 2px dotted #b7bdd3; }
.faq-item:first-child { padding-top: 0; border-top: 0; }
.faq-item h3 { margin: 0 0 10px; font-size: 1.25rem; color: var(--blue-deep); }
.faq-item p { margin: 0 0 8px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    padding: 0.85rem 1.5rem;
    font: 700 1.1rem/1 var(--font-display);
    color: #fff;
    text-decoration: none;
    background: var(--blue);
    border: 3px solid var(--ink);
    border-radius: 14px;
    box-shadow: 0 5px 0 var(--ink);
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: 0 5px 0 var(--ink); }
.btn-primary { background: var(--blue); }
.btn-success { background: var(--red-deep); }
.btn-small { margin-top: 12px; padding: 0.55rem 1rem; font-size: 0.95rem; box-shadow: 0 4px 0 var(--ink); }

/* ---------- Whitelist form ---------- */

.whitelist-form { max-width: 460px; }
.form-group { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-weight: 800; }

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 10px;
}
input::placeholder { color: #6b7391; }

.output-section { margin-top: 28px; }
.output-section h3 { margin-bottom: 10px; font-size: 1.2rem; }
.output-content {
    min-height: 3rem;
    padding: 16px 18px;
    color: #b8f2c9;
    background: var(--screen);
    border: 3px solid var(--ink);
    border-radius: 12px;
    font: 0.95rem/1.55 ui-monospace, 'Cascadia Mono', Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}
.output-content.success { color: #b8f2c9; }
.output-content.error { color: #ffb9b3; }
.hidden { display: none !important; }

/* ---------- Players ---------- */

.player-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }

.player-column { overflow: hidden; background: #fff; border: 3px solid var(--ink); border-radius: 16px; }

.column-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 12px 18px;
    font-size: 1.25rem;
    border-bottom: 3px solid var(--ink);
}
.online .column-head { background: var(--grass); }
.offline .column-head { background: var(--ghost); }

.dot { flex: none; width: 0.9rem; height: 0.9rem; border: 3px solid var(--ink); border-radius: 50%; background: #fff; }
.offline .dot { background: transparent; }

.player-list { list-style: none; margin: 0; padding: 12px; }
.player-item {
    margin: 0 0 8px;
    background: #fff;
    border: 2px solid var(--ink);
    border-left-width: 8px;
    border-radius: 10px;
}
.online .player-item { border-left-color: var(--grass-deep); }
.offline .player-item { border-left-color: #8b90a8; }

.player-name {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s;
}
.player-name:hover { background: #f1f4fb; }
.player-name img { width: 28px; height: 28px; border-radius: 4px; image-rendering: pixelated; }

.player-skin { display: none; padding: 4px 14px 16px; text-align: center; }
.player-item.is-open .player-skin { display: block; }
.skin-img { max-width: 100px; image-rendering: pixelated; }
.skin-img:not([src]) { display: none; }
.skin-status, .message-status { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }
.message-status.is-ok { color: #1e6b1a; font-weight: 700; }
.message-status.is-error { color: #b3261e; font-weight: 700; }

.empty { margin: 0; padding: 18px; text-align: center; color: var(--muted); }
.summary { margin-top: 36px; text-align: center; color: var(--muted); }
.summary p { margin: 0 0 18px; }

.alert-error {
    margin-bottom: 28px;
    padding: 16px 20px;
    background: #fdecea;
    border: 3px solid #b3261e;
    border-radius: 14px;
}
.alert-error h3 { margin: 0 0 6px; color: #b3261e; }
.alert-error p { margin: 0; }

/* ---------- Footer: the grass ---------- */

.site-footer {
    padding: 22px 20px 20px;
    text-align: center;
    color: var(--ink);
    background: var(--grass);
    border-top: 3px solid var(--ink);
    box-shadow: inset 0 10px 0 var(--grass-deep);
}
.site-footer p { margin: 8px 0 0; font-weight: 800; }
.site-footer .fine-print { margin-top: 4px; font-size: 0.85rem; font-weight: 600; }

/* ---------- Small screens and motion ---------- */

@media (max-width: 720px) {
    .container { padding-top: 56px; }
    .section { padding: 22px 18px; }
    .player-columns { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .ball-button { animation: none; }
    .btn, .player-name { transition: none; }
}
