/* Page chrome after foddy.net: grey desk, white sheet, red masthead, the game dead centre. */
* { box-sizing: border-box; }

body {
    margin: 0;
    background: #dcdcdc;
    color: #222;
    font: 13px/1.55 Verdana, Geneva, "DejaVu Sans", sans-serif;
}

main {
    max-width: 1172px;
    margin: 0 auto 40px;
    background: #fff;
    box-shadow: 0 0 22px rgba(0, 0, 0, 0.45);
}

.sitebar {
    padding: 8px 12px 7px;
    background: #e0382c;
    border-top: 4px solid #3a3232;
    border-bottom: 4px solid #3a3232;
    font-weight: bold;
    letter-spacing: 0.08em;
}

.sitebar a { color: #fff; text-decoration: none; }

h1 {
    margin: 8px 0 14px;
    font-size: 14px;
    letter-spacing: 0.16em;
    text-align: center;
}

.canvas-wrap {
    position: relative;
    width: min(800px, 100%);
    margin: 0 auto;
    background: #111;
}

canvas {
    display: block;
    width: 100%;
    aspect-ratio: 8 / 5;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* The result card: cream plaque with a medal ribbon, like the original's. */
#banner {
    position: absolute;
    left: 50%;
    top: 47%;
    transform: translate(-50%, -50%);
    min-width: 46%;
    padding: 16px 28px 16px 84px;
    border: 3px solid #8e8a80;
    border-radius: 10px;
    background: linear-gradient(#fbf8f0, #ddd8cb);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
    color: #1b1a17;
    font-family: "Mundo Sans Std", "Gill Sans", "Gill Sans MT", "Trebuchet MS", sans-serif;
    text-align: left;
    cursor: pointer;
}

.banner-ribbon {
    position: absolute;
    left: 24px;
    top: -3px;
    width: 34px;
    height: 46px;
    background: linear-gradient(90deg, #c8281e 0 33%, #f4f1e8 33% 66%, #2a62c9 66%);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

#banner::before {
    content: "";
    position: absolute;
    left: 25px;
    top: 34px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3b8, #d9a520 55%, #8f6a10);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.banner-title {
    display: block;
    font-size: clamp(17px, 3.4vw, 26px);
    font-weight: bold;
}

.banner-sub {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: #55524a;
}

.banner-sub:empty { display: none; }

#key-hint {
    margin: 8px 0 0;
    font-size: 11px;
    text-align: center;
    color: #777;
}

.lede {
    max-width: 800px;
    margin: 22px auto 0;
    padding: 0 16px;
}

.brains {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 800px;
    margin: 18px auto 0;
    padding: 0 16px;
}

.brain {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 9px 9px 8px;
    border: 1px solid #c4c4c4;
    border-radius: 5px;
    background: linear-gradient(#fafafa, #e9e9e9);
    color: #222;
    text-align: left;
    font: inherit;
    font-size: 11px;
    line-height: 1.4;
    cursor: pointer;
}

.brain:hover { border-color: #888; }

.brain[aria-pressed="true"] {
    border-color: #3a3232;
    background: #fff;
    box-shadow: 0 0 0 2px #e0382c;
}

.brain i {
    width: 100%;
    height: 5px;
    border-radius: 2px;
}

.brain b {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brain-desc { flex: 1; color: #555; }

.brain-stat {
    padding-top: 5px;
    border-top: 1px solid #d0d0d0;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 800px;
    margin: 12px auto 0;
    padding: 0 16px;
    font-size: 11px;
    color: #666;
    cursor: pointer;
}

.toggle input { accent-color: #e0382c; }

.notes {
    max-width: 800px;
    margin: 26px auto 0;
    padding: 0 16px 26px;
}

.notes h2 {
    margin: 0 0 6px;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.notes p { margin: 0 0 10px; color: #444; }

a { color: #c8281e; }

footer {
    padding: 10px 12px;
    background: #dcdcdc;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-align: center;
    color: #777;
}

footer a { color: #444; text-decoration: none; }

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