/* ============================================
   Like+ — Dark Green Premium Theme
   Mobile-First / Modern / Glassmorphism
   Inspired by CJWorld Thai design language
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

:root {
  --green-900: #011A0C;
  --green-800: #012E18;
  --green-700: #014D28;
  --green-600: #047339;
  --green-500: #059652;
  --green-400: #1DAA82;
  --green-300: #34C69E;
  --green-200: #52D9B4;

  --red-700: #B91C1C;
  --red-600: #DC2626;
  --red-500: #EF4444;
  --red-400: #F87171;

  --green-gradient: linear-gradient(135deg, #52D9B4 0%, #1DAA82 35%, #059652 65%, #014D28 100%);
  --red-gradient:   linear-gradient(135deg, #F87171 0%, #EF4444 50%, #B91C1C 100%);
  --dark-gradient:  linear-gradient(160deg, #000f07 0%, #010f08 40%, #011A0C 100%);

  --bg:          #010f08;
  --card-bg:     rgba(4, 50, 26, 0.80);
  --card-border: rgba(29, 170, 130, 0.20);
  --text:        rgba(232, 255, 248, 0.92);
  --text-muted:  rgba(190, 235, 220, 0.55);
  --shadow:      rgba(0, 0, 0, 0.45);

  --radius:      16px;
  --radius-sm:   10px;
  --nav-height:  64px;
  --header-height: 60px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Kanit', sans-serif;
  background: var(--dark-gradient);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ══════════════════════════════
   SPLASH SCREEN
══════════════════════════════ */
.ltv-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-gradient);
}

.ltv-splash-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
}

.orb-1 {
  width: 300px; height: 300px;
  background: var(--green-500);
  top: -80px; left: -80px;
  animation: orbDrift 8s ease-in-out infinite alternate;
}

.orb-2 {
  width: 200px; height: 200px;
  background: var(--red-600);
  bottom: -60px; right: -60px;
  animation: orbDrift 10s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 150px; height: 150px;
  background: var(--green-400);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: orbDrift 6s ease-in-out infinite alternate;
}

@keyframes orbDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(20px, 20px) scale(1.1); }
}

.ltv-splash-panel {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 28px;
}

.ltv-splash-logo-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(29, 170, 130, 0.35);
  animation: logoPulse 2.5s ease-in-out infinite;
}

.ltv-splash-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ltv-splash-logo-ring {
  display: none;
}

.ltv-splash-title {
  font-size: 30px;
  font-weight: 700;
  background: var(--green-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.ltv-splash-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 300;
  margin-bottom: 28px;
}

.ltv-splash-progress-track {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin: 0 auto 12px;
  overflow: hidden;
}

.ltv-splash-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.ltv-splash-loading-text {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.ltv-splash-percent {
  color: var(--green-300);
  font-size: 13px;
  font-weight: 600;
}

#loading-progress {
  width: 0%;
  height: 100%;
  background: var(--green-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 8px 32px rgba(29, 170, 130, 0.35); }
  50%       { transform: scale(1.04); box-shadow: 0 12px 48px rgba(29, 170, 130, 0.50); }
}

/* ══════════════════════════════
   HEADER
══════════════════════════════ */
.top-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(4, 50, 26, 0.98) 0%, rgba(4, 50, 26, 0.92) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  max-width: 600px;
  margin: 0 auto;
  height: var(--header-height);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(29, 170, 130, 0.3);
  object-fit: cover;
}

.header-text {
  display: flex;
  flex-direction: column;
}

.banner-title {
  font-size: 18px;
  font-weight: 700;
  background: var(--green-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.banner-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.3;
}

.lang-select,
.lang-selector-container select {
  background: rgba(29, 170, 130, 0.12);
  color: var(--green-300);
  border: 1px solid rgba(29, 170, 130, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.lang-select option {
  background: var(--green-900);
  color: var(--text);
}

/* ══════════════════════════════
   LAYOUT
══════════════════════════════ */
.lotto-results,
.tab-content {
  padding-bottom: calc(var(--nav-height) + 20px);
  max-width: 600px;
  margin: 0 auto;
}

/* ══════════════════════════════
   CARDS
══════════════════════════════ */
.lotto-section,
.check-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin: 12px 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px var(--shadow);
}

.lotto-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(5, 150, 82, 0.9) 0%, rgba(1, 77, 40, 0.95) 100%);
  border-bottom: 1px solid rgba(29, 170, 130, 0.2);
}

.lotto-header i {
  color: var(--green-200);
  font-size: 18px;
}

.lotto-header h2 {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--green-200);
}

.date-badge,
.stock-date {
  background: rgba(29, 170, 130, 0.18);
  color: var(--green-300);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(29, 170, 130, 0.25);
}

/* ══════════════════════════════
   CHECK FORM
══════════════════════════════ */
.check-form {
  padding: 16px;
}

.input-wrapper {
  position: relative;
  margin-bottom: 12px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green-400);
  font-size: 16px;
}

.input-wrapper input,
#check-number {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 20px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 5px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus,
#check-number:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(29, 170, 130, 0.15);
}

.input-wrapper input::placeholder,
#check-number::placeholder {
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: 400;
  font-size: 14px;
}

.check-buttons {
  display: flex;
  gap: 10px;
}

.check-result {
  padding: 0 16px 16px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  line-height: 1.6;
}

.check-result:empty { display: none; }

/* ══════════════════════════════
   BUTTONS
══════════════════════════════ */
.check-btn,
.reset-btn,
.spin-slot-btn,
.extra-btn,
.clear-btn,
.mini-game-btn,
.generate-lucky-btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.check-btn {
  flex: 1;
  background: linear-gradient(135deg, rgba(5, 150, 82, 0.9) 0%, rgba(1, 77, 40, 0.95) 100%);
  color: var(--green-200);
  border: 1px solid rgba(29, 170, 130, 0.3);
}

.check-btn:active { transform: scale(0.97); }

.reset-btn {
  background: transparent;
  color: var(--green-300);
  border: 1px solid rgba(29, 170, 130, 0.3);
}

.reset-btn:active { background: rgba(29, 170, 130, 0.1); }

/* ══════════════════════════════
   STOCK SECTION
══════════════════════════════ */
.stock-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: rgba(29, 170, 130, 0.07);
}

.stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background: var(--card-bg);
  transition: background 0.2s;
}

.stock-item:active { background: rgba(29, 170, 130, 0.06); }

.stock-flag-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-flag-name img {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
}

.stock-flag-name strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.stock-result {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.stock-number {
  font-size: 12px;
  color: var(--text-muted);
}

.stock-number b,
.stock-number strong {
  color: var(--green-300);
  font-weight: 700;
  font-size: 14px;
}

/* ══════════════════════════════
   PRIZE DISPLAY
══════════════════════════════ */
.result-box.main-prize,
.main-prize {
  padding: 24px 16px;
  text-align: center;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(185, 28, 28, 0.15) 100%);
}

.prize-number {
  font-size: 40px;
  font-weight: 700;
  background: var(--red-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 8px;
}

.sub-prizes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(29, 170, 130, 0.07);
}

.prize-box {
  text-align: center;
  padding: 14px 8px;
  background: var(--card-bg);
}

.prize-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 400;
}

.prize-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--green-300);
}

/* ══════════════════════════════
   BOTTOM NAV
══════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  z-index: 200;
  background: linear-gradient(180deg, rgba(4, 40, 22, 0.97) 0%, rgba(2, 25, 14, 0.99) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--card-border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.tab-icon {
  font-size: 18px;
  transition: all 0.2s;
}

.tab.active {
  color: var(--green-300);
}

.tab.active .tab-icon {
  transform: scale(1.12);
}

.tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--green-gradient);
  border-radius: 0 0 4px 4px;
}

.tab:active { transform: scale(0.92); }

/* ══════════════════════════════
   STATS / LUCKY NUMBERS TAB
══════════════════════════════ */
.stats-section {
  padding: 0 0 16px;
}

.stats-header {
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 0;
}

.stats-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--green-200);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.stats-header h2 i {
  color: var(--green-400);
}

.stats-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.daily-lucky-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin: 12px 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px var(--shadow);
}

.lucky-number-display {
  padding: 28px 16px;
  text-align: center;
}

.lucky-number-display h3 {
  font-size: 16px;
  color: var(--green-200);
  margin-bottom: 16px;
}

.main-lucky-number {
  font-size: 64px;
  font-weight: 700;
  background: var(--green-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 10px;
}

.lucky-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.generate-lucky-btn {
  background: var(--green-gradient);
  color: var(--green-900);
  font-weight: 700;
  padding: 12px 24px;
  border: none;
  box-shadow: 0 2px 14px rgba(29, 170, 130, 0.3);
}

.generate-lucky-btn:active { transform: scale(0.97); }

.lucky-tips-section,
.lucky-history-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin: 12px 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px var(--shadow);
}

.lucky-tips-section h3,
.lucky-history-section h3 {
  padding: 14px 16px 10px;
  font-size: 15px;
  color: var(--green-200);
  border-bottom: 1px solid var(--card-border);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(29, 170, 130, 0.07);
}

.tip-card {
  background: var(--card-bg);
  padding: 16px 12px;
  text-align: center;
}

.tip-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.tip-card h4 {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 4px;
}

.tip-card p {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.tip-number {
  font-size: 30px;
  font-weight: 700;
  color: var(--green-300);
}

.lucky-history-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 0;
}

.history-item {
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(29, 170, 130, 0.07);
}

.history-item:last-child { border-bottom: none; }

.clear-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 12px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(29, 170, 130, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-btn:hover { background: rgba(29, 170, 130, 0.08); color: var(--green-300); }

/* ══════════════════════════════
   GAME TAB
══════════════════════════════ */
.lucky-container {
  padding: 0;
}

.lucky-header {
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--card-border);
}

.lucky-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--green-200);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.lucky-header h2 i { color: var(--green-400); }

.lucky-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.slot-machine-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin: 12px 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px var(--shadow);
}

.slot-header {
  padding: 14px 16px 10px;
  background: linear-gradient(135deg, rgba(5, 150, 82, 0.9) 0%, rgba(1, 77, 40, 0.95) 100%);
  border-bottom: 1px solid rgba(29, 170, 130, 0.2);
}

.slot-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--green-200);
  margin-bottom: 2px;
}

.slot-subtitle {
  font-size: 12px;
  color: rgba(190, 235, 220, 0.7);
}

.slot-container {
  padding: 16px;
}

.number-guess-game {
  margin-bottom: 16px;
}

.game-instructions {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.number-selection {
  margin-bottom: 14px;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.number-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  border: 2px solid var(--card-border) !important;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.number-btn:active,
.number-btn.selected {
  background: var(--green-gradient) !important;
  color: var(--green-900) !important;
  border-color: var(--green-400) !important;
  transform: scale(0.95);
  box-shadow: 0 0 18px rgba(29, 170, 130, 0.4);
}

.game-result {
  text-align: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  margin-bottom: 14px;
}

.selected-number {
  font-size: 14px;
  color: var(--green-300);
  margin-bottom: 6px;
  font-weight: 500;
}

.result-display {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.result-display.correct { color: #4ade80; font-weight: 600; }
.result-display.wrong   { color: var(--red-400); font-weight: 600; }

.game-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.stat-item,
.stat {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-value,
.stat b,
.stat-item b { color: var(--green-300); }

.slot-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spin-slot-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(5, 150, 82, 0.9) 0%, rgba(1, 77, 40, 0.95) 100%);
  color: var(--green-200);
  border: 1px solid rgba(29, 170, 130, 0.3) !important;
  font-size: 16px;
  padding: 14px;
}

.spin-slot-btn:active { transform: scale(0.97); }

.extra-btn {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(29, 170, 130, 0.2) !important;
  font-size: 14px;
}

.extra-btn:hover { background: rgba(29, 170, 130, 0.08); color: var(--green-300); }

/* Mini Games */
.mini-games-section,
.game-history-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin: 12px 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px var(--shadow);
}

.mini-games-section h3,
.game-history-section h3 {
  padding: 14px 16px 10px;
  font-size: 15px;
  color: var(--green-200);
  border-bottom: 1px solid var(--card-border);
}

.mini-games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(29, 170, 130, 0.07);
}

.mini-game-card {
  background: var(--card-bg);
  padding: 16px 10px;
  text-align: center;
}

.mini-game-card h4 {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 500;
}

.game-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--green-300);
  margin-bottom: 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-game-btn {
  background: rgba(29, 170, 130, 0.15);
  color: var(--green-300);
  border: 1px solid rgba(29, 170, 130, 0.25) !important;
  font-size: 12px;
  padding: 8px 12px;
  width: 100%;
  border-radius: 8px;
}

.mini-game-btn:active { background: rgba(29, 170, 130, 0.25); }

.game-history-list {
  max-height: 180px;
  overflow-y: auto;
  padding: 8px 0;
}

/* ══════════════════════════════
   CHAT TAB
══════════════════════════════ */
#chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - var(--nav-height));
  position: relative;
}

.chat-messages-mobile {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.chat-tips {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin: 12px 16px 0;
  padding: 14px 16px;
  backdrop-filter: blur(8px);
}

.tips-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--green-200);
  margin-bottom: 8px;
}

.tip-item {
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 0;
  line-height: 1.5;
}

/* Message Bubbles */
.message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: msgSlide 0.3s ease;
}

.message.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-message { align-self: flex-start; }

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.user-message .message-avatar {
  background: var(--green-gradient);
  color: var(--green-900);
}

.ai-message .message-avatar {
  background: linear-gradient(135deg, rgba(5, 150, 82, 0.9) 0%, rgba(1, 77, 40, 0.95) 100%);
  color: var(--green-200);
  border: 1px solid var(--card-border);
}

.message-content {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.user-message .message-content {
  background: var(--green-gradient);
  color: var(--green-900);
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.ai-message .message-content {
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.typing-indicator .typing-dots {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 14px;
  border: 1px solid var(--card-border);
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--green-400);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

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

/* Chat Input */
.chat-input-mobile {
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--card-border);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
}

.input-container-mobile {
  display: flex;
  gap: 8px;
}

.input-field-mobile {
  flex: 1;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.input-field-mobile:focus { border-color: var(--green-400); }
.input-field-mobile::placeholder { color: var(--text-muted); }

.send-btn-mobile {
  background: var(--green-gradient);
  color: var(--green-900);
  font-weight: 700;
  padding: 12px 20px;
  border: none;
  border-radius: 24px;
  white-space: nowrap;
}

.send-btn-mobile:active { transform: scale(0.96); }

/* ══════════════════════════════
   COSMIC TAB
══════════════════════════════ */
.cosmic-bg {
  min-height: calc(100vh - var(--header-height) - var(--nav-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(29, 170, 130, 0.08) 0%, transparent 70%);
}

.cosmic-instruction {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 300px;
  line-height: 1.6;
}

#cosmic-number {
  font-size: 80px;
  font-weight: 700;
  background: var(--green-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
  animation: cosmicFloat 3s ease-in-out infinite;
}

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

.cosmic-actions {
  display: flex;
  gap: 12px;
}

.cosmic-actions button {
  background: rgba(29, 170, 130, 0.15);
  color: var(--green-300);
  border: 1px solid rgba(29, 170, 130, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.cosmic-actions button:active {
  background: rgba(29, 170, 130, 0.25);
  transform: scale(0.97);
}

/* ══════════════════════════════
   NOTIFICATION
══════════════════════════════ */
.notification {
  position: fixed;
  top: 16px;
  right: 16px;
  left: 16px;
  max-width: 400px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  text-align: center;
  animation: notifSlide 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.notification.success {
  background: rgba(74, 222, 128, 0.9);
  color: #014D28;
  border: 1px solid rgba(74, 222, 128, 0.5);
}

.notification.error {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

/* ══════════════════════════════
   MENU / OVERLAY
══════════════════════════════ */
.login-menu,
.menu-overlay,
#login-menu,
#menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
}

#menu-overlay {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.login-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(4, 46, 26, 0.98) 0%, rgba(1, 25, 14, 0.99) 100%);
  border-top: 1px solid var(--card-border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px;
  z-index: 600;
  max-width: 600px;
  margin: 0 auto;
}

.login-panel .btn-register {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--red-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 10px;
  text-align: center;
  transition: all 0.2s;
}

.login-panel .btn-login {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, rgba(5, 150, 82, 0.9) 0%, rgba(1, 77, 40, 0.95) 100%);
  color: var(--green-200);
  border: 1px solid rgba(29, 170, 130, 0.3);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

/* ══════════════════════════════
   SCROLLBAR
══════════════════════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(29, 170, 130, 0.2);
  border-radius: 4px;
}

/* ══════════════════════════════
   ANIMATIONS
══════════════════════════════ */
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1;   }
}

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

@keyframes notifSlide {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0);     }
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (min-width: 600px) {
  .stock-grid {
    grid-template-columns: 1fr 1fr;
  }

  .number-grid {
    grid-template-columns: repeat(5, 60px);
    justify-content: center;
  }

  .tips-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .mini-games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Safe area for notch devices */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav {
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }

  .lotto-results,
  .tab-content {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 20px);
  }
}

/* Touch devices: remove hover effects */
@media (hover: none) {
  .tab:hover { color: inherit; }
  .stock-item:hover { background: var(--card-bg); }
}
