:root {
  /* Pastel Palette matching Robot Icon */
  --blue: #4facfe;
  /* Soft Sky Blue */
  --pink: #ff9a9e;
  /* Soft Pastel Pink */
  --ink: #1f2a44;
  --muted: #6b7a99;
  --line: rgba(31, 42, 68, .12);
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans Thai", sans-serif;
  color: var(--ink);
  /* Premium Blue-White Gradient */
  background: radial-gradient(circle at 10% 20%, rgb(255, 255, 255) 0%, rgb(235, 247, 255) 40%, rgb(200, 230, 255) 90%);
  min-height: 100vh;
}

/* Common Styles (Preserved for other pages) */
.wrap {
  max-width: 1200px;
  margin: auto;
  padding: 26px 16px 56px;
}
.wrap-chat { padding: 0 !important; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--pink));
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.brand p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.card {
  background: #fff;
  border-radius: 24px;
  padding: 22px;
  border: 2px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .10);
}

.head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.h-title {
  margin: 10px 0 6px;
  font-size: 38px;
  letter-spacing: -.3px;
}

.h-sub {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.badge {
  display: inline-block;
  background: #eef5ff;
  border: 1px solid rgba(43, 123, 255, .25);
  color: #1649b6;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 800;
  border: 2px solid transparent;
}

.btn-primary {
  /* Pink Confirm Button as requested */
  background: linear-gradient(90deg, #ff758c 0%, #ff7eb3 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 117, 140, 0.4);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.actions {
  margin-top: 16px;
}

/* Redesign Welcome Styles - Dark UI Match */
.full-height-center {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* background: #0b1120; REMOVED to show body gradient */
}

.welcome-container {
  position: relative;
  width: 90%;
  max-width: 450px;
  /* Reduced size for smaller frame */
  max-height: 80vh;
  /* Adjusted max height */
  aspect-ratio: 9/16;
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  /* Clickable indication */
  border: 10px solid #fff;
  box-shadow: none;
  background: #fff;
  transition: transform 0.3s ease;
}

.welcome-container:hover {
  transform: scale(1.01);
}

.vid-item-single {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}



/* Top Logo Overlay */
.top-logo {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 32px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 24px;
  color: #1f2a44;
  z-index: 10;
  border: 4px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Start Button for Welcome Page */
.start-overlay {
  position: relative;
  z-index: 20;
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.btn-start-welcome {
  padding: 16px 40px;
  font-size: 20px;
  border-radius: 50px;
  box-shadow: none;
  animation: pulse-welcome 2s infinite;
  white-space: nowrap;
}

@keyframes pulse-welcome {
  0% { transform: scale(1); box-shadow: none; }
  50% { transform: scale(1.05); box-shadow: none; }
  100% { transform: scale(1); box-shadow: none; }
}



/* Mode Selection Page Styles */
/* Mode Selection Page Styles */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  padding: 10px;
  max-width: 850px;
  margin: 0 auto;
}

@media (max-width: 850px) {
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 500px;
  }
}

@media (max-width: 550px) {
  .mode-grid {
    grid-template-columns: 1fr;
    max-width: 300px;
    gap: 20px;
  }
  .wrap {
    padding: 15px 10px 40px;
  }
  .h-title {
    font-size: 28px !important;
  }
}

.mode-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
}

.mode-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(79, 172, 254, 0.3);
}

.mode-video-wrap {
  width: 100%;
  aspect-ratio: 3/4; /* Changed from 1/1 to show more body content */
  position: relative;
  background: #f0f4f8;
  overflow: hidden;
}

.mode-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05); /* Reduced scale to show more content */
  object-position: center;
}

.mode-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.mode-info {
  padding: 12px; /* Reduced from 20px */
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px; /* Reduced from 12px */
}

.mode-info h3 {
  margin: 0;
  font-size: 16px; /* Reduced from 20px */
  color: var(--ink);
}

.btn-mode-start {
  width: 100%;
  border-radius: 12px;
  font-size: 14px;
  padding: 8px 12px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .welcome-container {
    height: auto;
    max-height: 100dvh;
  }

  .wrap.full-height-center {
    padding: 12px;
  }
}


/* Snow Effect */
.snowflake {
  position: absolute;
  top: -10px;
  color: #fff;
  font-size: 1em;
  font-family: Arial;
  text-shadow: 0 0 1px #000;
  user-select: none;
  z-index: 9999;
  pointer-events: none;
  animation-name: snowfall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes snowfall {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(100vh);
  }
}