:root {
    --wine: #7a1424;
    --wine-deep: #5c101c;
    --red: #8e1c2c;
    --gold: #e4c16a;
    --gold-deep: #c9963c;
    --ivory: #fffdf9;
    --ink: #3a241c;
    --muted: #8d7468;
    --line: #e4d0bc;
    --field: #f6f0e6;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    background: var(--wine);
}

.shell {
    min-height: 100vh;
    padding: 22px;
    display: flex;
    background-color: var(--wine);
    background-image: url("/patterns/frame.svg");
}

.mat {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 18px;
    background-color: var(--field);
    background-image: url("/patterns/field.svg");
    border: 2px solid var(--gold);
    box-shadow:
        inset 0 0 0 7px var(--wine),
        inset 0 0 0 8px var(--gold);
}

.mat::before,
.mat::after {
    content: "";
    position: absolute;
    width: 42px;
    height: 42px;
    pointer-events: none;
    border-color: var(--gold-deep);
    border-style: solid;
}

.mat::before {
    top: 18px;
    left: 18px;
    border-width: 2px 0 0 2px;
}

.mat::after {
    right: 18px;
    bottom: 18px;
    border-width: 0 2px 2px 0;
}

.corner {
    position: absolute;
    width: 42px;
    height: 42px;
    pointer-events: none;
    border-color: var(--gold-deep);
    border-style: solid;
}

.corner-tr {
    top: 18px;
    right: 18px;
    border-width: 2px 2px 0 0;
}

.corner-bl {
    bottom: 18px;
    left: 18px;
    border-width: 0 0 2px 2px;
}

.card {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    padding: 34px 28px 28px;
    background: linear-gradient(180deg, #fffdf9 0%, #fbf6ef 100%);
    border: 1px solid #eadccb;
    border-radius: 22px;
    box-shadow: 0 22px 50px rgba(92, 16, 28, 0.14);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--red), var(--gold), var(--red), transparent);
}

.logo-ring {
    width: 124px;
    height: 124px;
    margin: 0 auto 18px;
    padding: 4px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #fff 62%, transparent 63%),
        linear-gradient(160deg, #f6e2a4, #c9963c 45%, #f3d78c 70%, #8a6420);
    box-shadow: 0 0 0 6px #fbf6ef, 0 10px 24px rgba(92, 16, 28, 0.16);
}

.logo-ring img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: #fff;
}

h1 {
    margin: 0;
    text-align: center;
    color: var(--red);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1;
}

.lead,
.spot,
.hint,
.rating-title {
    text-align: center;
}

.lead {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.45;
}

.spot {
    margin: 14px 0 0;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

form {
    margin-top: 22px;
}

textarea,
.upload,
.submit {
    width: 100%;
    font: inherit;
}

textarea {
    display: block;
    min-height: 132px;
    margin: 0;
    padding: 14px 16px;
    resize: vertical;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid #d8c1aa;
    border-radius: 12px;
    outline: none;
}

textarea::placeholder {
    color: #b7a494;
    font-style: italic;
}

textarea:focus,
.upload:focus-within,
.submit:focus-visible {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(142, 28, 44, 0.12);
}

.upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    margin-top: 14px;
    padding: 10px 14px;
    color: #7d685c;
    background: #f8f2ea;
    border: 1.5px dashed #d2b79d;
    border-radius: 12px;
    cursor: pointer;
}

.upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.upload svg {
    flex: none;
    color: var(--red);
}

.preview {
    display: block;
    width: 100%;
    max-height: 180px;
    margin-top: 12px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.rating-title {
    margin: 22px 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
}

.stars input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.stars label {
    color: #d9d0c6;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label,
.stars input:focus-visible ~ label {
    color: #e2b340;
}

.stars label:hover {
    transform: translateY(-1px);
}

.hint {
    margin: 6px 0 0;
    color: #a89486;
    font-size: 12.5px;
}

.submit {
    margin-top: 20px;
    height: 54px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.18em;
    background: linear-gradient(180deg, #a82434 0%, #7a1424 100%);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(122, 20, 36, 0.22);
}

.submit:hover {
    background: linear-gradient(180deg, #b82b3c 0%, #8e1c2c 100%);
}

.submit:disabled {
    cursor: wait;
    opacity: 0.7;
}

.alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    color: #8e1c2c;
    background: #fff1f2;
    border: 1px solid #f0c7cc;
    border-radius: 10px;
    font-size: 14px;
}

.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.thanks {
    padding: 18px 8px 8px;
    text-align: center;
}

.thanks-mark {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    color: var(--wine-deep);
    background: radial-gradient(circle at 40% 35%, #fff6d8, #e4c16a);
    border-radius: 50%;
}

.thanks h2 {
    margin: 0;
    color: var(--red);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 36px;
    letter-spacing: 0.08em;
}

.thanks p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.again {
    display: inline-block;
    margin-top: 18px;
    color: var(--red);
    font-weight: 700;
    text-decoration: none;
}

.home-copy {
    margin-top: 22px;
    text-align: center;
}

.home-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.gold-rule {
    width: 72px;
    height: 2px;
    margin: 18px auto;
    background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
}

@media (max-width: 640px) {
    .shell {
        padding: 10px;
    }

    .mat {
        padding: 22px 12px;
        box-shadow:
            inset 0 0 0 5px var(--wine),
            inset 0 0 0 6px var(--gold);
    }

    .card {
        padding: 28px 16px 18px;
    }

    h1 {
        font-size: 28px;
        letter-spacing: 0.08em;
    }
}
