:root {
    --bg-1: #83d3ff;
    --bg-2: #ccecff;
    --bg-3: #b8e988;
    --grass: #6ec545;
    --panel: rgba(255, 250, 229, 0.95);
    --panel-2: rgba(255, 243, 202, 0.95);
    --line: #2e4567;
    --ink: #19314b;
    --soft-ink: #3a5475;
    --accent: #ff9b3e;
    --accent-deep: #e6761d;
    --ok: #177a46;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Baloo 2", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.76), transparent 26%),
        radial-gradient(circle at 90% 12%, rgba(255, 255, 255, 0.7), transparent 24%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    bottom: 0;
    height: 110px;
    background:
        radial-gradient(circle at 7% 120%, #5bad39 23%, transparent 25%),
        radial-gradient(circle at 20% 120%, #68b945 21%, transparent 23%),
        radial-gradient(circle at 37% 120%, #5cae3b 22%, transparent 24%),
        radial-gradient(circle at 52% 120%, #66ba45 23%, transparent 25%),
        radial-gradient(circle at 68% 120%, #5caf3c 22%, transparent 24%),
        radial-gradient(circle at 84% 120%, #67b947 23%, transparent 25%),
        linear-gradient(180deg, transparent 0%, var(--grass) 45%, #57a737 100%);
}

body::after {
    top: 24px;
    height: 42px;
    background:
        radial-gradient(circle at 12% 50%, rgba(255, 255, 255, 0.9) 0 26px, transparent 28px),
        radial-gradient(circle at 57% 50%, rgba(255, 255, 255, 0.86) 0 23px, transparent 25px),
        radial-gradient(circle at 87% 50%, rgba(255, 255, 255, 0.9) 0 20px, transparent 22px);
    animation: cloud-slide 16s linear infinite alternate;
}

.app-shell {
    width: min(1120px, calc(100% - 1.1rem));
    margin: 1rem auto 1.8rem;
    display: grid;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

h1,
h2,
h3,
p {
    margin: 0;
}

.panel {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 3px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 6px 0 #1f3350;
}

.hero {
    padding: 1.2rem;
    animation: rise 550ms ease-out;
}

.eyebrow {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #37679f;
    font-weight: 800;
}

h1 {
    margin-top: 0.2rem;
    font-family: "Luckiest Guy", cursive;
    font-size: clamp(2rem, 5.1vw, 3.1rem);
    letter-spacing: 0.03em;
    color: #1a3f6e;
    text-shadow: 2px 2px 0 #fdf4d4;
}

.hero>p {
    margin-top: 0.35rem;
    line-height: 1.32;
    max-width: 74ch;
    color: #27496f;
}

.feature-toys {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem;
}

.toy-card {
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid #3b577b;
    border-radius: 18px;
    padding: 0.56rem;
    display: grid;
    justify-items: center;
    gap: 0.33rem;
}

.toy-card p {
    font-size: 0.94rem;
    font-weight: 800;
    color: #2a496c;
}

.icon {
    width: 78px;
    height: 58px;
    position: relative;
}

.cow-icon {
    border: 3px solid #2f3442;
    border-radius: 16px;
    background: #fff;
}

.cow-icon::before,
.cow-icon::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: #3d4454;
}

.cow-icon::before {
    width: 16px;
    height: 12px;
    left: 8px;
    top: 10px;
}

.cow-icon::after {
    width: 14px;
    height: 10px;
    right: 4px;
    top: 35px;
}

.cow-icon .ear {
    position: absolute;
    top: -8px;
    width: 17px;
    height: 12px;
    border: 3px solid #2f3442;
    border-radius: 12px;
    background: #f8b6c9;
}

.cow-icon .ear.left {
    left: 6px;
}

.cow-icon .ear.right {
    right: 6px;
}

.cow-icon .eye {
    position: absolute;
    top: 22px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #222837;
}

.cow-icon .eye.left {
    left: 17px;
}

.cow-icon .eye.right {
    right: 17px;
}

.cow-icon .nose {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 8px;
    width: 31px;
    height: 16px;
    border: 3px solid #2f3442;
    border-radius: 10px;
    background: #ffadc1;
}

.wave-icon {
    overflow: hidden;
    border: 3px solid #2e4c70;
    border-radius: 14px;
    background: #2f95ff;
}

.wave-icon .wave {
    display: none;
}

.wave-icon .wave.one {
    bottom: 20px;
}

.wave-icon .wave.two {
    bottom: 6px;
}

.wave-icon .splash {
    display: none;
}

.church-icon {
    border: 3px solid #6a4532;
    border-radius: 7px;
    background: #ffe4b8;
}

.church-icon .roof {
    position: absolute;
    left: 0px;
    right: 0px;
    top: -20px;
    height: 0;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-bottom: 18px solid #db6642;
}

.church-icon .door {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 19px;
    height: 23px;
    border: 3px solid #633f2e;
    border-bottom: none;
    border-radius: 9px 9px 0 0;
    background: #9d5f40;
}

.church-icon .cross {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 5px;
    width: 4px;
    height: 15px;
    background: #6a4532;
}

.church-icon .cross::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 5px;
    width: 14px;
    height: 4px;
    background: #6a4532;
}

.main-grid {
    display: grid;
    gap: 1rem;
}

.register-panel,
.controls-panel,
.scoreboard-panel,
.events-panel {
    padding: 0.95rem;
    animation: rise 650ms ease-out;
}

h2 {
    font-family: "Luckiest Guy", cursive;
    font-weight: 400;
    font-size: 1.45rem;
    letter-spacing: 0.03em;
    color: #1b406d;
}

.row-form {
    margin-top: 0.7rem;
    display: grid;
    gap: 0.5rem;
}

.target-form {
    margin-top: 0.55rem;
}

.controls-subtitle {
    margin-top: 0.36rem;
    font-weight: 700;
    color: #2f5e93;
}

.player-actions {
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 0.65rem;
}

.player-action-card {
    border: 2px solid #3c5678;
    border-radius: 16px;
    padding: 0.6rem;
    display: grid;
    gap: 0.46rem;
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.8), transparent 36%),
        linear-gradient(180deg, #fff8e8, #eaf7ff);
}

.player-action-card h3 {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    color: #21466e;
    font-size: 1.04rem;
    font-family: "Luckiest Guy", cursive;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.avatar {
    width: 1.9rem;
    height: 1.9rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    border: 2px solid #3f5678;
    background: #fff5cf;
    font-size: 1.14rem;
}

.action-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
}

.avatar-line input {
    text-align: center;
    font-size: 1.15rem;
    letter-spacing: 0.05em;
}

.avatar-line button {
    border-color: #4c4a7b;
    background: linear-gradient(180deg, #d6d0ff, #b5adf7);
    color: #27234f;
}

.action-empty {
    margin: 0;
    border: 2px dashed #4a6690;
    border-radius: 14px;
    padding: 0.65rem;
    color: #2a4e76;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.76);
}

input,
select,
button {
    width: 100%;
    border-radius: 12px;
    border: 2px solid #3f5473;
    padding: 0.6rem 0.65rem;
    font: inherit;
    font-weight: 700;
    color: var(--ink);
    background: #fff;
}

button {
    border-width: 3px;
    border-color: #8d4518;
    color: #341603;
    cursor: pointer;
    background: linear-gradient(180deg, #ffb258, var(--accent));
    transition: transform 140ms ease, background 140ms ease;
}

button:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #ffab4c, var(--accent-deep));
}

button:active {
    transform: translateY(0);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
}

.church-button {
    background: linear-gradient(180deg, #ffd08f, #ffab58);
}

.secondary-button {
    margin-top: 0.55rem;
    border-color: #4f5566;
    background: linear-gradient(180deg, #ebedf6, #dbe1ef);
    color: #2a334a;
}

.hint {
    margin-top: 0.55rem;
    color: #27558a;
    font-weight: 700;
}

.scoreboard,
.event-log {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.52rem;
}

.scoreboard li {
    border: 2px solid #3b5272;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.58rem 0.68rem;
}

.scoreboard .name {
    font-weight: 800;
}

.scoreboard .points {
    margin-left: auto;
    color: var(--ok);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.rank-badge {
    min-width: 2.2rem;
    border: 2px solid #3b5272;
    border-radius: 999px;
    text-align: center;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 0.32rem 0.45rem;
    color: #26374f;
    background: #dde8fa;
    line-height: 1;
}

.rank-1 {
    background: #ffe281;
}

.rank-2 {
    background: #d8e5ef;
}

.rank-3 {
    background: #ffd2b0;
}

.event-log li {
    border: 2px solid #496896;
    border-radius: 12px;
    padding: 0.5rem 0.58rem;
    font-size: 0.95rem;
    line-height: 1.25;
    color: #254264;
    background: rgba(238, 250, 255, 0.86);
}

.event-log .empty {
    color: #4b5b70;
    background: rgba(255, 255, 255, 0.74);
}

.status {
    margin: 0;
    min-height: 1.2rem;
    border: 2px dashed #3f5d83;
    border-radius: 12px;
    padding: 0.35rem 0.7rem;
    font-weight: 700;
    color: #234366;
    background: rgba(255, 255, 255, 0.72);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cloud-slide {
    from {
        transform: translateX(-28px);
    }

    to {
        transform: translateX(20px);
    }
}

@media (min-width: 880px) {
    .main-grid {
        grid-template-columns: 1fr 1.35fr;
        grid-template-areas:
            "register controls"
            "scoreboard events";
    }

    .register-panel {
        grid-area: register;
    }

    .controls-panel {
        grid-area: controls;
    }

    .scoreboard-panel {
        grid-area: scoreboard;
    }

    .events-panel {
        grid-area: events;
    }
}

@media (min-width: 980px) {
    .row-form {
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 620px) {
    .app-shell {
        width: calc(100% - 0.9rem);
    }

    h1 {
        font-size: clamp(1.9rem, 9vw, 2.6rem);
    }

    .feature-toys {
        grid-template-columns: 1fr;
    }

    body::before {
        height: 90px;
    }
}