:root {
  --background: #000;
  --surface: #111;
  --surface-2: #1b1b1d;
  --control: #3b3b3b;
  --control-hover: #4a4a4a;
  --text: #fff;
  --muted: #9b9ba1;
  --accent: #49e573;
  --border: #2c2c2f;
  --danger: #ff6262;
  --sidebar-width: 380px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--background); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,.08), transparent 34rem),
    var(--background);
  color: var(--text);
}

button, input { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  left: 1rem; top: -4rem;
  z-index: 1000;
  padding: .75rem 1rem;
  background: var(--accent);
  color: #000;
  border-radius: .7rem;
  font-weight: 800;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1.25rem;
  background: rgba(0,0,0,.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  z-index: 50;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.topbar-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
}

.icon-button, .text-button {
  border: 0;
  background: transparent;
  color: var(--text);
}

.menu-button {
  position: relative;
  width: 54px;
  height: 54px;
  padding: 13px;
  border-radius: 16px;
  justify-self: start;
  transition: background .2s ease, transform .2s ease;
}
.menu-button:hover { background: var(--surface-2); }
.menu-button:active { transform: scale(.94); }
.menu-button span {
  position: absolute;
  left: 13px;
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: currentColor;
  transform-origin: center;
  transition: top .24s ease, transform .24s ease, opacity .18s ease;
}
.menu-button span:nth-child(1) { top: 16px; }
.menu-button span:nth-child(2) { top: 25px; }
.menu-button span:nth-child(3) { top: 34px; }

.menu-button[aria-expanded="true"] span:nth-child(1) {
  top: 25px;
  transform: rotate(45deg);
}
.menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(.2);
}
.menu-button[aria-expanded="true"] span:nth-child(3) {
  top: 25px;
  transform: rotate(-45deg);
}

.text-button {
  justify-self: end;
  font-weight: 700;
  color: var(--muted);
}

.sidebar {
  position: fixed;
  top: 72px;
  left: 0;
  bottom: 0;
  width: min(var(--sidebar-width), 92vw);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  background: #0b0b0c;
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  box-shadow: 24px 0 60px rgba(0,0,0,.42);
  transition: transform .46s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease;
  z-index: 40;
}
.sidebar.open { transform: translateX(0); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem;
  margin-bottom: 1.6rem;
}
.sidebar-brand img {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  object-fit: cover;
}
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 1.25rem; }
.sidebar-brand span { color: var(--muted); font-size: 1rem; margin-top: .25rem; }

.side-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .85rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  width: 100%;
  min-height: 76px;
  padding: 0 1.3rem;
  border: 1px solid transparent;
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 780;
  text-align: left;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .16s ease;
}
.nav-item:active { transform: scale(.975); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active {
  color: var(--accent);
  background: var(--control);
  border-color: #555;
}
.nav-icon {
  width: 40px;
  text-align: center;
  font-size: 1.35rem;
}
.settings-item { margin-top: auto; }

.sidebar-backdrop {
  position: fixed;
  inset: 72px 0 0 0;
  background: rgba(0,0,0,.62);
  z-index: 35;
}

main { padding-top: 72px; }

.landing-view {
  min-height: calc(100vh - 72px);
}

.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.25rem;
  text-align: center;
}

.hero-logo {
  width: clamp(126px, 19vw, 205px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 30%;
  box-shadow: 0 0 65px rgba(255,255,255,.16);
}

.eyebrow {
  margin: 1.8rem 0 .5rem;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .18em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: .95;
  letter-spacing: -.06em;
}

.hero-copy {
  max-width: 680px;
  margin: 1.25rem auto 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.login-card {
  width: min(100%, 620px);
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(17,17,17,.92);
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}

.login-card h2 {
  margin: .4rem 0 1.2rem;
  font-size: 1.8rem;
}

.auth-button, .primary-button {
  width: 100%;
  min-height: 58px;
  border: 1px solid #4b4b4e;
  border-radius: 16px;
  background: var(--control);
  color: var(--text);
  font-weight: 800;
}
.auth-button + .auth-button { margin-top: .75rem; }
.auth-button:hover, .primary-button:hover { background: var(--control-hover); }

.google-mark {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: .25rem;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-weight: 900;
}

.plain-link {
  margin-top: 1rem;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
}

.status-message {
  min-height: 1.4rem;
  margin: .9rem 0 0;
  color: var(--muted);
}

.security-section {
  padding: 6rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #080808;
}

.section-heading {
  width: min(1100px, 100%);
  margin: 0 auto 2rem;
}

.section-heading h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  letter-spacing: -.045em;
}

.feature-grid {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feature-card {
  min-height: 220px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
}
.feature-card h3 { margin-top: 0; font-size: 1.3rem; }
.feature-card p { color: var(--muted); line-height: 1.65; }

.app-view {
  min-height: calc(100vh - 72px);
  padding: clamp(1.25rem, 4vw, 3rem);
}

.screen {
  display: none;
  width: min(1100px, 100%);
  margin: 0 auto;
}
.screen.active-screen { display: block; }

.screen-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.screen-header .eyebrow { margin-top: 0; }
.screen-header h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  letter-spacing: -.055em;
}
.primary-button {
  width: auto;
  min-width: 170px;
  padding: 0 1.4rem;
}

.search-field { display: block; }
.search-field input {
  width: 100%;
  min-height: 66px;
  padding: 0 1.25rem;
  border: 1px solid #4b4b4e;
  border-radius: 18px;
  background: var(--control);
  color: var(--text);
  font-size: 1.15rem;
}
.search-field input::placeholder { color: #a2a2a8; }

.empty-state {
  min-height: 52vh;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
.empty-state h2 { margin-bottom: .4rem; color: var(--text); }

.profile-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
}
.avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-weight: 950;
}
.profile-card h2, .profile-card p { margin: .2rem 0; }
.profile-card p { color: var(--muted); }
.profile-card .experiment-status { color: var(--accent); font-weight: 750; }

.settings-list {
  display: grid;
  gap: .75rem;
}
.settings-list button {
  min-height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.25rem;
  border: 1px solid #4b4b4e;
  border-radius: 17px;
  background: var(--control);
  color: var(--text);
  font-weight: 800;
  text-align: left;
}
.settings-list button span {
  color: var(--accent);
  font-size: 2rem;
  font-weight: 400;
}
.settings-list button:hover { background: var(--control-hover); }
.settings-list .danger-button {
  justify-content: center;
  color: var(--danger);
}

.account-dialog {
  width: min(92vw, 540px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
}
.account-dialog::backdrop {
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(6px);
}
.account-dialog form { padding: 1.5rem; }
.account-dialog .eyebrow { margin-top: 0; }
.account-dialog h2 { margin: 0; font-size: 2rem; }
.dialog-copy { color: var(--muted); line-height: 1.55; }
.dialog-close {
  float: right;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--control);
  color: var(--text);
  font-size: 1.6rem;
}
.account-dialog label {
  display: block;
  margin: 1rem 0;
  font-weight: 800;
}
.account-dialog input {
  width: 100%;
  min-height: 56px;
  margin-top: .5rem;
  padding: 0 1rem;
  border: 1px solid #4b4b4e;
  border-radius: 14px;
  background: #080808;
  color: var(--text);
}
.code-area { margin-top: .75rem; }
.demo-code { color: var(--accent); }

@media (min-width: 980px) {
  body.app-authenticated.sidebar-open main {
    margin-left: var(--sidebar-width);
  }

  body.app-authenticated main {
    transition: margin-left .32s cubic-bezier(.22, 1, .36, 1);
  }

  body.app-authenticated .sidebar-backdrop {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar-brand { justify-self: center; }
  .feature-grid { grid-template-columns: 1fr; }
  .screen-header { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .profile-card { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}


/* Website v0.1: ecosystem, downloads, FAQ, and footer */

.centered-heading {
  text-align: center;
}

.centered-heading h2 {
  margin-inline: auto;
}

.section-copy {
  max-width: 780px;
  margin: 1.25rem auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.everywhere-section {
  padding: 6rem 1.25rem;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 15%, rgba(73,229,115,.09), transparent 28rem),
    #050505;
}

.download-arrow {
  margin: 1.5rem 0;
  color: var(--accent);
  font-size: 2.4rem;
  font-weight: 900;
  text-align: center;
  animation: gentle-bounce 1.8s ease-in-out infinite;
}

.store-button-row {
  width: min(760px, 100%);
  margin: 0 auto 2.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.store-button {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  padding: 1rem 1.25rem;
  border: 1px solid #505055;
  border-radius: 18px;
  background: linear-gradient(180deg, #3f3f42, #29292c);
  box-shadow: 0 16px 34px rgba(0,0,0,.28);
}

.store-button span:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.store-button small {
  color: #d5d5d8;
  font-size: .78rem;
}

.store-button strong {
  margin-top: .1rem;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1.1;
}

.store-icon {
  width: 42px;
  text-align: center;
  font-size: 2rem;
}

.play-icon {
  color: var(--accent);
  font-size: 1.65rem;
}

.ecosystem-grid {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.faq-section {
  padding: 6rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #090909;
}

.faq-list {
  width: min(900px, 100%);
  margin: 2rem auto 0;
  display: grid;
  gap: .85rem;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.faq-list summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 500;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  margin: 0;
  padding: 0 1.2rem 1.25rem;
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  padding: 2.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #030303;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
}

.footer-brand img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
}

.footer-brand strong,
.footer-brand span {
  display: block;
  text-align: left;
}

.footer-brand span {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .9rem;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1.5rem 0;
}

.social-links a {
  min-width: 120px;
  padding: .8rem 1.1rem;
  border: 1px solid #4b4b4e;
  border-radius: 14px;
  background: var(--control);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.social-links a:hover {
  background: var(--control-hover);
  color: var(--accent);
}

.copyright {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

@media (max-width: 760px) {
  .store-button-row,
  .ecosystem-grid {
    grid-template-columns: 1fr;
  }

  .store-button {
    width: 100%;
  }

  .footer-brand {
    align-items: center;
  }
}


/* Website v0.2: larger navigation and explicit close state */
@media (max-width: 430px) {
  :root { --sidebar-width: 340px; }

  .sidebar {
    padding: 1.25rem;
  }

  .nav-item {
    min-height: 70px;
    font-size: 1.08rem;
  }
}


/* Website v0.3: smoother off-canvas navigation */
.sidebar {
  will-change: transform;
  overscroll-behavior: contain;
}

.sidebar-backdrop {
  opacity: 0;
  transition: opacity .34s ease;
}

.sidebar-backdrop:not([hidden]) {
  opacity: 1;
}

@media (max-width: 979px) {
  body.app-authenticated main {
    transition: transform .46s cubic-bezier(.22, 1, .36, 1), filter .3s ease;
    will-change: transform;
  }

  body.app-authenticated.sidebar-open main {
    transform: translateX(min(48px, 10vw));
    filter: brightness(.78);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-backdrop,
  body.app-authenticated main,
  .menu-button span {
    transition-duration: .01ms !important;
  }
}


/* Website v0.3: SwiftUI-inspired Settings screen */
.settings-screen-header {
  margin-bottom: 1.5rem;
}

.settings-screen-header h1 {
  margin: .2rem 0 .4rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.screen-subtitle {
  color: var(--muted);
  max-width: 680px;
}

.settings-list {
  display: grid;
  gap: 1rem;
  width: min(100%, 920px);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 92px;
  padding: 0 1.7rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(87,87,87,.98), rgba(72,72,72,.98));
  color: #fff;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 780;
  text-align: left;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.settings-row:hover,
.settings-row:focus-visible {
  border-color: rgba(65, 218, 99, .62);
  background: linear-gradient(180deg, rgba(94,94,94,.99), rgba(78,78,78,.99));
}

.settings-row:active {
  transform: scale(.985);
}

.settings-chevron {
  color: #42db63;
  font-size: 2.8rem;
  font-weight: 500;
  line-height: .8;
  transform: translateY(-1px);
}

.settings-row-danger:hover,
.settings-row-danger:focus-visible {
  border-color: rgba(255, 96, 96, .62);
}

.settings-preview-panel {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 80;
  width: min(520px, calc(100vw - 2rem));
  transform: translate(-50%, -50%);
  padding: 2rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 26px;
  background: rgba(24,24,24,.97);
  box-shadow: 0 28px 90px rgba(0,0,0,.58);
}

.settings-preview-panel[hidden] {
  display: none;
}

.settings-preview-close {
  position: absolute;
  top: .7rem;
  right: .8rem;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.8rem;
}

@media (max-width: 600px) {
  .settings-row {
    min-height: 78px;
    padding: 0 1.2rem;
    border-radius: 20px;
  }

  .settings-list {
    gap: .8rem;
  }
}

.sidebar-backdrop.visible {
  opacity: 1;
}


/* CloakChat Website v0.5 — Gamer Settings section */
.gaming-section {
  width: min(1180px, calc(100% - 2rem));
  margin: 2.75rem auto 4.5rem;
  padding: clamp(1.5rem, 4vw, 3.2rem);
  border: 1px solid rgba(65, 218, 99, .22);
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(65, 218, 99, .14), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.018));
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}

.gaming-heading {
  max-width: 900px;
  margin-inline: auto;
}

.gaming-heading h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.gaming-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.2rem;
}

.gaming-setting-card {
  min-height: 215px;
  padding: 1.35rem;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 24px;
  background: rgba(17,17,17,.82);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.gaming-setting-card:hover,
.gaming-setting-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(65, 218, 99, .4);
  background: rgba(24,24,24,.96);
}

.gaming-setting-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  border-radius: 18px;
  background: rgba(65, 218, 99, .12);
  font-size: 1.7rem;
}

.gaming-setting-card h3 {
  margin: 0 0 .55rem;
  font-size: 1.18rem;
}

.gaming-setting-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.gaming-settings-note {
  max-width: 900px;
  margin: 1.5rem auto 0;
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 16px 16px 0;
  background: rgba(65, 218, 99, .075);
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 1050px) {
  .gaming-settings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .gaming-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .gaming-section {
    margin-top: 1.5rem;
    margin-bottom: 3.5rem;
    padding: 1.25rem;
    border-radius: 24px;
  }

  .gaming-settings-grid {
    grid-template-columns: 1fr;
  }

  .gaming-setting-card {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gaming-setting-card {
    transition: none;
  }
}


/* CloakChat Website v0.5.3 — Notifications */
.notifications-header {
  margin-bottom: 1.5rem;
}

.subscreen-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.notification-settings-list {
  width: min(100%, 920px);
  display: grid;
  gap: 1rem;
}

.notification-setting-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: start;
  gap: 1rem;
  min-height: 132px;
  padding: 1.45rem 1.6rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(87,87,87,.98), rgba(72,72,72,.98));
  cursor: pointer;
  transition: transform .16s ease, border-color .18s ease, background .18s ease;
}

.notification-setting-card:hover,
.notification-setting-card:focus-within {
  border-color: rgba(73,229,115,.48);
  background: linear-gradient(180deg, rgba(94,94,94,.99), rgba(78,78,78,.99));
}

.notification-setting-card:active {
  transform: scale(.988);
}

.notification-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.notification-checkbox-visual {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-top: .08rem;
  border: 2px solid rgba(255,255,255,.45);
  border-radius: 8px;
  background: rgba(0,0,0,.28);
  transition: background .18s ease, border-color .18s ease, transform .16s ease;
}

.notification-checkbox-visual::after {
  content: "✓";
  color: #000;
  font-size: 1.45rem;
  font-weight: 950;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .15s ease, transform .15s ease;
}

.notification-toggle:checked + .notification-checkbox-visual {
  border-color: #fff;
  background: #fff;
}

.notification-toggle:checked + .notification-checkbox-visual::after {
  opacity: 1;
  transform: scale(1);
}

.notification-toggle:focus-visible + .notification-checkbox-visual {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.notification-card-text {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.notification-card-text strong {
  color: #fff;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}

.notification-card-text span {
  color: #b1b1b7;
  font-size: 1rem;
  line-height: 1.55;
}

.notification-local-note {
  width: min(100%, 920px);
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 16px 16px 0;
  background: rgba(73,229,115,.07);
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 620px) {
  .notification-setting-card {
    grid-template-columns: 42px 1fr;
    min-height: auto;
    padding: 1.2rem;
    border-radius: 20px;
  }

  .notification-checkbox-visual {
    width: 34px;
    height: 34px;
  }
}

/* CloakChat Website v0.5.4 — Gamer Settings screen */
.gamer-settings-header{margin-bottom:1.4rem}.gamer-settings-intro{width:min(100%,980px);margin-bottom:1.3rem;padding:1.35rem 1.45rem;border:1px solid rgba(73,229,115,.22);border-radius:22px;background:rgba(73,229,115,.065)}.gamer-settings-intro h2{margin:0 0 .5rem;font-size:1.45rem}.gamer-settings-intro p{margin:0;color:var(--muted);line-height:1.65}.gamer-settings-control-grid{width:min(100%,1100px);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.gamer-setting-control-card{min-height:210px;display:flex;flex-direction:column;justify-content:space-between;gap:1.2rem;padding:1.35rem;border:1px solid rgba(255,255,255,.09);border-radius:24px;background:linear-gradient(180deg,rgba(71,71,71,.98),rgba(49,49,49,.98));box-shadow:0 14px 34px rgba(0,0,0,.18)}.gamer-setting-card-top{display:flex;align-items:flex-start;gap:1rem}.gamer-setting-control-icon{display:grid;place-items:center;width:50px;height:50px;flex:0 0 auto;border-radius:16px;background:rgba(73,229,115,.12);font-size:1.5rem}.gamer-setting-control-text h3{margin:0 0 .45rem;color:#fff;font-size:1.18rem}.gamer-setting-control-text p{margin:0;color:#b1b1b7;line-height:1.55}.gamer-setting-control-wrap{display:flex;align-items:center;gap:.8rem}.switch-control{position:relative;display:inline-block;width:64px;height:36px}.switch-control input{opacity:0;width:0;height:0}.switch-slider{position:absolute;inset:0;border-radius:999px;background:#222;border:1px solid #666;transition:.18s ease}.switch-slider::before{content:"";position:absolute;width:28px;height:28px;left:3px;top:3px;border-radius:50%;background:#fff;transition:.18s ease}.switch-control input:checked+.switch-slider{background:var(--accent);border-color:var(--accent)}.switch-control input:checked+.switch-slider::before{transform:translateX(28px)}.gamer-select{width:100%;min-height:48px;padding:0 .8rem;border:1px solid #666;border-radius:14px;background:#171717;color:#fff}.gamer-range{flex:1;accent-color:var(--accent)}.gamer-range-value{min-width:48px;color:#fff;font-weight:800}.connection-status-box{display:flex;align-items:center;gap:.7rem;padding:.8rem 1rem;border-radius:14px;background:#171717;color:#fff}.connection-status-dot{width:12px;height:12px;border-radius:50%;background:var(--accent);box-shadow:0 0 14px rgba(73,229,115,.55)}.gamer-prototype-note{width:min(100%,1100px);margin:1.25rem 0 0;padding:1rem 1.1rem;border-left:4px solid var(--accent);border-radius:0 16px 16px 0;background:rgba(73,229,115,.07);color:var(--muted);line-height:1.58}@media(max-width:760px){.gamer-settings-control-grid{grid-template-columns:1fr}}


/* CloakChat Website v0.5.5 — Sidebar profile, icon cleanup, Language stage 1 */
.sidebar-profile {
  display:flex;
  align-items:center;
  gap:1rem;
  width:100%;
}

.sidebar-profile-image {
  width:64px;
  height:64px;
  flex:0 0 auto;
  border-radius:50%;
  object-fit:cover;
  border:2px solid rgba(73,229,115,.35);
  background:#080808;
}

.sidebar-profile-text strong,
.sidebar-profile-text span {
  display:block;
}

.sidebar-profile-text strong {
  color:var(--text);
  font-size:1.15rem;
  max-width:220px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sidebar-profile-text span {
  margin-top:.2rem;
  color:var(--muted);
  font-size:.9rem;
}

.nav-icon-clean {
  width:42px;
  min-width:42px;
  display:inline-grid;
  place-items:center;
  font-size:1.65rem;
  line-height:1;
  filter:grayscale(1) brightness(1.8);
}

.nav-item.active .nav-icon-clean {
  filter:none;
}

.language-header {
  margin-bottom:1.4rem;
}

.language-list {
  width:min(100%,920px);
  display:grid;
  gap:1rem;
}

.language-row {
  position:relative;
  display:grid;
  grid-template-columns:52px 1fr;
  align-items:center;
  gap:1rem;
  min-height:92px;
  padding:0 1.55rem;
  border:1px solid rgba(255,255,255,.08);
  border-radius:24px;
  background:linear-gradient(180deg,rgba(87,87,87,.98),rgba(72,72,72,.98));
  cursor:pointer;
  transition:transform .16s ease,border-color .18s ease,background .18s ease;
}

.language-row:hover,
.language-row:focus-within {
  border-color:rgba(73,229,115,.48);
  background:linear-gradient(180deg,rgba(94,94,94,.99),rgba(78,78,78,.99));
}

.language-row:active {
  transform:scale(.988);
}

.language-radio {
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.language-radio-visual {
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border:3px solid #fff;
  border-radius:7px;
  background:transparent;
}

.language-radio-visual::after {
  content:"✓";
  color:#111;
  font-size:1.35rem;
  font-weight:950;
  opacity:0;
  transform:scale(.7);
}

.language-radio:checked + .language-radio-visual {
  background:#fff;
}

.language-radio:checked + .language-radio-visual::after {
  opacity:1;
  transform:scale(1);
}

.language-radio:focus-visible + .language-radio-visual {
  outline:3px solid var(--accent);
  outline-offset:4px;
}

.language-label {
  color:#fff;
  font-size:clamp(1.1rem,2.2vw,1.4rem);
  font-weight:800;
}

.language-stage-note {
  width:min(100%,920px);
  margin:1.2rem 0 0;
  padding:1rem 1.1rem;
  border-left:4px solid var(--accent);
  border-radius:0 16px 16px 0;
  background:rgba(73,229,115,.07);
  color:var(--muted);
  line-height:1.6;
}

@media(max-width:620px){
  .sidebar-profile-image{width:56px;height:56px}
  .language-row{grid-template-columns:44px 1fr;min-height:78px;padding:0 1.2rem;border-radius:20px}
}

/* CloakChat v0.5.6 — Edit Profile responsive layout / oversized-image bug fix */
.edit-profile-header,
.edit-profile-card {
  width: min(100%, 900px);
  margin-inline: auto;
}
.edit-profile-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.edit-profile-card {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
}
.edit-profile-preview {
  width: 132px;
  height: 132px;
  margin: 0 auto .35rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #090909;
}
.edit-profile-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
}
.edit-profile-card > label:not(.upload-photo-button) {
  font-weight: 800;
}
#profilePhotoInput {
  width: 100%;
  max-width: 100%;
  color: var(--muted);
}
.upload-photo-button {
  display: inline-flex;
  width: fit-content;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  padding: 0 1.15rem;
  border: 1px solid #555;
  border-radius: 14px;
  background: var(--control);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
#profileNameInput {
  width: 100%;
  min-height: 54px;
  padding: 0 1rem;
  border: 1px solid #4b4b4e;
  border-radius: 14px;
  background: #080808;
  color: var(--text);
  font: inherit;
  box-sizing: border-box;
}
.profile-helper-text,
#editProfileStatus {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.edit-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.edit-profile-actions button {
  min-height: 48px;
}
@media (max-width: 760px) {
  .edit-profile-card { padding: 1.1rem; border-radius: 20px; }
  .edit-profile-preview { width: 108px; height: 108px; }
  .edit-profile-actions { flex-direction: column; }
  .edit-profile-actions button { width: 100%; }
}


/* CloakChat Website v0.5.7 — Settings profile sizing + sidebar sync fix */
.settings-profile-summary {
  width: min(100%, 920px);
  margin: 0 auto 1.35rem;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-sizing: border-box;
}

.profile-avatar-button {
  display: block;
  width: 128px;
  height: 128px;
  min-width: 128px;
  min-height: 128px;
  max-width: 128px;
  max-height: 128px;
  padding: 0;
  border: 2px solid rgba(73,229,115,.35);
  border-radius: 50%;
  overflow: hidden;
  background: #080808;
  box-sizing: border-box;
}

.profile-avatar-button img,
#profileAvatarImage {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 128px !important;
  max-height: 128px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 50%;
}

.profile-summary-text {
  width: 100%;
  text-align: center;
}

.profile-summary-text p {
  margin: .3rem 0;
  color: var(--muted);
  line-height: 1.45;
}

.profile-summary-text strong {
  color: var(--text);
}

.profile-summary-text .experiment-status {
  color: var(--accent);
  font-weight: 800;
}

/* Defensive constraints for any locally uploaded profile image */
#editProfilePreviewImage,
#sidebarProfileImage,
#profileAvatarImage {
  object-fit: cover !important;
}

/* Prevent the settings content from stretching beyond the app column */
[data-screen-panel="settings"] {
  overflow-x: hidden;
}

@media (max-width: 620px) {
  .settings-profile-summary {
    padding: 1.1rem;
    border-radius: 20px;
  }

  .profile-avatar-button {
    width: 104px;
    height: 104px;
    min-width: 104px;
    min-height: 104px;
    max-width: 104px;
    max-height: 104px;
  }

  .profile-avatar-button img,
  #profileAvatarImage {
    max-width: 104px !important;
    max-height: 104px !important;
  }
}


/* CloakChat Website v0.6.0 — Back arrows, profile fit, pre-auth settings */

/* Larger submenu back arrows */
.back-button {
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  min-height: 68px !important;
  border-radius: 20px !important;
  font-size: 2.5rem !important;
  line-height: 1 !important;
  display: inline-grid !important;
  place-items: center !important;
}

/* Better automatic profile-photo fitting.
   Show the whole image instead of cropping aggressively. */
.profile-avatar-button,
.edit-profile-preview {
  background:
    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%) 0 0/18px 18px,
    linear-gradient(-45deg, rgba(255,255,255,.035) 25%, transparent 25%) 0 0/18px 18px,
    #0b0b0b;
}

.profile-avatar-button img,
#profileAvatarImage,
#editProfilePreviewImage,
#sidebarProfileImage {
  object-fit: contain !important;
  object-position: center center !important;
  background: #0b0b0b;
}

/* Profile preview gets a visible outline so adjustments are obvious */
.profile-avatar-button,
.edit-profile-preview img,
#profileAvatarImage {
  outline: 3px solid var(--profile-outline, rgba(255,255,255,.9));
  outline-offset: 3px;
}

/* Sidebar keeps a subtle branded outline */
#sidebarProfileImage {
  outline: 2px solid rgba(73,229,115,.55);
  outline-offset: 2px;
}

/* Ensure image containers never stretch with large source files */
.edit-profile-preview img {
  width: 150px !important;
  height: 150px !important;
  max-width: 150px !important;
  max-height: 150px !important;
}

@media (max-width: 620px) {
  .back-button {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    font-size: 2.25rem !important;
  }
}
