@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap");

:root {
  --bg: #0b0c10;
  --panel: #11131a;
  --text: #e9ecf1;
  --muted: #aab2c0;
  --border: rgba(255,255,255,0.10);
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
  --r: 14px;
  --topbar: rgba(17, 19, 26, 0.75);
  --soft: rgba(255,255,255,0.06);
  --soft2: rgba(255,255,255,0.08);
  --softHover: rgba(255,255,255,0.10);
  --promo-bg: rgba(8, 8, 16, 0.92);
  --promo-badge-bg: rgba(10, 12, 18, 0.9);
  --promo-text: var(--text);
  --promo-muted: color-mix(in srgb, var(--promo-text) 88%, transparent);
  --promo-hover-overlay: rgba(255,255,255,0.05);
  --promo-lift: 6px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Roboto", ui-sans-serif, system-ui, -apple-system, Segoe UI, Arial;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }

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

.topbar{
  position: sticky;
  top: 0;
  z-index: 20;

  display: grid;
  grid-template-columns: auto 1fr auto; /* left / flexible center / right */
  align-items: center;
  gap: 14px;

  padding: 12px 16px;
  background: var(--topbar);
  /* background: rgba(17, 19, 26, 0.75); */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-left{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  min-width: 0;
}

.brand{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo{
  height: 44px;     /* tweak size */
  width: auto;
  display: block;
  transform: scale(1.7);
  transform-origin: left center;
}

@media (max-width: 640px) {
  .brand-logo { display: none; }
}

.navlinks{
  display: flex;
  gap: 14px;
  align-items: center;
  justify-self: center;

  margin-left: 0; /* remove the old offset */
}

.right{
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  position: relative;
  margin-left: 0;
}

.navlinks a { opacity: 0.9; }
.navlinks a.active { opacity: 1; text-decoration: underline; }


.icon-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.btn {
  border: 1px solid var(--border);
  /* background: rgba(255,255,255,0.06); */
  background: var(--soft);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.btn:hover, .icon-btn:hover { background: var(--softHover); } /* was rgba(255,255,255,0.10) */

.dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  width: 170px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
}
.dropdown-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 10px 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.dropdown-item:hover { background: var(--soft); } /* was rgba(255,255,255,0.07) */
.dropdown-item.danger { color: #ffb3b3; }

.page { max-width: 980px; margin: 0 auto; padding: 24px 16px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
}

.site-content {
  flex: 1;
}

.site-footer {
  margin-top: 36px;
  padding: 18px 16px 26px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--muted);
  background: transparent;
  border-top: 1px solid var(--border);
}

.modal-backdrop, .drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 30;
}

.modal {
  position: fixed;
  z-index: 40;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  width: min(460px, calc(100% - 26px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.modal-title {
  font-size: 20px;
}
.modal-head h2 { margin: 0; font-size: 18px; }
.providers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.provider {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px;
  text-align: center;
  /* background: rgba(255,255,255,0.05); */
  background: var(--soft);
}
.provider:hover { background: var(--softHover); text-decoration: none; }/* was rgba(255,255,255,0.10) */
.provider.discord {
  background: #5865f2;
  border-color: rgba(88, 101, 242, 0.7);
  color: #ffffff;
}
.provider.discord:hover { background: #4c5be3; }
.provider.twitch {
  background: #9146ff;
  border-color: rgba(145, 70, 255, 0.7);
  color: #ffffff;
}
.provider.twitch:hover { background: #7f3df0; }

.consent-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.72);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.consent-modal {
  width: min(520px, calc(100% - 24px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.consent-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}
.consent-lead {
  margin: 0 0 12px;
  color: var(--muted);
}
.consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0;
  font-size: 14px;
}
.consent-check input {
  margin-top: 3px;
}
.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.consent-accept {
  background: #3b82f6;
  border-color: rgba(59, 130, 246, 0.6);
  color: #fff;
}
.consent-accept:hover {
  background: #2563eb;
}
.consent-accept:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.consent-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.consent-declined {
  margin-top: 8px;
  color: #ffb3b3;
  font-size: 13px;
}
body.consent-locked {
  overflow: hidden;
}
body.consent-locked > *:not(.consent-backdrop) {
  filter: blur(6px);
}
.provider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  transform: translateY(1px);
}
.provider-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.faq-q-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-q {
  font-weight: 800;
}

.faq-a {
  color: var(--muted);
  margin-top: 8px;
}

.faq-toggle {
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.faq-a img,
.faq-q img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.faq-a a,
.faq-q a {
  text-decoration: underline;
}

.faq-editor {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.faq-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.home-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 20px;
}

.home-logo img {
  width: 100%;
  max-width: 500px;
  height: auto;
}

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

.drawer {
  position: fixed;
  z-index: 40;
  top: 0; left: 0;
  height: 100%;
  width: 280px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 10px;
}
.drawer-links { display: flex; flex-direction: column; gap: 10px; padding: 8px 2px; }
/* Drawer items: make links and dropdown toggles the same height */
.drawer-links a {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  margin: 0;                 /* kill any default margins */
  opacity: 0.92;
}

.drawer-links a:hover {
  background: rgba(255,255,255,0.06);
  text-decoration: none;
  opacity: 1;
}

/* Ensure buttons don’t introduce extra spacing */
.drawer-links .drawer-admin-toggle {
  margin: 0;
}

/* Optional: slightly tighter spacing between rows */
.drawer-links { gap: 6px; }

.drawer-footer { margin-top: auto; padding: 10px 2px 2px; }
.full { width: 100%; }

.profile-row { display: flex; gap: 14px; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--border); background: var(--soft); object-fit: cover; } /*background: rgba(255,255,255,0.06);*/
.big { font-size: 20px; font-weight: 800; }
.muted { color: var(--muted); font-size: 14px; }

/* Responsive behavior:
   - Hide nav links, show burger on small screens */
.burger { display: none; }

@media (max-width: 700px) {
  .navlinks { display: none; }
  .burger { display: inline-flex; }
}

@media (max-width: 420px) {
  .providers { grid-template-columns: 1fr; }
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  /* background: rgba(255,255,255,0.06); */
  background: var(--soft);
}

.auth-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connect-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.provider-left {
  display: flex;
  align-items: center;     /* <-- makes label + status line up */
  gap: 14px;
  min-width: 0;
}

.provider-label {
  font-weight: 800;
  width: 90px;             /* <-- keeps Discord/Twitch aligned */
  flex: 0 0 auto;
}

.provider-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.provider-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  /* background: rgba(255,255,255,0.06); */
  background: var(--soft);
  flex: 0 0 auto;
}

.provider-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connect-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Promo cards grid */
/* Full-bleed cards section */
.cards-section.fullbleed {
  width: 100%;
  padding: 22px 16px 40px;
}

/* "Wrap" gives the cards a larger max width than .page */
.cards-wrap {
  max-width: 1600px;     /* increase/decrease to taste */
  margin: 0 auto;
}

.cards-section { margin-top: 18px; }
.cards-grid {
  display: grid;
  gap: 22px;

  /* Responsive columns:
     - Each card wants at least 320px
     - The grid will automatically fit as many columns as it can */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.cards-block { width: 100%; }

.cards-heading {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.4px;
  padding: 0 2px;
  color: var(--text);
}

/* Primary = big cards */
/* MAIN (big cards) — never stretch bigger just because there are fewer cards */
.cards-grid-primary {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}

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

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

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


/* Secondary = smaller cards */
.cards-grid-secondary {
  display: grid;
  gap: 18px;
  align-items: start;
  grid-template-columns: 1fr;
}

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

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

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


/* Make card clickable */
.promo-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.promo-card-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 6px;
  border-radius: 26px;
}

/* Smaller card variant */
.promo-card.secondary {
  padding: 22px 18px;
  min-height: 360px;
  border-radius: 22px;
}

.promo-card.secondary .promo-title {
  font-size: 15px;
  letter-spacing: 2px;
}

.promo-card.secondary .promo-lines {
  font-size: 15px;
  gap: 10px;
}

.promo-card.secondary .promo-logo img {
  max-height: 56px;
}

/* IMPORTANT: clickable cards must not underline */
.promo-card-link,
.promo-card-link:hover,
.promo-card-link:focus,
.promo-card-link:active,
.promo-card-link:visited {
  text-decoration: none !important;
  /* color: inherit; */
}

.promo-card-link { cursor: pointer; }

/* Secondary should not be stretched */
.cards-grid-secondary { align-items: start; }
.promo-card.secondary { min-height: auto; height: auto; }
.promo-card:not(.secondary) .promo-inner { height: 100%; }

/* Stack on mobile */
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: 1fr; }
}

.promo-card {
  --accent: #12b5ff;
  --accent2: var(--accent);
  position: relative;
  border-radius: 26px;
  padding: 34px 28px;
  min-height: 560px;
  border: 2px solid color-mix(in srgb, var(--accent) 85%, rgba(255,255,255,0.08));
  background:
    radial-gradient(1200px circle at 15% 0%,
      color-mix(in srgb, var(--accent) 22%, transparent),
      transparent 55%),
    radial-gradient(900px circle at 85% 100%,
      color-mix(in srgb, var(--accent2) 18%, transparent),
      transparent 60%),
    var(--promo-bg); /* was rgba(8, 8, 16, 0.92) */

  color: var(--promo-text);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 0 44px color-mix(in srgb, var(--accent) 55%, transparent);
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease;
  will-change: transform;
}

.promo-card::before {
  content: "";
  position: absolute;
  inset: -40px;
  background:
    radial-gradient(600px circle at 20% 0%,
      color-mix(in srgb, var(--accent) 16%, transparent),
      transparent 60%);
  filter: blur(18px);
  opacity: 0.9;
  pointer-events: none;
}

.promo-card::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  background: var(--promo-hover-overlay);
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events:none;
}

.promo-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.promo-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 85%, rgba(255,255,255,0.10));
  background: var(--promo-badge-bg); /* was rgba(10, 12, 18, 0.9) */
  box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 55%, transparent);
}

.promo-logo {
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  width: 100%;
}

.promo-logo img {
  max-height: 72px;
  max-width: 80%;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,0.55));
}

.promo-title {
  margin-top: 6px;
  font-weight: 900;
  letter-spacing: 3px;
  font-size: 18px;
  opacity: 0.9;
}

.promo-divider {
  width: 78%;
  height: 1px;
  margin: 28px 0 22px;
  background: linear-gradient(
    to right,
    transparent,
    color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,0.10)),
    transparent
  );
}

.promo-lines {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
  font-size: 18px;
  letter-spacing: 0.4px;
}

.promo-lines .mutedline{
  color: var(--promo-muted);
  opacity: 1; /* 0.92*/
}

.promo-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.promo-info-btn {
  border-color: color-mix(in srgb, var(--accent) 60%, rgba(255,255,255,0.2));
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
}

.promo-card.secondary .promo-info-btn {
  font-size: 12px;
  padding: 8px 12px;
}

.promo-highlight {
  margin-top: auto;
  padding-top: 26px;
  font-size: 20px;
  letter-spacing: 0.6px;
}

.promo-highlight .accent {
  color: var(--accent);
  font-weight: 900;
  margin-right: 8px;
}

.promo-card:hover{
  transform: translateY(calc(var(--promo-lift) * -1));
  border-color: color-mix(in srgb, var(--accent) 92%, rgba(255,255,255,0.16));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 54px color-mix(in srgb, var(--accent) 65%, transparent),
    0 18px 54px rgba(0,0,0,0.35);
}

.promo-card:hover::after{
  opacity: 1;
}

.card-info-modal.modal {
  width: min(640px, calc(100% - 28px));
}

.tournament-info-trigger {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--link);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.tournament-info-trigger:hover {
  text-decoration: underline;
}

.tournament-image-modal.modal {
  width: min(960px, calc(100% - 28px));
  top: 8%;
}

.tournament-image-modal-img {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
}

.card-info-line {
  margin: 0;
  color: var(--promo-muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}

@media (max-width: 1000px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.json-editor {
  width: 100%;
  height: 420px;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
}

.uploads-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tab-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.tab-btn.active {
  border-color: rgba(255,255,255,0.3);
  text-decoration: underline;
}

.tab-panel { display: none; margin-top: 12px; }
.tab-panel.active { display: block; }

.tournament-list {
  display: grid;
  gap: 14px;
  margin-top: 10px;
  justify-items: center;
}

.tournament-section {
  margin-top: 18px;
}

.tournament-card h2 {
  margin: 0 0 4px;
}

.tournament-card {
  width: min(100%, 960px);
}

.tournament-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tournament-search {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0;
}

.tournament-search input[type="search"] {
  max-width: 260px;
  width: 100%;
}

.tournament-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.05);
}

.table-wrap {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  overflow: auto;
  max-height: 320px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  background: rgba(17, 19, 26, 0.92);
  padding: 10px;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.tournament-card .table-wrap thead th,
.tournament-card .table-wrap tbody td {
  text-align: center;
}

.table-wrap tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 700px) {
  .table-wrap table { min-width: 0; }
  .table-wrap thead th,
  .table-wrap tbody td {
    padding: 6px 8px;
    font-size: 12px;
  }
}

.upload-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.upload-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.upload-thumb {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.upload-url {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

/* Make admin page content wider than normal pages */
body.admin-page .page {
  max-width: 1400px;
}

/* Give the JSON editor column more space */
body.admin-page .admin-grid {
  grid-template-columns: 0.9fr 2.1fr;
}

/* Optional: make the editor taller too (feels nicer) */
body.admin-page .json-editor {
  height: 560px;
}

.preview-title {
  max-width: 1600px;
  margin: 0 auto 18px; 
  padding: 0 16px;
}

.section-title {
  margin: 18px 0 10px;
  font-size: 20px;
  font-weight: 900;
}

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

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

@media (min-width: 1100px){
  /* Always 3 columns when screen allows — even if only 1 or 2 videos exist */
  .video-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


.video-card {
  display: block;
  text-decoration: none !important;
  color: inherit;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
}

.video-card:hover { transform: translateY(-1px); transition: transform 120ms ease; }

.video-thumb {
  height: 160px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.video-thumb-fallback {
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.12), transparent 55%),
              rgba(255,255,255,0.06);
}

.video-title {
  padding: 12px;
  font-weight: 700;
  opacity: 0.95;
}

.video-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
}

.video-modal {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(980px, calc(100vw - 28px));
  background: rgba(10, 12, 18, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  z-index: 2001;
  padding: 12px;
}

.video-close { position: absolute; top: 10px; right: 10px; }

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
}

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

.input {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 10px 12px;
}

@media (max-width: 900px) {
  .admin-form { grid-template-columns: 1fr; }
}

.admin-list { display: grid; gap: 10px; margin-top: 10px; }
.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: 14px;
  background: rgba(255,255,255,0.04);
}
.admin-row-left { display: grid; gap: 6px; min-width: 0; }
.tag {
  display: inline-flex; width: fit-content;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  font-size: 12px; font-weight: 800;
}

.video-admin-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.video-admin-subtitle {
  margin: 0 0 10px;
  font-weight: 900;
  opacity: 0.95;
}

@media (max-width: 900px) {
  .video-admin-split {
    grid-template-columns: 1fr;
  }
}

.modal-body{
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

/* Bigger modal inputs (admin edit) */
.modal-body .input {
  font-size: 16px;
  padding: 12px 14px;
}

.modal-body .field span {
  font-size: 13px;
}

/* Make the edit modal a bit wider */
#editVideoModal.modal {
  width: min(720px, calc(100vw - 28px));
}


.field span{
  display:block;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 6px;
}

.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* Danger button for delete */
.btn.danger{
  border-color: rgba(255, 80, 80, 0.55);
  color: #ffb3b3;
}
.btn.danger:hover{
  box-shadow: 0 0 18px rgba(255,80,80,0.25);
}

.video-title {
  padding: 12px;
  font-weight: 700;
  opacity: 0.95;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#editVideoModal {
  width: min(980px, calc(100vw - 28px));
}

#editVideoModal .field {
  width: 100%;
}

#editVideoModal .input {
  width: 100%;
  box-sizing: border-box;
}

/* Topbar admin dropdown */
.nav-dd {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.navlinks a,
.nav-dd-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;          /* pick a size that matches your bar */
  padding: 0 12px;       /* vertical padding removed; height handles it */
  line-height: 1;        /* remove baseline weirdness */
  border-radius: 12px;
}

.navlinks a.active,
.nav-dd-btn.active {
  box-shadow: inset 0 -2px 0 rgba(255,255,255,0);
}

.nav-dd-btn {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.nav-dd-btn:hover {
  /* background: rgba(255,255,255,0.06); */
  background: var(--soft);
  opacity: 1;
}

.nav-dd-btn.active {
  /* background: rgba(255,255,255,0.08); */
  background: var(--soft2);
  opacity: 1;
  font-weight: 800;
}

.nav-dd-menu{
  position: absolute;
  top: calc(100% + 10px);

  left: 0;          /* <-- key change */
  right: auto;      /* <-- key change */
  transform: translateX(0);

  min-width: 220px;
  z-index: 2000;

  border: 1px solid var(--border);
  /* background: rgba(10, 12, 18, 0.96); */
  background: var(--panel);
  border-radius: 14px;
  /* box-shadow: 0 10px 30px rgba(0,0,0,0.4); */
  box-shadow: var(--shadow);
  padding: 8px;
}

.nav-dd-menu a {
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  opacity: 0.92;
}

.nav-dd-menu a:hover {
  /* background: rgba(255,255,255,0.06); */
  background: var(--soft);
  opacity: 1;
}

.nav-dd-menu a.active {
  /* background: rgba(255,255,255,0.08); */
  background: var(--soft2);
  opacity: 1;
  font-weight: 800;
}

.caret {
  opacity: 0.8;
  display: inline-block;           /* needed so transform works nicely */
  transition: transform 120ms ease;
}

/* Topbar Admin dropdown: rotate caret when aria-expanded is true */
.nav-dd-btn[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.drawer-admin-toggle[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}


/* Drawer admin collapsible */
.drawer-admin-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-admin-sub {
  display: grid;
  gap: 6px;
  padding-left: 12px;
  margin-top: 6px;
  /* border-left: 1px solid rgba(255,255,255,0.08); */
  border-left: 1px solid var(--border);
}

.drawer-admin-sub a {
  opacity: 0.9;
}

.drawer-admin-toggle{
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 12px;       /* match your drawer links */
  border-radius: 12px;
  cursor: pointer;
}

.drawer-admin-toggle:hover { background: var(--soft); } /* was rgba(255,255,255,0.06) */



/* === Theme presets === */
html { color-scheme: dark; }

/* Make selects always use your theme colors */
select,
select.input {
  background-color: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

/* Dropdown list (options) */
select option {
  background-color: var(--panel);
  color: var(--text);
}

html[data-theme="midnight"]{
  --bg:#0b0c10; --panel:#11131a; --text:#e9ecf1; --muted:#aab2c0;
  --border:rgba(255,255,255,0.10); --shadow:0 10px 30px rgba(0,0,0,0.45);
  --topbar:rgba(17, 19, 26, 0.75);
}

html[data-theme="aurora"]{
  --bg:#061410; --panel:#0b1f18; --text:#eafff7; --muted:#a7d2c5;
  --border:rgba(170,255,226,0.14); --shadow:0 10px 30px rgba(0,0,0,0.50);
  --topbar:rgba(11, 31, 24, 0.72);
}

html[data-theme="lagoon"]{
  --bg:#041218; --panel:#071f2a; --text:#e9fbff; --muted:#9cd5df;
  --border:rgba(120,255,238,0.16); --shadow:0 10px 30px rgba(0,0,0,0.50);
  --topbar:rgba(7, 31, 42, 0.72);
}

html[data-theme="ocean"]{
  --bg:#070b1a; --panel:#0d1430; --text:#eaf0ff; --muted:#a9b7dd;
  --border:rgba(175,200,255,0.14); --shadow:0 10px 30px rgba(0,0,0,0.50);
  --topbar:rgba(13, 20, 48, 0.72);
}

html[data-theme="mocha"]{
  --bg:#120d0a; --panel:#1b1410; --text:#f4efe8; --muted:#c7b8ab;
  --border:rgba(255,230,200,0.12); --shadow:0 10px 30px rgba(0,0,0,0.55);
  --topbar:rgba(27, 20, 16, 0.74);
}

html[data-theme="ember"]{
  --bg:#140a0a; --panel:#221010; --text:#fff1f1; --muted:#e0b2b2;
  --border:rgba(255,160,160,0.14); --shadow:0 10px 30px rgba(0,0,0,0.55);
  --topbar:rgba(34, 16, 16, 0.74);
}

html[data-theme="violet"]{
  --bg:#0f0a18; --panel:#18102a; --text:#f3efff; --muted:#c9bee8;
  --border:rgba(210,190,255,0.14); --shadow:0 10px 30px rgba(0,0,0,0.55);
  --topbar:rgba(24, 16, 42, 0.74);
}

html[data-theme="slate"]{
  --bg:#0b0f12; --panel:#121a20; --text:#eef4f8; --muted:#b6c3cf;
  --border:rgba(210,230,255,0.10); --shadow:0 10px 30px rgba(0,0,0,0.48);
  --topbar:rgba(18, 26, 32, 0.74);
}
html[data-theme="porcelain"] {
  color-scheme: light;

  --bg: #f3f5f9;
  --panel: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --border: rgba(17, 24, 39, 0.14);
  --shadow: 0 12px 28px rgba(17, 24, 39, 0.10);

  --topbar: rgba(255, 255, 255, 0.78);

  /* flip fills to dark in light theme */
  --soft: rgba(17, 24, 39, 0.06);
  --soft2: rgba(17, 24, 39, 0.09);
  --softHover: rgba(17, 24, 39, 0.12);
  --promo-bg: rgba(17, 24, 39, 0.90);
  --promo-badge-bg: rgba(17, 24, 39, 0.92);
  --promo-text: #f8fafc;
  --promo-muted: rgba(248, 250, 252, 0.84);
  --promo-hover-overlay: rgba(255,255,255,0.08);
}

html[data-theme="fuchsia"] {
  color-scheme: dark;

  --bg: #120015;
  --panel: #1b0320;
  --text: #fff1fb;
  --muted: #f0b5da;
  --border: rgba(255, 105, 200, 0.18);
  --shadow: 0 12px 32px rgba(0,0,0,0.55);

  --topbar: rgba(27, 3, 32, 0.78);

  --soft: rgba(255,255,255,0.06);
  --soft2: rgba(255,255,255,0.09);
  --softHover: rgba(255,255,255,0.12);
}


/* === Small form controls (profile page) === */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; color: var(--muted); }
.select {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
}




.raffle-row { text-decoration: none; color: inherit; }
.raffle-row:hover { background: var(--soft); }

.raffle-kv {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

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

.raffle-title{
  display:flex;
  justify-content:space-between;
  gap: 14px;
  align-items:flex-start;
}

.countdown{ font-variant-numeric: tabular-nums; }

.checks{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 6px;
}
.check{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft);
}
.check input{
  accent-color: var(--text);
}


.reqs{ margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--soft); }
.req-title{ font-weight: 900; margin-bottom: 8px; }
.req-tags{ display:flex; gap:8px; flex-wrap:wrap; }





/* ===== Admin roulette ===== */
.roulette-card { margin-top: 12px; }
.roulette-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.roulette-testrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}

.roulette-testrow-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roulette-fake-input {
  width: 110px;
}

.roulette-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--soft) 55%, transparent));
  padding: 10px;
  height: 106px;
}

.roulette-viewport::before,
.roulette-viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  pointer-events: none;
  z-index: 3;
}

.roulette-viewport::before {
  left: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--panel) 92%, transparent), transparent);
}

.roulette-viewport::after {
  right: 0;
  background: linear-gradient(270deg, color-mix(in srgb, var(--panel) 92%, transparent), transparent);
}

.roulette-marker {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 6px;
  transform: translateX(-3px);
  background: linear-gradient(180deg, rgba(0,0,0,0.75), rgba(0,0,0,0.35));
  z-index: 4;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.55), 0 0 12px rgba(0,0,0,0.4);
}

.roulette-track {
  --itemW: 134px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  transform: translate3d(0,0,0);
  will-change: transform;
}

.roulette-item {
  position: relative;
  flex: 0 0 var(--itemW);
  height: 86px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--soft) 85%, transparent);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  box-sizing: border-box;
  user-select: none;
}

.roulette-item img {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--soft2);
  flex: 0 0 auto;
}

.roulette-item .name {
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70px;
}

.roulette-item.is-fake {
  border-style: dashed;
  opacity: 0.92;
}

.roulette-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.roulette-item.is-winner {
  border-color: color-mix(in srgb, var(--accent) 85%, rgba(255,255,255,0.20));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent),
    0 0 26px color-mix(in srgb, var(--accent) 40%, transparent);
  transform: translateY(-1px) scale(1.02);
}

.roulette-status { margin-top: 8px; }

.roulette-card .btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .roulette-track { --itemW: 120px; gap: 10px; }
  .roulette-fake-input { width: 100px; }
  .roulette-item { height: 80px; padding: 10px; }
  .roulette-item img { width: 46px; height: 46px; }
}

/* ===== Toast ===== */
.toast{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  width: min(560px, calc(100vw - 24px));
  z-index: 9999;

  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;

  /* optional: nicer pop-in */
  animation: toastPop 140ms ease-out;
}

body.toast-open::before{
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 9998;
}

@keyframes toastPop{
  from { transform: translate(-50%, -50%) scale(0.98); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}


.toast.toast-error{ border-color: rgba(255, 80, 80, 0.45); }
.toast.toast-ok{ border-color: rgba(80, 255, 160, 0.35); }

.toast-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.toast-title{ font-weight: 900; }
.toast-msg{ opacity: 0.92; line-height: 1.35; }
.toast-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.toast .btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 36px;
  padding: 0 12px;
}
.toast-close{
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text);
  opacity: 0.75;
}
.toast-close:hover{ opacity: 1; }

@media (max-width: 640px){
  .toast-actions{
    flex-direction: column;
    align-items: stretch;
  }
  .toast .btn{
    width: 100%;
  }
}

/* ===== Requirement chips ===== */
.req-box{
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft);
}

.req-title{
  font-weight: 900;
  margin-bottom: 8px;
}

.req-chips{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

.req-chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--fill-1, rgba(255,255,255,0.04));
  color: inherit;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.req-chip.missing:hover{
  background: var(--softHover);
  cursor: pointer;
}

.req-chip.ok{
  border-color: rgba(80, 255, 160, 0.35);
}

.req-chip .mark{
  display:inline-flex;
  width: 16px;
  height: 16px;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1;
  opacity: 0.9;
}

.req-chip.ok .mark{
  border-color: rgba(80, 255, 160, 0.45);
}

.req-chip.missing .mark{
  border-color: rgba(255, 200, 120, 0.35);
}
