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

:root {
  --forest: #0b1f14;
  --green:  #2d6a4f;
  --leaf:   #52b788;
  --mint:   #95d5b2;
  --amber:  #e9a84c;
  --white:  #ffffff;
  --gray:   #888;
}

html, body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--forest);
  color: var(--white);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── SCREENS ─────────────────────────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  animation: fadeIn .4s ease;
}

.screen.active { display: flex; }

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

/* ── LOGO ────────────────────────────────────────────────────────────────── */
.logo {
  position: fixed; top: 1.25rem; left: 1.5rem; z-index: 200;
  font-size: 1rem; font-weight: 800; color: var(--white);
  text-decoration: none; display: flex; align-items: center; gap: .4rem;
}

.logo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--leaf);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.6); }
}

/* ── START-SCREEN ────────────────────────────────────────────────────────── */
#screen-start {
  background: radial-gradient(ellipse at 50% 30%, rgba(45,106,79,.4) 0%, var(--forest) 70%);
}

.start-badge {
  display: inline-flex; align-items: center;
  background: rgba(82,183,136,.12);
  border: 1px solid rgba(82,183,136,.3);
  color: var(--mint);
  padding: .35rem .9rem; border-radius: 50px;
  font-size: .72rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 1.75rem;
}

#screen-start h1 {
  font-size: clamp(2.2rem, 8vw, 3.8rem);
  font-weight: 800; letter-spacing: -1.5px; line-height: 1.08;
  margin-bottom: 1.25rem;
}

.green { color: var(--leaf); }

#screen-start > p {
  font-size: 1rem; color: rgba(255,255,255,.6);
  max-width: 360px; line-height: 1.7; font-weight: 300; margin-bottom: 2rem;
}

/* ── STATS-BAR ───────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex; gap: 1.5rem; margin-bottom: 1.5rem;
  flex-wrap: wrap; justify-content: center;
}

.stat-item { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--leaf); letter-spacing: -1px; line-height: 1; }
.stat-label { font-size: .65rem; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .5px; }
.stat-divider { width: 1px; height: 32px; background: rgba(255,255,255,.1); }

/* ── KEIN GUTHABEN BANNER ────────────────────────────────────────────────── */
.no-credit-banner {
  background: rgba(233,168,76,.12);
  border: 1px solid rgba(233,168,76,.5);
  border-radius: 12px; padding: .9rem 1.1rem;
  max-width: 320px; margin-bottom: 1.25rem;
  text-align: left; display: none;
}

.no-credit-banner.visible { display: block; }
.no-credit-banner strong  { display: block; font-size: .85rem; font-weight: 700; color: var(--amber); margin-bottom: .25rem; }
.no-credit-banner span    { font-size: .8rem; color: rgba(255,255,255,.6); line-height: 1.5; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn-main {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; max-width: 320px;
  background: var(--leaf); color: var(--forest);
  border: none; border-radius: 16px;
  padding: 1.1rem 2rem; font-family: inherit;
  font-size: 1.05rem; font-weight: 700;
  cursor: pointer; transition: all .2s; margin-bottom: 1rem;
}

.btn-main:hover {
  background: var(--mint); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(82,183,136,.35);
}

.btn-main:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
}

.btn-secondary:hover {
  background: rgba(255,255,255,.1);
  color: var(--white); transform: none; box-shadow: none;
}

.btn-share    { background: var(--leaf); color: var(--forest); }
.btn-download { background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.15); color: rgba(255,255,255,.8); }
.btn-download:hover { background: rgba(255,255,255,.1); color: var(--white); transform: none; box-shadow: none; }

.btn-reset {
  background: transparent; border: none;
  color: rgba(255,255,255,.4); font-family: inherit;
  font-size: .85rem; cursor: pointer; margin-top: .25rem;
  text-decoration: underline; text-underline-offset: 3px;
}
.btn-reset:hover { color: rgba(255,255,255,.7); }

.btn-donate {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(233,168,76,.12); border: 1px solid rgba(233,168,76,.4);
  color: var(--amber); padding: .5rem 1.2rem; border-radius: 50px;
  font-family: inherit; font-size: .8rem; font-weight: 700;
  text-decoration: none; transition: all .2s; margin-top: .75rem;
}
.btn-donate:hover { background: rgba(233,168,76,.2); transform: translateY(-1px); }

/* ── FILE INPUT ──────────────────────────────────────────────────────────── */
#file-input { display: none; }

/* ── SDG CHIPS ───────────────────────────────────────────────────────────── */
.sdg-strip { margin-top: 2rem; display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; max-width: 360px; }

.sdg-chip {
  font-size: .65rem; font-weight: 700;
  padding: .25rem .65rem; border-radius: 50px;
  cursor: pointer; border: none; font-family: inherit;
  transition: transform .15s;
}
.sdg-chip:hover { transform: translateY(-2px); }
.sdg-3  { background: rgba(76,159,56,.15);  color: #3a9a3a; border: 1px solid rgba(76,159,56,.3); }
.sdg-7  { background: rgba(252,195,11,.15); color: #a08000; border: 1px solid rgba(252,195,11,.3); }
.sdg-11 { background: rgba(253,157,36,.15); color: #b07000; border: 1px solid rgba(253,157,36,.3); }
.sdg-13 { background: rgba(63,126,68,.15);  color: #3a7a40; border: 1px solid rgba(63,126,68,.3); }
.sdg-15 { background: rgba(86,192,43,.15);  color: #4a9a20; border: 1px solid rgba(86,192,43,.3); }

/* ── VORSCHAU-SCREEN ─────────────────────────────────────────────────────── */
#screen-preview { justify-content: flex-start; padding-top: 5rem; }

.preview-label {
  font-size: .75rem; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--leaf); margin-bottom: 1rem;
}

#preview-img {
  width: 100%; max-width: 400px; border-radius: 16px;
  object-fit: cover; max-height: 55vh;
  border: 1px solid rgba(255,255,255,.1);
}

.preview-actions {
  width: 100%; max-width: 400px; margin-top: 1.5rem;
  display: flex; flex-direction: column; gap: .75rem; align-items: center;
}

/* ── LADE-SCREEN ─────────────────────────────────────────────────────────── */
#screen-loading {
  background: radial-gradient(ellipse at 50% 50%, rgba(45,106,79,.35) 0%, var(--forest) 65%);
}

.loader-ring {
  width: 120px; height: 120px; position: relative; margin-bottom: 2.5rem;
}

.loader-ring svg { width: 100%; height: 100%; animation: spin 2s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.loader-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}

#screen-loading h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .5rem; }

.loading-sub { font-size: .9rem; color: rgba(255,255,255,.5); margin-bottom: 2.5rem; }

.sdg-tip {
  background: rgba(82,183,136,.08);
  border: 1px solid rgba(82,183,136,.2);
  border-radius: 12px; padding: 1.25rem 1.5rem;
  max-width: 340px; text-align: left;
}

.tip-label {
  font-size: .65rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--leaf); margin-bottom: .4rem;
}

#tip-text { font-size: .88rem; color: rgba(255,255,255,.7); line-height: 1.6; }

.progress-wrap {
  width: 100%; max-width: 300px; margin-top: 2rem;
  background: rgba(255,255,255,.08); border-radius: 50px;
  height: 4px; overflow: hidden;
}

.progress-bar {
  height: 100%; background: var(--leaf); border-radius: 50px;
  animation: progress 50s linear forwards;
}

@keyframes progress { from { width: 0%; } to { width: 90%; } }

/* ── ERGEBNIS-SCREEN ─────────────────────────────────────────────────────── */
#screen-result { justify-content: flex-start; padding-top: 5rem; padding-bottom: 3rem; }

.result-header { margin-bottom: 1.25rem; }
.result-header h2 { font-size: 1.5rem; font-weight: 800; }
.result-header p  { font-size: .85rem; color: rgba(255,255,255,.5); margin-top: .3rem; }

.comparison {
  width: 100%; max-width: 440px; position: relative;
  border-radius: 16px; overflow: hidden;
  user-select: none; cursor: col-resize;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.comparison img { width: 100%; display: block; max-height: 55vh; object-fit: cover; }

.comparison .after { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.comparison .after img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.slider-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%); width: 3px;
  background: var(--white); cursor: col-resize;
}

.slider-handle::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white); width: 36px; height: 36px;
  border-radius: 50%; box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.result-actions {
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: .75rem;
  margin-top: 1.5rem; align-items: center;
}

.donate-result { margin-top: 1.5rem; }
.donate-result a { font-size: .8rem; color: rgba(255,255,255,.35); text-decoration: underline; }
.donate-result a:hover { color: var(--leaf); }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.app-footer {
  text-align: center; padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

.app-footer a {
  color: rgba(255,255,255,.35); text-decoration: none;
  margin: 0 .6rem; font-size: .8rem;
}
.app-footer a:hover { color: var(--leaf); }

/* ── EINWILLIGUNGS-BANNER ────────────────────────────────────────────────── */
.consent-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}

.consent-overlay.hidden { display: none; }

.consent-box {
  background: #0f2c1c; border: 1px solid rgba(82,183,136,.25);
  border-radius: 20px; padding: 2rem;
  max-width: 460px; width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}

.consent-box h2 { font-size: 1.2rem; margin-bottom: .5rem; font-weight: 800; }
.consent-box > p { font-size: .88rem; color: rgba(255,255,255,.65); margin-bottom: 1.25rem; }

.consent-checks { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }

.consent-check {
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .87rem; color: rgba(255,255,255,.75); line-height: 1.5; cursor: pointer;
}

.consent-check input[type="checkbox"] {
  width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px;
  accent-color: var(--leaf); cursor: pointer;
}

.consent-check a { color: var(--leaf); }

.btn.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.75rem; border-radius: 50px;
  font-family: inherit; font-size: .95rem; font-weight: 700;
  cursor: pointer; border: none; transition: all .2s;
  background: var(--leaf); color: var(--forest); width: 100%;
}
.btn.btn-primary:hover:not(:disabled) { background: var(--mint); }
.btn.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

/* ── SDG MODAL ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: #0f2c1c; border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 1.75rem;
  max-width: 380px; width: 100%; position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}

.modal-close {
  position: absolute; top: .9rem; right: .9rem;
  background: rgba(255,255,255,.1); border: none;
  color: rgba(255,255,255,.6); width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,.2); }

.modal-num   { font-size: .7rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: .4rem; }
.modal-title { font-size: 1.1rem; font-weight: 800; margin-bottom: .75rem; }
.modal-desc  { font-size: .88rem; color: rgba(255,255,255,.7); line-height: 1.7; }

/* ── RECHTLICHE SEITEN ───────────────────────────────────────────────────── */
body.legal {
  background: #f4f0e6; color: #0a2e1a;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

nav {
  background: #0a2e1a; padding: .9rem 1.5rem;
  display: flex; align-items: center;
  position: sticky; top: 0; z-index: 100;
}

.nav-logo {
  font-size: 1.1rem; font-weight: 800;
  color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: .5rem;
}

.legal-content { max-width: 720px; margin: 2.5rem auto; padding: 0 1.5rem 4rem; }
.legal-content h1 { font-size: 2rem; font-weight: 800; margin-bottom: 2rem; color: #0a2e1a; }
.legal-content h2 { font-size: 1.05rem; font-weight: 700; color: #2d8f55; margin: 2rem 0 .5rem; }
.legal-content p, .legal-content li { font-size: .95rem; color: #444; margin-bottom: .6rem; line-height: 1.75; }
.legal-content ul { padding-left: 1.5rem; margin-bottom: .75rem; }
.legal-content a { color: #2d8f55; }

.legal-footer {
  background: #0a2e1a; color: rgba(255,255,255,.4);
  text-align: center; padding: 1.5rem; font-size: .8rem;
}
.legal-footer a { color: rgba(255,255,255,.4); text-decoration: none; margin: 0 .5rem; }
.legal-footer a:hover { color: #52b788; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .btn-main { max-width: 100%; }
  .comparison, .result-actions, .preview-actions { max-width: 100%; }
  .btn-main { font-size: .95rem; }
}

/* -- QUIZ MINIGAME -- */
.quiz-wrap { width:100%; max-width:380px; margin-bottom:1.5rem; }

.quiz-header {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:.75rem; font-size:.75rem; font-weight:700;
  color:rgba(255,255,255,.5); letter-spacing:.5px;
}

.quiz-score-display { color:#52b788; }

.quiz-card {
  background:rgba(255,255,255,.05);
  border:1px solid rgba(82,183,136,.2);
  border-radius:16px; padding:1.25rem;
  animation:fadeIn .3s ease;
}

.quiz-sdg-tag {
  font-size:.65rem; font-weight:700; letter-spacing:1.5px;
  text-transform:uppercase; color:#52b788; margin-bottom:.6rem;
}

.quiz-question {
  font-size:.95rem; font-weight:600; color:#fff;
  line-height:1.5; margin-bottom:1rem;
}

.quiz-options {
  display:grid; grid-template-columns:1fr 1fr;
  gap:.5rem;
}

.quiz-opt {
  background:rgba(255,255,255,.06);
  border:1.5px solid rgba(255,255,255,.12);
  border-radius:10px; padding:.6rem .75rem;
  font-family:inherit; font-size:.82rem; font-weight:500;
  color:rgba(255,255,255,.85); cursor:pointer;
  transition:all .15s; text-align:left; line-height:1.4;
}

.quiz-opt:hover:not(:disabled) {
  background:rgba(82,183,136,.12);
  border-color:rgba(82,183,136,.4);
}

.quiz-opt.correct {
  background:rgba(82,183,136,.2) !important;
  border-color:#52b788 !important; color:#52b788;
}

.quiz-opt.wrong {
  background:rgba(220,53,69,.15) !important;
  border-color:rgba(220,53,69,.5) !important;
  color:rgba(220,53,69,.85);
}

.quiz-opt:disabled { cursor:default; }

.quiz-fact {
  margin-top:.9rem; padding:.7rem .85rem;
  background:rgba(82,183,136,.08); border-radius:8px;
  font-size:.8rem; color:rgba(255,255,255,.65); line-height:1.55;
  display:flex; gap:.5rem; align-items:flex-start;
  animation:fadeIn .4s ease;
}

.quiz-fact.hidden { display:none; }
.quiz-fact-icon { font-size:1rem; flex-shrink:0; margin-top:1px; }

.quiz-result { text-align:center; padding:1.5rem; animation:fadeIn .4s ease; }
.quiz-result.hidden { display:none; }
.quiz-result-emoji { font-size:2.5rem; margin-bottom:.5rem; }
.quiz-result-msg { font-size:.9rem; color:rgba(255,255,255,.75); margin-bottom:1rem; line-height:1.6; }

.quiz-restart {
  background:rgba(82,183,136,.15); border:1px solid rgba(82,183,136,.35);
  color:#52b788; border-radius:50px; padding:.45rem 1.1rem;
  font-family:inherit; font-size:.8rem; font-weight:700; cursor:pointer;
  transition:background .2s;
}
.quiz-restart:hover { background:rgba(82,183,136,.25); }
