/**
 * ChatCrack iOS home — CCAPP Join a Chat Room + Settings.
 * Active when html.cc-ios-home is set (Apple devices on index.html).
 */

html.cc-ios-home,
html.cc-ios-home body {
  height: 100%;
  overflow: hidden;
  background: #090e1a;
}

html.cc-ios-home .scale-fit-container,
html.cc-ios-home .scale-fit-viewport,
html.cc-ios-home .header,
html.cc-ios-home .main,
html.cc-ios-home .site-footer,
html.cc-ios-home .banner-public,
html.cc-ios-home .hero {
  display: none !important;
}

html.cc-ios-home #ccIosHome {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0d1628 0%, #090e1a 40%, #090e1a 100%);
  color: #dde6f5;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

html.cc-ios-home.cc-ios-need-auth #ccIosHome {
  visibility: hidden;
  pointer-events: none;
}

/* Full-screen login / register / guest (CCAPP-style) */
html.cc-ios-home .cc-ios-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px calc(18px + env(safe-area-inset-bottom, 0px));
  background: #000;
  color: #e7ecf3;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html.cc-ios-home .cc-ios-auth-gate.open {
  display: flex;
}

html.cc-ios-home .cc-ios-auth-brand {
  text-align: center;
  margin: 12px 0 18px;
}

html.cc-ios-home .cc-ios-auth-brand .cc-ios-home-logo {
  margin: 0 auto 10px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #b8f000;
}

html.cc-ios-home .cc-ios-auth-brand .cc-ios-home-logo span {
  width: 18px;
  height: 18px;
  border-color: #0b1220;
}

html.cc-ios-home .cc-ios-auth-brand-name {
  font-size: 28px;
  font-weight: 800;
  color: #c6ff00;
}

html.cc-ios-home .cc-ios-auth-tagline {
  margin: 6px 0 0;
  color: #d7deea;
  font-size: 13px;
}

html.cc-ios-home .cc-ios-auth-card {
  width: min(400px, 100%);
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 18px 16px 16px;
  box-sizing: border-box;
}

html.cc-ios-home .cc-ios-auth-card h1 {
  margin: 0;
  font-size: 24px;
  color: #f0d54a;
  font-weight: 800;
}

html.cc-ios-home .cc-ios-auth-sub {
  margin: 4px 0 14px;
  color: #d7deea;
  font-size: 13px;
  line-height: 1.35;
}

html.cc-ios-home .cc-ios-auth-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

html.cc-ios-home .cc-ios-auth-close {
  border: none;
  background: transparent;
  color: #c7d2e5;
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

html.cc-ios-home .cc-ios-auth-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0b0b0b;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 0 12px;
  margin-bottom: 10px;
}

html.cc-ios-home .cc-ios-auth-field.is-invalid {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.45);
}

html.cc-ios-home .cc-ios-auth-gender.is-invalid {
  outline: 1px solid #f87171;
  border-radius: 12px;
}

html.cc-ios-home .cc-ios-auth-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: #f0d54a;
  font-size: 15px;
  padding: 12px 0;
  outline: none;
}

html.cc-ios-home .cc-ios-auth-field input::placeholder {
  color: #f0d54a;
  opacity: 0.85;
}

html.cc-ios-home .cc-ios-auth-ico {
  flex: 0 0 auto;
  opacity: 0.7;
  font-size: 14px;
}

html.cc-ios-home .cc-ios-auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #c7d2e5;
  margin: 4px 0 8px;
}

html.cc-ios-home .cc-ios-auth-check input {
  width: 16px;
  height: 16px;
  accent-color: #38bdf8;
}

html.cc-ios-home .cc-ios-auth-forgot {
  display: block;
  text-align: right;
  color: #fff;
  font-size: 13px;
  margin: 0 0 12px;
  text-decoration: none;
}

html.cc-ios-home .cc-ios-auth-primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 800;
  background: #9ec9e8;
  color: #0b1220;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

html.cc-ios-home .cc-ios-auth-primary.is-green {
  background: #22c55e;
}

html.cc-ios-home .cc-ios-auth-primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

html.cc-ios-home .cc-ios-auth-primary.is-guest {
  background: #64748b;
  color: #fff;
}

html.cc-ios-home .cc-ios-auth-inline-msg {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.92);
  border: 1px solid #f87171;
}

html.cc-ios-home .cc-ios-auth-inline-msg.is-ok {
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.92);
  border-color: #34d399;
}

html.cc-ios-home .cc-ios-auth-inline-msg[hidden] {
  display: none !important;
}

html.cc-ios-home .cc-ios-auth-switch {
  margin: 14px 0 0;
  text-align: center;
  color: #8fa3c0;
  font-size: 13px;
}

html.cc-ios-home .cc-ios-auth-switch button {
  border: none;
  background: none;
  color: #c6ff00;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

html.cc-ios-home .cc-ios-auth-label {
  margin: 4px 0 8px;
  color: #c7d2e5;
  font-size: 13px;
  font-weight: 600;
}

html.cc-ios-home .cc-ios-auth-gender {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

html.cc-ios-home .cc-ios-auth-gender button {
  border: 1px solid #2a4060;
  background: #0b1424;
  color: #dde6f5;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
}

html.cc-ios-home .cc-ios-auth-gender button.is-on {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  color: #fff;
}

html.cc-ios-home .cc-ios-auth-about {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #2a4060;
  background: #0b1424;
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  resize: vertical;
  font: inherit;
}

html.cc-ios-home .cc-ios-auth-hint {
  margin: 0 0 12px;
  color: #8fa3c0;
  font-size: 12px;
  line-height: 1.4;
}

html.cc-ios-home .cc-ios-auth-hint strong {
  color: #e2e8f0;
}

html.cc-ios-home .cc-ios-auth-msg {
  position: sticky;
  top: 0;
  z-index: 5;
  width: min(400px, 100%);
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: #d7deea;
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid #333;
}

html.cc-ios-home .cc-ios-auth-msg[hidden] {
  display: none !important;
}

html.cc-ios-home .cc-ios-auth-msg.is-err {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.95);
  border-color: #f87171;
}

html.cc-ios-home .cc-ios-auth-msg.is-ok {
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.95);
  border-color: #34d399;
}

html.cc-ios-home .cc-ios-auth-ver {
  margin-top: auto;
  padding-top: 18px;
  color: #4b5d78;
  font-size: 12px;
}

html.cc-ios-home .cc-ios-home-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 8px;
  background: rgba(9, 14, 26, 0.97);
  border-bottom: 1px solid #2a4060;
}

html.cc-ios-home .cc-ios-home-brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

html.cc-ios-home .cc-ios-home-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #14b8a6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}

html.cc-ios-home .cc-ios-home-logo span {
  width: 12px;
  height: 12px;
  border: 2px solid #ecfeff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.35);
}

html.cc-ios-home .cc-ios-home-title {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(90deg, #5eead4, #e2e8f0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html.cc-ios-home .cc-ios-home-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

html.cc-ios-home .cc-ios-home-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #8fa3c0;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html.cc-ios-home .cc-ios-home-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #2a4060;
  background: linear-gradient(135deg, #60a5fa, #34d399);
  color: #060d1f;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
}

html.cc-ios-home .cc-ios-home-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html.cc-ios-home .cc-ios-home-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 24px;
}

html.cc-ios-home .cc-ios-home-heading {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 4px 0 2px;
}

html.cc-ios-home .cc-ios-home-sub {
  font-size: 14px;
  color: #8fa3c0;
  margin: 0 0 14px;
}

html.cc-ios-home .cc-ios-home-rooms {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

html.cc-ios-home .cc-ios-room-card {
  display: flex;
  align-items: center;
  gap: 0;
  background: #111d33;
  border: 1px solid #2a4060;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-align: left;
  width: 100%;
  padding: 0;
  color: inherit;
}

html.cc-ios-home .cc-ios-room-card.is-locked {
  opacity: 0.55;
}

html.cc-ios-home .cc-ios-room-accent {
  width: 4px;
  align-self: stretch;
  flex: 0 0 auto;
  background: #60a5fa;
}

html.cc-ios-home .cc-ios-room-thumb {
  width: 48px;
  height: 48px;
  margin: 14px 0 14px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  flex: 0 0 auto;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #60a5fa;
}

html.cc-ios-home .cc-ios-room-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 8px 14px 12px;
}

html.cc-ios-home .cc-ios-room-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

html.cc-ios-home .cc-ios-room-desc {
  font-size: 12px;
  color: #8fa3c0;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.cc-ios-home .cc-ios-room-online {
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
  margin-top: 4px;
}

html.cc-ios-home .cc-ios-room-chevron {
  flex: 0 0 auto;
  padding: 0 14px;
  color: #8fa3c0;
  font-size: 18px;
}

html.cc-ios-home .cc-ios-home-empty {
  color: #8fa3c0;
  font-size: 14px;
  padding: 16px 0;
}

html.cc-ios-home .cc-ios-home-guest-banner {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #111d33;
  border-top: 1px solid #2a4060;
  border-radius: 16px 16px 0 0;
}

html.cc-ios-home .cc-ios-home-guest-banner.is-visible {
  display: flex;
  flex-wrap: wrap;
}

@media (max-width: 380px) {
  html.cc-ios-home .cc-ios-home-guest-banner.is-visible {
    flex-direction: column;
    align-items: stretch;
  }
  html.cc-ios-home .cc-ios-home-guest-actions {
    width: 100%;
  }
  html.cc-ios-home .cc-ios-home-guest-actions button {
    flex: 1;
  }
}

html.cc-ios-home .cc-ios-home-guest-text {
  flex: 1 1 auto;
  min-width: 0;
}

html.cc-ios-home .cc-ios-home-guest-text strong {
  display: block;
  font-size: 13px;
  color: #fff;
}

html.cc-ios-home .cc-ios-home-guest-text span {
  display: block;
  font-size: 11px;
  color: #8fa3c0;
  margin-top: 2px;
  line-height: 1.3;
}

html.cc-ios-home .cc-ios-home-guest-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

html.cc-ios-home .cc-ios-home-guest-actions button {
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #2a4060;
  -webkit-tap-highlight-color: transparent;
}

html.cc-ios-home .cc-ios-home-guest-actions .is-login {
  background: transparent;
  color: #fff;
  border-color: #2dd4bf;
}

html.cc-ios-home .cc-ios-home-guest-actions .is-register {
  background: #2dd4bf;
  border-color: #2dd4bf;
  color: #0b1220;
}

/* Settings overlay */
html.cc-ios-home .cc-ios-settings {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  flex-direction: column;
  background: linear-gradient(180deg, #0d1628 0%, #090e1a 40%, #090e1a 100%);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

html.cc-ios-home .cc-ios-settings.open {
  display: flex;
}

html.cc-ios-home .cc-ios-settings-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a4060;
  background: rgba(9, 14, 26, 0.97);
}

html.cc-ios-home .cc-ios-settings-bar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

html.cc-ios-home .cc-ios-settings-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 28px;
}

html.cc-ios-home .cc-ios-set-section {
  font-size: 12px;
  font-weight: 700;
  color: #60a5fa;
  margin: 14px 4px 8px;
  text-transform: none;
  letter-spacing: 0.02em;
}

html.cc-ios-home .cc-ios-set-card {
  background: #111d33;
  border: 1px solid #2a4060;
  border-radius: 16px;
  overflow: hidden;
}

html.cc-ios-home .cc-ios-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(42, 64, 96, 0.65);
}

html.cc-ios-home .cc-ios-set-row:last-child {
  border-bottom: none;
}

html.cc-ios-home .cc-ios-set-label {
  font-size: 15px;
  color: #fff;
  font-weight: 600;
}

html.cc-ios-home .cc-ios-set-sub {
  font-size: 12px;
  color: #8fa3c0;
  line-height: 1.4;
  padding: 0 18px 14px;
}

html.cc-ios-home .cc-ios-set-ver {
  padding: 14px 18px;
}

html.cc-ios-home .cc-ios-set-ver strong {
  display: block;
  font-size: 13px;
  color: #8fa3c0;
  font-weight: 600;
}

html.cc-ios-home .cc-ios-set-ver span {
  display: block;
  font-size: 12px;
  color: #6b7f9c;
  margin-top: 4px;
}

html.cc-ios-home .cc-ios-set-link {
  background: none;
  border: none;
  color: #2dd4bf;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

html.cc-ios-home .cc-ios-set-open {
  background: none;
  border: none;
  color: #60a5fa;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

html.cc-ios-home .cc-ios-switch {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: #3a4558;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}

html.cc-ios-home .cc-ios-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #111;
  transition: transform 0.15s ease;
}

html.cc-ios-home .cc-ios-switch.is-on {
  background: #22c55e;
}

html.cc-ios-home .cc-ios-switch.is-on::after {
  transform: translateX(22px);
  background: #0b1220;
}

html.cc-ios-home .cc-ios-whatsnew {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
}

html.cc-ios-home .cc-ios-whatsnew.open {
  display: flex;
}

html.cc-ios-home .cc-ios-whatsnew-card {
  width: min(360px, 100%);
  max-height: 70vh;
  overflow: auto;
  background: #111d33;
  border: 1px solid #2a4060;
  border-radius: 16px;
  padding: 18px;
}

html.cc-ios-home .cc-ios-whatsnew-card h3 {
  margin: 0 0 12px;
  color: #fff;
}

html.cc-ios-home .cc-ios-whatsnew-card li {
  color: #dde6f5;
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.4;
}

html.cc-ios-home .cc-ios-whatsnew-card button {
  margin-top: 10px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

html.cc-ios-home .cc-ios-profile-sheet {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: none;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.55);
}

html.cc-ios-home .cc-ios-profile-sheet.open {
  display: flex;
}

html.cc-ios-home .cc-ios-profile-card {
  width: 100%;
  background: #111d33;
  border-radius: 16px 16px 0 0;
  border: 1px solid #2a4060;
  border-bottom: none;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
}

html.cc-ios-home .cc-ios-profile-card .signout {
  width: 100%;
  margin-top: 16px;
  border: none;
  background: transparent;
  color: #f87171;
  font-weight: 800;
  font-size: 15px;
  padding: 12px;
  cursor: pointer;
}
