* {
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

:root {
    --section-bg: linear-gradient(180deg, #faf4e8, #f6eddc);
    --panel-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(246, 235, 220, 0.94));
    --panel-border: rgba(186, 157, 133, 0.26);
    --panel-shadow: 0 14px 34px rgba(95, 71, 55, 0.08);
}

.marck-script-regular {
  font-family: "Marck Script", cursive !important;
  font-weight: 400;
  font-style: normal;
}


body {
    margin: 0;
    background-color: #f4ecd8;
    background-image:
        radial-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        radial-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(to bottom, #f8f1df, #efe2c4);
    background-size:
        4px 4px,
        6px 6px,
        100% 100%;
    color: #333;
}

.hero::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #f3dede, transparent 70%);
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
}

.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 0;
    z-index: 3;
    text-align: center;
}

.hero-bubbles {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.hero-name {
    position: absolute;
    z-index: 1;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(139, 106, 84, 0.28);
    box-shadow: 0 8px 18px rgba(95, 71, 55, 0.1);
    color: #7a1f2a;
    font-family: "Marck Script", cursive;
    font-size: 1.45rem;
    line-height: 1;
    white-space: nowrap;
}

.hero-name-groom {
    left: clamp(88px, 18vw, 250px);
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
    transform: rotate(-6deg);
}

.hero-name-bride {
    right: clamp(88px, 18vw, 250px);
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
    transform: rotate(5deg);
}

.hero {
    position: relative;
    height: 100svh;
    min-height: 100svh;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    overflow: hidden;
}

.hero-center {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 126px 0 calc(env(safe-area-inset-bottom, 0px) + 110px);
}

.hero-canvas-panel {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 0;
}

.hero-canvas-shell {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.speech-bubble {
    position: absolute;
    z-index: 1;
    max-width: min(168px, 20vw);
    padding: 10px 14px;
    border: 3px solid #2b1911;
    border-radius: 54% 46% 50% 50% / 42% 48% 52% 58%;
    background: #ffffff;
    box-shadow: 6px 7px 0 #2b1911;
    color: #5d1d25;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-align: center;
    text-transform: none;
    transform: rotate(-2deg);
    font-family: "Trebuchet MS", "Arial Black", Arial, sans-serif;
}

.speech-bubble::after {
    content: none;
}

.speech-bubble::before {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border: 3px solid #2b1911;
    border-radius: 50%;
    background: #ffffff;
}

.speech-bubble-groom {
    top: calc(env(safe-area-inset-top, 0px) + 84px);
    left: clamp(150px, 23vw, 360px);
    transform: rotate(-3deg);
}

.speech-bubble-groom::before {
    left: 26px;
    bottom: -16px;
    box-shadow: 18px 16px 0 -2px #ffffff, 18px 16px 0 1px #2b1911;
}

.speech-bubble-bride {
    top: calc(env(safe-area-inset-top, 0px) + 74px);
    right: clamp(150px, 23vw, 360px);
    transform: rotate(2deg);
}

.speech-bubble-bride::before {
    right: 26px;
    bottom: -16px;
    box-shadow: -18px 16px 0 -2px #ffffff, -18px 16px 0 1px #2b1911;
}

#outfitCanvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 0;
    touch-action: pan-y;
}

.hero-canvas-shell.drag-disabled {
    touch-action: pan-y;
}

.canvas-edit-hint {
    position: absolute;
    top: 8px;
    left: 10px;
    z-index: 5;
    font-size: 0.75rem;
    color: #6c4b34;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(125, 95, 71, 0.45);
    border-radius: 999px;
    padding: 4px 10px;
    pointer-events: none;
}

.canvas-toolbar {
    position: absolute;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 4;
    width: calc(100% - 32px);
    max-width: 360px;
}

.canvas-btn {
    border: 1px solid #ba9d85;
    background: #f6ebdc;
    color: #5f4737;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.canvas-btn:hover,
.random-btn:hover {
    background: #ead8bf;
}

.canvas-btn.is-active {
    background: #d9b7b7;
    border-color: #b98282;
    color: #5d2730;
}

.canvas-btn-icon {
    min-width: 40px;
    width: 40px;
    padding: 8px 0;
    font-size: 1rem;
    line-height: 1;
}

.hero h1 {
    font-family: "Marck Script", cursive;
    font-size: 4rem;
    letter-spacing: 2px;
    line-height: 0.92;
    margin: 0;
}

.hero-invitation-text {
    max-width: 620px;
    margin: 0;
    font-family: "Arial", sans-serif;
    font-size: 0.98rem;
    line-height: 1.3;
    color: #6c4b34;
}

.date {
    font-family: "Marck Script", cursive;
    font-size: 2rem;
    margin: 0;
    color: #7a1f2a;
}

/* INFO */
.info {
    padding: 60px 20px;
    max-width: 800px;
    margin: auto;
    text-align: center;
}

.details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 40px;
}

.details div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 0;
    padding: 24px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: var(--panel-bg);
    box-shadow: var(--panel-shadow);
    text-align: left;
}

.details h3,
.details p {
    margin: 0;
}

.details h3 {
    font-size: 1.15rem;
}

.details p {
    flex: 1;
    color: #5f4737;
    line-height: 1.45;
}

.dress-code-swatch {
    /* flex: 0 0 48px; */
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(95, 71, 55, 0.18);
    /* box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.28); */
}

.place-link {
    display: inline-block;
    margin-top: auto;
    color: #8b6a54;
    text-decoration: none;
    border-bottom: 1px solid rgba(139, 106, 84, 0.35);
    font-size: 0.95rem;
}

.place-link:hover {
    color: #5f4737;
    border-bottom-color: rgba(95, 71, 55, 0.55);
}

.info-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.timeline-separator {
    border: 0;
    border-top: 1px dashed #ccc;
    width: 100%;
}

.registry-notice,
.dress-code-note,
.timeline {
    padding: 24px;
    border-radius: 18px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    text-align: left;
}

.registry-notice h3,
.dress-code-note h3,
.timeline h3,
.timeline-content h4 {
    margin-top: 0;
}

.registry-notice p,
.dress-code-note p,
.timeline-content p {
    margin-bottom: 0;
}

.registry-meta {
    margin-top: 14px;
    color: #7a1f2a;
    font-weight: 600;
    line-height: 1.5;
}

.max-chat-widget {
    margin-top: 28px;
    padding: 24px;
    border-radius: 18px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    text-align: left;
}

.max-chat-widget h3 {
    margin-top: 0;
}

.max-chat-widget p {
    margin-bottom: 16px;
}

.max-chat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    color: #5f4737;
    text-decoration: none;
    border: 1px solid rgba(186, 157, 133, 0.4);
}

.max-chat-link:hover {
    background: #fff7ec;
}

.timeline {
    margin-top: 28px;
}

.timeline-list {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 14px;
    align-items: start;
}

.timeline-time {
    font-weight: 700;
    color: #6c4b34;
}

.calendar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 28px 0 0;
}

.calendar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 20px;
    border: 1px solid #ba9d85;
    border-radius: 999px;
    background: #f6ebdc;
    color: #5f4737;
    text-decoration: none;
    transition: background 0.2s ease;
}

.calendar-link-secondary {
    background: #fff;
}

.calendar-link:hover {
    background: #ead8bf;
}

.personal-note {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: min(760px, calc(100% - 40px));
    margin: 0 auto 28px;
    padding: 24px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 247, 247, 0.98), rgba(247, 220, 220, 0.94));
    border: 1px solid rgba(170, 88, 98, 0.35);
    box-shadow: 0 14px 34px rgba(122, 31, 42, 0.12);
    text-align: center;
}

.personal-note h2,
.personal-note p {
    margin: 0;
}

.personal-note h2 {
    color: #7a1f2a;
}

.personal-note p {
    color: #6b2e34;
    line-height: 1.6;
}

/* RSVP */
.rsvp {
    background: var(--section-bg);
    padding: 60px 20px;
    text-align: center;
}

.rsvp h2 {
    margin: 0;
}

.rsvp-intro {
    max-width: 540px;
    margin: 12px auto 0;
    color: #6c4b34;
    line-height: 1.55;
}

.rsvp-card {
    max-width: 460px;
    margin: 26px auto 0;
    padding: 26px 22px 22px;
    border-radius: 24px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--panel-shadow);
}

.rsvp form {
    max-width: none;
    margin: 0;
}

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

.form-label {
    display: block;
    margin: 0 0 8px;
    color: #5f4737;
    font-size: 0.95rem;
    font-weight: 600;
}

.form-field.has-error .input,
.drink-group.has-error .drink-options {
    border-color: rgba(184, 82, 95, 0.72);
    box-shadow: 0 0 0 4px rgba(184, 82, 95, 0.12);
}

.rsvp input,
.rsvp select,
.rsvp button {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 0;
    border-radius: 14px;
    border: 1px solid rgba(186, 157, 133, 0.5);
    background: rgba(255, 255, 255, 0.96);
    color: #5f4737;
    font-size: 0.98rem;
}

.rsvp input::placeholder {
    color: #9a806f;
}

.rsvp input:focus,
.rsvp select:focus {
    outline: none;
    border-color: rgba(184, 116, 116, 0.8);
    box-shadow: 0 0 0 4px rgba(216, 167, 167, 0.16);
}

.rsvp .btn,
.rsvp button[type="submit"] {
    margin-top: 6px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #c78888, #b96d76);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 24px rgba(185, 109, 118, 0.22);
}

.rsvp .btn:hover,
.rsvp button[type="submit"]:hover {
    background: linear-gradient(135deg, #bf7c7c, #ad626c);
}

.drink-options {
    margin: 0 0 18px;
    padding: 16px 16px 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(186, 157, 133, 0.24);
    text-align: left;
}

.drink-fields.is-hidden {
    display: none;
}

.attendance-dependent-fields.is-hidden {
    display: none;
}

.drink-options-title {
    margin: 0 0 14px;
    font-weight: 600;
    color: #5f4737;
}

.drink-group + .drink-group {
    margin-top: 10px;
}

.drink-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.drink-option input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1.5px solid rgba(139, 106, 84, 0.55);
    border-radius: 7px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(95, 71, 55, 0.08);
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.drink-option input[type="checkbox"]::before {
    content: "";
    width: 12px;
    height: 12px;
    transform: scale(0);
    transition: transform 0.15s ease;
    background: #ffffff;
    clip-path: polygon(14% 44%, 0 59%, 43% 100%, 100% 15%, 84% 0, 39% 62%);
}

.drink-option input[type="checkbox"]:checked {
    border-color: #b96d76;
    background: linear-gradient(135deg, #c78888, #b96d76);
    box-shadow: 0 0 0 3px rgba(185, 109, 118, 0.12);
}

.drink-option input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.drink-option input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(216, 167, 167, 0.22);
}

.drink-option span {
    flex: 1;
    line-height: 1.35;
}

.drink-other-field {
    margin-top: 14px;
    margin-bottom: 0;
}

.drink-other-field .form-label {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.field-error {
    min-height: 1.1em;
    margin: 6px 2px 0;
    color: #b44757;
    font-size: 0.84rem;
    line-height: 1.3;
}

#result {
    margin: 18px 0 0;
    color: #7a1f2a;
    min-height: 1.2em;
}

/* ADAPTIVE */
@media (max-width: 768px) {
    .hero-content {
        min-height: 124px;
        gap: 3px;
        padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 0;
    }

    .hero h1 {
        font-size: 2.5rem;
        line-height: 0.98;
    }

    .hero-invitation-text {
        max-width: 320px;
        font-size: 0.86rem;
        line-height: 1.2;
    }

    .date {
        font-size: 1.55rem;
        margin-top: 0;
    }

    .hero-center {
        padding: 156px 0 calc(env(safe-area-inset-bottom, 0px) + 104px);
    }

    .hero-canvas-shell {
        min-height: 0;
    }

    .speech-bubble {
        max-width: min(138px, 34vw);
        padding: 8px 10px;
        font-size: 0.74rem;
        line-height: 1.25;
        border-width: 2.5px;
        border-radius: 56% 44% 52% 48% / 44% 50% 46% 56%;
        box-shadow: 3px 4px 0 #2b1911;
    }

    .speech-bubble-groom {
        top: calc(env(safe-area-inset-top, 0px) + 118px);
        left: 20px;
    }

    .speech-bubble-bride {
        top: calc(env(safe-area-inset-top, 0px) + 112px);
        right: 20px;
    }

    .speech-bubble::after {
        content: none;
    }

    .speech-bubble::before {
        width: 8px;
        height: 8px;
        border-width: 2.5px;
    }

    .speech-bubble-groom::before {
        left: 18px;
        bottom: -14px;
        box-shadow: 12px 12px 0 -2px #ffffff, 12px 12px 0 1px #2b1911;
    }

    .speech-bubble-bride::before {
        right: 18px;
        bottom: -14px;
        box-shadow: -12px 12px 0 -2px #ffffff, -12px 12px 0 1px #2b1911;
    }

    .hero-name {
        padding: 3px 9px;
        font-size: 1.08rem;
    }

    .hero-name-groom {
        left: 34px;
        top: auto;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 86px);
    }

    .hero-name-bride {
        right: 34px;
        top: auto;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 86px);
    }

    .canvas-edit-hint {
        font-size: 0.68rem;
        top: 6px;
        left: 8px;
        padding: 3px 8px;
    }

    .canvas-toolbar {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
        width: calc(100% - 24px);
    }

    .canvas-btn {
        font-size: 0.82rem;
        padding: 7px 11px;
    }

    .details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .details div {
        min-height: 176px;
    }

    .personal-note {
        margin: 0 20px 24px;
        padding: 22px 18px;
    }

    .rsvp-card {
        padding: 22px 16px 18px;
        border-radius: 20px;
    }

    .rsvp-intro {
        max-width: 320px;
        font-size: 0.95rem;
    }

    .info-notes {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 900px) and (max-height: 540px) {
    .hero {
        height: auto;
        min-height: 760px;
    }

    .hero-center {
        min-height: 560px;
        padding: 132px 0 calc(env(safe-area-inset-bottom, 0px) + 96px);
    }
}

.map {
    padding: 60px 20px;
    background: var(--section-bg);
    text-align: center;
}

.map h2 {
    margin-bottom: 30px;
}

.map-note {
    max-width: 620px;
    margin: 0 auto 14px;
    color: #6c4b34;
    line-height: 1.55;
}

.map-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.map-taxi-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    color: #5f4737;
    text-decoration: none;
    border: 1px solid rgba(186, 157, 133, 0.4);
}

.map-taxi-link:hover {
    background: #fff7ec;
}

.map-wrapper {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: var(--panel-bg);
    box-shadow: var(--panel-shadow);
}

/* Адаптивный iframe */
.map-wrapper iframe {
    width: 100%;
    height: 400px;
    border: 0;
}

@media (max-width: 768px) {
    .map-wrapper iframe {
        height: 300px;
    }
}

.countdown {
    padding: 44px 20px 52px;
    text-align: center;
    background: var(--section-bg);
}

.countdown h2 {
    margin: 0 0 24px;
    font-weight: 500;
}

.gallery {
    padding: 60px 20px;
    background: var(--section-bg);
}

.gallery-header {
    max-width: 720px;
    margin: 0 auto 24px;
    text-align: center;
}

.gallery-upload {
    display: grid;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto 20px;
}

.gallery-upload-label {
    margin: 0;
    font-weight: 600;
}

.gallery-upload-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.gallery-upload-input {
    display: none;
}

.gallery-upload-btn,
.gallery-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid #ba9d85;
    background: #f6ebdc;
    color: #5f4737;
    cursor: pointer;
    text-decoration: none;
}

.gallery-upload-btn-secondary {
    background: #fff;
}

.gallery-status,
.gallery-empty {
    text-align: center;
    color: #6c4b34;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    max-width: 1040px;
    margin: 24px auto 0;
}

.gallery-card {
    overflow: hidden;
    border-radius: 18px;
    background: var(--panel-bg);
    box-shadow: var(--panel-shadow);
}

.gallery-media {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(60px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.time-box {
    background: var(--panel-bg);
    border-radius: 20px;
    padding: 20px 10px;
    box-shadow: var(--panel-shadow);
}

.time-box .number {
    font-size: 2.4rem;
    font-weight: 600;
    display: block;
}

.time-box .label {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Адаптив */
@media (max-width: 768px) {
    .countdown-grid {
        gap: 12px;
    }

    .time-box .number {
        font-size: 1.8rem;
    }
}
