:root {
    --celeste: #579c9f;
    --azul: #142b4d;
    --celeste-claro: #bae0d5;
    --blanco: #ffffff;
    --sombra: rgba(20, 43, 77, .22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    min-height: 100vh;
    padding: 28px 18px 0;
    color: var(--azul);
    background:
        radial-gradient(circle at 8% 14%, rgba(186, 224, 213, .35) 0 90px, transparent 91px),
        radial-gradient(circle at 94% 28%, rgba(186, 224, 213, .28) 0 130px, transparent 131px),
        linear-gradient(180deg, var(--celeste) 0%, #4e9295 100%);
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -1;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 2px solid rgba(186, 224, 213, .18);
    pointer-events: none;
}

body::before { left: -80px; bottom: 12%; }
body::after { right: -70px; top: 48%; }

main {
    width: min(100%, 1180px);
    margin: 0 auto;
}

.hero {
    position: relative;
    margin: -28px calc(50% - 50vw) 0;
    padding: clamp(25px, 3.5vw, 72px) clamp(18px, 3vw, 60px) clamp(18px, 1.6vw, 32px);
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(110deg, #39a8a4 0%, #008c8c 47%, #078789 100%);
}

.hero::before {
    content: '';
    position: absolute;
    z-index: -1;
    width: 105%;
    height: 180%;
    top: -130%;
    left: -48%;
    border-radius: 50%;
    background: rgba(10, 107, 123, .28);
}

.hero::after {
    content: '';
    position: absolute;
    z-index: -1;
    top: -10%;
    right: -4%;
    width: 25%;
    height: 112%;
    transform: rotate(12deg);
    background-image: linear-gradient(#123359 2px, transparent 2px), linear-gradient(90deg, #123359 2px, transparent 2px);
    background-size: 74px 74px;
    opacity: .8;
}

.site-logo {
    position: absolute;
    z-index: 1;
    top: clamp(12px, 2vw, 32px);
    right: clamp(12px, 2vw, 32px);
    width: clamp(90px, 10vw, 150px);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
    background: #282828;
}

.site-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: translate(3.3%, -2.6%);
}

.site-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 6px solid #282828;
    border-radius: 50%;
    pointer-events: none;
}

.hero-inner {
    width: min(100%, 1800px);
    margin: 0 auto;
}

.hero-title {
    width: fit-content;
    margin: 0 0 clamp(22px, 2.6vw, 52px) 15%;
    color: #fff;
}

.hero-eyebrow {
    display: block;
    font: 800 clamp(1.8rem, 3.4vw, 4.4rem)/1 'Roboto Slab', Georgia, serif;
}

.hero-wordmark {
    display: flex;
    align-items: flex-end;
    gap: clamp(8px, 1vw, 22px);
}

.hero-soft {
    font: clamp(5rem, 10vw, 13rem)/.87 'Anton', Impact, sans-serif;
    letter-spacing: -.03em;
}

.hero-robot-lockup {
    display: flex;
    flex-direction: column;
    gap: clamp(5px, .6vw, 12px);
    padding-bottom: .1em;
}

.hero-robot {
    display: flex;
    font: 800 clamp(2.6rem, 5vw, 6.3rem)/1 'Roboto Slab', Georgia, serif;
    letter-spacing: .02em;
}

.hero-robot span {
    display: grid;
    place-items: center;
    width: clamp(42px, 4.5vw, 92px);
    height: clamp(48px, 5vw, 102px);
    color: #fff;
    background: #0a2b4f;
}

.hero-robot span:nth-child(even) {
    color: #0a2b4f;
    background: #fff;
}

.hero-challenge {
    padding: 2px 8px;
    color: #0a2b4f;
    background: #b6efe4;
    font: 800 clamp(1rem, 1.8vw, 2.3rem)/1.15 'Roboto Slab', Georgia, serif;
    text-align: center;
    white-space: nowrap;
}

.hero-mission {
    display: grid;
    width: min(100%, 1180px);
    margin-inline: auto;
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    gap: clamp(12px, 2.5vw, 50px);
    padding: clamp(16px, 1.5vw, 30px);
    border-radius: 20px;
    background: #d0f6e9;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}

.hero-mission:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(20, 43, 77, .18);
}

.hero-mission:focus-visible {
    outline: 3px solid #0a2b4f;
    outline-offset: 4px;
}

.hero-mission p {
    margin: 0;
    color: #35393b;
    font: 700 clamp(1.1rem, 1.7vw, 2.2rem)/1.17 'Barlow Condensed', sans-serif;
}

.mission-factors {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(6px, 1vw, 20px);
}

.mission-factor {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    text-align: center;
    color: #35393b;
    font: 700 clamp(.8rem, 1.3vw, 1.65rem)/1.05 'Barlow Condensed', sans-serif;
}

.mission-factor img {
    width: auto;
    height: clamp(42px, 4.1vw, 84px);
    max-width: 100%;
    object-fit: contain;
}

.game-stage {
    position: relative;
    padding: 55px 0 75px;
}

.game-panel {
    position: relative;
    z-index: 2;
    width: min(100%, 900px);
    margin: 0 auto;
    padding: 34px;
    background: rgba(186, 224, 213, .96);
    border: 3px solid rgba(20, 43, 77, .1);
    border-radius: 34px;
    box-shadow: 0 24px 55px var(--sombra);
}

.game-heading {
    margin-bottom: 22px;
    text-align: center;
}

.game-heading h2 {
    margin: 12px 0 2px;
    color: var(--azul);
    font-size: clamp(2rem, 5vw, 3.1rem);
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
}

.game-heading p {
    margin: 9px 0 0;
    color: rgba(20, 43, 77, .78);
    font-weight: 700;
}

.camera-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 260px;
    background: #0c1d35;
    border: 5px solid var(--azul);
    border-radius: 24px;
    box-shadow: 0 12px 0 rgba(20, 43, 77, .12);
}

#camera-stream { display: none; }

#output-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #0c1d35;
}

#trail-canvas {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.camera-status,
.camera-hint {
    position: absolute;
    z-index: 2;
    left: 14px;
    padding: 8px 12px;
    border: 2px solid rgba(186, 224, 213, .55);
    border-radius: 999px;
    color: var(--celeste-claro);
    background: rgba(20, 43, 77, .9);
    backdrop-filter: blur(6px);
    font-weight: 900;
}

.camera-status { top: 12px; font-size: .78rem; }
.camera-hint { bottom: 12px; font-size: .82rem; }
.camera-hint strong { color: var(--celeste-claro); }

.status-light {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 5px;
    background: var(--celeste-claro);
    border-radius: 50%;
    box-shadow: 0 0 9px rgba(186, 224, 213, .8);
}

.controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 22px 0 20px;
}

button {
    padding: 14px 25px;
    border: 3px solid var(--azul);
    border-radius: 999px;
    color: var(--celeste-claro);
    background: var(--azul);
    box-shadow: 0 7px 0 rgba(20, 43, 77, .18);
    font: 900 1rem 'Nunito', sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
}

button:hover {
    background: #1c3a63;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(5px);
    box-shadow: 0 2px 0 rgba(20, 43, 77, .18);
}

#info-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.info-card {
    min-width: 0;
    padding: 17px;
    background: rgba(255, 255, 255, .38);
    border: 2px solid rgba(20, 43, 77, .14);
    border-radius: 17px;
}

.tag-card {
    border-color: rgba(20, 43, 77, .28);
    box-shadow: inset 5px 0 0 var(--celeste);
}

.info-card h2 {
    margin: 0 0 8px;
    color: var(--azul);
    font-size: 1rem;
    text-transform: uppercase;
}

pre {
    margin: 0;
    color: rgba(20, 43, 77, .85);
    font: 700 .82rem 'Nunito', sans-serif;
    white-space: pre-wrap;
    overflow-x: auto;
}

.decor-robot {
    position: absolute;
    z-index: 1;
    width: 185px;
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 14px 12px rgba(20, 43, 77, .16));
}

.robot-top-left {
    top: -2px;
    left: -18px;
    transform: rotate(-13deg);
}

.robot-top-right {
    top: -6px;
    right: -20px;
    transform: scaleX(-1) rotate(-12deg);
}

.robot-bottom-left {
    bottom: -5px;
    left: 2%;
    width: 150px;
    transform: rotate(13deg);
}

.robot-bottom-right {
    right: 3%;
    bottom: -2px;
    width: 155px;
    transform: scaleX(-1) rotate(11deg);
}

.robot-bottom-center {
    width: 125px;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%) rotate(7deg);
}

.sponsors {
    margin: 10px calc(50% - 50vw) 0;
    padding: 34px 0 0;
    background: var(--celeste-claro);
    border-radius: 36px 36px 0 0;
    overflow: hidden;
    box-shadow: 0 -12px 30px rgba(20, 43, 77, .1);
}

.sponsors p {
    margin: 0;
    padding: 16px 18px;
    text-align: center;
    font-weight: 800;
    white-space: nowrap;
    overflow-x: auto;
}

.sponsors img {
    display: block;
    width: 100%;
    height: auto;
}

.mission-modal {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(20, 43, 77, .78);
    backdrop-filter: blur(8px);
}

.mission-modal[hidden] { display: none; }

.mission-modal-card {
    width: min(100%, 470px);
    padding: 34px 22px;
    text-align: center;
    color: var(--azul);
    background: var(--celeste-claro);
    border: 4px solid var(--azul);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(20, 43, 77, .3);
    animation: mission-pop .45s cubic-bezier(.2, 1.4, .5, 1);
}

.mission-modal-card h2 {
    margin: 12px 0 6px;
    color: var(--azul);
    font-size: clamp(1.8rem, 7vw, 2.6rem);
}

.mission-modal-card p {
    margin: 0 0 24px;
    font-size: 1.15rem;
    font-weight: 900;
}

.celebration { font-size: clamp(2rem, 10vw, 3.4rem); }

@keyframes mission-pop {
    from { opacity: 0; transform: scale(.65) rotate(-3deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@media (max-width: 900px) {
    .hero-title { margin-left: 5%; }
    .hero-mission { grid-template-columns: 1fr; }
    .decor-robot { width: 145px; }
    .robot-bottom-left,
    .robot-bottom-right { width: 120px; }
}

@media (max-width: 620px) {
    body { padding: 10px 10px 0; }

    .hero { margin-top: -10px; }
    .site-logo { top: 8px; right: 8px; width: 64px; }
    .hero-title { margin: 0 auto 24px; }
    .hero-wordmark { flex-direction: column; align-items: center; }
    .hero-eyebrow { text-align: center; }
    .hero-soft { font-size: clamp(5rem, 21vw, 8rem); }
    .hero-robot { font-size: clamp(2.6rem, 10vw, 4rem); }
    .hero-robot span { width: clamp(42px, 10vw, 64px); height: clamp(48px, 11vw, 70px); }
    .hero-challenge { font-size: clamp(.9rem, 3.4vw, 1.3rem); }
    .hero-mission p { font-size: 1.3rem; }
    .mission-factor { font-size: .9rem; }

    .game-stage { padding: 36px 0 55px; }

    .game-panel {
        padding: 22px 15px;
        border-radius: 25px;
    }

    .game-heading { margin-bottom: 17px; }
    .game-heading p { font-size: .9rem; }

    .decor-robot { width: 100px; }
    .robot-top-left { left: -28px; top: 2px; }
    .robot-top-right { right: -30px; top: 3px; }
    .robot-bottom-left,
    .robot-bottom-right,
    .robot-bottom-center { display: none; }

    #info-panel { grid-template-columns: 1fr; }
    .camera-data-card { display: none; }

    .sponsors {
        margin-top: 5px;
        padding-top: 20px;
        border-radius: 25px 25px 0 0;
    }
}
