:root {
    color-scheme: dark;
    --bg: #0f041d;
    --bg-soft: rgba(41, 12, 53, 0.6);
    --bg-card: rgba(18, 9, 30, 0.85);
    --accent: #f97316;
    --accent-soft: rgba(249, 115, 22, 0.2);
    --glow: rgba(192, 132, 252, 0.35);
    --text: #f4f3ff;
    --text-muted: rgba(244, 243, 255, 0.7);
    --success: #10b981;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, rgba(244, 114, 182, 0.15), transparent 45%),
        radial-gradient(circle at bottom, rgba(16, 185, 129, 0.12), transparent 50%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
}

.container {
    width: min(960px, 92%);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    background: rgba(10, 6, 21, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.25rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.logo-icon {
    height: 40px;
    width: 40px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    background: rgba(249, 115, 22, 0.12);
    border-radius: 1rem;
}

.main-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.main-nav a {
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.main-nav .cta-link {
    background: rgba(249, 115, 22, 0.18);
    border: 1px solid rgba(249, 115, 22, 0.45);
}

.main-nav .link-quiet {
    color: var(--text-muted);
}

.site-main {
    padding: 2.5rem 0 4rem;
}

.hero-card,
.card,
.panel {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.75rem;
    padding: 2rem;
    box-shadow: 0 0 80px -30px var(--glow);
}

.panel + .panel {
    margin-top: 2rem;
}

.hero-card h1 {
    margin-top: 0;
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    line-height: 1.05;
    text-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.18);
    color: rgba(243, 232, 255, 0.86);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.button,
.button-secondary,
.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-radius: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.button {
    background: linear-gradient(135deg, #f97316, #c026d3);
    color: #fff;
}

.button.copied {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.button-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
}

.button-secondary {
    background: rgba(16, 185, 129, 0.16);
    color: var(--text);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.section-title {
    margin: 3rem 0 1rem;
    font-size: 1.75rem;
}

.panel ol {
    margin: 0;
    padding-left: 1.4rem;
    display: grid;
    gap: 0.65rem;
    font-size: 1rem;
    color: var(--text-muted);
}

.panel li strong {
    color: var(--text);
}

.cards-grid {
    display: grid;
    gap: 1rem;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.is-open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 15, 30, 0.65);
}

.modal-card {
    position: relative;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1.25rem;
    padding: 2rem;
    max-width: 420px;
    width: min(90vw, 420px);
    box-shadow: 0 25px 60px rgba(14, 1, 40, 0.5);
    color: var(--text);
    text-align: center;
}

.modal-card h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.qr-preview {
    margin: 1.5rem auto 1rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1.25rem;
    display: grid;
    gap: 0.75rem;
}

.qr-preview img {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: block;
    background: #ffffff;
    padding: 0.75rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
}

.qr-link-display {
    margin-bottom: 1.25rem;
    word-break: break-all;
}

.qr-link-display a {
    color: var(--accent-fuchsia);
    font-weight: 600;
}

@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.card p {
    margin: 0.2rem 0;
    color: var(--text-muted);
}

.list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.list-table th,
.list-table td {
    padding: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.list-table .icon-column {
    width: 2.75rem;
    text-align: center;
}

.delete-cell {
    text-align: center;
    vertical-align: middle;
}

.delete-ghoul-button {
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.55);
    color: #f87171;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.delete-ghoul-button:hover,
.delete-ghoul-button:focus {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.8);
    color: #fecaca;
}

.tracking-link {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.secret-link {
    margin-bottom: 0.75rem;
}

.tracker-panel {
    text-align: center;
}

.tracker-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.tracker-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tracking-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.micro-print {
    font-size: 0.7rem;
    color: rgba(226, 232, 240, 0.75);
    margin: 0.2rem 0 0;
}

.inline-form {
    display: inline;
}

.tracking-link-anchor {
    color: #38bdf8;
    word-break: break-all;
    text-decoration: none;
}

.tracking-link-anchor:hover,
.tracking-link-anchor:focus {
    text-decoration: underline;
}

.copy-button {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.6);
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease;
}

.copy-button:hover,
.copy-button:focus {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(148, 163, 184, 0.8);
}

.copy-button.copied {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.7);
    color: #bbf7d0;
}

.summoner-moderation-note {
    margin-bottom: 0.85rem;
    color: rgba(226, 232, 240, 0.8);
}

.action-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    align-items: stretch;
}

.action-buttons .action-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.65rem;
    text-align: center;
    white-space: nowrap;
}

.action-buttons .copy-button {
    letter-spacing: 0.01em;
    text-transform: none;
}

.action-buttons .copy-button.copied {
    color: #0f172a;
}

form label {
    display: block;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(244, 243, 255, 0.75);
    margin-bottom: 0.35rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 8, 28, 0.75);
    color: var(--text);
    font-size: 1rem;
}

textarea {
    min-height: 120px;
}

form .form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.terms-panel {
    margin-top: 2rem;
    padding: 1.6rem;
    border-radius: 1.4rem;
    background: rgba(18, 9, 30, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.terms-panel h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.35rem;
}

.terms-panel .tos-issuer {
    font-size: 0.85rem;
    color: rgba(244, 243, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 1rem;
}

.terms-panel ul {
    margin: 1rem 0 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.75rem;
    color: rgba(244, 243, 255, 0.75);
}

.terms-panel li strong {
    color: var(--text);
}

.field-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.25rem;
}

@media (min-width: 720px) {
    .field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.flash-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.flash-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.gallery {
    --gallery-max-height: min(25vh, 520px);
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
    justify-items: center;
}

@media (min-width: 640px) {
    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.gallery figure {
    margin: 0;
    background: rgba(10, 8, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 520px);
}

.gallery-media {
    position: relative;
    background: rgba(15, 23, 42, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: var(--gallery-max-height);
    overflow: hidden;
}

.gallery img {
    display: block;
    max-width: 100%;
    max-height: var(--gallery-max-height);
    width: auto;
    height: auto;
    object-fit: contain;
}

.gallery .delete-haunt {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fef3c7;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.gallery .delete-haunt:hover,
.gallery .delete-haunt:focus {
    background: rgba(220, 38, 38, 0.85);
    transform: scale(1.05);
}

.gallery .delete-haunt:focus {
    outline: 2px solid rgba(248, 113, 113, 0.75);
    outline-offset: 2px;
}

.gallery figcaption {
    padding: 0.75rem 1rem 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    width: 100%;
    text-align: center;
}

.form-error {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--danger);
    display: none;
}

.form-error.is-visible {
    display: block;
}

@keyframes field-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
    35% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.45);
    }
    70% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.field-error {
    border-color: rgba(239, 68, 68, 0.75) !important;
    animation: field-flash 1.2s ease-in-out;
}

.site-footer {
    padding: 3rem 0 2rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(7, 4, 15, 0.82);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.9rem;
}

.footer-copy a {
    color: inherit;
    text-decoration: underline;
}

.ghoul-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: rgba(59, 7, 100, 0.25);
}

.keeper-panel {
    background: rgba(6, 95, 70, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.28);
}

.keeper-panel h2 {
    margin-top: 0;
}

.keeper-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
    display: grid;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.keeper-list strong {
    color: #bbf7d0;
}

.keeper-reminder {
    margin-top: 1.25rem;
    padding: 0.9rem 1rem;
    border-radius: 0.9rem;
    background: rgba(249, 115, 22, 0.18);
    border: 1px solid rgba(249, 115, 22, 0.35);
    font-weight: 600;
    font-size: 0.95rem;
}

.reclaim-note {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.return-message {
    background: rgba(15, 8, 28, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.95rem;
}

.modal-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(249, 115, 22, 0.22);
    color: rgba(255, 237, 213, 0.95);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.upload-box {
    border: 2px dashed rgba(168, 85, 247, 0.4);
    border-radius: 1.1rem;
    padding: 1.5rem;
    text-align: center;
    background: rgba(67, 56, 202, 0.18);
}

.upload-box input[type="file"] {
    margin-top: 0.75rem;
}

.empty-state {
    padding: 1.5rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
}

.small-print {
    font-size: 0.85rem;
    color: var(--text-muted);
}

code {
    font-family: "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.35rem;
    border-radius: 0.4rem;
    word-break: break-all;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(9, 5, 19, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
    z-index: 4000;
}

.lightbox.is-open {
    display: flex;
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-figure {
    margin: 0;
    max-width: min(90vw, 900px);
    width: 100%;
    text-align: center;
}

.lightbox-figure img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 1.25rem;
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-figure figcaption {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.lightbox-nav,
.lightbox-close {
    border: none;
    background: rgba(15, 23, 42, 0.7);
    color: #fef08a;
    border-radius: 999px;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

.lightbox-nav:hover,
.lightbox-nav:focus,
.lightbox-close:hover,
.lightbox-close:focus {
    background: rgba(217, 119, 6, 0.85);
    transform: scale(1.05);
}

.lightbox-nav:focus,
.lightbox-close:focus {
    outline: 2px solid rgba(253, 224, 71, 0.8);
    outline-offset: 3px;
}

.lightbox-nav {
    font-size: 2rem;
}

@media (max-width: 640px) {
    .lightbox {
        padding: 1.5rem;
        gap: 1rem;
    }

    .lightbox-nav,
    .lightbox-close {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
