  :root{
    --brick: #8a3324;
    --brick-dark: #5f2118;
    --ink: #24262b;
    --parchment: #efe3ce;
    --parchment-deep: #e4d5b8;
    --hunte: #2f5f63;
    --gold: #b8862f;
    --white: #fdfaf3;
  }
  *{ box-sizing: border-box; }
  html,body{ margin:0; padding:0; }
  body{
    background: var(--parchment);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    min-height:100vh;
  }
  .app{ max-width: 720px; margin: 0 auto; padding-bottom: 60px; }

  /* HEADER */
  header{
    background: linear-gradient(160deg, var(--brick) 0%, var(--brick-dark) 100%);
    color: var(--white);
    padding: 28px 22px 34px;
    position: relative;
    overflow:hidden;
  }
  header::after{
    content:"";
    position:absolute; right:-40px; top:-40px;
    width:160px; height:160px; border-radius:50%;
    background: rgba(255,255,255,0.06);
  }
  .eyebrow{
    font-family:'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.85;
  }
  h1{
    font-family:'Fraunces', serif;
    font-weight: 600;
    font-size: 34px;
    line-height: 1.1;
    margin: 8px 0 6px;
  }
  header p.sub{
    margin:0;
    font-size: 14.5px;
    opacity: 0.9;
    max-width: 46ch;
  }

  /* STAMP CARD */
  .stampcard{
    margin: -22px 16px 0;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(40,20,10,0.18);
    padding: 16px 18px 18px;
    position: relative;
    z-index: 5;
  }
  .stampcard-row{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
  .stampcard-title{
    font-family:'Fraunces', serif; font-weight:600; font-size:15px; color: var(--brick-dark);
  }
  .score{
    font-family:'Space Mono', monospace; font-size: 13px; color: var(--hunte); font-weight:700;
  }
  .stamps{
    display:flex; flex-wrap:wrap; gap: 6px;
  }
  .stamp{
    width: 27px; height: 27px; border-radius:50%;
    border: 1.5px dashed #c9b998;
    display:flex; align-items:center; justify-content:center;
    font-family:'Space Mono', monospace; font-size: 9px; color:#b6a480;
    transition: all .35s ease;
    flex: 0 0 auto;
  }
  .stamp.done{
    border-style: solid;
    color: var(--white);
    transform: rotate(-6deg) scale(1.04);
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  }
  .stamp.done.correct{
    border-color: #4c8a4c;
    background: #4c8a4c;
    box-shadow: 0 2px 5px rgba(76,138,76,0.4);
  }
  .stamp.done.wrong{
    border-color: #b23b3b;
    background: #b23b3b;
    box-shadow: 0 2px 5px rgba(178,59,59,0.4);
  }

  /* MAP */
  #map{
    height: 340px;
    margin: 16px 16px 0;
    border-radius: 14px;
    border: 1px solid var(--parchment-deep);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    position: relative;
    z-index: 1;
  }
  .leaflet-popup-content-wrapper{ font-family:'Inter',sans-serif; border-radius:8px; }

  /* STATION LIST */
  .route{
    margin: 22px 16px 0;
    position: relative;
    max-height: 372px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
  }
  .route::-webkit-scrollbar{ width: 6px; }
  .route::-webkit-scrollbar-track{ background: transparent; }
  .route::-webkit-scrollbar-thumb{ background: var(--brick); border-radius: 3px; opacity:0.6; }
  .route-line{
    position:absolute; left: 21px; top: 8px;
    width: 2px;
    background: repeating-linear-gradient(to bottom, var(--brick) 0 6px, transparent 6px 12px);
    opacity:0.5;
    pointer-events: none;
  }
  .stop{
    display:flex; gap:14px; align-items:flex-start;
    padding: 12px 8px;
    cursor:pointer;
    position:relative;
    border-radius: 10px;
    transition: background .2s ease;
  }
  .stop:hover{ background: rgba(138,51,36,0.06); }
  .stop-num{
    flex:0 0 auto;
    width:42px; height:42px; border-radius:50%;
    background: var(--white);
    border:2px solid var(--brick);
    color: var(--brick-dark);
    display:flex; align-items:center; justify-content:center;
    font-family:'Space Mono', monospace; font-weight:700; font-size:15px;
    z-index:2;
  }
  .stop.answered .stop-num{
    background: var(--brick); color:var(--white);
  }
  .stop-thumb{
    flex:0 0 auto; width:52px; height:52px; border-radius:10px;
    overflow:hidden; border:1.5px solid var(--parchment-deep);
    background: var(--white);
  }
  .stop-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
  /* LOCATE */
  .route-info{
    margin: 8px 16px 0;
    font-family:'Space Mono', monospace; font-size:12px; color: var(--brick-dark);
    text-align:center;
  }
  .stopwatch{
    margin: 4px 16px 0;
    font-family:'Space Mono', monospace; font-size:11px; color: var(--hunte);
    text-align:center;
  }
  .locate-bar{
    margin: 14px 16px 0;
    display:flex; align-items:center; gap:10px;
    flex-wrap: wrap;
  }
  .locate-btn{
    border: none; border-radius: 10px;
    background: var(--hunte); color: var(--white);
    font-family:'Inter',sans-serif; font-weight:600; font-size:13.5px;
    padding: 10px 16px; cursor:pointer;
    transition: background .2s ease;
  }
  .locate-btn:hover{ background:#254c4f; }
  .locate-btn.active{ background: var(--brick); }
  .locate-status{
    font-family:'Space Mono', monospace; font-size:12px; color:#6b5c47;
  }
  .stop-distance{
    font-family:'Space Mono', monospace; font-size:11.5px;
    color: var(--hunte); margin-top:4px; font-weight:700;
  }
  .stop.nearby{
    background: rgba(184,134,47,0.14);
    border: 1.5px solid var(--gold);
  }
  .stop-nearby-badge{
    display:inline-block; margin-left:6px;
    background: var(--gold); color: var(--white);
    font-size:10.5px; font-family:'Space Mono', monospace;
    padding: 2px 7px; border-radius: 20px;
  }

  .stop-body{ flex:1; padding-top:4px; }
  .stop-name{ font-family:'Fraunces', serif; font-weight:600; font-size:17px; margin:0 0 2px; }
  .stop-hint{ font-size: 13px; color:#6b5c47; margin:0; }
  .stop-check{
    font-size: 11px; font-family:'Space Mono', monospace; color: var(--hunte); margin-top:4px;
  }

  /* MODAL */
  .overlay{
    position:fixed; inset:0; background: rgba(20,12,6,0.55);
    display:none; align-items:flex-end; justify-content:center; z-index:3000;
  }
  .overlay.open{ display:flex; }
  .sheet{
    background: var(--white);
    width:100%; max-width:720px;
    border-radius: 20px 20px 0 0;
    padding: 22px 22px 28px;
    max-height: 86vh; overflow-y:auto;
    animation: slideup .28s ease;
  }
  @keyframes slideup{ from{ transform: translateY(24px); opacity:0;} to{ transform: translateY(0); opacity:1;} }
  .sheet-img{
    width: 100%; aspect-ratio: 8/5; object-fit: cover;
    border-radius: 12px; margin-bottom: 14px;
    border: 1px solid var(--parchment-deep);
    background: var(--parchment);
  }
  .sheet-eyebrow{
    font-family:'Space Mono', monospace; font-size:11px; letter-spacing:.1em; text-transform:uppercase; color: var(--hunte);
  }
  .sheet h2{
    font-family:'Fraunces', serif; font-size:24px; margin: 4px 0 12px; color: var(--brick-dark);
  }
  .sheet .info{ font-size:14.5px; line-height:1.55; color:#3a3226; margin-bottom:18px; }
  .exkurs-btn{
    display:inline-block; margin: 0 0 22px;
    padding: 9px 18px; border-radius: 20px;
    border: 1.5px solid var(--hunte); color: var(--hunte);
    font-family:'Space Mono', monospace; font-size: 12.5px; font-weight:700;
    text-decoration: none; letter-spacing: 0.03em;
    transition: all .15s ease;
  }
  .exkurs-btn:hover{ background: var(--hunte); color: var(--white); }
  .exkurs-btn::before{ content:"↪ "; }
  .quiz-q{
    font-family:'Fraunces', serif; font-weight:600; font-size:16px; margin-bottom:10px;
  }
  .retry-note{
    background: #f3d9d3; color: var(--brick-dark);
    border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
    font-size: 13px; font-weight:600;
  }
  .opt{
    display:block; width:100%; text-align:left;
    padding: 12px 14px; margin-bottom:8px;
    border-radius: 10px; border: 1.5px solid var(--parchment-deep);
    background: var(--parchment); font-size:14.5px; font-family:'Inter',sans-serif;
    cursor:pointer; transition: all .15s ease;
  }
  .opt:hover{ border-color: var(--brick); }
  .opt.correct{ background: #dcecdc; border-color:#4c8a4c; color:#2b5a2b; }
  .opt.wrong{ background: #f3d9d3; border-color: var(--brick); color: var(--brick-dark); }
  .opt[disabled]{ cursor:default; }
  .feedback{
    margin-top: 12px; padding: 12px 14px; border-radius:10px;
    background: var(--parchment-deep); font-size: 13.5px; line-height:1.5; display:none;
  }
  .feedback.show{ display:block; }
  .close-btn{
    margin-top: 18px; width:100%; padding: 13px; border:none; border-radius:10px;
    background: var(--brick); color:var(--white); font-family:'Inter',sans-serif;
    font-weight:600; font-size:14.5px; cursor:pointer;
  }
  .close-btn:hover{ background: var(--brick-dark); }

  /* COOKIE BANNER */
  /* WELCOME OVERLAY */
  .welcome-overlay{
    display:none;
    position: fixed; inset:0;
    background: rgba(20,12,6,0.72);
    z-index: 5000;
    align-items:center; justify-content:center;
    padding: 20px;
  }
  .welcome-card{
    background: var(--white);
    border-radius: 18px;
    max-width: 440px; width:100%;
    padding: 28px 26px 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    max-height: 88vh; overflow-y:auto;
  }
  .welcome-eyebrow{
    font-family:'Space Mono', monospace; font-size:11px; letter-spacing:.1em;
    text-transform:uppercase; color: var(--hunte);
  }
  .welcome-card h2{
    font-family:'Fraunces', serif; font-size:24px; margin: 4px 0 14px; color: var(--brick-dark);
  }
  .welcome-text{ font-size: 13.5px; line-height:1.55; color:#3a3226; margin: 0 0 12px; }
  .welcome-list{
    font-size: 13px; line-height:1.55; color:#3a3226; margin: 0 0 16px; padding-left: 18px;
  }
  .welcome-list li{ margin-bottom: 8px; }
  .account-cta{
    width:100%; margin-top: 10px; padding: 11px;
    background: transparent; color: var(--hunte); border: 1.5px solid var(--hunte);
  }
  .account-cta:hover{ background: var(--hunte); color: var(--white); }
  .cookie-actions{ display:flex; gap:10px; margin-top: 8px; }
  .cookie-btn{
    flex:1; padding: 12px; border-radius:10px; border:none;
    font-family:'Inter',sans-serif; font-weight:600; font-size:13.5px; cursor:pointer;
  }
  .cookie-btn.accept{ background: var(--brick); color: var(--white); }
  .cookie-btn.accept:hover{ background: var(--brick-dark); }
  .cookie-btn.decline{ background: transparent; color: var(--brick-dark); border:1.5px solid var(--parchment-deep); }
  .cookie-btn.decline:hover{ border-color: var(--brick); }

  /* ACCOUNT BAR */
  .account-bar{
    margin: 14px 0 0;
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    font-family:'Space Mono', monospace; font-size:11.5px; color: rgba(255,255,255,0.85);
    flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 12px;
  }
  .account-link{
    border:none; background:none; color: var(--white); font-family:'Space Mono', monospace;
    font-size:11.5px; font-weight:700; cursor:pointer; text-decoration:underline; padding:2px 0;
  }
  .account-link:hover{ color: var(--gold); }

  /* AUTH MODAL */
  .auth-input{
    width:100%; padding: 11px 12px; margin-bottom: 10px;
    border-radius: 10px; border: 1.5px solid var(--parchment-deep);
    background: var(--parchment); font-size:14.5px; font-family:'Inter',sans-serif;
    box-sizing: border-box;
  }
  .auth-input:focus{ outline: none; border-color: var(--hunte); }
  .auth-error{
    background: #f3d9d3; color: var(--brick-dark);
    border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
    font-size: 13px; font-weight:600;
  }
  .auth-switch{ font-size: 13px; color:#6b5c47; margin: 14px 0 0; text-align:center; }
  .auth-switch a{ color: var(--hunte); font-weight:600; }

  /* FINALE */
  .finale{
    margin: 26px 16px 0; padding: 22px; border-radius:14px;
    background: linear-gradient(160deg, var(--hunte), #1f4548);
    color: var(--white); text-align:center; display:none;
  }
  .finale.show{ display:block; }
  .finale h3{ font-family:'Fraunces', serif; font-size:20px; margin: 0 0 6px; }
  .finale p{ font-size:13.5px; opacity:.9; margin:0; }

  footer{ text-align:center; font-size:12px; color:#8a7a5f; margin-top:26px; }
