/* Toybox shared navbar + account/auth UI — one navbar, every page. */
:root {
  --tb-line: rgba(255,255,255,.09);
  --tb-muted: #a6a6af;
  --tb-dim: #71717a;
  --tb-text: #f5f5f7;
}

/* ================= Top bar ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
  padding: 0 36px;
  background: linear-gradient(to bottom, rgba(0,0,0,.8), rgba(0,0,0,.35) 70%, transparent);
  backdrop-filter: blur(6px);
}
.brand {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: .06em;
  font-size: 26px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(to bottom, #f6121d, #b00710);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--tb-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: color .15s;
  white-space: nowrap;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.06); }

/* Shop dropdown */
.nav-item { position: relative; }
.nav-item > a { display: inline-flex; align-items: center; gap: 5px; }
.nav-item__caret { font-size: 9px; opacity: .7; transition: transform .15s; }
.nav-item:hover .nav-item__caret { transform: rotate(180deg); }
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  background: #1b1b22;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0,0,0,.55);
}
.dropdown::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown { display: flex; }
.dropdown a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--tb-muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.dropdown a:hover { color: #fff; background: rgba(255,255,255,.06); }

/* ================= Search ================= */
.search { display: flex; align-items: center; }
.search__btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
.search__btn:hover { background: rgba(255,255,255,.06); }
.search__input {
  width: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  outline: none;
  transition: width .2s ease, opacity .2s ease, padding .2s ease;
}
.search.is-open .search__input { width: 240px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.15); opacity: 1; }
.search__input::placeholder { color: var(--tb-dim); }
.search__clear { display: none; place-items: center; width: 28px; height: 28px; margin-left: 6px; border: 0; border-radius: 6px; background: transparent; color: var(--tb-muted); font-size: 15px; cursor: pointer; }
.search.is-open .search__clear { display: grid; }
.search__clear:hover { color: #fff; background: rgba(255,255,255,.06); }

/* ================= Sign in / Create / Account ================= */
.signin { margin-left: 8px; display: none; }
body:not(.logged-in) .signin { display: inline-flex; }
.signin__btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #e50914;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.signin__btn:hover { background: #f6121d; }
.signin__btn:active { transform: scale(.96); }

.create { margin-left: 8px; }
body:not(.logged-in) .create { display: none; }
.create__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(120deg, #c084fc, #f472b6);
  color: #0b0b0e;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, filter .15s;
}
.create__btn:hover { filter: brightness(1.08); }
.create__btn:active { transform: scale(.96); }

.account { position: relative; margin-left: 8px; }
body:not(.logged-in) .account { display: none; }
.account__btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 6px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.account__btn:hover { background: rgba(255,255,255,.08); }
.account__avatar { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; overflow: hidden; }
.account__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.account__menu {
  position: absolute;
  top: 44px;
  right: 0;
  width: 190px;
  border-radius: 10px;
  background: #1b1b22;
  border: 1px solid rgba(255,255,255,.09);
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  display: none;
}
.account__menu.is-open { display: block; }
.account__menu p { margin: 0; padding: 8px 10px 6px; font-size: 13px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.09); }
.account__menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--tb-muted); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.account__menu button:hover { background: rgba(255,255,255,.08); color: #fff; }
.acct-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--tb-muted); }
.acct-badge[hidden] { display: none; }
.acct-email { margin: -4px 0 10px; font-size: 11px; color: var(--tb-dim); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-email[hidden] { display: none; }

/* ================= Full-screen auth (login / profiles) ================= */
.screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1000px 520px at 50% -10%, rgba(229,9,20,.18), transparent 60%), #08080c;
  padding: 24px;
}
.screen.is-open { display: flex; }
.screen__brand {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: .06em;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1;
  margin-bottom: 26px;
  background: linear-gradient(to bottom, #f6121d, #b00710);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-card { position: relative; width: min(380px, 92vw); border-radius: 14px; background: rgba(19,19,24,.92); border: 1px solid rgba(255,255,255,.09); padding: 30px; }
.login-card h2 { margin: 0 0 18px; font-size: 22px; font-weight: 800; }
.login-card__close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--tb-muted); font-size: 18px; cursor: pointer; }
.login-card__close:hover { color: #fff; background: rgba(255,255,255,.08); }
.login-card .field { display: grid; gap: 6px; margin-bottom: 14px; }
.login-card label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tb-dim); }
.login-card input { height: 44px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(0,0,0,.35); color: var(--tb-text); font-family: inherit; font-size: 14px; padding: 0 13px; outline: none; width: 100%; }
.login-card input:focus { border-color: #e50914; }
.login-hint { margin: 14px 0 0; font-size: 12px; color: var(--tb-dim); text-align: center; line-height: 1.5; }

.btn--provider { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 44px; margin-bottom: 10px; border: 0; border-radius: 8px; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; transition: filter .15s, transform .1s; }
.btn--provider:hover { filter: brightness(1.12); }
.btn--provider:active { transform: scale(.98); }
.btn--github { background: #24292e; border: 1px solid rgba(255,255,255,.15); }
.btn--cfx { background: linear-gradient(135deg, #ff9900, #e8590c); }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; color: var(--tb-dim); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.09); }
.login-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.login-tab { flex: 1; height: 34px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: transparent; color: var(--tb-muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.login-tab.is-active { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }

/* Profiles ("who's watching") */
.profiles { max-width: 880px; width: 100%; text-align: center; }
.profiles h2 { margin: 0 0 26px; font-size: clamp(26px, 4vw, 40px); font-weight: 800; }
.profiles__grid { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.profile { position: relative; width: 120px; background: none; border: 0; cursor: pointer; color: var(--tb-muted); font-size: 14px; font-weight: 600; padding: 0; display: grid; gap: 10px; justify-items: center; }
.profile__avatar { width: 104px; height: 104px; border-radius: 12px; display: grid; place-items: center; font-size: 44px; border: 3px solid transparent; transition: border-color .15s, transform .15s; }
.profile__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.profile:hover .profile__avatar { border-color: #fff; transform: scale(1.04); }
.profile:hover { color: #fff; }
.profile--add .profile__avatar { border: 2px dashed rgba(255,255,255,.25); font-size: 40px; background: rgba(255,255,255,.03); }
.profiles__actions { display: flex; gap: 14px; justify-content: center; margin-top: 34px; }
.profiles__manage, .profiles__signin {
  padding: 9px 22px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.profiles__manage { border: 1px solid rgba(128,128,128,.55); background: transparent; color: #b3b3b3; }
.profiles__manage:hover { border-color: #fff; color: #fff; }
.profiles__signin { border: 1px solid transparent; background: #fff; color: #000; }
.profiles__signin:hover { background: rgba(255,255,255,.85); }
.profile__remove {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #e50914;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.profiles.is-managing .profile__remove { display: grid; place-items: center; }

/* ================= Modals ================= */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 100; place-items: center; background: rgba(0,0,0,.7); padding: 24px; }
.modal-overlay.is-open { display: grid; }
.modal { width: min(360px, 92vw); border-radius: 14px; background: #131318; border: 1px solid rgba(255,255,255,.09); padding: 26px; }
.modal h3 { margin: 0 0 6px; font-family: "Bebas Neue", sans-serif; font-size: 30px; letter-spacing: .03em; line-height: 1; }
.modal p { margin: 0 0 16px; color: var(--tb-muted); font-size: 13px; line-height: 1.5; }
.modal input { width: 100%; height: 42px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(0,0,0,.35); color: var(--tb-text); font-family: inherit; font-size: 14px; padding: 0 13px; margin-bottom: 14px; outline: none; }
.modal input:focus { border-color: #c084fc; }
.modal__actions { display: flex; gap: 10px; }

.modal .btn,
.login-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.modal .btn--play, .login-card .btn--play { background: #fff; color: #000; }
.modal .btn--play:hover, .login-card .btn--play:hover { background: rgba(255,255,255,.85); }
.modal .btn--info, .login-card .btn--info { background: rgba(109,109,110,.6); color: #fff; }
.modal .btn--info:hover, .login-card .btn--info:hover { background: rgba(109,109,110,.42); }
.login-card .btn--play { width: 100%; margin-top: 6px; }

.modal--wide { width: min(560px, 94vw); }
.up-form { display: grid; gap: 14px; }
.up-form .field { display: grid; gap: 6px; }
.up-form label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tb-dim); }
.up-form input[type="text"], .up-form textarea, .up-form select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(0,0,0,.35);
  color: var(--tb-text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
}
.up-form select { cursor: pointer; }
.up-form input:focus, .up-form textarea:focus, .up-form select:focus { border-color: #c084fc; }
.create-types { display: flex; gap: 8px; flex-wrap: wrap; }
.ctype { height: 34px; padding: 0 14px; border: 1px solid rgba(255,255,255,.09); border-radius: 999px; background: transparent; color: var(--tb-muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.ctype.is-active { background: #c084fc; border-color: #c084fc; color: #0b0b0e; }
.drop { display: grid; place-items: center; min-height: 90px; border: 1px dashed rgba(255,255,255,.25); border-radius: 10px; color: var(--tb-muted); font-size: 13px; cursor: pointer; padding: 14px; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover { border-color: #c084fc; background: rgba(192,132,252,.06); }
.drop input { display: none; }
#upPreview { width: 100%; border-radius: 10px; background: #000; }

.wallet { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.wallet__label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tb-dim); }
.wallet__bal { font-size: 28px; font-weight: 800; margin-top: 2px; }
.tier { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 14px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; }
.tier__name { font-weight: 700; font-size: 14px; }
.tier__price { font-size: 12px; color: var(--tb-muted); margin-top: 2px; }
.methods { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.method { padding: 7px 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--tb-muted); }
.method.active { border-color: #c084fc; color: #fff; }
.pay-note { font-size: 12px; color: var(--tb-dim); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #131318; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 12px 18px; font-size: 14px; font-weight: 600; z-index: 200; opacity: 0; transition: opacity .25s, transform .25s; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================= Mobile nav ================= */
.nav-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.nav-toggle:hover { background: rgba(255,255,255,.08); }
.nav__signin {
  display: none;
  margin-top: 8px;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #e50914;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 900px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .brand { font-size: 22px; }
  .nav-toggle { display: grid; margin-left: auto; }
  body.logged-in .nav-toggle { margin-left: 0; }
  body.logged-in .account { margin-left: auto; }
  .nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-left: 0;
    padding: 10px 14px 16px;
    background: rgba(8,8,12,.98);
    border-bottom: 1px solid rgba(255,255,255,.09);
    box-shadow: 0 24px 60px rgba(0,0,0,.6);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { font-size: 15px; padding: 12px 14px; }
  .nav .search { width: 100%; padding: 2px 6px 12px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.09); }
  .nav .search__btn { display: none; }
  .nav .search__clear { display: none; }
  .nav .search .search__input { width: 100%; opacity: 1; padding: 10px 12px; border: 1px solid rgba(255,255,255,.15); }
  .nav-item { position: static; }
  .nav-item > a { width: 100%; justify-content: space-between; }
  .nav-item__caret { display: none; }
  .dropdown {
    position: static;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0 0 0 16px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .dropdown::before { display: none; }
  .dropdown a { padding: 10px 14px; }
  .signin { display: none !important; }
  .account__btn #accountName { display: none; }
  .account__btn { padding: 0 6px; }
  body:not(.logged-in) .nav__signin { display: flex; }
}
