/* ==========================================================================
   TIKTOK APP SIMULATION STYLESHEET (ALL ENGLISH)
   Easy 3-Slide Puzzle (Pieces slide from bottom row up into 3 vacant slots)
   No "empty" text anywhere in the puzzle
   ========================================================================== */

:root {
  --bg-dark: #0a0b10;
  --chassis-bg: #1c1d24;
  --screen-bg: #ffffff;
  --text-main: #161823;
  --text-secondary: #757575;
  --text-muted: #8a8b91;
  --border-light: #e8e8ea;
  --border-subtle: #f1f1f2;
  --tiktok-red: #fe2c55;
  --tiktok-red-hover: #e0264b;
  --tiktok-cyan: #25f4ee;
  --tiktok-blue: #007aff;
  --roblox-blue: #2563eb;
  --roblox-blue-hover: #1d4ed8;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-chassis: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  user-select: none;
}

/* ==========================================================================
   DESKTOP TOPBAR CONTROLS
   ========================================================================== */

.app-topbar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(22, 24, 35, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tiktok-note {
  font-size: 20px;
  color: var(--tiktok-cyan);
  text-shadow: 2px 0 var(--tiktok-red);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.scenario-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(254, 44, 85, 0.15);
  color: var(--tiktok-red);
  border: 1px solid rgba(254, 44, 85, 0.3);
}

.flow-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 16px;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.step-item:hover, .step-item.active {
  opacity: 1;
}

.step-item.active {
  background: rgba(255, 255, 255, 0.12);
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.step-item.active .step-num {
  background: var(--tiktok-red);
  color: #fff;
}

.step-label {
  font-size: 12px;
  font-weight: 500;
  color: #e1e2e6;
}

.step-divider {
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
}

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

.tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.reset-btn {
  background: rgba(254, 44, 85, 0.15);
  border-color: rgba(254, 44, 85, 0.3);
  color: var(--tiktok-red);
}

.reset-btn:hover {
  background: var(--tiktok-red);
  color: #ffffff;
}

/* ==========================================================================
   SIMULATOR WORKSPACE & PHONE CHASSIS
   ========================================================================== */

.simulator-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 16px;
  width: 100%;
}

.device-chassis {
  width: 395px;
  height: 840px;
  background: #111216;
  border-radius: 44px;
  box-shadow: var(--shadow-chassis);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 3px solid #2e303c;
  transition: all 0.3s ease;
}

.hardware-speaker {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background: #232530;
  border-radius: 3px;
  z-index: 40;
}

.hardware-camera {
  position: absolute;
  top: 19px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: #000000;
  border-radius: 50%;
  border: 1.5px solid #1f2029;
  z-index: 40;
}

.device-viewport {
  width: 100%;
  height: 100%;
  background: var(--screen-bg);
  border-radius: 34px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--text-main);
}

body.theme-fullscreen .simulator-wrapper {
  padding: 0;
  width: 100%;
  height: 100vh;
}

body.theme-fullscreen .device-chassis {
  width: 100%;
  max-width: 480px;
  height: 100%;
  border-radius: 0;
  border: none;
  padding: 0;
  box-shadow: none;
}

body.theme-fullscreen .device-viewport {
  border-radius: 0;
}

/* ==========================================================================
   ANDROID STATUS BAR & NAVIGATION
   ========================================================================== */

.android-status-bar {
  height: 28px;
  padding: 4px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #111;
  background: #fff;
  z-index: 30;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-icon-bubble { font-size: 11px; }

.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-signal {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-battery {
  display: flex;
  align-items: center;
  gap: 3px;
}

.battery-pct { font-size: 11px; }

.battery-icon {
  width: 18px;
  height: 10px;
  border: 1.5px solid #222;
  border-radius: 2.5px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 1px;
}

.battery-icon::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: #222;
  border-radius: 0 1px 1px 0;
}

.battery-level {
  width: 46%;
  height: 100%;
  background: #111;
  border-radius: 1px;
}

.android-bottom-nav {
  height: 38px;
  background: #ffffff;
  border-top: 1px solid #f0f0f2;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 30;
}

.nav-key {
  background: none;
  border: none;
  color: #888;
  padding: 8px 24px;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.15s;
}

.nav-key:active {
  background: rgba(0, 0, 0, 0.08);
  color: #111;
}

.interaction-toast {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 24, 35, 0.94);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 50;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  animation: slideToast 0.4s ease;
  white-space: nowrap;
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tiktok-cyan);
  box-shadow: 0 0 8px var(--tiktok-cyan);
}

@keyframes slideToast {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

.screen.active {
  display: flex;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

.screen-scrollable-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen-scrollable-content::-webkit-scrollbar { width: 4px; }
.screen-scrollable-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.icon-btn {
  background: none;
  border: none;
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.15s;
}

.icon-btn:active { background: rgba(0, 0, 0, 0.06); }

/* ==========================================================================
   SCREEN 1: SEARCH SCREEN
   ========================================================================== */

.search-top-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: #ffffff;
}

.search-input-pill {
  flex: 1;
  height: 38px;
  background: #f1f1f2;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
}

.search-lens-icon {
  color: #8a8b91;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #161823;
  outline: none;
}

.clear-search-btn {
  background: #c5c6c9;
  border: none;
  color: #fff;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-search-btn:hover { background: #a0a1a5; }

.search-tabs-bar {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.search-tabs-bar::-webkit-scrollbar { display: none; }

.search-tab-item {
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #73747b;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.search-tab-item.active { color: #161823; }

.search-tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2.5px;
  background: #161823;
  border-radius: 2px;
}

.filter-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-chips-bar::-webkit-scrollbar { display: none; }

.chip-item {
  background: #f1f1f2;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #161823;
  cursor: pointer;
  white-space: nowrap;
}

.chip-item.active {
  background: #ffffff;
  border-color: #161823;
  font-weight: 700;
}

.ad-results-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px;
}

.ad-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}

.ad-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}

.ad-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-pill, .ad-tag-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 5px;
  color: #161823;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #8a8b91;
  margin-top: 4px;
}

.ad-author {
  display: flex;
  align-items: center;
  gap: 4px;
}

.author-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.amazon-dot { background: #ff9900; }
.user-dot { background: #555; }

.roblox-account-card {
  margin: 10px 12px;
  padding: 14px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #ebebeb;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.roblox-account-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  border-color: #d8d8d8;
}

.pulse-target { animation: cardHighlight 2.5s infinite ease-in-out; }

@keyframes cardHighlight {
  0% { box-shadow: 0 0 0 0 rgba(254, 44, 85, 0.4); }
  70% { box-shadow: 0 0 0 7px rgba(254, 44, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(254, 44, 85, 0); }
}

.account-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-container {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.account-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-details { flex: 1; }

.account-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.account-username {
  font-size: 16px;
  font-weight: 700;
  color: #161823;
}

.verified-badge-blue {
  display: flex;
  align-items: center;
}

.account-display-name {
  font-size: 13px;
  color: #73747b;
  margin-top: 1px;
}

.account-followers-count {
  font-size: 12px;
  color: #8a8b91;
  margin-top: 1px;
}

.follow-cta-btn {
  background: var(--tiktok-red);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.follow-cta-btn:hover { background: var(--tiktok-red-hover); }

.follow-cta-btn.following {
  background: #f1f1f2;
  color: #161823;
  font-weight: 600;
}

.account-preview-videos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.preview-video-item {
  aspect-ratio: 9 / 13;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.preview-vid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-vid-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
}

.preview-vid-bottom {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.hollow-featured {
  border: 1px solid rgba(254, 44, 85, 0.6);
}

.card-action-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
  color: var(--tiktok-red);
  font-size: 12px;
  font-weight: 700;
}

.search-grid-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px 24px;
}

.secondary-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.sec-thumb-wrap {
  position: relative;
  aspect-ratio: 9 / 13;
  background: #111;
  border-radius: 6px;
  overflow: hidden;
}

.sec-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sec-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
}

.sec-overlay-text {
  position: absolute;
  bottom: 8px;
  left: 6px;
  right: 6px;
}

.blue-tag {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 1px 2px #000;
}

.sub-tag {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
}

.sec-info {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #161823;
}

/* ==========================================================================
   SCREEN 2: ROBLOX PROFILE SCREEN
   ========================================================================== */

.profile-top-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: #ffffff;
}

.profile-header-title {
  font-size: 17px;
  font-weight: 700;
  color: #161823;
}

.header-right-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px 10px;
}

.profile-avatar-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  margin-bottom: 8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.profile-large-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-handle-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-handle {
  font-size: 16px;
  font-weight: 700;
  color: #161823;
}

.business-category {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #73747b;
  margin-top: 3px;
}

.profile-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px 12px;
}

.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 18px;
  font-weight: 800;
  color: #161823;
}

.stat-label {
  font-size: 12px;
  color: #8a8b91;
  margin-top: 1px;
}

.stat-divider {
  width: 1px;
  height: 18px;
  background: #e5e5e7;
}

.profile-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px 14px;
}

.profile-follow-btn {
  flex: 1.2;
  height: 44px;
  background: var(--tiktok-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-follow-btn:hover { background: var(--tiktok-red-hover); }

.profile-follow-btn.following {
  background: #f1f1f2;
  color: #161823;
}

.profile-message-btn {
  flex: 1.2;
  height: 44px;
  background: #f1f1f2;
  color: #161823;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.pulse-glow { animation: messageBtnPulse 2s infinite ease-in-out; }

@keyframes messageBtnPulse {
  0% { box-shadow: 0 0 0 0 rgba(32, 213, 236, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(32, 213, 236, 0); }
  100% { box-shadow: 0 0 0 0 rgba(32, 213, 236, 0); }
}

.profile-message-btn:hover { background: #e4e4e6; }

.profile-dropdown-btn {
  width: 44px;
  height: 44px;
  background: #f1f1f2;
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #161823;
  cursor: pointer;
}

.profile-bio-section {
  padding: 0 24px 12px;
  text-align: center;
}

.profile-bio-text {
  font-size: 13.5px;
  color: #161823;
  line-height: 1.4;
}

.profile-bio-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #161823;
  text-decoration: none;
}

.profile-tab-header {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.profile-tab {
  flex: 1;
  height: 44px;
  background: none;
  border: none;
  color: #8a8b91;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.profile-tab.active { color: #161823; }

.tab-indicator {
  position: absolute;
  bottom: 0;
  width: 32px;
  height: 2px;
  background: #161823;
  border-radius: 1px;
}

.profile-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5px;
  background: #f5f5f7;
  padding-bottom: 24px;
}

.grid-video-card {
  aspect-ratio: 9 / 13;
  position: relative;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.grid-vid-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.view-count-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.featured-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  color: var(--tiktok-red);
  font-size: 12px;
}

/* ==========================================================================
   SCREEN 3: DIRECT MESSAGE (CHAT) SCREEN
   ========================================================================== */

.chat-top-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: #ffffff;
}

.chat-recipient-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-small-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
}

.recipient-title-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.recipient-name {
  font-size: 15px;
  font-weight: 700;
  color: #161823;
}

.business-subtext {
  font-size: 11px;
  color: #8a8b91;
  display: block;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-disclaimer-bar {
  background: #f7f7f8;
  border-bottom: 1px solid #ededee;
  padding: 8px 14px;
  font-size: 11px;
  color: #73747b;
  line-height: 1.35;
  text-align: center;
}

.chat-messages-area {
  padding: 16px 12px 24px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.chat-intro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px 18px;
  text-align: center;
}

.chat-intro-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  margin-bottom: 10px;
}

.chat-intro-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-intro-name {
  font-size: 17px;
  font-weight: 700;
  color: #161823;
}

.chat-intro-handle {
  font-size: 13px;
  color: #73747b;
  margin-top: 2px;
}

.chat-intro-followers {
  font-size: 12px;
  color: #8a8b91;
  margin-top: 2px;
}

.chat-time-marker {
  font-size: 11px;
  color: #8a8b91;
  margin-top: 14px;
  margin-bottom: 6px;
}

.chat-privacy-notice {
  font-size: 11.5px;
  color: #8a8b91;
  max-width: 280px;
  line-height: 1.4;
}

.chat-privacy-notice a {
  color: #1f6feb;
  text-decoration: none;
}

.messages-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.msg-row.sent { justify-content: flex-end; }
.msg-row.received { justify-content: flex-start; }

.msg-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.msg-row.sent .msg-bubble {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.msg-row.received .msg-bubble {
  background: #f1f1f2;
  color: #161823;
  border-bottom-left-radius: 4px;
}

.roblox-text-bubble {
  background: #f1f1f2;
  color: #161823;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  white-space: pre-line;
}

/* ==========================================================================
   EASY 12-SLOT PUZZLE HOLDER (3x4 Grid: 9 Pieces + 3 Vacant Slots)
   NO "EMPTY" TEXT!
   ========================================================================== */

.puzzle-12holder-widget {
  background: #141622;
  border-radius: 16px;
  padding: 12px;
  border: 1.5px solid #292d3f;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  color: #ffffff;
  transition: all 0.3s ease;
}

.puzzle-12holder-widget.puzzle-solved {
  border-color: #22c55e;
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.4);
}

.widget-top-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.widget-title-tag {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-score-pill {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.widget-instructions {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}

/* The 12-Slot Board (3 Columns x 4 Rows) */
.holder-12-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: #0b0c11;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #1f2333;
  position: relative;
}

.holder-slot {
  aspect-ratio: 159 / 213;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  background: #181a26;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  border: 1.5px solid transparent;
}

.holder-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Vacant Slot: NO TEXT, just a clean sleek placeholder with glowing border */
.holder-slot.slot-empty {
  border: 1.5px dashed rgba(96, 165, 250, 0.5);
  background: rgba(30, 41, 59, 0.5);
}

.holder-slot.slot-empty:hover {
  border-color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
}

.holder-slot.slot-empty.slot-target-glow {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
  animation: slotGlow 1.2s infinite ease-in-out;
}

@keyframes slotGlow {
  0%, 100% { box-shadow: inset 0 0 6px rgba(34, 197, 94, 0.4); }
  50% { box-shadow: inset 0 0 14px rgba(34, 197, 94, 0.8); }
}

/* Bottom pieces to slide up: highlighted with subtle pulse so user knows to click! */
.holder-slot.slide-piece {
  border-color: rgba(56, 189, 248, 0.6);
  cursor: pointer;
}

.holder-slot.slide-piece:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.35);
}

/* Selected piece */
.holder-slot.piece-selected {
  border-color: #22c55e;
  box-shadow: 0 0 14px #22c55e;
  transform: scale(1.04);
  z-index: 5;
}

/* Separator between top 3x3 puzzle zone and bottom 3 sliding pieces */
.target-zone-divider {
  grid-column: span 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  margin: 3px 0;
  border: 1px dashed rgba(56, 189, 248, 0.3);
}

.divider-arrow {
  font-size: 13px;
  animation: bounceUp 1.4s infinite ease-in-out;
}

@keyframes bounceUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Widget Action Buttons */
.widget-action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.widget-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
}

.widget-btn:hover { background: rgba(255, 255, 255, 0.16); }

.widget-btn.auto-solve-btn {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.35);
  color: #4ade80;
}
.widget-btn.auto-solve-btn:hover {
  background: #22c55e;
  color: #ffffff;
}

/* ==========================================================================
   OFFICIAL CHALLENGE COMPLETED CARD
   ========================================================================== */

.challenge-completed-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  max-width: 320px;
  color: #161823;
  animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.challenge-card-banner {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
}

.challenge-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.challenge-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.challenge-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.challenge-author-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.challenge-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #000;
  object-fit: cover;
}

.challenge-names-col {
  display: flex;
  flex-direction: column;
}

.challenge-verified-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.challenge-status-subtext {
  font-size: 11px;
  color: #64748b;
}

.challenge-celebrate-icon { font-size: 20px; }

.challenge-headline {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 6px;
}

.challenge-body-text {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 16px;
}

.challenge-cta-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.challenge-cta-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

/* Typing Indicator */
.typing-indicator-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.typing-indicator-row.hidden { display: none; }

.typing-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.typing-bubble {
  background: #f1f1f2;
  padding: 8px 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8a8b91;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

.typing-label {
  font-size: 11px;
  color: #8a8b91;
}

/* Quick Chips */
.quick-chips-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  border-top: 1px solid var(--border-subtle);
  scrollbar-width: none;
}
.quick-chips-scroll::-webkit-scrollbar { display: none; }

.quick-chip {
  background: #f1f1f2;
  border: none;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #161823;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.quick-chip:hover { background: #e5e5e8; }
.quick-chip:first-child {
  background: #e8f3ff;
  color: #2563eb;
}

/* Chat Input Bar */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #eef0f2;
  background: #ffffff;
}

.chat-action-tool-btn {
  width: 32px;
  height: 32px;
  background: #f1f1f2;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tool-letter-icon {
  font-size: 13px;
  font-weight: 800;
  color: #161823;
}

.chat-input-wrapper {
  flex: 1;
  height: 40px;
  background: #f1f1f2;
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  color: #161823;
  outline: none;
}

.chat-emoji-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  background: var(--tiktok-red);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--tiktok-red-hover);
  transform: scale(1.05);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden { display: none; }

.puzzle-reference-modal, .video-modal-dialog {
  background: #ffffff;
  color: #161823;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid #ebebeb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h4 {
  font-size: 15px;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #8a8b91;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}
.modal-close-btn:hover { color: #fff; }

.ref-sub {
  font-size: 13px;
  color: #555;
  margin-bottom: 10px;
  padding: 0 16px;
}

.ref-img-wrap {
  width: 100%;
  padding: 0 16px 16px;
}

.ref-puzzle-img {
  width: 100%;
  border-radius: 8px;
  display: block;
  border: 1px solid #e2e8f0;
}

.video-preview-body {
  position: relative;
  background: #000;
  aspect-ratio: 9 / 13;
}

.video-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-playback-indicator {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Confetti */
.confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 99;
  animation: confettiFall 1.8s forwards ease-out;
}

@keyframes confettiFall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(720deg); opacity: 0; }
}

@media (max-width: 600px) {
  .app-topbar { padding: 10px 14px; }
  .brand-title { display: none; }
  .scenario-tag { display: none; }
  .device-chassis {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    padding: 0;
  }
  .device-viewport { border-radius: 0; }
}
