:root {
  /* Färgpalett: Cyberpunk / Green Tech */
  --bg-black: #050505;
  --bg-dark: #0f1115;
  --bg-card: #181a20;
  --green-neon: #00ff88;
  --green-dim: rgba(0, 255, 136, 0.15);
  --green-glow: 0 0 10px rgba(0, 255, 136, 0.3);
  --text-white: #ffffff;
  --text-gray: #889096;
  --font-main: 'Inter', system-ui, sans-serif;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font-main);
  height: 100vh;
  overflow: hidden;
  display: flex; justify-content: center;
}

.app {
  width: 100%; max-width: 420px; /* Lite bredare för moderna telefoner */
  background: var(--bg-dark);
  height: 100%;
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

/* --- HEADER --- */
header {
  padding: 18px 16px 10px;
  display: flex; justify-content: space-between; align-items: flex-start;
  background: linear-gradient(180deg, rgba(24,26,32,0.8) 0%, transparent 100%);
}
h1 { margin: 0; font-size: 18px; text-transform: uppercase; font-weight: 900; font-style: italic; letter-spacing: -0.5px; line-height: 1.1; }
#headerSubtitle { color: var(--green-neon); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 4px; }
 

/* --- MAIN & VIEWS --- */
main { flex: 1; overflow-y: auto; padding: 0 0 90px 0; position: relative; }
.view { display: none; padding: 20px; animation: slideUp 0.4s ease; }
.view.active { display: block; }

/* --- HERO SECTION --- */
.progress-container { width: 240px; height: 240px; margin: 10px auto 30px; position: relative; }
svg { transform: rotate(-90deg); width: 100%; height: 100%; }
circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring-bg { stroke: #222; }
.ring-val { 
  stroke: var(--green-neon); stroke-dasharray: 628; stroke-dashoffset: 628; 
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1); 
  filter: drop-shadow(0 0 8px var(--green-neon)); 
}
.hero-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
#stepCounter { font-size: 48px; font-weight: 900; line-height: 1; letter-spacing: -2px; }
.step-label { color: var(--text-gray); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin-top: 5px; }
.env-badge { margin-top: 10px; font-size: 13px; color: #fff; background: rgba(255,255,255,0.1); padding: 4px 12px; border-radius: 20px; }

/* --- BUTTONS & CARDS --- */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.action-btn {
  background: var(--bg-card); border: 1px solid #333; color: var(--text-white);
  padding: 16px; border-radius: var(--radius); font-weight: 700; font-size: 13px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.1s, border-color 0.2s;
}
.action-btn:active { transform: scale(0.96); }
.action-btn.primary { background: var(--green-neon); color: #000; border: none; box-shadow: var(--green-glow); }
.action-btn.secondary { flex-direction: row; background: transparent; border: 1px solid var(--green-neon); color: var(--green-neon); }

.card { background: var(--bg-card); padding: 20px; border-radius: var(--radius); margin-bottom: 15px; border: 1px solid rgba(255,255,255,0.03); }

/* --- LISTS --- */
.list-item {
  background: rgba(255,255,255,0.03); margin-bottom: 8px; padding: 14px;
  border-radius: 10px; display: flex; align-items: center; justify-content: space-between;
  border-left: 3px solid transparent; transition: background 0.2s;
}
.list-item.me { border-left-color: var(--green-neon); background: linear-gradient(90deg, rgba(0,255,136,0.08), transparent); }
.avatar { 
  width: 40px; height: 40px; background: #2a2d35; border-radius: 50%; 
  display: grid; place-items: center; margin-right: 12px; 
  font-weight: 700; color: #fff; flex-shrink: 0; 
}
.item-info { flex: 1; }
.item-name { font-weight: 700; font-size: 14px; }
.item-sub { font-size: 12px; color: var(--text-gray); }

.btn-sm { 
  padding: 6px 12px; font-size: 11px; border-radius: 20px; 
  border: 1px solid var(--green-neon); background: transparent; color: var(--green-neon); 
  cursor: pointer; font-weight: 700; white-space: nowrap;
}
.btn-sm:active { background: var(--green-neon); color: #000; }

/* --- BADGES SYSTEM --- */
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge-item { display: flex; flex-direction: column; align-items: center; opacity: 0.3; transition: opacity 0.5s; }
.badge-item.unlocked { opacity: 1; }
.badge-icon { 
  font-size: 24px; width: 50px; height: 50px; background: #222; 
  border-radius: 50%; display: grid; place-items: center; margin-bottom: 5px; 
  border: 2px solid transparent; 
}
.badge-item.unlocked .badge-icon { border-color: var(--green-neon); background: var(--green-dim); box-shadow: var(--green-glow); }
.badge-name { font-size: 9px; text-align: center; color: var(--text-gray); }

.mini-badge-card { display: flex; align-items: center; cursor: pointer; }
.mini-icon { font-size: 24px; margin-right: 15px; width: 40px; height: 40px; background: #222; border-radius: 50%; display: grid; place-items: center; }

/* --- GROUP & CHAT --- */
.no-group-container { text-align: center; padding: 40px 20px; border: 1px dashed #333; border-radius: var(--radius); color: var(--text-gray); }
.big-icon { font-size: 48px; color: var(--green-neon); margin-bottom: 10px; }
.chat-window { background: #111; height: 350px; border-radius: var(--radius); padding: 15px; overflow-y: auto; margin-bottom: 15px; border: 1px solid #222; }
.msg { margin-bottom: 8px; font-size: 14px; animation: fadeIn 0.3s; }
.msg.system { color: var(--text-gray); font-style: italic; text-align: center; font-size: 11px; margin: 15px 0; border-top: 1px solid #222; padding-top: 10px; }
.sender { color: var(--green-neon); font-weight: 700; margin-right: 6px; }
.reaction-bar { display: flex; gap: 8px; }
.reaction-bar button { flex: 1; padding: 12px; background: #222; border: none; border-radius: 8px; cursor: pointer; font-size: 20px; transition: transform 0.1s; }
.reaction-bar button:active { transform: scale(0.9); background: #333; }

/* --- PROFIL & INPUTS --- */
.profile-input {
  width: 100%; background: #0b0c0e; border: 1px solid #333; color: #fff;
  padding: 12px; border-radius: 8px; font-size: 16px; font-weight: 700;
  text-align: center; margin-top: 5px;
}
.profile-input:focus { border-color: var(--green-neon); outline: none; }
.profile-header { text-align: center; margin-bottom: 20px; position: relative; }
.profile-avatar { 
  width: 90px; height: 90px; background: #222; border-radius: 50%; 
  margin: 0 auto 12px; display: grid; place-items: center; 
  font-size: 36px; font-weight: 800; border: 3px solid var(--green-neon); box-shadow: var(--green-glow);
}
.lang-pill { position: absolute; top: 0; right: 0; background: #222; color: #fff; border: 1px solid #444; padding: 4px; border-radius: 6px; font-size: 11px; }

/* --- NAV --- */
nav {
  position: absolute; bottom: 0; width: 100%; height: 80px;
  background: rgba(15, 17, 21, 0.95); border-top: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  display: flex; justify-content: space-around; align-items: center; z-index: 500;
  padding-bottom: 15px; /* För nya iPhones swipe-bar */
}
.nav-item { 
  background: none; border: none; color: #555; 
  display: flex; flex-direction: column; align-items: center; 
  gap: 4px; cursor: pointer; flex: 1; 
}
.nav-item .material-symbols-rounded { font-size: 24px; transition: transform 0.2s; }
.nav-label { font-size: 10px; font-weight: 600; }
.nav-item.active { color: var(--green-neon); }
.nav-item.active .material-symbols-rounded { transform: translateY(-2px); text-shadow: 0 0 10px rgba(0,255,136,0.5); }

/* --- UTILS & MODAL --- */
.btn-primary { background: var(--green-neon); color: #000; padding: 14px; border: none; border-radius: 10px; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px; transition: opacity 0.2s; }
.btn-primary:active { opacity: 0.8; }
.full-width { width: 100%; display: block; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.active { display: flex; opacity: 1; }
.center-text { text-align: center; }
.badge-icon-large { font-size: 60px; margin-bottom: 10px; }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--green-neon); color: #000; padding: 12px 24px;
  border-radius: 30px; font-weight: 700; font-size: 13px;
  z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.3s, top 0.3s;
  box-shadow: 0 5px 20px rgba(0,255,136,0.4);
}
.toast.show { opacity: 1; top: 50px; }

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }