:root {
    --black: #070707;
    --panel: #101010;
    --panel-2: #161616;
    --red: #9d1111;
    --red-bright: #d31f1f;
    --gold: #c9a227;
    --gold-light: #f0d36a;
    --text: #f3f3f3;
    --muted: #8d8d8d;
    --border: #2a2a2a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 50% -10%, rgba(157,17,17,.25), transparent 40%),
        linear-gradient(145deg, #050505, #0b0b0b 55%, #070707);
    font-family: Arial, "Noto Sans Thai", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .08;
    background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 48px 48px;
}

.site-header {
    padding: 22px clamp(20px, 5vw, 70px);
    border-bottom: 1px solid rgba(201,162,39,.2);
    background: rgba(5,5,5,.86);
    backdrop-filter: blur(10px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 900px;
    margin: auto;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-weight: 900;
    transform: rotate(45deg);
}

.brand-mark::first-letter { transform: rotate(-45deg); }

.brand strong {
    display: block;
    letter-spacing: .18em;
}

.brand small {
    color: var(--gold);
    letter-spacing: .28em;
}

.container {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto;
    padding: 60px 0;
}

.hero {
    text-align: center;
    margin-bottom: 28px;
}

.eyebrow {
    color: var(--gold-light);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .3em;
}

.hero h1, .success-page h1 {
    margin: 10px 0 8px;
    font-size: clamp(30px, 7vw, 58px);
    letter-spacing: .08em;
}

.hero p, .success-page > p {
    color: var(--muted);
}

.application-card {
    border: 1px solid var(--border);
    background: rgba(15,15,15,.94);
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
}

.form-section {
    padding: clamp(22px, 5vw, 42px);
    border-bottom: 1px solid var(--border);
}

.section-title {
    margin-bottom: 28px;
    font-weight: 900;
    letter-spacing: .05em;
}

.section-title span {
    margin-right: 12px;
    color: var(--gold);
}

label {
    display: block;
    margin: 18px 0 8px;
    color: #ddd;
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    padding: 14px 15px;
    color: var(--text);
    background: #090909;
    border: 1px solid #303030;
    outline: none;
    border-radius: 3px;
}

input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201,162,39,.08);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

button, .discord-btn, .link-btn {
    border: 0;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-weight: 900;
    letter-spacing: .05em;
}

.secondary-btn {
    padding: 0 18px;
    color: var(--gold-light);
    background: #1b1b1b;
    border: 1px solid var(--gold);
}

.secondary-btn:hover { background: #252015; }

.discord-btn {
    display: block;
    padding: 15px;
    color: white;
    background: #5865f2;
}

.discord-connected {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 16px;
    border: 1px solid rgba(201,162,39,.45);
    background: #111;
}

.discord-connected strong, .discord-connected small {
    display: block;
}

.discord-connected small {
    margin-top: 4px;
    color: var(--muted);
}

.discord-connected span {
    color: #6fe58b;
    font-size: 12px;
    font-weight: 900;
    align-self: center;
}

.hint, .status {
    color: var(--muted);
    font-size: 13px;
}

.status { margin-top: 8px; }
.status.success { color: #6fe58b; }
.status.error { color: #ff6666; }
.status.loading { color: var(--gold-light); }

.consent {
    margin-top: 18px;
    padding: 18px;
    border-left: 2px solid var(--red);
    background: #0b0b0b;
}

.consent p {
    margin: 0 0 12px;
    line-height: 1.65;
}

.radio {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 22px 0 0;
    color: #ccc;
    font-weight: 500;
}

.radio input {
    width: auto;
    accent-color: var(--red-bright);
}

.form-footer {
    padding: 28px clamp(22px, 5vw, 42px);
    text-align: center;
}

.form-footer p {
    color: var(--muted);
    font-size: 13px;
}

.submit-btn {
    width: min(100%, 420px);
    padding: 16px 24px;
    color: #090909;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: 0 0 25px rgba(201,162,39,.12);
}

.submit-btn:hover { filter: brightness(1.08); }

.site-footer {
    display: flex;
    justify-content: space-between;
    width: min(900px, calc(100% - 32px));
    margin: auto;
    padding: 24px 0 40px;
    color: #555;
    font-size: 10px;
    letter-spacing: .18em;
}

.success-page {
    text-align: center;
}

.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    display: grid;
    place-items: center;
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-size: 35px;
}

.application-id {
    width: min(500px, 100%);
    margin: 32px auto 12px;
    padding: 24px;
    border: 1px solid rgba(201,162,39,.4);
    background: #101010;
}

.application-id small, .application-id strong {
    display: block;
}

.application-id small {
    color: var(--muted);
    letter-spacing: .2em;
}

.application-id strong {
    margin-top: 8px;
    color: var(--gold-light);
    font-size: 25px;
    letter-spacing: .12em;
}

.link-btn {
    display: inline-block;
    margin-top: 25px;
    padding: 13px 20px;
    color: var(--gold-light);
    border: 1px solid var(--gold);
    background: #141414;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(4px);
}

.modal-overlay[hidden] { display: none; }

.modal-card {
    width: min(360px, 100%);
    padding: 28px;
    text-align: center;
    background: var(--panel);
    border: 1px solid rgba(201,162,39,.4);
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.modal-title {
    font-weight: 900;
    letter-spacing: .08em;
    color: var(--gold-light);
    margin-bottom: 18px;
}

.modal-skin {
    width: 140px;
    height: 280px;
    object-fit: contain;
    image-rendering: pixelated;
    background: #0b0b0b;
    border: 1px solid var(--border);
    margin: 0 auto;
}

.modal-username {
    margin-top: 14px;
    font-weight: 700;
    color: var(--text);
}

.modal-hint {
    margin: 8px 0 22px;
    color: var(--muted);
    font-size: 13px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.modal-actions .secondary-btn {
    padding: 13px;
}

.modal-confirm {
    padding: 13px;
}

@media (max-width: 600px) {
    .container { padding: 38px 0; }
    .input-row { grid-template-columns: 1fr; }
    .secondary-btn { padding: 13px; }
    .discord-connected { flex-direction: column; }
    .site-footer { flex-direction: column; gap: 8px; }
}
