:root {
  --ink: #0b0d12;
  --card: #16181e;
  --card-2: #1c1f27;
  --paper: #f3f4f6;
  --muted: #9aa3b2;
  --accent: #f0e218;
  --accent-ink: #111208;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(240, 226, 24, 0.35);
  --danger: #ff5c7a;
  --ok: #3dffb5;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Montserrat", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--paper);
  font-family: var(--font);
  background: var(--ink);
}

body {
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  background: url("/static/back.png") center / cover no-repeat;
  transform: scale(1.02);
  animation: drift 28s ease-in-out infinite alternate;
  z-index: 0;
}

.bg-veil {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 10, 14, 0.45) 0%, rgba(8, 10, 14, 0.72) 45%, rgba(8, 10, 14, 0.9) 100%);
  z-index: 1;
}

@keyframes drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.05) translate3d(-1%, 0.8%, 0); }
}

.app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
}

.footer-logo {
  display: inline-flex;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.footer-logo:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

.footer-logo img {
  width: min(140px, 42vw);
  height: auto;
  display: block;
}

.footer-link {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.footer-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.boot {
  margin: auto;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.25rem 3rem;
  gap: 1.1rem;
}

.brand-logo {
  width: min(380px, 74vw);
  height: auto;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  animation: rise 0.9s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero p {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  animation: rise 0.9s 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.35rem;
  animation: rise 0.9s 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: #fff34a;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--paper);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: transparent;
  border-color: rgba(255, 92, 122, 0.45);
  color: var(--danger);
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
}

.btn-danger:hover {
  background: rgba(255, 92, 122, 0.1);
}

.btn-small {
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
}

.btn-link {
  background: none;
  border: 0;
  color: var(--accent);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-link:hover {
  opacity: 0.85;
}

.shell {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1.35rem;
  margin-bottom: 1.25rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  font-size: clamp(0.72rem, 2.2vw, 0.86rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.25;
}

.brand-sub {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.hero-stage {
  margin: 0 !important;
  color: var(--accent) !important;
  font-weight: 700;
  font-size: 0.95rem !important;
  letter-spacing: 0.03em;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
}

.user-chip img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 50%;
}

.user-chip .name {
  font-weight: 600;
  font-size: 0.86rem;
  padding-right: 0.25rem;
}

.section-title {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  color: var(--accent);
}

.section-lead {
  margin: 0 0 1.35rem;
  color: var(--muted);
  max-width: 36rem;
  line-height: 1.5;
  font-size: 0.95rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem;
  margin-bottom: 1rem;
  animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.panel-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1rem;
}

.inline-form .field {
  flex: 1;
  min-width: 180px;
}

.inline-form .btn {
  flex-shrink: 0;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field > span,
label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="number"],
input[type="text"] {
  width: 100%;
  background: #12141a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--paper);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.8rem 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input:focus {
  border-color: var(--accent);
}

.mmr-saved {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.mmr-saved .value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
}

.mmr-saved .hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.role-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 640px) {
  .role-pick {
    grid-template-columns: 1fr;
  }
}

.role-card {
  text-align: left;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: inherit;
  padding: 1.05rem 1rem;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.role-card:hover {
  border-color: rgba(240, 226, 24, 0.35);
}

.role-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(240, 226, 24, 0.25);
  background: rgba(240, 226, 24, 0.05);
}

.role-card strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--accent);
}

.role-card span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.role-actions {
  margin-top: 1rem;
}

.invite-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.invite-box code {
  flex: 1;
  min-width: 200px;
  background: #12141a;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--accent);
  font-family: var(--font);
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.35rem;
  border-bottom: 1px solid var(--line);
}

.player-row:last-child {
  border-bottom: 0;
}

.player-row img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}

.player-meta {
  flex: 1;
  min-width: 0;
}

.player-meta .pn {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta .sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.1rem;
}

.badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  vertical-align: middle;
}

.flash {
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line-strong);
  background: rgba(240, 226, 24, 0.08);
  border-radius: var(--radius-sm);
  color: var(--paper);
  font-size: 0.9rem;
}

.flash.error {
  border-color: rgba(255, 92, 122, 0.4);
  background: rgba(255, 92, 122, 0.1);
  color: #ffc2cd;
}

.status-pill {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ok);
}

.error-inline {
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 0.65rem;
}

.empty {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
}

.contacts {
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

.contact-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-link:hover {
  opacity: 0.85;
}

.accent-num {
  color: var(--accent);
  font-weight: 800;
}

.invites-banner {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-bottom: 1rem;
  animation: rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.invite-card {
  border-top: 1px solid var(--line);
  padding: 0.9rem 0 0.2rem;
  margin-top: 0.75rem;
}

.invite-card:first-of-type {
  border-top: 0;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
}

.invite-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.invite-card-head strong {
  color: var(--accent);
  font-size: 1.05rem;
}

.invite-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.contacts.muted,
.muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.pos-pick {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
}

@media (max-width: 720px) {
  .pos-pick {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pos-card {
  text-align: left;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: inherit;
  padding: 0.75rem 0.7rem;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.pos-card:hover,
.pos-card.active {
  border-color: var(--accent);
  background: rgba(240, 226, 24, 0.06);
}

.pos-card strong {
  display: block;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.pos-card span {
  color: var(--muted);
  font-size: 0.75rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.filter-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.disband-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.hint-line {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.rules-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--paper);
  cursor: pointer;
  line-height: 1.45;
}

.rules-check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.rules-check a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rules-check a:hover {
  opacity: 0.85;
}
