.tdp-story-generator {
    --tdp-orange: #f47b20;
    --tdp-black: #111111;
    --tdp-white: #ffffff;
    --tdp-gray: #f3f4f6;
    box-sizing: border-box;
    max-width: 1120px;
    margin: 32px auto;
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(135deg, #111 0%, #222 52%, #f47b20 100%);
    color: var(--tdp-white);
    font-family: inherit;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
}

.tdp-story-generator *,
.tdp-story-generator *::before,
.tdp-story-generator *::after {
    box-sizing: border-box;
}

.tdp-story-copy {
    text-align: center;
    margin-bottom: 24px;
}

.tdp-story-copy h2 {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 3vw, 2.8rem);
    line-height: 1.08;
    color: var(--tdp-white);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.tdp-story-event,
.tdp-story-date,
.tdp-story-help {
    margin: 6px auto;
    max-width: 760px;
}

.tdp-story-date {
    color: #ffd8b7;
    font-weight: 800;
}

.tdp-story-help {
    color: rgba(255, 255, 255, .88);
}

.tdp-story-layout {
    display: grid;
    grid-template-columns: minmax(280px, 430px) 1fr;
    gap: 28px;
    align-items: start;
}

.tdp-story-canvas-wrap {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 10px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .24);
}

.tdp-story-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    background: #f2f2f2;
    touch-action: none;
    cursor: grab;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .30);
}

.tdp-story-canvas-wrap canvas:active {
    cursor: grabbing;
}

.tdp-story-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .95);
    color: var(--tdp-black);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.tdp-story-upload {
    display: block;
    width: 100%;
}

.tdp-story-upload span,
.tdp-story-download,
.tdp-story-reset,
.tdp-story-rotate {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .02em;
    cursor: pointer;
    transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.tdp-story-upload span,
.tdp-story-download {
    background: var(--tdp-orange);
    color: var(--tdp-white);
    box-shadow: 0 10px 25px rgba(244, 123, 32, .35);
}

.tdp-story-reset,
.tdp-story-rotate {
    background: var(--tdp-black);
    color: var(--tdp-white);
}

.tdp-story-upload input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.tdp-story-upload span:hover,
.tdp-story-download:hover,
.tdp-story-reset:hover,
.tdp-story-rotate:hover {
    transform: translateY(-1px);
}

.tdp-story-download:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tdp-story-range-label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

.tdp-story-zoom {
    width: 100%;
    accent-color: var(--tdp-orange);
}

.tdp-story-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tdp-story-buttons .tdp-story-download {
    grid-column: 1 / -1;
}

.tdp-story-tip {
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--tdp-gray);
    color: #333;
    font-size: .95rem;
}

.tdp-story-alert {
    max-width: 900px;
    margin: 24px auto;
    padding: 18px;
    border-radius: 12px;
    background: #fff4e8;
    border: 1px solid #ffd0a6;
    color: #5a2a00;
}

@media (max-width: 820px) {
    .tdp-story-generator {
        padding: 18px;
        border-radius: 18px;
        margin: 20px auto;
    }

    .tdp-story-layout {
        grid-template-columns: 1fr;
    }

    .tdp-story-controls {
        padding: 18px;
    }
}
