:root {
    --bg: #edf5e8;
    --bg-2: #d9ebcf;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-border: rgba(85, 125, 64, 0.18);
    --text: #1f2b1d;
    --muted: #52604d;
    --accent: #6e9b4d;
    --accent-strong: #557d40;
    --shadow: 0 18px 40px rgba(54, 76, 40, 0.12);
}

@font-face {
    font-family: 'Stardew Valley Regular';
    src: url('/fonts/Stardew%20Valley%20Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Stardew Valley Caps';
    src: url('/fonts/Stardew%20Valley%20ALL%20CAPS.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Stardew Valley Thin';
    src: url('/fonts/svthin.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'Stardew Valley Bold';
    src: url('/fonts/svbold.otf') format('opentype');
    font-display: swap;
}

.font-stardew {
    font-family: 'Stardew Valley Regular', 'Trebuchet MS', 'Segoe UI', sans-serif;
}

.font-stardew-caps {
    font-family: 'Stardew Valley Caps', 'Trebuchet MS', 'Segoe UI', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.font-svthin {
    font-family: 'Stardew Valley Thin', 'Trebuchet MS', 'Segoe UI', sans-serif;
}

.font-svbold {
    font-family: 'Stardew Valley Bold', 'Trebuchet MS', 'Segoe UI', sans-serif;
}

html, body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body.home-page {
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.7), transparent 40%),
        linear-gradient(180deg, #f3f7ee 0%, #d9ebcf 100%);
}

.landing-shell {
    min-height: 100vh;
    padding: 24px;
    display: grid;
    place-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-card {
    width: min(100%, 620px);
    padding: 36px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    text-align: center;
    position: relative;
}

.hero-card::before {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: 18px;
    border: 1px solid rgba(110, 155, 77, 0.08);
    pointer-events: none;
}

.hero-card h1 {
    position: relative;
    margin: 0 0 22px;
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.2;
    color: var(--text);
}

.hero-card h1.font-stardew-caps {
    line-height: 1.15;
}

.retro-banner {
    position: relative;
    height: 90px;
    margin: -6px 0 18px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(141, 191, 255, 0.42), rgba(255, 255, 255, 0.08)),
        linear-gradient(90deg, rgba(110, 155, 77, 0.08), rgba(110, 155, 77, 0.02));
    overflow: hidden;
    border: 1px solid rgba(85, 125, 64, 0.1);
}

.upload-card {
    position: relative;
    margin-top: 10px;
}

#fileupload {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

#fileupload::file-selector-button {
    display: none;
}

#spanUpload {
    position: relative;
    z-index: 1;
    min-height: 180px;
    padding: 24px;
    border-radius: 20px;
    border: 2px dashed rgba(110, 155, 77, 0.3);
    background: rgba(255, 255, 255, 0.55);
    display: grid;
    place-items: center;
    text-align: center;
    gap: 6px;
    color: var(--text);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

#spanUpload:hover,
#spanUpload:focus-within {
    transform: translateY(-2px);
    border-color: rgba(110, 155, 77, 0.55);
    background: rgba(255, 255, 255, 0.72);
}

.upload-title {
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    line-height: 1.5;
}

.upload-subtitle {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--muted);
}

.info-tabs {
    margin-top: 22px;
    text-align: left;
}

.tab-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.tab-button {
    appearance: none;
    border: 1px solid rgba(110, 155, 77, 0.24);
    background: rgba(255, 255, 255, 0.55);
    color: var(--text);
    border-radius: 14px;
    padding: 14px 12px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.tab-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.75);
}

.tab-button.is-active {
    background: linear-gradient(180deg, #89b65f, #5a8241);
    color: #152310;
    border-color: rgba(90, 130, 65, 0.35);
}

.tab-panels {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(85, 125, 64, 0.12);
    border-radius: 20px;
    padding: 18px;
}

.tab-panel h2 {
    margin: 0 0 14px;
    font-size: 1.2rem;
}

.tab-panel.is-active {
    display: block;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.info-list li {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(110, 155, 77, 0.12);
}

.tab-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.placeholder-grid span {
    padding: 16px 12px;
    border-radius: 14px;
    text-align: center;
    background: rgba(255, 255, 255, 0.68);
    border: 1px dashed rgba(110, 155, 77, 0.22);
}

.planning-list {
    display: grid;
    gap: 10px;
}

.planning-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(110, 155, 77, 0.12);
}

.planning-list strong {
    color: var(--accent-strong);
}

.btn,
.btn:hover,
.btn:focus {
    background: linear-gradient(180deg, #89b65f, #5a8241);
    color: #152310;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(54, 76, 40, 0.18);
    text-transform: none;
}

#download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 0 22px;
    margin: 20px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.photo-item {
    cursor: pointer;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
}

.photo-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s;
}

.photo-modal.show {
    visibility: visible;
    opacity: 1;
}

.photo-modal-content {
    max-width: 90%;
    max-height: 90%;
}

.photo-modal-content img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.selectable {
    border: 5px solid rgb(0, 140, 255);
    border-radius: 5px;
}

.selected {
    border: 5px solid rgb(255, 0, 0);
    border-radius: 5px;
}

#select-div {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    z-index: 99;
}

#select-div * {
    margin: 10px;
    width: 30%;
    font-size: 30px;
    height: 150px;
}

@media screen and (max-width: 720px) {
    .landing-shell {
        padding: 16px;
    }

    .hero-card {
        padding: 22px;
    }

    #spanUpload {
        min-height: 160px;
        padding: 20px;
    }

    .tab-list {
        grid-template-columns: 1fr;
    }

    .placeholder-grid {
        grid-template-columns: 1fr;
    }

    .hero-card h1,
    .hero-card p {
        font-size: 1.4rem !important;
    }

    .retro-banner {
        height: 74px;
    }
}
