@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Work+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap");

:root {
  --ink-900: #0b0d13;
  --ink-800: #151824;
  --ink-750: #191d2b;
  --ink-700: #212536;
  --ink-600: #2c3145;
  --ink-500: #3a4059;
  --parchment: #ece7d6;
  --parchment-dim: #a7a294;
  --parchment-faint: #726e63;
  --gold: #b43cf0;
  --gold-bright: #d17dfa;
  --ember: #4f6bef;
  --ember-bright: #7b93ff;
  --ok: #4f9d69;
  --warn: #c99a3d;
  --danger: #b23a48;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: "Work Sans", sans-serif;
  background: radial-gradient(circle at 20% -10%, #1c2032 0%, var(--ink-900) 55%);
  background-attachment: fixed;
  color: var(--parchment);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3 { font-family: "Cinzel", serif; letter-spacing: 0.02em; margin: 0 0 8px; }
.mono { font-family: "JetBrains Mono", monospace; }
a { color: var(--gold-bright); }
img { max-width: 100%; }
::selection { background: var(--gold); color: var(--ink-900); }

.wrap { max-width: 900px; margin: 0 auto; padding: 28px 20px 80px; }
.wrap-wide { max-width: 1320px; margin: 0 auto; padding: 28px 20px 80px; }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .badge {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #5b1a8a);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  box-shadow: 0 0 0 1px rgba(180, 60, 240, 0.4), 0 4px 14px rgba(180, 60, 240, 0.25);
}
.brand .presented { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember-bright); font-weight: 600; }
.lang-toggle { display: flex; gap: 6px; background: var(--ink-750); border: 1px solid var(--ink-600); border-radius: 999px; padding: 4px; }
.lang-toggle button {
  border: none; background: transparent; color: var(--parchment-dim); padding: 6px 14px; border-radius: 999px;
  font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: "Work Sans", sans-serif;
}
.lang-toggle button.active { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: #1a0a2e; }

.hero { text-align: center; margin: 34px 0 40px; }
.hero h1 { font-size: clamp(28px, 4vw, 40px); color: var(--parchment); }
.hero p { color: var(--parchment-dim); margin-top: 10px; }
.hero .tagline { color: var(--gold-bright); font-weight: 600; font-size: 15px; max-width: 560px; margin: 14px auto 0; line-height: 1.5; }
.social-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.social-row .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }

/* game grid */
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 700px; margin: 0 auto; }
@media (max-width: 560px) { .game-grid { grid-template-columns: 1fr; } }
.game-card {
  background: var(--ink-800); border: 1px solid var(--ink-600); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .12s, border-color .12s; display: block;
}
.game-card:hover:not(.disabled) { transform: translateY(-3px); border-color: var(--gold); }
.game-card.disabled { opacity: 0.5; cursor: not-allowed; }
.game-card .icon { font-size: 34px; margin-bottom: 10px; }
.game-logo {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; min-height: 40px;
}
.game-logo img { height: 40px; width: auto; max-width: 160px; display: block; }
.game-card h3 { color: var(--parchment); font-size: 19px; }
.game-card .meta { color: var(--parchment-dim); font-size: 12.5px; margin: 8px 0 4px; }
.game-card .date { color: var(--ember-bright); font-size: 12.5px; font-weight: 600; }
.game-card .cta { margin-top: 14px; color: var(--gold-bright); font-weight: 700; font-size: 13.5px; }
.game-card .soon { margin-top: 14px; color: var(--parchment-faint); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; }

/* panels */
.panel {
  background: var(--ink-800); border: 1px solid var(--ink-600); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel h2 { font-size: 17px; color: var(--gold-bright); margin-bottom: 4px; }
.panel .hint { color: var(--parchment-dim); font-size: 13px; margin-bottom: 16px; }
.section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ember-bright); margin: 26px 0 14px; padding-top: 14px; border-top: 1px solid var(--ink-600);
}
.section-label:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--parchment-dim); margin-bottom: 6px; font-weight: 600; }
.field label .req { color: var(--danger); }
.field .fhint { color: var(--parchment-faint); font-size: 12px; margin-top: 5px; }
input[type=text], input[type=tel], input[type=number], input[type=email], input[type=file],
textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--ink-600);
  background: var(--ink-750); color: var(--parchment); font-size: 14.5px; font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type=file] { padding: 9px; cursor: pointer; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.checkbox-row label { font-size: 13.5px; color: var(--parchment); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }

.role-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.role-chip {
  border: 1px solid var(--ink-600); background: var(--ink-750); color: var(--parchment);
  padding: 9px 16px; border-radius: 9px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; user-select: none;
}
.role-chip:hover { border-color: var(--gold); }
.role-chip.picked { border-color: var(--gold-bright); background: rgba(180, 60, 240, 0.16); }
.role-chip .rank-badge {
  width: 18px; height: 18px; border-radius: 5px; background: var(--gold); color: #1a0a2e;
  font-family: "JetBrains Mono", monospace; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* buttons */
.btn {
  padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 14.5px;
  background: var(--ink-600); color: var(--parchment); border: none; cursor: pointer;
  transition: transform .08s, background .15s; font-family: "Work Sans", sans-serif;
}
.btn:hover { background: var(--ink-500); }
.btn:active { transform: scale(0.97); }
.btn-gold { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: #1a0a2e; box-shadow: 0 4px 14px rgba(180, 60, 240, 0.3); }
.btn-gold:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--gold-bright), var(--gold)); }
.btn-ghost { background: transparent; color: var(--parchment-dim); border: 1px solid var(--ink-600); }
.btn-ghost:hover { color: var(--parchment); border-color: var(--ink-500); background: transparent; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(178, 58, 72, 0.5); }
.btn-danger:hover { background: rgba(178, 58, 72, 0.12); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; }
.btn-x { background: var(--parchment); color: #0b0d13; }
.btn-x:hover { background: #fff; }

.warn-box { background: rgba(201, 154, 61, 0.12); border: 1px solid rgba(201, 154, 61, 0.4); color: #e8cf9a; padding: 12px 16px; border-radius: 9px; font-size: 13px; margin-bottom: 16px; }
.error-box { background: rgba(178, 58, 72, 0.12); border: 1px solid rgba(178, 58, 72, 0.4); color: #e8b3ba; padding: 12px 16px; border-radius: 9px; font-size: 13px; margin-bottom: 16px; }
.ok-box { background: rgba(79, 157, 105, 0.14); border: 1px solid rgba(79, 157, 105, 0.4); color: #b7e6c4; padding: 12px 16px; border-radius: 9px; font-size: 13px; margin-bottom: 16px; }

table.pricing { width: 100%; border-collapse: collapse; font-size: 14px; }
table.pricing th, table.pricing td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--ink-600); }
table.pricing th { color: var(--parchment-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

.footer-note { text-align: center; color: var(--parchment-faint); font-size: 11.5px; margin-top: 40px; line-height: 1.8; }

/* ---------- signature pad ---------- */
.sig-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sig-tab {
  border: 1px solid var(--ink-600); background: var(--ink-750); color: var(--parchment-dim);
  padding: 9px 16px; border-radius: 9px; cursor: pointer; font-size: 13.5px; font-weight: 600; font-family: inherit;
}
.sig-tab:hover { border-color: var(--gold); color: var(--parchment); }
.sig-tab.active { border-color: var(--gold-bright); background: rgba(180, 60, 240, 0.16); color: var(--parchment); }
.sig-pad {
  position: relative; width: 100%; aspect-ratio: 5 / 2; max-width: 100%;
  background: #f6f2e8; border-radius: 10px; border: 1px solid var(--ink-600);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.12); overflow: hidden;
}
@media (max-width: 600px) { .sig-pad { aspect-ratio: 3 / 2; } } /* taller on phones so a finger has room */
.sig-pad canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; position: relative; z-index: 1; }
.sig-baseline { position: absolute; left: 8%; right: 8%; bottom: 22%; border-bottom: 1.5px dashed rgba(20, 22, 31, 0.22); pointer-events: none; }
.sig-x { position: absolute; left: 4%; bottom: 20%; color: rgba(20, 22, 31, 0.3); font-size: 18px; font-weight: 700; pointer-events: none; }
.sig-toolbar { display: flex; gap: 8px; margin-top: 10px; }
.sig-preview, .photo-preview {
  margin: -6px 0 16px; padding: 12px; border-radius: 10px; border: 1px solid var(--ink-600); background: var(--ink-750);
  display: flex; justify-content: center;
}
.sig-preview img { max-height: 220px; background: #fff; border-radius: 6px; padding: 8px; }
.photo-preview img { max-height: 260px; border-radius: 8px; }
/* submission receipt — a list, on purpose not a card mock-up */
.receipt { border: 1px solid var(--ink-600); border-radius: 10px; background: var(--ink-750); padding: 4px 14px; }
.receipt-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ink-600); font-size: 14px; flex-wrap: wrap; }
.receipt-row:last-child { border-bottom: none; }
.receipt-label { width: 72px; flex-shrink: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--parchment-dim); }
.receipt-row img { width: 72px; height: 54px; object-fit: contain; flex-shrink: 0; }
.receipt-row img.receipt-sig { width: auto; max-width: 240px; height: auto; max-height: 90px; background: #f6f2e8; border-radius: 6px; padding: 6px 10px; }
.receipt-slot { width: 20px; height: 20px; border-radius: 6px; background: var(--ink-600); color: var(--parchment); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-left: -6px; }

/* ---------- loadout pickers ---------- */
.pick-search { position: relative; }
.pick-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 340px; overflow-y: auto;
  background: var(--ink-800); border: 1px solid var(--ink-500); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.pick-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 8px;
  background: transparent; border: none; color: var(--parchment); cursor: pointer; font-family: inherit; font-size: 13.5px;
}
.pick-item:hover, .pick-item:focus { background: var(--ink-700); outline: none; }
.pick-item img { width: 64px; height: 48px; object-fit: contain; flex-shrink: 0; }
.pick-names { display: flex; flex-direction: column; min-width: 0; }
.pick-name { font-weight: 600; border-left: 3px solid var(--rarity, var(--ink-500)); padding-left: 8px; }
.pick-zh { color: var(--parchment-dim); font-size: 12.5px; padding-left: 11px; }
.pick-empty { padding: 10px 12px; color: var(--parchment-dim); font-size: 13px; }
.pick-selected { display: flex; flex-direction: column; gap: 8px; }
.pick-selected:not(:empty) { margin-bottom: 8px; }
.pick-card {
  display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 10px;
  background: var(--ink-750); border: 1px solid var(--ink-600); border-left: 3px solid var(--rarity, var(--ink-500));
}
.pick-card img { width: 96px; height: 72px; object-fit: contain; flex-shrink: 0; }
.pick-card .pick-name { border-left: none; padding-left: 0; }
.pick-card .pick-zh { padding-left: 0; }
.pick-card .pick-names { flex: 1; }
.pick-remove {
  background: transparent; border: 1px solid var(--ink-600); color: var(--parchment-dim); width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; flex-shrink: 0;
}
.pick-remove:hover { color: var(--danger); border-color: var(--danger); }
.spec { border: 1px dashed var(--ink-600); border-radius: 10px; padding: 12px 14px; }
.spec-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--parchment-dim); margin-bottom: 8px; }
.wear-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wear-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 64px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--ink-600); background: var(--ink-800); color: var(--parchment); cursor: pointer; font-family: inherit;
}
.wear-chip b { font-size: 13px; }
.wear-chip span { font-size: 10.5px; color: var(--parchment-dim); }
.wear-chip:hover:not(:disabled) { border-color: var(--gold); }
.wear-chip.picked { border-color: var(--gold-bright); background: rgba(180, 60, 240, 0.16); }
.wear-chip:disabled { opacity: 0.3; cursor: not-allowed; }
.preview-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.preview-links a { text-decoration: none; }
.inspect-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.inspect-box input { flex: 1; min-width: 200px; font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
.sig-thumb { height: 44px; max-width: 160px; background: #fff; border-radius: 5px; padding: 3px; display: block; }
.sig-thumb-photo { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }

/* ---------- admin ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; flex-shrink: 0; background: var(--ink-800); border-right: 1px solid var(--ink-600);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.admin-sidebar .tab {
  padding: 11px 14px; border-radius: 9px; color: var(--parchment-dim); font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none; background: transparent; text-align: left; font-family: inherit;
}
.admin-sidebar .tab:hover { background: var(--ink-750); color: var(--parchment); }
.admin-sidebar .tab.active { background: linear-gradient(135deg, rgba(180,60,240,0.22), rgba(79,107,239,0.14)); color: var(--parchment); border: 1px solid var(--ink-600); }
.admin-main { flex: 1; padding: 26px 30px 60px; min-width: 0; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar select { width: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.pill-open { background: rgba(79,157,105,0.18); color: #8fe0a8; }
.pill-coming-soon { background: rgba(201,154,61,0.18); color: #f0cd80; }
.pill-closed { background: rgba(178,58,72,0.18); color: #f0a3ac; }
.pill-pending { background: rgba(201,154,61,0.18); color: #f0cd80; }
.pill-approved { background: rgba(79,157,105,0.18); color: #8fe0a8; }
.pill-waitlisted { background: rgba(79,107,239,0.18); color: #a9b8ff; }
.pill-rejected { background: rgba(178,58,72,0.18); color: #f0a3ac; }
.pill-tier { background: var(--ink-700); color: var(--gold-bright); }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ink-600); vertical-align: middle; }
table.data th { color: var(--parchment-dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; position: sticky; top: 0; background: var(--ink-800); }
table.data tbody tr:hover { background: var(--ink-750); }
table.data select, table.data input { padding: 6px 8px; font-size: 13px; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--ink-600); }
.table-scroll table.data { border: none; }
.table-scroll .panel { box-shadow: none; }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card { background: var(--ink-800); border: 1px solid var(--ink-600); border-radius: 12px; padding: 16px 20px; min-width: 130px; }
.stat-card .num { font-family: "JetBrains Mono", monospace; font-size: 26px; font-weight: 700; color: var(--gold-bright); }
.stat-card .label { font-size: 12px; color: var(--parchment-dim); margin-top: 2px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,6,10,0.75); display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 50;
}
.modal { background: var(--ink-800); border: 1px solid var(--ink-600); border-radius: var(--radius); max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow); }
.modal .close-x { float: right; background: none; border: none; color: var(--parchment-dim); font-size: 20px; cursor: pointer; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; margin: 4px 0; }
.kv b { color: var(--parchment-dim); font-weight: 600; }

.login-shell { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { width: 100%; max-width: 380px; text-align: center; }

textarea.mono-area { font-family: "JetBrains Mono", monospace; font-size: 12.5px; line-height: 1.6; }
