/* Platform flow experience V2 — modern homepage/account/join surfaces only. */
html[data-ui-mode="modern"] body.platform-home.home-v2{
  --pf-panel:#0b1731;
  --pf-panel-2:#0d1c3a;
  --pf-line:rgba(161,184,232,.18);
  --pf-line-strong:rgba(176,197,240,.30);
  --pf-text:#fffaf2;
  --pf-muted:#a9b5ca;
  --pf-purple:#9251ff;
  --pf-purple-2:#7034e8;
  --pf-gold:#ffc94a;
  --pf-green:#53d7ad;
  --pf-red:#ff7286;
}

/* Universal room entry: feedback should feel immediate and unambiguous. */
html[data-ui-mode="modern"] body.platform-home.home-v2 .hero-join .join-panel{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .hero-join .join-copy{
  text-align:center!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .hero-join .join-copy h2{
  margin:0 0 7px!important;
  color:#dfe6f3!important;
  font-size:12px!important;
  font-weight:800!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .join-input-row:focus-within{
  border-color:rgba(167,126,255,.58)!important;
  box-shadow:0 0 0 3px rgba(146,81,255,.11),0 14px 36px rgba(0,0,0,.22)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .join-input-row button[disabled]{
  opacity:.68!important;
  cursor:progress!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .join-input-row button[aria-busy="true"]::before{
  content:"";
  width:14px;
  height:14px;
  border:2px solid rgba(30,22,8,.24);
  border-top-color:#211707;
  border-radius:50%;
  animation:pfSpin .7s linear infinite;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .join-status{
  display:flex!important;
  justify-content:center!important;
  align-items:center!important;
  min-height:25px!important;
  margin:5px 0 0!important;
  padding:0 8px!important;
  color:var(--pf-muted)!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:1.45!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .join-status[data-state="loading"]{color:#d8c9ff!important}
html[data-ui-mode="modern"] body.platform-home.home-v2 .join-status[data-state="success"]{color:#aaf0d4!important}
html[data-ui-mode="modern"] body.platform-home.home-v2 .join-status[data-state="error"]{color:#ffb1bd!important}
html[data-ui-mode="modern"] body.platform-home.home-v2 .join-status[data-state="loading"]::before{
  content:"";
  width:11px;
  height:11px;
  margin-inline-end:7px;
  border:2px solid rgba(216,201,255,.22);
  border-top-color:#d8c9ff;
  border-radius:50%;
  animation:pfSpin .72s linear infinite;
}

/* Account/auth modal: product-quality sheet instead of a generic form popup. */
html[data-ui-mode="modern"] body.platform-home.home-v2 .modal{
  padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))!important;
  background:rgba(2,7,18,.76)!important;
  backdrop-filter:blur(16px) saturate(118%)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .modal-card{
  width:min(530px,100%)!important;
  max-height:min(88dvh,780px)!important;
  padding:70px 28px 28px!important;
  border:1px solid var(--pf-line-strong)!important;
  border-radius:26px!important;
  background:
    radial-gradient(420px 230px at 100% 0,rgba(146,81,255,.13),transparent 62%),
    linear-gradient(180deg,rgba(13,28,58,.985),rgba(7,17,37,.99))!important;
  box-shadow:0 30px 90px rgba(0,0,0,.46),inset 0 1px rgba(255,255,255,.045)!important;
  scrollbar-width:thin;
  scrollbar-color:rgba(159,130,230,.45) transparent;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #authModal .modal-card::before{
  content:"";
  position:absolute;
  top:12px;
  right:18px;
  width:92px;
  height:52px;
  background:url('/assets/fbrkh-approved-brand.svg') center/contain no-repeat;
  pointer-events:none;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .modal-x{
  left:14px!important;
  top:14px!important;
  width:44px!important;
  height:44px!important;
  display:grid!important;
  place-items:center!important;
  border:1px solid var(--pf-line)!important;
  border-radius:13px!important;
  background:rgba(255,255,255,.045)!important;
  color:#e8edf5!important;
  font-size:25px!important;
  box-shadow:none!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .modal-x:hover{
  border-color:rgba(255,255,255,.28)!important;
  background:rgba(255,255,255,.075)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #authContent>h2{
  margin:0!important;
  font-size:clamp(28px,5vw,38px)!important;
  letter-spacing:-.04em!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #authContent>p{
  margin:8px 0 18px!important;
  color:var(--pf-muted)!important;
  font-size:13px!important;
  line-height:1.75!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .auth-tabs{
  gap:5px!important;
  margin:13px 0 16px!important;
  padding:4px!important;
  border-color:var(--pf-line)!important;
  border-radius:14px!important;
  background:rgba(255,255,255,.035)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .auth-tabs button{
  min-height:44px!important;
  border-radius:10px!important;
  color:#aeb9cc!important;
  font-size:13px!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .auth-tabs button.active{
  background:linear-gradient(180deg,var(--pf-purple),var(--pf-purple-2))!important;
  color:#fff!important;
  box-shadow:0 7px 18px rgba(112,52,232,.22)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #accountAuthForm{
  gap:10px!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #accountAuthForm input{
  width:100%!important;
  min-height:52px!important;
  padding:12px 14px!important;
  border:1px solid var(--pf-line)!important;
  border-radius:14px!important;
  background:rgba(3,11,27,.66)!important;
  color:var(--pf-text)!important;
  font-size:15px!important;
  outline:0!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #accountAuthForm input:focus{
  border-color:rgba(146,81,255,.62)!important;
  box-shadow:0 0 0 3px rgba(146,81,255,.11)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #accountAuthForm input::placeholder{color:#728099!important}
html[data-ui-mode="modern"] body.platform-home.home-v2 #accountAuthForm>.btn{
  width:100%!important;
  min-height:52px!important;
  border-radius:14px!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #accountAuthForm>.btn.primary{
  margin-top:2px!important;
  background:linear-gradient(180deg,var(--pf-purple),var(--pf-purple-2))!important;
  box-shadow:0 11px 25px rgba(112,52,232,.22)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #accountAuthForm>.btn.ghost{
  border-color:var(--pf-line)!important;
  background:rgba(255,255,255,.035)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #forgotPasswordBtn{
  min-height:42px!important;
  justify-self:center!important;
  color:#d4c2ff!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #authStatus{
  min-height:20px!important;
  color:#ffb1bd!important;
  font-size:11px!important;
  font-weight:800!important;
  text-align:center!important;
}

/* Signed-in account view. */
html[data-ui-mode="modern"] body.platform-home.home-v2 .platform-profile-hero{
  margin:0 0 14px!important;
  padding:14px!important;
  gap:13px!important;
  border-color:var(--pf-line)!important;
  border-radius:19px!important;
  background:linear-gradient(135deg,rgba(146,81,255,.09),rgba(255,201,74,.025))!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .platform-profile-avatar{
  width:70px!important;
  height:70px!important;
  flex-basis:70px!important;
  border:2px solid rgba(255,201,74,.74)!important;
  box-shadow:0 8px 22px rgba(0,0,0,.24)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .platform-profile-hero h2{
  margin:2px 0!important;
  color:var(--pf-text)!important;
  font-size:23px!important;
  line-height:1.25!important;
  overflow-wrap:anywhere;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .platform-profile-hero small,
html[data-ui-mode="modern"] body.platform-home.home-v2 .platform-profile-hero p{
  color:var(--pf-muted)!important;
  font-size:11px!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .account-photo-button{
  min-height:50px!important;
  margin:2px 0 10px!important;
  border-radius:14px!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .account-hint{
  margin:0 0 14px!important;
  padding:11px 12px!important;
  border:1px solid var(--pf-line)!important;
  border-radius:14px!important;
  background:rgba(255,255,255,.025)!important;
  color:var(--pf-muted)!important;
  font-size:11px!important;
  line-height:1.65!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .notification-settings{
  margin:12px 0!important;
  padding:15px!important;
  border:1px solid var(--pf-line)!important;
  border-radius:18px!important;
  background:rgba(255,255,255,.025)!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .notification-settings h3{
  margin:0 0 10px!important;
  font-size:16px!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .notification-settings form{gap:7px!important}
html[data-ui-mode="modern"] body.platform-home.home-v2 .notification-toggle{
  min-height:46px!important;
  padding:9px 10px!important;
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  border:1px solid rgba(255,255,255,.07)!important;
  border-radius:12px!important;
  background:rgba(255,255,255,.022)!important;
  color:#dce3ee!important;
  font-size:12px!important;
}
html[data-ui-mode="modern"] body.platform-home.home-v2 .notification-toggle input{
  width:19px!important;
  height:19px!important;
  min-height:0!important;
  padding:0!important;
  accent-color:var(--pf-purple);
}
html[data-ui-mode="modern"] body.platform-home.home-v2 #logoutBtn{
  width:100%!important;
  min-height:48px!important;
  margin-top:3px!important;
  border-color:rgba(255,114,134,.20)!important;
  color:#ffb5c0!important;
  background:rgba(255,114,134,.055)!important;
}

/* Rules modal follows the same hierarchy. */
html[data-ui-mode="modern"] body.platform-home.home-v2 .rules-modal-card{width:min(650px,100%)!important}
html[data-ui-mode="modern"] body.platform-home.home-v2 .rules-grid{gap:7px!important}
html[data-ui-mode="modern"] body.platform-home.home-v2 .rules-grid p{
  padding:12px 13px!important;
  border:1px solid rgba(255,255,255,.065)!important;
  border-radius:13px!important;
  background:rgba(255,255,255,.025)!important;
  color:#c0cada!important;
}

@media(max-width:700px){
  html[data-ui-mode="modern"] body.platform-home.home-v2 .modal{
    align-items:end!important;
    padding:0!important;
  }
  html[data-ui-mode="modern"] body.platform-home.home-v2 .modal-card{
    width:100%!important;
    max-width:none!important;
    max-height:min(92dvh,820px)!important;
    margin:0!important;
    padding:70px 16px calc(18px + env(safe-area-inset-bottom))!important;
    border-width:1px 0 0!important;
    border-radius:25px 25px 0 0!important;
    overscroll-behavior:contain;
  }
  html[data-ui-mode="modern"] body.platform-home.home-v2 #authModal .modal-card::before{
    right:14px!important;
    width:86px!important;
    height:50px!important;
  }
  html[data-ui-mode="modern"] body.platform-home.home-v2 .modal-x{
    position:sticky!important;
    float:left!important;
    top:8px!important;
    margin-top:-56px!important;
    margin-left:0!important;
    z-index:4!important;
    backdrop-filter:blur(12px);
  }
  html[data-ui-mode="modern"] body.platform-home.home-v2 #authContent>h2{font-size:29px!important}
  html[data-ui-mode="modern"] body.platform-home.home-v2 #accountAuthForm input{min-height:54px!important;font-size:16px!important}
  html[data-ui-mode="modern"] body.platform-home.home-v2 #accountAuthForm>.btn{min-height:54px!important}
  html[data-ui-mode="modern"] body.platform-home.home-v2 .platform-profile-avatar{width:62px!important;height:62px!important;flex-basis:62px!important}
  html[data-ui-mode="modern"] body.platform-home.home-v2 .platform-profile-hero h2{font-size:20px!important}
}

@media(max-width:390px){
  html[data-ui-mode="modern"] body.platform-home.home-v2 .modal-card{padding-inline:12px!important}
  html[data-ui-mode="modern"] body.platform-home.home-v2 .notification-settings{padding:12px!important}
  html[data-ui-mode="modern"] body.platform-home.home-v2 .hero-join .join-input-row{grid-template-columns:30px minmax(0,1fr) 88px!important}
  html[data-ui-mode="modern"] body.platform-home.home-v2 .hero-join .join-input-row .btn{padding-inline:9px!important}
}

@media(prefers-reduced-motion:reduce){
  html[data-ui-mode="modern"] body.platform-home.home-v2 .join-status[data-state="loading"]::before,
  html[data-ui-mode="modern"] body.platform-home.home-v2 .join-input-row button[aria-busy="true"]::before{animation:none!important}
}
@keyframes pfSpin{to{transform:rotate(360deg)}}
