* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-0: #0b0d17;
  --bg-1: #12152350;
  --bg-2: #171a2b;
  --bg-3: #1f2438;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --gem: #37e0c9;
  --text-0: #f4f5fb;
  --text-1: #a8adc7;
  --danger: #ff5c7a;
  --success: #4ade80;
  --border: #2a2f47;
  --radius: 14px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 0%, #1a1f3a 0%, var(--bg-0) 55%);
  color: var(--text-0);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { text-decoration: none; color: inherit; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(18, 21, 35, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-gem {
  color: var(--gem);
  filter: drop-shadow(0 0 6px rgba(55, 224, 201, 0.6));
  display: inline-flex;
  align-items: center;
}

.icon-svg {
  display: inline-block;
  vertical-align: middle;
}

.feature-card .icon {
  display: inline-flex;
  color: var(--accent-2);
  margin-bottom: 14px;
}

.header-icon {
  display: inline-flex;
  color: var(--accent-2);
}

.send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: var(--text-1);
  font-weight: 600;
  font-size: 15px;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-0);
}

.btn-primary-nav {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 8px 18px;
  border-radius: 999px;
  color: white !important;
  font-weight: 700;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gem-badge {
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--gem);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.username {
  font-weight: 600;
  color: var(--text-0);
}

.btn-logout {
  color: var(--text-1);
  font-size: 14px;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  transition: all 0.2s;
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 24px 60px;
  text-align: center;
}

.hero h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-0), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin-top: 20px;
  font-size: 18px;
  color: var(--text-1);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.5);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-0);
}

.btn-outline:hover {
  border-color: var(--accent-2);
}

.features {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-2);
}

.feature-card .icon {
  font-size: 28px;
  margin-bottom: 14px;
  display: inline-block;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
}

.auth-wrap {
  max-width: 420px;
  margin: 80px auto;
  padding: 0 24px;
}

.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}

.auth-card h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

.auth-card .sub {
  color: var(--text-1);
  font-size: 14px;
  margin-bottom: 26px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-0);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: var(--accent-2);
}

.auth-card .btn {
  width: 100%;
  margin-top: 8px;
}

.auth-alt {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-1);
}

.auth-alt a {
  color: var(--accent-2);
  font-weight: 600;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 18px;
}

.alert-error {
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid rgba(255, 92, 122, 0.4);
  color: var(--danger);
}

.alert-success {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: var(--success);
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  width: 100%;
  flex: 1;
}

.sidebar {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  height: fit-content;
}

.sidebar h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-1);
  margin-bottom: 14px;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.friend-item:hover, .friend-item.active {
  background: var(--bg-3);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}

.friend-name {
  font-size: 14px;
  font-weight: 600;
}

.chat-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 640px;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
}

.msg-them {
  background: var(--bg-3);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-me {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-author {
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 3px;
}

.msg-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 3px;
}

.chat-input {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.chat-input input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-0);
  outline: none;
  font-size: 14px;
}

.chat-input input:focus {
  border-color: var(--accent-2);
}

.send-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-box input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-0);
  outline: none;
  font-size: 14px;
}

.search-box button {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-0);
  border-radius: 10px;
  padding: 0 16px;
  cursor: pointer;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-3);
  margin-bottom: 8px;
}

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

.small-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.small-btn.secondary {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-0);
}

.small-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.friends-col {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.friends-col h3 {
  font-size: 15px;
  margin-bottom: 16px;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.shop-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}

.shop-item .item-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.shop-item h4 {
  font-size: 16px;
  margin-bottom: 6px;
}

.shop-item p {
  color: var(--text-1);
  font-size: 13px;
  margin-bottom: 16px;
  min-height: 34px;
}

.shop-item .price {
  color: var(--gem);
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 15px;
}

.empty-state {
  text-align: center;
  color: var(--text-1);
  padding: 40px 20px;
  font-size: 14px;
}

.context-menu {
  display: none;
  position: absolute;
  z-index: 200;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  min-width: 200px;
  padding: 6px;
}

.context-menu-item {
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-0);
}

.context-menu-item:hover {
  background: var(--bg-3);
}

.context-menu-item.danger {
  color: var(--danger);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
}

.toast {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  animation: toastIn 0.25s ease-out;
}

.toast strong {
  font-size: 15px;
}

.toast span {
  font-size: 13px;
  opacity: 0.9;
}

.toast-hide {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.4s, transform 0.4s;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-1);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.page-title {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 24px;
  font-size: 26px;
  font-weight: 800;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  text-align: left;
}

.hero-grid .hero-text h1 {
  margin: 0;
}

.hero-grid .hero-text p {
  margin: 20px 0 0;
  max-width: 520px;
  margin-left: 0;
  margin-right: 0;
}

.hero-grid .hero-actions {
  justify-content: flex-start;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.hero-icon-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.45), rgba(34, 211, 238, 0.15) 60%, transparent 70%);
  filter: blur(30px);
  border-radius: 50%;
}

.hero-icon-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--border);
  border-radius: 32px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  transform: rotate(-12deg);
  animation: heroFloat 5s ease-in-out infinite;
  color: var(--accent-2);
}

.hero-icon-wrap svg {
  width: 96px;
  height: 96px;
}

@keyframes heroFloat {
  0%, 100% { transform: rotate(-12deg) translateY(0); }
  50% { transform: rotate(-12deg) translateY(-14px); }
}

.floating-gem {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--gem);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  animation: floatSmall 4s ease-in-out infinite;
}

.gem-1 {
  top: 10%;
  left: 6%;
  animation-delay: 0s;
}

.gem-2 {
  bottom: 14%;
  left: -2%;
  color: var(--accent-2);
  animation-delay: 0.6s;
}

.gem-3 {
  top: 4%;
  right: 4%;
  color: var(--accent);
  animation-delay: 1.2s;
}

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

.stats-strip {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-2), var(--gem));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-1);
}

.section-title {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
}

.steps-section {
  max-width: 1100px;
  margin: 60px auto 0;
  padding: 0 24px 20px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.step-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  margin: 0 auto 16px;
}

.step-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.step-card p {
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
}

.cta-banner {
  max-width: 1100px;
  margin: 70px auto 90px;
  padding: 50px 40px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(34, 211, 238, 0.1));
  border: 1px solid var(--border);
  text-align: center;
}

.cta-banner h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
}

.cta-banner p {
  color: var(--text-1);
  margin-bottom: 24px;
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .friends-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .features { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-grid .hero-text { text-align: center; }
  .hero-grid .hero-text p { margin-left: auto; margin-right: auto; }
  .hero-grid .hero-actions { justify-content: center; }
  .hero-visual { margin-top: 40px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
}