/* MOMO DESIGN SYSTEM v1.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0f0a;
  --surface: #111611;
  --card: #141a14;
  --card-hover: #1a221a;
  --border: #1e281e;
  --border-active: #2d3d2d;
  --accent: #4ade80;
  --accent-dim: #22c55e;
  --accent-muted: rgba(74,222,128,0.12);
  --text: #e8f0e8;
  --text-secondary: #8a9e8a;
  --text-muted: #4a5e4a;
  --danger: #f87171;
  --warning: #fbbf24;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --transition: 0.15s ease;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* LAYOUT */
.app { max-width: 480px; margin: 0 auto; padding: 16px; padding-bottom: calc(80px + env(safe-area-inset-bottom, 24px)); }

/* HEADER */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 24px;
}
.header-icon {
  width: 40px; height: 40px;
  background: var(--accent-muted);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.header h1 {
  font-size: 20px; font-weight: 700;
  color: var(--text); letter-spacing: -0.3px;
}
.header p { font-size: 13px; color: var(--text-secondary); margin-top: 1px; }

/* CARDS */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 12px;
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit;
  transition: all var(--transition); min-height: 44px;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #0a0f0a; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary { background: var(--card-hover); color: var(--text); border: 1px solid var(--border-active); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: rgba(248,113,113,0.12); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }
.btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* INPUTS */
.input, input[type=text], input[type=number], input[type=email], input[type=search], textarea, select {
  width: 100%; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 15px; font-family: inherit;
  transition: border-color var(--transition); min-height: 44px;
  -webkit-appearance: none;
}
.input:focus, input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--text-muted); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a9e8a' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }

/* FORM GROUP */
.form-group { margin-bottom: 14px; }
.input-row { display: flex; gap: 8px; }
.input-row .input, .input-row input { flex: 1; }

/* LIST ITEMS */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px;
  transition: border-color var(--transition);
}
.list-item:hover { border-color: var(--border-active); }
.list-item-text { flex: 1; font-size: 14px; }
.list-item-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
}
.badge-green { background: var(--accent-muted); color: var(--accent); }
.badge-red { background: rgba(248,113,113,0.12); color: var(--danger); }
.badge-yellow { background: rgba(251,191,36,0.12); color: var(--warning); }

/* STATS ROW */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: center; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* EMPTY STATE */
.empty { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13px; }

/* DIVIDER */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* TOAST */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--border-active);
  border-radius: var(--radius-full); padding: 6px 14px;
  font-size: 12px; font-weight: 500; color: var(--text);
  box-shadow: var(--shadow); z-index: 9999;
  pointer-events: none;
}
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(8px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* PROGRESS */
.progress { height: 6px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width 0.3s ease; }

/* TABS */
.tabs { display: flex; gap: 4px; background: var(--card); border-radius: var(--radius); padding: 4px; margin-bottom: 16px; }
.tab { flex: 1; padding: 8px; border: none; background: none; color: var(--text-secondary); font-size: 12px; font-weight: 500; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; transition: all var(--transition); }
.tab.active { background: var(--accent-muted); color: var(--accent); }

/* CHECKBOX */
.checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 0; }
.checkbox input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.checkbox span { font-size: 14px; }
.checkbox input:checked + span { text-decoration: line-through; color: var(--text-muted); }

/* MOBILE SAFE */
@media (max-width: 480px) {
  .app { padding: 12px; }
  .header { padding: 16px 0 20px; }
}

/* Modal override — small toast notification, not blocking popup */
.momo-modal-overlay {
  position: fixed!important;
  top: 12px!important;
  left: 50%!important;
  transform: translateX(-50%)!important;
  right: auto!important;
  bottom: auto!important;
  width: auto!important;
  max-width: 300px!important;
  background: none!important;
  backdrop-filter: none!important;
  z-index: 99999!important;
  display: block!important;
  inset: auto!important;
  pointer-events: none!important;
  opacity: 0;
  transition: opacity 0.3s;
}
.momo-modal-overlay.show { opacity: 1!important; }
.momo-modal-box {
  background: rgba(0,0,0,0.85)!important;
  color: #fff!important;
  border-radius: 10px!important;
  padding: 10px 16px!important;
  max-width: 280px!important;
  max-height: 80px!important;
  width: auto!important;
  text-align: center!important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3)!important;
  pointer-events: auto!important;
  overflow: hidden!important;
}
.momo-modal-box p { 
  font-size: 13px!important; 
  margin: 0!important; 
  color: #fff!important;
  line-height: 1.3!important;
}
.momo-modal-btns { display: none!important; }

/* Auto-hide toast after 3 seconds */
@keyframes toastFade {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}
.momo-modal-overlay.show {
  animation: toastFade 3s forwards!important;
}


/* Game modal override — make game panels smaller and less intrusive */
.modal-overlay .modal-content,
.game-modal, .popup-content, .dialog-content {
  max-width: 320px!important;
  max-height: 60vh!important;
  padding: 16px!important;
  border-radius: 12px!important;
}
.modal-overlay {
  background: rgba(0,0,0,0.3)!important;
  backdrop-filter: blur(4px)!important;
}


/* Game toast override — move to top, make smaller, non-blocking */
.toast, #toast, [class*="toast"] {
  top: 16px!important;
  left: 50%!important;
  transform: translateX(-50%) scale(1)!important;
  bottom: auto!important;
  max-width: 260px!important;
  padding: 8px 16px!important;
  font-size: 13px!important;
  border-radius: 8px!important;
  pointer-events: none!important;
  background: rgba(0,0,0,0.8)!important;
  color: #fff!important;
  border: none!important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3)!important;
}
.toast.active, #toast.active, [class*="toast"].active {
  transform: translateX(-50%) scale(1)!important;
}
