*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f1e7;
    color: #111;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: clamp(32px, 7vh, 96px) clamp(24px, 5vw, 80px) clamp(40px, 6vh, 96px);
    -webkit-font-smoothing: antialiased;
}

.header {
    text-align: center;
    width: min(100%, 640px);
}
.header h1 {
    font-family: 'Oswald', 'Impact', sans-serif;
    font-size: clamp(2.2rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.02em;
    color: #111;
    white-space: nowrap;
}
.logo {
    width: clamp(130px, 30vw, 280px);
    height: auto;
    margin-bottom: clamp(16px, 3vh, 32px);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(36px, 5vh, 72px);
    width: 100%;
    max-width: min(90%, 800px);
    margin-top: clamp(36px, 9vh, 120px);
}
.main-content .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    font-weight: 600;
    color: #8f6a2a;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: clamp(12px, 2.5vh, 32px);
}

.code-inputs {
    display: flex;
    gap: clamp(14px, 3vw, 32px);
    width: min(100%, 520px);
    justify-content: center;
}
.code-inputs input {
    flex: 1;
    aspect-ratio: 1 / 1;
    max-width: clamp(72px, 17vw, 130px);
    background: #fffaf4;
    border: 2px solid #e1d6c8;
    border-radius: clamp(14px, 3vw, 22px);
    text-align: center;
    font-family: 'Oswald', 'Impact', sans-serif;
    font-size: clamp(2rem, 7vw, 3.6rem);
    font-weight: 700;
    color: #111;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    caret-color: #8f6a2a;
}
.code-inputs input:focus {
    border-color: #8f6a2a;
    box-shadow: 0 0 0 3px rgba(143,106,42,0.18);
}

.hint {
    text-align: center;
    font-size: clamp(0.95rem, 2vw, 1.2rem);
    color: rgba(17,17,17,0.45);
    max-width: clamp(300px, 50vw, 460px);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 2vh, 22px);
    margin-top: -16px;
}
.hint svg {
    color: rgba(17,17,17,0.35);
    width: clamp(22px, 3vw, 30px);
    height: clamp(22px, 3vw, 30px);
}
.hint.error {
    color: #c0392b;
    max-width: clamp(320px, 55vw, 500px);
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(52px, 7vw, 80px);
    padding: 0 clamp(32px, 6vw, 64px);
    border-radius: 999px;
    font-size: clamp(0.95rem, 2.2vw, 1.4rem);
    font-weight: 700;
    border: 1px solid #d6bf95;
    background: #e6d3ae;
    color: #111;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.4;
    pointer-events: none;
}
.submit-btn.active {
    opacity: 1;
    pointer-events: auto;
}
.submit-btn.active:hover {
    background: #f1e3c6;
    border-color: #cfb487;
}

.vote-section {
    gap: clamp(24px, 4vh, 52px);
    margin-top: clamp(20px, 4vh, 64px);
}

#categoriesContainer {
    transition: opacity 0.5s ease;
    width: 100%;
}

.category-block {
    width: 100%;
    background: #fffaf4;
    border: 1px solid #e1d6c8;
    border-radius: clamp(16px, 3vw, 28px);
    padding: clamp(24px, 4vw, 52px);
}

.category-title {
    font-family: 'Oswald', 'Impact', sans-serif;
    font-size: clamp(1.4rem, 3.5vw, 2.4rem);
    font-weight: 700;
    color: #111;
    margin-bottom: clamp(20px, 3vh, 44px);
    letter-spacing: 0.02em;
    text-align: center;
}

.films-list {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 24px);
    align-items: flex-start;
}

.film-option {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.5vw, 26px);
    padding: clamp(16px, 2.5vw, 28px) clamp(18px, 3vw, 36px);
    border-radius: clamp(12px, 2vw, 20px);
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
}
.film-option:hover {
    background: rgba(143,106,42,0.06);
}
.film-option input[type="radio"] {
    display: none;
}

.film-radio {
    width: clamp(24px, 4vw, 38px);
    height: clamp(24px, 4vw, 38px);
    border-radius: 50%;
    border: 2px solid #d6bf95;
    background: #fffaf4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
}
.film-radio svg {
    width: clamp(14px, 2.5vw, 22px);
    height: clamp(14px, 2.5vw, 22px);
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s;
}
.film-option input[type="radio"]:checked ~ .film-radio {
    border-color: #8f6a2a;
    background: #8f6a2a;
}
.film-option input[type="radio"]:checked ~ .film-radio svg {
    opacity: 1;
}

.film-name {
    font-size: clamp(1.05rem, 2.5vw, 1.7rem);
    font-weight: 600;
    color: #111;
}

.vote-submit {
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.5s ease;
}

.bottom-bar {
    position: sticky;
    bottom: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(10px, 2vh, 16px);
    padding: clamp(24px, 4vh, 40px) 0 clamp(20px, 4vh, 36px);
    background: linear-gradient(to bottom, transparent 0%, #f7f1e7 30%);
}

.vote-hint {
    display: none;
    align-items: center;
    gap: clamp(12px, 2vw, 18px);
    padding: clamp(14px, 2.5vw, 22px) clamp(18px, 3vw, 28px);
    border-radius: clamp(12px, 2vw, 20px);
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 500;
    line-height: 1.4;
    border: 1.5px solid transparent;
    width: 100%;
}
.vote-hint.visible {
    display: flex;
    animation: fadeSlideIn 0.25s ease;
}
.vote-hint.hiding {
    display: flex;
    animation: fadeSlideOut 0.25s ease forwards;
}
.vote-hint svg {
    width: clamp(20px, 3vw, 28px);
    height: clamp(20px, 3vw, 28px);
    flex-shrink: 0;
}
.vote-hint.success {
    background: #eef7ee;
    color: #2a602a;
    border-color: #b8d8b8;
}
.vote-hint.info {
    background: #fdf7ed;
    color: #7a5820;
    border-color: #e6d3ae;
}
.vote-hint.error {
    background: #fef0ee;
    color: #b03020;
    border-color: #f0c0b8;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(8px); }
}
