:root {
    --gold: #ffd700;
    --gold-soft: rgba(255, 215, 0, 0.4);
    --bg-1: #1a1a2e;
    --bg-2: #0f0f1a;
    --bg-3: #1a0a0a;
    --panel: #1f1f2e;
    --panel-2: #14141f;
    --input-bg: #222;
    --input-border: #444;
    --text: #fff;
    --muted: #c9c9c9;
    --muted-2: #888;
    --teal: #4a9;
    --teal-dark: #286;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ---------- Header ---------- */

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-family: 'Black Ops One', 'Impact', 'Arial Black', sans-serif;
    font-size: 4rem;
    font-weight: normal;
    line-height: 1.1;
    letter-spacing: 5px;
    text-transform: uppercase;
    background: linear-gradient(180deg,
        #fff5d4 0%,
        #ffe066 18%,
        #ffd700 38%,
        #ff8c00 65%,
        #8b4513 92%,
        #c9881f 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter:
        drop-shadow(2px 2px 0 #5a3700)
        drop-shadow(4px 4px 0 #3a1f00)
        drop-shadow(0 8px 14px rgba(0, 0, 0, 0.85))
        drop-shadow(0 0 28px rgba(255, 200, 0, 0.55));
}

.subhead {
    color: var(--muted);
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.4;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.trust-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 14px;
}

.trust-pill {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid var(--gold-soft);
    color: var(--gold);
}

.usage-badge {
    display: inline-block;
    margin-top: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    border: 1px solid;
}

.usage-badge.free {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold-soft);
    color: var(--gold);
}

.usage-badge.paid {
    background: rgba(74, 169, 153, 0.15);
    border-color: rgba(74, 169, 153, 0.5);
    color: #6dd5c0;
}

.usage-badge.empty {
    background: rgba(255, 80, 80, 0.1);
    border-color: rgba(255, 80, 80, 0.4);
    color: #ff8080;
}

/* ---------- Main layout ---------- */

.main-content {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-start;
}

.controls {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-section {
    flex: 0 0 500px;
}

/* ---------- Upload ---------- */

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 24px 20px;
    background: linear-gradient(180deg, #444 0%, #222 100%);
    border: 2px dashed #666;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-btn:hover {
    border-color: var(--gold);
    background: linear-gradient(180deg, #555 0%, #333 100%);
}

.upload-btn span {
    font-weight: bold;
    color: var(--gold);
    letter-spacing: 1px;
}

.upload-btn input {
    display: none;
}

.upload-btn.has-photo {
    border-style: solid;
    border-color: #4a4;
}

.preview-thumb {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--gold);
    margin: 10px auto 0;
}

/* ---------- Inputs ---------- */

.inputs {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-size: 12px;
    color: var(--muted-2);
    letter-spacing: 2px;
}

.optional-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 9px;
    letter-spacing: 1px;
    color: #999;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    text-transform: uppercase;
    vertical-align: middle;
}

.input-hint {
    font-size: 11px;
    color: #777;
    margin-top: 4px;
    font-style: italic;
}

.input-group input {
    padding: 12px 15px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 5px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--gold);
}

.input-group input::placeholder {
    color: #555;
}

.input-with-action {
    position: relative;
}

.input-with-action input {
    width: 100%;
    padding-right: 52px;
}

.random-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 38px;
    background: linear-gradient(180deg, #ffd700 0%, #cc7000 100%);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s;
}

.random-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

.random-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.vibe-disclosure {
    margin-top: 4px;
}

.vibe-disclosure summary {
    cursor: pointer;
    color: var(--gold);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 4px 0;
    list-style: none;
}

.vibe-disclosure summary::-webkit-details-marker {
    display: none;
}

.vibe-disclosure[open] summary {
    margin-bottom: 8px;
}

/* ---------- Primary buttons ---------- */

.generate-btn {
    width: 100%;
    padding: 18px 20px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: linear-gradient(180deg, #ffd700 0%, #ff8c00 50%, #cc7000 100%);
    color: #000;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.4);
    letter-spacing: 1px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.6);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-btn.download {
    background: linear-gradient(180deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff;
}

.action-btn.share {
    background: linear-gradient(180deg, #c0c0c0 0%, #808080 100%);
    color: #000;
}

/* ---------- Paywall ---------- */

.paywall {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 140, 0, 0.08) 100%);
    border: 1px solid var(--gold-soft);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
}

.paywall-headline {
    font-size: 18px;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.paywall-sub {
    color: #ddd;
    font-size: 14px;
    margin-bottom: 14px;
}

.buy-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(180deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(40, 134, 102, 0.4);
}

.buy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 134, 102, 0.6);
}

.buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.paywall-note {
    margin-top: 10px;
    font-size: 12px;
    color: #aaa;
    font-style: italic;
}

/* ---------- Merch button ---------- */

.merch-btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(180deg, #ff4081 0%, #c2185b 100%);
    color: #fff;
    text-shadow: 0 1px 0 rgba(0,0,0,0.3);
    box-shadow: 0 4px 15px rgba(194, 24, 91, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 1px;
}

.merch-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(194, 24, 91, 0.6);
}

.merch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- Album cover preview ---------- */

.album-cover {
    width: 500px;
    height: 500px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    background: #111;
    border-radius: 4px;
}

.placeholder-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 20px;
}

.placeholder-icon {
    font-size: 80px;
    opacity: 0.3;
}

.placeholder-text {
    text-align: center;
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.placeholder-text strong {
    color: #888;
    font-size: 18px;
    letter-spacing: 1px;
}

.generated-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #333;
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--gold);
    font-size: 16px;
    text-align: center;
    letter-spacing: 1px;
    padding: 0 20px;
}

/* ---------- Modal ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal h2 {
    color: var(--gold);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.modal-preview {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #333;
    flex: 0 0 280px;
    transition: opacity 0.25s;
}

.modal-preview.is-loading {
    opacity: 0.55;
}

.modal-form {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-product-name {
    font-size: 14px;
    color: #ccc;
    letter-spacing: 1px;
}

.modal-price {
    font-size: 28px;
    font-weight: bold;
    color: var(--gold);
}

.size-picker-label {
    font-size: 12px;
    color: var(--muted-2);
    letter-spacing: 2px;
    margin-bottom: 8px;
    display: block;
}

.size-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.size-option {
    padding: 10px 16px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 5px;
    color: var(--text);
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s;
}

.size-option:hover {
    border-color: #888;
}

.size-option.selected {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold);
}

.ip-rights {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    line-height: 1.4;
}

.ip-rights input {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
    flex-shrink: 0;
}

.merch-buy-btn {
    padding: 16px 20px;
    font-size: 17px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(180deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(40, 134, 102, 0.4);
}

.merch-buy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 134, 102, 0.6);
}

.merch-buy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.merch-note {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
    min-height: 16px;
}

.modal-confirm {
    max-width: 480px;
    text-align: center;
}

.modal-confirm h2 {
    text-align: center;
    color: #6dd5c0;
}

.modal-confirm p {
    color: #ddd;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

/* ---------- Footer ---------- */

.page-footer {
    text-align: center;
    margin-top: 40px;
    font-size: 12px;
    color: #666;
}

.page-footer a {
    color: #888;
    text-decoration: none;
}

.page-footer a:hover {
    color: var(--gold);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }
    .controls {
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
    }
    .preview-section {
        flex: 0 0 auto;
        order: -1;
    }
    .album-cover {
        width: min(400px, calc(100vw - 40px));
        height: min(400px, calc(100vw - 40px));
    }
    header h1 {
        font-size: 2.4rem;
        letter-spacing: 3px;
        filter:
            drop-shadow(2px 2px 0 #5a3700)
            drop-shadow(3px 3px 0 #3a1f00)
            drop-shadow(0 6px 10px rgba(0, 0, 0, 0.85))
            drop-shadow(0 0 20px rgba(255, 200, 0, 0.5));
    }
    .subhead {
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 14px;
    }
    .modal-body {
        flex-direction: column;
    }
    .modal-preview {
        width: 100%;
        height: auto;
        flex: 0 0 auto;
        max-height: 320px;
    }
}
