:root {
    --blue: #1400d8;
    --blue-deep: #0d0099;
    --blue-light: #3b2bff;
    --lime: #ccff00;
    --pink: #ff4fd8;
    --white: #ffffff;
    --ink: #0d0099;
    --line: rgba(255, 255, 255, 0.45);
    --radius: 28px;
    --font: "Gilroy", system-ui, sans-serif;
}

@font-face {
    font-family: Gilroy;
    src: url("/gilroy-bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font);
    color: var(--white);
    text-align: center;
    background: var(--blue);
    overflow-x: hidden;
    position: relative;
}

a { color: var(--lime); }

.bg-blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-blobs i {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    animation: blob 14s ease-in-out infinite alternate;
}
.bg-blobs i:nth-child(1) { width: 380px; height: 380px; background: #7a5cff; top: -90px; left: -80px; }
.bg-blobs i:nth-child(2) { width: 320px; height: 320px; background: var(--pink); bottom: 8%; right: -90px; animation-delay: -5s; opacity: 0.35; }
.bg-blobs i:nth-child(3) { width: 260px; height: 260px; background: var(--lime); top: 48%; left: -110px; animation-delay: -9s; opacity: 0.18; }

@keyframes blob {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 40px) scale(1.2); }
}

.topbar, .wrap, .site-footer { position: relative; z-index: 1; }

.topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(20, 0, 216, 0.7);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { justify-self: start; text-decoration: none; }
.brand img { display: block; height: clamp(26px, 5vw, 36px); width: auto; max-width: min(190px, 46vw); }

.school-logo {
    justify-self: center;
    height: clamp(48px, 11vw, 66px);
    width: auto;
    animation: wobble 5s ease-in-out infinite;
}

@keyframes wobble {
    0%, 100% { transform: rotate(-4deg); }
    50% { transform: rotate(4deg) scale(1.05); }
}

.topbar-actions { justify-self: end; display: flex; flex-direction: row; align-items: center; gap: 6px; flex-wrap: nowrap; flex-shrink: 0; }
.topbar-actions .btn-sm { padding: 6px 10px; font-size: 10px; white-space: nowrap; }
.topbar-actions .chip { font-size: 12px; padding: 6px 10px; max-width: none; overflow: visible; }
@media (max-width: 480px) {
    .topbar { padding-left: 12px; padding-right: 12px; gap: 6px; }
    .brand img { height: 22px; }
    .school-logo { height: 44px; }
}

.btn-sm { width: auto; margin-top: 0; padding: 8px 14px; font-size: 13px; }

.chip {
    white-space: nowrap;
    font-size: 13px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--lime);
    color: var(--ink);
}

.wrap { max-width: 900px; margin: 0 auto; padding: 36px 16px 24px; }

.hero { margin-bottom: 28px; animation: rise 0.7s ease both; }

@keyframes rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

.eyebrow {
    display: inline-block;
    margin: 0 0 18px;
    padding: 8px 16px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(40px, 11vw, 84px);
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.h1-it {
    display: inline-block;
    padding: 0 0.22em;
    border-radius: 0.25em;
    background: var(--lime);
    color: var(--ink);
    transform: rotate(-3deg);
    animation: pop 2.8s ease-in-out infinite;
}

@keyframes pop {
    0%, 100% { transform: rotate(-3deg) scale(1); }
    50% { transform: rotate(2deg) scale(1.08); }
}

.lead {
    margin: 0 auto 22px;
    max-width: 34em;
    font-size: clamp(16px, 3.6vw, 20px);
    line-height: 1.5;
    font-weight: 400;
    opacity: 0.95;
}

.stickers { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; }

.sticker {
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 15px;
    text-transform: uppercase;
    animation: float 3.4s ease-in-out infinite;
}
.sticker--lime { background: var(--lime); color: var(--ink); }
.sticker--white { background: var(--white); color: var(--ink); animation-delay: -1.1s; }
.sticker--pink { background: var(--pink); color: #fff; animation-delay: -2.2s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-9px) rotate(2deg); }
}

.hero-vk { margin: 0; font-size: 14px; font-weight: 400; }
.hero-vk a { text-decoration: none; border-bottom: 1px solid rgba(204, 255, 0, 0.5); }

.marquee {
    margin: 0 -16px 30px;
    padding: 14px 0;
    background: var(--lime);
    color: var(--ink);
    overflow: hidden;
    transform: rotate(-1.4deg);
    white-space: nowrap;
}

.marquee-track { display: inline-flex; gap: 28px; font-size: 22px; text-transform: uppercase; animation: marquee 22s linear infinite; }

@keyframes marquee {
    to { transform: translateX(-50%); }
}

.topics { margin: 0 0 34px; }

.topic-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.topic-list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 120px;
    padding: 18px 12px;
    border-radius: 24px;
    border: 1.5px solid var(--line);
    transition: transform 0.25s;
    animation: float 4.2s ease-in-out infinite;
}
.topic-list li:nth-child(2) { animation-delay: -1s; }
.topic-list li:nth-child(3) { animation-delay: -2s; }
.topic-list li:nth-child(4) { animation-delay: -3s; }
.topic-list li:hover { transform: scale(1.05) rotate(-1.5deg); }
.topic-list b { font-size: 14px; opacity: 0.6; }
.topic-list span { font-size: clamp(18px, 4.6vw, 26px); text-transform: uppercase; line-height: 1.1; }
.tp-lime { background: var(--lime); color: var(--ink); border-color: var(--lime) !important; }
.tp-white { background: var(--white); color: var(--ink); border-color: var(--white) !important; }
.tp-pink { background: var(--pink); color: #fff; border-color: var(--pink) !important; }
.tp-line {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.qr-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 22px;
    max-width: 560px;
    margin: 0 auto 34px;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 14px 0 var(--blue-deep), 0 24px 50px rgba(0, 0, 40, 0.35);
}
.qr-img { width: 170px; height: 170px; border-radius: 12px; animation: pulse 3s ease-in-out infinite; }
.qr-text { flex: 1 1 200px; }
.qr-text h2 { margin: 0 0 8px; font-size: 24px; text-transform: uppercase; }
.qr-text p { margin: 0; font-size: 15px; font-weight: 400; line-height: 1.5; }
.qr-text a { color: var(--blue); }

.publish-box { margin-top: 18px; padding-top: 16px; border-top: 2px dashed #d9d4ff; }
.btn-publish { margin-top: 12px; background: var(--pink); color: #fff; box-shadow: 0 5px 0 #b3239a; animation: pulse 1.8s ease-in-out infinite; }
.btn-publish:hover { box-shadow: 0 7px 0 #b3239a; }
.btn-publish:disabled { animation: none; }

.tech-block { margin: 0 0 32px; }

.tech-title {
    margin: 0 0 18px;
    font-size: clamp(24px, 6vw, 36px);
    text-transform: uppercase;
}

.tech-scroller {
    margin: 0 -16px;
    overflow: hidden;
    padding: 6px 0 12px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.tech-track {
    display: flex;
    width: max-content;
    animation: tech-scroll 50s linear infinite;
}

.tech-scroller:hover .tech-track { animation-play-state: paused; }

@keyframes tech-scroll {
    to { transform: translateX(-50%); }
}

.tech-list {
    list-style: none;
    margin: 0;
    padding: 0 6px;
    display: flex;
    gap: 12px;
    flex: none;
}

.tech-list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    width: min(42vw, 158px);
    min-height: 132px;
    padding: 18px 10px;
    border-radius: 22px;
    border: 1.5px solid var(--line);
    transition: transform 0.25s;
}
.tech-list li:hover { transform: translateY(-6px) rotate(-1.5deg) scale(1.03); }

.t-white { background: var(--white); color: var(--ink); border-color: var(--white); }
.t-lime { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.t-line {
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 0 rgba(13, 0, 153, 0.35);
}

.tech-ico { width: 46px; height: 46px; object-fit: contain; border-radius: 12px; animation: float 4s ease-in-out infinite; }
.tech-list li:nth-child(2n) .tech-ico { animation-delay: -1.5s; }
.tech-list li:nth-child(3n) .tech-ico { animation-delay: -2.5s; }

.tech-list span { font-size: 16px; text-transform: uppercase; }
.tech-list small { font-size: 11px; font-weight: 400; opacity: 0.8; }

.grid { display: grid; gap: 16px; }

@media (min-width: 900px) { .grid--main { grid-template-columns: 1fr 1fr; align-items: start; } }

.card {
    background: var(--white);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 28px 22px;
    box-shadow: 0 14px 0 var(--blue-deep), 0 24px 50px rgba(0, 0, 40, 0.35);
    animation: rise 0.7s ease both;
}

.publish-box[hidden] { display: none; }
.gate { max-width: 460px; margin: 0 auto 14px; }

.card h2 { margin: 0 0 16px; font-size: 26px; text-transform: uppercase; }
.sub-title { margin: 22px 0 4px; font-size: 18px; text-transform: uppercase; }

.field { margin-bottom: 14px; text-align: left; }

label { display: block; margin-bottom: 6px; font-size: 13px; opacity: 0.75; font-weight: 400; }

input[type="text"], textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 2px solid #d9d4ff;
    background: #f5f3ff;
    color: var(--ink);
    font: inherit;
    font-weight: 400;
}

input:focus, textarea:focus { outline: none; border-color: var(--blue-light); box-shadow: 0 0 0 4px rgba(59, 43, 255, 0.2); }

textarea { min-height: 110px; resize: vertical; }

.kinds { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }

.kinds button {
    font: inherit;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 999px;
    border: 2px solid var(--blue);
    background: #fff;
    color: var(--blue);
    font-size: 14px;
    text-transform: uppercase;
    transition: transform 0.2s;
}
.kinds button:hover { transform: scale(1.06); }
.kinds button.is-on { background: var(--lime); color: var(--ink); border-color: var(--ink); transform: scale(1.06); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 999px;
    font: inherit;
    font-size: 16px;
    text-transform: uppercase;
    cursor: pointer;
    background: var(--blue);
    color: #fff;
    box-shadow: 0 5px 0 var(--blue-deep);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--blue-deep); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--blue-deep); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

#genBtn, #regForm .btn { background: var(--lime); color: var(--ink); box-shadow: 0 5px 0 #8fb300; animation: pulse 2.4s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: #fff; box-shadow: none; padding: 8px 14px; }
.btn-ghost:hover { box-shadow: none; }

.hint { font-size: 12px; opacity: 0.7; margin: 10px 0 0; font-weight: 400; line-height: 1.45; }

.status { margin-top: 14px; padding: 12px 14px; border-radius: 16px; font-size: 14px; font-weight: 400; display: none; }
.status.is-show { display: block; }
.status--load { background: #ede9ff; animation: pulse 1.4s ease-in-out infinite; }
.status--ok { background: #eaffb0; }
.status--err { background: #ffe0f5; color: #a0125f; }

.preview { margin-top: 12px; border-radius: 18px; overflow: hidden; border: 2px solid #d9d4ff; background: #f5f3ff; aspect-ratio: 16 / 10; }
.preview iframe { width: 100%; height: 100%; border: 0; background: #fff; }

.preview-actions { margin-top: 12px; }
.preview-actions a {
    display: inline-block;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--blue);
    text-decoration: none;
    color: #fff;
}

.works-list { display: grid; gap: 10px; max-height: 70vh; overflow: auto; text-align: left; }

.work-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 16px;
    border-radius: 18px;
    border: 2px solid #d9d4ff;
    background: #f5f3ff;
}
.work-link { display: grid; gap: 3px; text-decoration: none; color: inherit; min-width: 0; }
.work-link:hover strong { text-decoration: underline; }
.work-item strong { font-size: 15px; }
.work-item span { font-size: 12px; opacity: 0.7; font-weight: 400; }

.vote-btn {
    font: inherit;
    font-size: 14px;
    padding: 9px 14px;
    border-radius: 999px;
    border: 2px solid var(--pink);
    background: #fff;
    color: #c0188f;
    cursor: pointer;
    transition: transform 0.15s;
    white-space: nowrap;
}
.vote-btn:hover:not(:disabled) { transform: scale(1.08); }
.vote-btn.is-on { background: var(--pink); color: #fff; }
.vote-btn.is-mine { border-color: #d9d4ff; color: var(--ink); opacity: 0.6; cursor: default; }
.vote-btn:disabled:not(.is-mine) { opacity: 0.5; }
.hint--votes { margin: 4px 0 12px; font-weight: 700; opacity: 0.85; }
.hint--votes:empty { display: none; }

.leaders { margin: 0 0 34px; }
.leaders[hidden] { display: none; }
.leaders-list { display: grid; gap: 12px; }
@media (min-width: 700px) { .leaders-list { grid-template-columns: repeat(3, 1fr); } }
.leader {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 22px 16px 16px;
    border-radius: 24px;
    text-decoration: none;
    color: var(--ink);
    background: var(--white);
    animation: float 4.5s ease-in-out infinite;
}
.leader--1 { background: var(--lime); }
.leader--2 { animation-delay: -1.2s; }
.leader--3 { animation-delay: -2.4s; }
.leader-place {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--pink);
    color: #fff;
    font-size: 18px;
}
.leader strong { font-size: 18px; text-transform: uppercase; line-height: 1.15; }
.leader-author { font-size: 12px; opacity: 0.7; font-weight: 400; }
.leader-votes { font-size: 20px; color: #c0188f; }

.gate[hidden], .studio[hidden] { display: none !important; }

.site-footer { max-width: 900px; margin: 0 auto; padding: 24px 16px 44px; }

.site-footer figure { margin: 0; text-align: center; }
.site-footer img {
    display: inline-block;
    width: min(100%, 560px);
    height: auto;
    filter: drop-shadow(0 18px 24px rgba(0, 0, 40, 0.4));
    animation: float 5s ease-in-out infinite;
}

.foot-note { margin: 28px 0 0; font-size: 13px; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.08em; }


.player {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    border-radius: 999px;
    background: var(--white);
    box-shadow: 0 5px 0 var(--blue-deep), 0 12px 30px rgba(0, 0, 40, 0.35);
}

.player-btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--lime);
    cursor: pointer;
    display: grid;
    place-items: center;
    flex: none;
}

.eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.eq i { width: 4px; height: 100%; background: var(--ink); border-radius: 2px; transform-origin: bottom; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
.player-btn { color: var(--ink); }
.player .eq { display: none; }
.player.is-on .eq { display: flex; }
.player.is-on .ico-play { display: none; }
.player:not(.is-on) .player-btn { background: #e3e0ff; }

@keyframes eq {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

.player input[type="range"] { width: 110px; height: 32px; touch-action: pan-x; accent-color: var(--blue); cursor: pointer; }

.site-footer { padding-bottom: 90px; }


.topbar { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.wrap, .site-footer { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

@media (orientation: landscape) and (max-height: 560px) {
    .topbar { position: relative; padding-top: 8px; padding-bottom: 8px; }
    .brand img { height: 26px; }
    .school-logo { height: 44px; }
    .btn-sm { padding: 6px 12px; font-size: 12px; }

    .wrap { max-width: 1000px; padding-top: 18px; padding-bottom: 12px; }

    .hero { margin-bottom: 16px; }
    .eyebrow { margin-bottom: 10px; padding: 5px 12px; font-size: 10px; }
    .hero h1 { font-size: clamp(30px, 8vh, 48px); margin-bottom: 8px; }
    .lead { font-size: 14px; margin-bottom: 12px; max-width: 46em; }
    .stickers { margin-bottom: 10px; gap: 8px; }
    .sticker { padding: 6px 14px; font-size: 12px; }

    .marquee { margin-bottom: 18px; padding: 8px 0; }
    .marquee-track { font-size: 15px; gap: 20px; }

    .tech-title { font-size: 20px; margin-bottom: 12px; }
    .topics, .tech-block { margin-bottom: 20px; }
    .topic-list { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .topic-list li { min-height: 84px; padding: 10px 8px; border-radius: 18px; }
    .topic-list span { font-size: clamp(13px, 2.6vw, 18px); }
    .tech-list li { width: min(28vw, 140px); min-height: 108px; padding: 12px 8px; border-radius: 16px; }
    .tech-track { animation-duration: 38s; }
    .tech-ico { width: 34px; height: 34px; }
    .tech-list span { font-size: 12px; }
    .tech-list small { display: none; }

    .qr-block { margin-bottom: 20px; padding: 14px 18px; gap: 16px; }
    .qr-img { width: 120px; height: 120px; }
    .qr-text h2 { font-size: 20px; }

    .gate { max-width: 560px; }
    .gate form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
    .gate .btn, .gate .hint { grid-column: 1 / -1; }
    .card { padding: 18px 16px; }
    .card h2 { font-size: 22px; margin-bottom: 10px; }
    .grid--main { grid-template-columns: 1fr 1fr; align-items: start; }

    .player { bottom: max(10px, env(safe-area-inset-bottom)); right: max(10px, env(safe-area-inset-right)); padding: 5px 12px 5px 5px; }
    .player-btn { width: 36px; height: 36px; }
    .site-footer img { width: min(100%, 320px); }
    .site-footer { padding-top: 8px; padding-bottom: 70px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

.hint--limit { margin: 14px 0 0; font-size: 11px; opacity: 0.45; text-align: center; letter-spacing: 0.02em; }
.hint--limit:empty { display: none; }

.field--prompt { text-align: left; }
.field--prompt label { font-size: 15px; font-weight: 700; opacity: 1; color: var(--ink); margin-bottom: 8px; }
.field--prompt textarea {
    min-height: 150px;
    border: 3px solid var(--blue);
    background: #fff;
    font-size: 16px;
    line-height: 1.45;
}
.field--prompt textarea::placeholder { color: #8b86c4; }
.field--prompt textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 5px rgba(255, 79, 216, 0.25); }

.tips { margin-top: 10px; }
.tips summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 14px;
    border-radius: 14px;
    background: #ede9fe;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}
.tips summary::-webkit-details-marker { display: none; }
.tips summary::before { content: "＋ "; }
.tips[open] summary::before { content: "− "; }
.tips[open] summary { border-radius: 14px 14px 0 0; }
.tips .hint--kind { margin: 0; border-radius: 0 0 14px 14px; border-top: 0; }
.btn-link--left { margin: 8px 0 0; padding: 4px 0; }
.tips.is-hidden { display: none; }
.hint--kind {
    margin: 0 0 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #ede9fe;
    border: 1px solid #d9d4ff;
    font-size: 12px;
    line-height: 1.5;
    opacity: 1;
    color: var(--ink);
    opacity: 0.85;
    text-align: left;
}
.hint--kind strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 13px; opacity: 1; }
.hint--kind ul { margin: 0; padding-left: 1.1em; }
.hint--kind li { margin-bottom: 4px; }
.hint--kind:empty { display: none; }

.btn-link { display: block; margin: 12px auto 0; padding: 6px 10px; border: 0; background: none; color: var(--blue); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.btn-link[hidden] { display: none; }
.kinds button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
