:root {
    --bg: #05080d;
    --panel: rgba(12, 18, 27, .92);
    --line: rgba(255,255,255,.09);
    --text: #f5f7fb;
    --muted: #9ba9bc;
    --gold: #e6bd56;
    --gold-2: #fff0a8;
    --ice: #6ce7ff;
    --ice-2: #b9f6ff;
    --discord: #5865f2;
    --shadow: 0 30px 80px rgba(0,0,0,.45);
    --radius: 22px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, rgba(108,231,255,.12), transparent 28%),
        radial-gradient(circle at 85% 20%, rgba(230,189,86,.12), transparent 26%),
        linear-gradient(180deg, #070b11 0%, #040609 58%, #030405 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

a { color: inherit; }
code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,.07);
    color: var(--ice-2);
}

.shell {
    width: min(1480px, calc(100% - 34px));
    margin: 0 auto;
    padding: 38px 0 50px;
}

.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: center;
    padding: 28px 32px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(12,18,27,.96), rgba(8,12,19,.78));
    box-shadow: var(--shadow);
}

.hero::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -80px;
    top: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108,231,255,.18), rgba(230,189,86,.08) 46%, transparent 68%);
    filter: blur(6px);
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ice-2);
    text-transform: uppercase;
    letter-spacing: .19em;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 11px;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--ice), var(--gold));
}

h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.02;
    letter-spacing: -.04em;
}

.gradient-text {
    background: linear-gradient(90deg, #fff, var(--ice-2) 45%, var(--gold-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p, .auth-card p {
    max-width: 760px;
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 15px;
}

.hero-right {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {
    width: 126px;
    height: 126px;
    object-fit: contain;
    filter: drop-shadow(0 0 28px rgba(108,231,255,.12)) drop-shadow(0 14px 24px rgba(0,0,0,.45));
}

.user-box {
    min-width: 230px;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: rgba(255,255,255,.04);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(108,231,255,.2), rgba(230,189,86,.25));
    color: #fff;
    font-weight: 900;
}

.user-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-text strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.user-text span {
    margin-top: 2px;
    color: var(--ice-2);
    font-size: 11px;
}

.logout-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
}

.logout-link:hover { color: #fff; }

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.03fr) minmax(440px, .97fr);
    gap: 22px;
    margin-top: 22px;
    align-items: start;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(14,20,30,.92), rgba(8,12,18,.93));
    box-shadow: 0 18px 50px rgba(0,0,0,.28);
    overflow: hidden;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 19px 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.018);
}

.card-head h2 { margin: 0; font-size: 17px; }
.card-head small { color: var(--muted); font-size: 12px; }

.form, .preview-wrap { padding: 22px; }
.field { margin-bottom: 17px; }
.no-margin { margin-bottom: 0; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #dfe8f6;
}

.hint {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}

input, textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,.11);
    outline: none;
    background: rgba(255,255,255,.035);
    color: var(--text);
    border-radius: 13px;
    padding: 12px 14px;
    font: inherit;
    transition: .18s ease;
}

textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.5;
}

input:focus, textarea:focus {
    border-color: rgba(108,231,255,.62);
    box-shadow: 0 0 0 3px rgba(108,231,255,.09);
}

.timestamp-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--muted);
}

.chip {
    padding: 5px 8px;
    border: 1px solid rgba(108,231,255,.16);
    background: rgba(108,231,255,.05);
    border-radius: 999px;
    color: #bceef7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

details {
    margin-top: 3px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: rgba(255,255,255,.018);
}

summary {
    cursor: pointer;
    padding: 12px 14px;
    color: #cbd6e5;
    font-size: 13px;
    font-weight: 700;
    user-select: none;
}

.advanced { padding: 2px 14px 14px; }

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

button, .discord-login {
    appearance: none;
    border: 0;
    border-radius: 13px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease;
}

button:hover, .discord-login:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.primary {
    color: #061016;
    background: linear-gradient(135deg, var(--ice-2), var(--gold-2));
    box-shadow: 0 8px 28px rgba(108,231,255,.13);
}

.secondary {
    color: #dfe8f6;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
}

.discord {
    position: relative;
    background: #111214;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 17px;
    padding: 20px;
    min-height: 360px;
    overflow: hidden;
}

.discord::after {
    content: "";
    position: absolute;
    right: -35px;
    bottom: -35px;
    width: 180px;
    height: 180px;
    background: url("/assets/white-dragons.png") center/contain no-repeat;
    opacity: .035;
    pointer-events: none;
}

.discord-message {
    position: relative;
    z-index: 1;
    color: #dbdee1;
    font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15.5px;
    line-height: 1.375rem;
}

.mention {
    display: inline-block;
    padding: 0 3px;
    border-radius: 3px;
    color: #c9cdfb;
    background: rgba(88,101,242,.32);
}

.discord-title {
    margin: 21px 0 4px;
    color: #f2f3f5;
    font-size: 21px;
    line-height: 1.2;
    font-weight: 800;
}

.timestamp-preview {
    display: inline-block;
    color: #dbdee1;
    background: #2b2d31;
    border-radius: 3px;
    padding: 0 3px;
    margin-bottom: 16px;
    font-size: 13px;
}

.timestamp-preview.inline { margin: 0; }

.discord p {
    margin: 0 0 16px;
    white-space: pre-wrap;
}

.discord ul { margin: 0; padding-left: 20px; }
.discord li { margin: 3px 0; }
.discord b { color: #f2f3f5; }

.raw {
    margin-top: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
    background: #080b10;
    padding: 14px;
}

.raw-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.raw-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

pre {
    margin: 0;
    color: #c8d5e7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.copy-status {
    min-height: 20px;
    margin-top: 9px;
    font-size: 12px;
    color: var(--ice-2);
}

.foot {
    padding-top: 18px;
    text-align: center;
    color: #677487;
    font-size: 12px;
}

/* Login */
.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-shell {
    width: min(520px, 100%);
}

.auth-card {
    position: relative;
    overflow: hidden;
    padding: 34px;
    text-align: center;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(14,20,30,.97), rgba(7,11,17,.96));
    box-shadow: var(--shadow);
}

.auth-card .eyebrow {
    justify-content: center;
}

.auth-logo {
    width: 190px;
    height: 190px;
    object-fit: contain;
    margin: -10px auto 8px;
    filter: drop-shadow(0 18px 40px rgba(0,0,0,.42));
}

.auth-card h1 {
    font-size: 34px;
}

.auth-card p {
    margin-left: auto;
    margin-right: auto;
}

.discord-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    text-decoration: none;
    background: var(--discord);
    color: #fff;
}

.discord-mark {
    padding-right: 12px;
    border-right: 1px solid rgba(255,255,255,.2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.auth-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 18px;
    color: #7e8b9c;
    font-size: 11px;
}

.notice {
    margin-top: 18px;
    padding: 11px 12px;
    border: 1px solid rgba(108,231,255,.16);
    border-radius: 11px;
    background: rgba(108,231,255,.05);
    color: #d6f8ff;
    font-size: 12px;
    line-height: 1.5;
}

.notice-error {
    border-color: rgba(255,125,125,.2);
    background: rgba(255,125,125,.06);
    color: #ffd0d0;
}

@media (max-width: 1080px) {
    .hero { grid-template-columns: 1fr; }
    .hero-right { justify-content: space-between; }
    .grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .shell { width: min(100% - 20px, 1480px); padding-top: 10px; }
    .hero { padding: 22px; border-radius: 20px; }
    .hero-right { align-items: flex-start; flex-direction: column; }
    .logo { width: 96px; height: 96px; }
    .user-box { width: 100%; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .card-head { align-items: flex-start; flex-direction: column; }
    .form, .preview-wrap { padding: 16px; }
    .discord { padding: 16px; }
    .auth-card { padding: 24px 18px; }
    .auth-logo { width: 150px; height: 150px; }
}


/* Discord spoiler preview for the role ping */
.spoiler {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #1e1f22;
    color: transparent;
    cursor: default;
    user-select: none;
}

.spoiler-label {
    color: #8e9297;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.spoiler-content {
    color: transparent;
    background: #1e1f22;
    border-radius: 3px;
}

.spoiler:hover .spoiler-content {
    color: #c9cdfb;
    background: rgba(88,101,242,.18);
}

.config-problems {
    text-align: left;
}

.config-problems strong {
    display: block;
    margin-bottom: 7px;
}

.config-problems ul {
    margin: 0;
    padding-left: 20px;
}

.config-problems li + li {
    margin-top: 5px;
}

.setup-hint {
    font-size: 12px !important;
}
