/* =========================================================================
   Historisk Skattejagt – tema
   Jordfarvet "historisk kort"-stil. Mobil-først.
   Skift farverne ét sted (:root) for at matche jeres brand præcist.
   ========================================================================= */

:root {
  --clay: #a8472a;          /* terrakotta – primær (Sorring lertøj) */
  --clay-dark: #7e3219;
  --forest: #4b6043;        /* natur/rute-grøn */
  --gold: #c8922a;          /* skat & point */
  --gold-soft: #e7c277;
  --ink: #2b2118;           /* tekst */
  --parchment: #f1e7d6;     /* sidebaggrund */
  --parchment-2: #e9dcc6;
  --cream: #fcf8f0;         /* kort */
  --muted: #837663;
  --line: #ddd0ba;
  --good: #3f7d4e;
  --bad: #b23b2e;
  --shadow: 0 6px 20px rgba(43, 33, 24, 0.14);
  --radius: 14px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--parchment);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(200, 146, 42, 0.10), transparent 42%),
    radial-gradient(circle at 85% 78%, rgba(168, 71, 42, 0.09), transparent 46%);
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 1.9rem; letter-spacing: .2px; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--clay); }

.container { max-width: 720px; margin: 0 auto; padding: 18px 16px 40px; }

/* ---- eyebrow / brandlinje ---- */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--clay);
  margin-bottom: 6px;
}

/* ---- kort ---- */
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card.center { text-align: center; }

/* ---- knapper ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  padding: 13px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1.1;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
  width: 100%;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-gold { background: var(--gold); color: #3a2a08; }
.btn-secondary { background: transparent; color: var(--clay); border-color: var(--clay); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn-sm { padding: 8px 14px; font-size: .9rem; width: auto; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { width: auto; flex: 1 1 auto; }

/* ---- formularer ---- */
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; font-family: var(--sans); font-size: 1rem;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }
textarea { min-height: 70px; resize: vertical; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; }

/* ---- badges & chips ---- */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .3px;
  padding: 3px 9px; border-radius: 999px; background: var(--parchment-2); color: var(--ink);
}
.badge-gold { background: var(--gold); color: #3a2a08; }
.badge-cat { background: rgba(75,96,67,.14); color: var(--forest); }

/* ---- point-tæller ---- */
.points { font-family: var(--serif); font-weight: 700; color: var(--gold); }

/* =========================================================================
   Spillet (forside / kort)
   ========================================================================= */
body.game { background: var(--parchment); overflow: hidden; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: rgba(43,33,24,.92); color: #fbf6ec;
  backdrop-filter: blur(6px);
}
.topbar .brand { display: flex; align-items: center; gap: 9px; font-family: var(--serif); font-weight: 700; }
.topbar .brand .mark { width: 26px; height: 26px; flex: none; }
.topbar .score-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--gold); color: #3a2a08; font-weight: 800;
  padding: 6px 13px; border-radius: 999px; font-size: .95rem;
}
.topbar .iconbtn {
  background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fbf6ec;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.15rem;
  display: inline-flex; align-items: center; justify-content: center;
}

#map { position: fixed; inset: 0; top: 0; z-index: 1; }

/* GPS-status nederst */
.gps-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); z-index: 800;
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; font-size: .9rem;
}
.gps-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.gps-bar.ok .dot { background: var(--good); }
.gps-bar.warn .dot { background: var(--gold); }
.gps-bar.err .dot { background: var(--bad); }
.gps-bar .near {
  margin-left: auto; background: var(--clay); color: #fff; border: none;
  padding: 8px 14px; border-radius: 999px; font-weight: 700; cursor: pointer;
  display: none;
}
.gps-bar .near.show { display: inline-block; animation: pulse 1.4s infinite; }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(168,71,42,.5); }
  50% { box-shadow: 0 0 0 8px rgba(168,71,42,0); }
}

/* Kortmarkører (DivIcon) */
.t-marker {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); border: 2px solid #fff; box-shadow: var(--shadow);
  background: var(--muted);
}
.t-marker span { transform: rotate(45deg); font-size: 1.1rem; line-height: 1; }
.t-marker.locked { background: #9a8c76; }
.t-marker.near { background: var(--clay); animation: pulse 1.4s infinite; }
.t-marker.solved { background: var(--gold); }
.me-marker {
  width: 18px; height: 18px; border-radius: 50%; background: #2f6fed;
  border: 3px solid #fff; box-shadow: 0 0 0 5px rgba(47,111,237,.25);
}

/* =========================================================================
   Modal (åbn skat)
   ========================================================================= */
.modal-back {
  position: fixed; inset: 0; z-index: 1000; background: rgba(43,33,24,.55);
  display: none; align-items: flex-end; justify-content: center; padding: 0;
}
.modal-back.show { display: flex; animation: backFade .28s ease; }
.modal-back.closing { animation: backFadeOut .26s ease forwards; }
.modal-back.closing .modal { animation: slideDown .26s ease forwards; }
@keyframes backFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes backFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideDown { from { transform: none; opacity: 1; } to { transform: translateY(70px); opacity: 0; } }
.modal {
  background: var(--cream); width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.3); max-height: 92vh; overflow-y: auto;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal .chest { font-size: 2.4rem; text-align: center; margin-bottom: 4px; }
.modal .q { font-family: var(--serif); font-size: 1.15rem; margin: 10px 0 14px; }
.opt {
  display: block; width: 100%; text-align: left; background: #fff; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 15px;
  font-size: 1rem; margin-bottom: 10px; cursor: pointer; transition: border .12s, background .12s;
}
.opt:hover { border-color: var(--gold); }
.opt.correct { border-color: var(--good); background: rgba(63,125,78,.12); font-weight: 600; }
.opt.wrong { border-color: var(--bad); background: rgba(178,59,46,.10); }
.opt:disabled { cursor: default; }
.result { text-align: center; padding: 8px 0 2px; }
.result .big { font-family: var(--serif); font-size: 1.4rem; margin-bottom: 4px; }
.result .pts { font-size: 1.6rem; font-weight: 800; color: var(--gold); }
.result.bonus { background: rgba(200,146,42,.12); border-radius: 12px; padding: 14px; margin-top: 12px; }

/* =========================================================================
   Scoreboard
   ========================================================================= */
.lb { list-style: none; padding: 0; margin: 0; }
.lb li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px;
}
.lb .rank { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; width: 30px; color: var(--muted); text-align: center; }
.lb li:nth-child(1) .rank { color: var(--gold); }
.lb li:nth-child(2) .rank { color: #9a9a9a; }
.lb li:nth-child(3) .rank { color: var(--clay); }
.lb .name { flex: 1; font-weight: 600; }
.lb .sc { font-family: var(--serif); font-weight: 700; color: var(--clay); font-size: 1.1rem; }
.lb .sub { font-size: .78rem; color: var(--muted); font-weight: 400; }

/* =========================================================================
   Admin
   ========================================================================= */
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--ink); color: var(--cream); position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.admin-head .brand { font-family: var(--serif); font-weight: 700; }

/* Dashboard-layout: sidebar + indhold */
.admin-shell { display: flex; gap: 18px; max-width: 1100px; margin: 0 auto; padding: 16px; align-items: flex-start; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; width: 200px; flex: 0 0 auto; position: sticky; top: 64px; }
.admin-nav .tab {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; justify-content: flex-start;
  border-radius: 10px; border: 1px solid transparent; background: transparent;
  padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: .94rem; color: var(--ink);
}
.admin-nav .tab .nav-ico { font-size: 1.05rem; width: 22px; text-align: center; }
.admin-nav .tab:hover { background: var(--cream); }
.admin-nav .tab.active { background: var(--cream); border-color: var(--line); color: var(--clay);
  box-shadow: inset 3px 0 0 var(--clay); font-weight: 700; }
.admin-main { flex: 1 1 auto; min-width: 0; }
.panel-title { margin: 0 0 14px; }

/* Nøgletals-kort */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.stat-card { background: var(--cream); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat-ico { font-size: 1.35rem; }
.stat-num { font-family: var(--serif); font-size: 2rem; font-weight: 800; color: var(--clay); line-height: 1.05; margin-top: 6px; }
.stat-lbl { color: var(--muted); font-size: .85rem; margin-top: 2px; }

.panel { display: none; }
.panel.active { display: block; }

@media (max-width: 820px) {
  .admin-shell { flex-direction: column; gap: 10px; padding: 12px; }
  .admin-nav { flex-direction: row; width: 100%; overflow-x: auto; position: static;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .admin-nav .tab { width: auto; white-space: nowrap; flex: 0 0 auto; }
  .admin-nav .tab.active { box-shadow: none; }
}

#adminMap, #routeEditMap, #shardMap, #towerMap { height: 360px; border-radius: 12px; border: 1px solid var(--line); margin: 10px 0; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }

.list-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff;
}
.list-item .grow { flex: 1; }
.list-item .ttl { font-weight: 600; }
.list-item .meta { font-size: .8rem; color: var(--muted); }

.opt-edit { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-edit input[type=text] { flex: 1; }
.opt-edit input[type=number] { width: 74px; }
.opt-edit .rm { background: transparent; border: 1px solid var(--bad); color: var(--bad); border-radius: 8px; width: 34px; height: 38px; cursor: pointer; }

/* toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 2000;
  background: var(--ink); color: var(--cream); padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow); font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s;
  pointer-events: none; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--clay); border-radius: 50%; animation: spin .8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--muted); }
.hide { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 14px; }

footer.credit { text-align: center; font-size: .8rem; color: var(--muted); padding: 18px; }
footer.credit a { color: var(--clay); text-decoration: none; }

/* =========================================================================
   Pottejagten – logo, credit, rute-oversigt
   ========================================================================= */
.welcome-logo { display:block; width:104px; height:104px; object-fit:contain; margin:2px auto 8px; }
.topbar .brand .mark { border-radius:6px; }
.credit-line { text-align:center; font-size:.8rem; color:var(--muted); margin-top:16px; line-height:1.5; }
.credit-line a { color:var(--clay); text-decoration:none; font-weight:600; }
.credit-line .sep { opacity:.5; margin:0 4px; }

/* Rute-oversigt på brugersiden */
.route-ov { list-style:none; padding:0; margin:0; }
.route-ov li { background:var(--cream); border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-bottom:10px; }
.route-ov .r-top { display:flex; align-items:center; gap:10px; }
.route-ov .r-dot { width:14px; height:14px; border-radius:50%; flex:none; border:2px solid #fff; box-shadow:0 0 0 1px var(--line); }
.route-ov .r-name { font-weight:700; flex:1; font-family:var(--serif); }
.route-ov .r-badge { font-size:.72rem; font-weight:700; padding:3px 9px; border-radius:999px; background:var(--parchment-2); color:var(--ink); }
.route-ov .r-meta { font-size:.82rem; color:var(--muted); margin-top:6px; }
.route-ov .r-desc { font-size:.88rem; margin-top:6px; }
.route-ov .r-prog { height:8px; background:var(--parchment-2); border-radius:999px; margin-top:9px; overflow:hidden; }
.route-ov .r-prog > span { display:block; height:100%; background:var(--gold); transition:width .3s ease; }
.route-ov .r-done { color:var(--good); font-weight:700; }

/* =========================================================================
   Scoreboard-overlay, potteskår, installér-knap
   ========================================================================= */
/* Scoreboard som kort i appen */
.lb-overlay { list-style:none; padding:0; margin:0; }
.lb-overlay li { display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:12px; background:var(--cream); border:1px solid var(--line); margin-bottom:8px; animation: lbIn .35s ease both; }
.lb-overlay li .rank { font-weight:800; font-size:1.1rem; width:34px; text-align:center; flex:none; color:var(--clay); }
.lb-overlay li .name { flex:1; font-weight:600; }
.lb-overlay li .name .sub { display:block; font-size:.76rem; color:var(--muted); font-weight:400; }
.lb-overlay li .sc { font-weight:800; color:var(--clay); }
.lb-overlay li .sc .sub { font-size:.7rem; color:var(--muted); font-weight:400; }
.lb-overlay li.me { outline:2px solid var(--gold); }
@keyframes lbIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* Potteskår-markør på kortet */
.shard-marker { display:flex; align-items:center; justify-content:center; width:30px; height:30px; }
.shard-marker .glyph { width:26px; height:26px; border-radius:50%; background:#8a5a2b; border:2px solid #f4e3c8; box-shadow:0 1px 5px rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; font-size:15px; }
.shard-marker.near .glyph { background:#c8922a; animation: shardPulse 1.3s infinite; cursor:pointer; }
.shard-marker.found .glyph { background:#7a8a6a; opacity:.7; }
@keyframes shardPulse { 0%,100% { transform:scale(1); box-shadow:0 0 0 0 rgba(200,146,42,.5);} 50% { transform:scale(1.12); box-shadow:0 0 0 10px rgba(200,146,42,0);} }

/* Installér-app knap */
.install-row { text-align:center; margin-top:12px; }
#btnInstall, #btnInstall2 { display:none; }
#btnInstall.show, #btnInstall2.show { display:inline-flex; }
body.standalone .install-row { display:none !important; }

/* =========================================================================
   Potteskår – skrabe-minispil
   ========================================================================= */
.scratch-wrap { position:relative; width:100%; max-width:320px; height:220px; margin:8px auto 2px;
  border-radius:14px; overflow:hidden; border:1px solid var(--line); background:var(--parchment); }
.scratch-prize { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:6px; }
.scratch-prize img { width:120px; height:120px; object-fit:contain; }
.scratch-label { font-family:var(--serif); font-weight:800; color:var(--clay); font-size:1.15rem; }
#scratchCanvas { position:absolute; inset:0; width:100%; height:100%; touch-action:none; cursor:grab; }
#scratchCanvas:active { cursor:grabbing; }
#shardResult { animation: lbIn .3s ease both; }
#shardResult .big { font-family:var(--serif); font-size:1.2rem; color:var(--clay); font-weight:800; }
#shardResult .pts { font-size:1.5rem; font-weight:800; margin:4px 0; color:var(--gold); }

/* Skrabe-pensel der følger fingeren */
#scratchBrush { position:absolute; left:0; top:0; width:50px; height:auto; pointer-events:none;
  display:none; z-index:4; transform:translate(-50%,-100%) rotate(10deg); transform-origin:50% 100%;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); will-change:left,top; }
#scratchBrush.show { display:block; }

/* =========================================================================
   Avatar – valg ved oprettelse + GPS-markør
   ========================================================================= */
.avatar-pick { display:flex; gap:10px; margin-top:6px; }
.avatar-opt { flex:1; background:var(--cream); border:2px solid var(--line); border-radius:14px;
  padding:8px 4px 6px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:4px;
  transition:border-color .15s, transform .1s; }
.avatar-opt img { width:100%; max-width:78px; height:78px; object-fit:contain; }
.avatar-opt span { font-size:.72rem; color:var(--muted); font-weight:600; }
.avatar-opt.selected { border-color:var(--clay); background:#fff; }
.avatar-opt.selected span { color:var(--clay); }
.avatar-opt:active { transform:scale(.97); }

/* GPS-markør: avataren sidder i en cirkel oven på lokationen og popper ud */
.me-avatar { position:relative; width:46px; height:46px; }
.me-avatar .me-pulse { position:absolute; inset:-2px; border-radius:50%;
  border:3px solid rgba(200,146,42,.55); animation: mePulse 1.9s ease-out infinite; }
.me-avatar .me-ring { position:absolute; inset:0; border-radius:50%; background:#fff;
  border:3px solid var(--clay); box-shadow:0 2px 7px rgba(0,0,0,.45); }
.me-avatar img { position:absolute; left:50%; top:50%; transform:translate(-50%,-54%);
  width:44px; height:44px; object-fit:contain; filter:drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
@keyframes mePulse { 0% { transform:scale(.8); opacity:.85; } 70% { transform:scale(1.45); opacity:0; } 100% { opacity:0; } }

/* Lille figur ud for navnet på scoreboardet */
.lb-ava { width:40px; height:40px; object-fit:contain; flex:0 0 auto; }
.lb li .lb-ava { margin:0 2px; }

/* =========================================================================
   Tårn-minispil ("Byg tårnet")
   ========================================================================= */
.tower-wrap { position:relative; width:100%; max-width:320px; height:360px; margin:8px auto 2px;
  border-radius:14px; overflow:hidden; border:1px solid var(--line);
  background:linear-gradient(#c9cccd 0%, #d4d6d6 50%, #b9c2a4 70%, #8fa56c 100%); }
#towerCanvas { position:absolute; inset:0; width:100%; height:100%; touch-action:none; cursor:pointer; }
.tower-score { position:absolute; top:8px; left:50%; transform:translateX(-50%);
  font-family:var(--serif); font-weight:800; font-size:1.4rem; color:#3a3f30;
  text-shadow:0 1px 0 rgba(255,255,255,.6); pointer-events:none; }
#towerResult { animation: lbIn .3s ease both; }
#towerResult .big { font-family:var(--serif); font-size:1.2rem; color:var(--clay); font-weight:800; }
#towerResult .pts { font-size:1.6rem; font-weight:800; margin:4px 0; color:var(--gold); }

/* Tårn-markør på kortet */
.tower-marker { display:flex; align-items:center; justify-content:center; width:40px; height:40px; }
.tower-marker .glyph { width:36px; height:36px; border-radius:50%; background:#6b7c8c; border:3px solid #fff;
  box-shadow:0 2px 6px rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; font-size:20px; }
.tower-marker.near .glyph { background:#c8922a; animation: shardPulse 1.4s infinite; cursor:pointer; }
.tower-marker.cooldown .glyph { background:#8a9099; opacity:.8; }

/* =========================================================================
   Admin – kort-baseret deltagerliste
   ========================================================================= */
.player-cards { display:flex; flex-direction:column; gap:10px; }
.pcard { border:1px solid var(--line); border-radius:14px; padding:12px 14px; background:var(--cream);
  display:flex; gap:12px; align-items:flex-start; flex-wrap:wrap; }
.pcard .pc-ava { width:46px; height:46px; object-fit:contain; flex:0 0 auto; }
.pcard .pc-main { flex:1 1 180px; min-width:150px; }
.pcard .pc-name { font-weight:700; font-family:var(--serif); font-size:1.02rem; }
.pcard .pc-email { font-size:.8rem; color:var(--muted); word-break:break-all; }
.pcard .pc-stats { display:flex; gap:6px; flex-wrap:wrap; margin-top:7px; }
.pc-chip { font-size:.74rem; background:var(--parchment-2); border-radius:999px; padding:3px 10px; color:var(--ink); white-space:nowrap; }
.pc-chip.ok { background:#e3f0e0; color:#2f6b3a; }
.pc-chip.warn { background:#f5e2cf; color:#9c5a1e; }
.pc-chip.score { background:#f0e2c8; color:#8a5a1e; font-weight:700; }
.pcard .pc-actions { display:flex; gap:6px; flex-wrap:wrap; flex:1 1 100%; padding-top:2px; }

/* =========================================================================
   Bund-navigation + fuldskærms-views (spiller-app)
   ========================================================================= */
.view {
  position: fixed; inset: 0; z-index: 700; background: var(--parchment);
  overflow-y: auto; -webkit-overflow-scrolling: touch; display: none;
  padding: 60px 0 calc(96px + env(safe-area-inset-bottom, 0px));
}
.view.show { display: block; }
.view-inner { max-width: 560px; margin: 0 auto; padding: 16px; }
.view-inner h1 { font-size: 1.9rem; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
  background: var(--cream); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: flex-end;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 12px rgba(0,0,0,.10); overflow: visible;
}
.bn-item {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: .7rem; font-weight: 700; padding: 7px 0 8px;
}
.bn-item .bn-ico { font-size: 1.2rem; line-height: 1; }
.bn-item.active { color: var(--clay); }
.bn-center .bn-ico {
  width: 54px; height: 54px; border-radius: 50%; background: var(--clay); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  margin-top: -28px; box-shadow: 0 4px 12px rgba(168,71,42,.5); border: 3px solid var(--cream);
}
.bn-center.active .bn-ico { background: var(--clay-dark); }

/* Forside-kort */
.home-score { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.hs-num { font-family: var(--serif); font-weight: 800; font-size: 1.9rem; color: var(--gold); line-height: 1; }
.hs-lbl { font-size: .8rem; color: var(--muted); }
.home-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.home-tile {
  background: var(--cream); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 6px; display: flex; flex-direction: column; gap: 6px; align-items: center;
  font-weight: 700; font-size: .85rem; color: var(--ink); cursor: pointer;
}
.home-tile span:first-child { font-size: 1.5rem; }

/* Profil */
.profile-head { display: flex; gap: 14px; align-items: center; }
.profile-ava { width: 64px; height: 64px; object-fit: contain; flex: none; }
.profile-name { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
.profile-stats { display: flex; gap: 10px; margin-top: 14px; }
.pstat { flex: 1; background: var(--parchment-2); border-radius: 12px; padding: 11px 6px; text-align: center; }
.pstat-num { font-family: var(--serif); font-weight: 800; font-size: 1.25rem; color: var(--clay); }
.pstat-lbl { font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* Krukke-samling på profilen */
.jar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shard-badge { background: var(--parchment-2); border-radius: 999px; padding: 4px 12px;
  font-weight: 700; color: var(--clay); white-space: nowrap; }
.jar-tier { margin-top: 14px; }
.jar-tier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.jt-name { font-weight: 700; font-family: var(--serif); }
.tier-standard { color: #b5642f; }
.tier-rare { color: #2b2b30; }
.tier-epic { color: #b53a2a; }
.tier-legendary { color: #c79a1e; }
.jar-collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.jcol { position: relative; background: var(--parchment-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; aspect-ratio: 1; cursor: default; }
.jcol img { width: 100%; height: 100%; object-fit: contain; }
.jcol.locked img { filter: grayscale(1) brightness(1.15); opacity: .26; }
.jcol.owned { cursor: pointer; }
.jcol.owned.tier-rare { box-shadow: inset 0 0 0 2px #3a3a42; }
.jcol.owned.tier-epic { box-shadow: inset 0 0 0 2px #b53a2a; }
.jcol.owned.tier-legendary { box-shadow: inset 0 0 0 2px #e0a82e; }
.jcol-x { position: absolute; bottom: 2px; right: 3px; font-size: .68rem; font-weight: 800;
  background: var(--clay); color: #fff; border-radius: 8px; padding: 0 5px; }
.jar-pop { animation: jarPop .5s ease; }
@keyframes jarPop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* =========================================================================
   Krukke-reveal animation
   ========================================================================= */
.jar-reveal-back {
  position: fixed; inset: 0; z-index: 1600; display: none;
  align-items: center; justify-content: center;
  background: rgba(40, 28, 18, .62); backdrop-filter: blur(2px);
  animation: backFade .25s ease both;
}
.jar-reveal-back.show { display: flex; }
.jar-reveal-card {
  position: relative; background: var(--cream); border-radius: 20px; padding: 26px 26px 20px;
  width: min(86vw, 320px); text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.4);
  animation: jarRevealIn .5s cubic-bezier(.18,.9,.3,1.2) both;
}
.jar-reveal-card .jr-eyebrow { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.jar-reveal-card .jr-jar { margin: 8px auto 4px; width: 140px; height: 140px; position: relative; }
.jar-reveal-card .jr-jar::after {
  content: ""; position: absolute; inset: -18px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, var(--glow, rgba(200,146,42,.55)) 0%, transparent 68%);
  animation: jarGlow 2.2s ease-in-out infinite;
}
.jar-reveal-card .jr-jar img { width: 140px; height: 140px; object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); animation: jarBob 2.4s ease-in-out infinite; }
.jar-reveal-card .jr-tier { font-family: var(--serif); font-weight: 800; font-size: 1.5rem; margin-top: 2px; }
.jar-reveal-card .jr-sub { color: var(--muted); font-size: .9rem; margin: 4px 0 16px; }
/* tier-glow farver */
.tier-glow-standard { --glow: rgba(181,100,47,.55); }
.tier-glow-rare { --glow: rgba(80,80,90,.6); }
.tier-glow-epic { --glow: rgba(181,58,42,.6); }
.tier-glow-legendary { --glow: rgba(224,168,46,.7); }
@keyframes jarRevealIn { 0% { transform: scale(.6) translateY(20px); opacity: 0; } 100% { transform: scale(1) translateY(0); opacity: 1; } }
@keyframes jarGlow { 0%,100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes jarBob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }

/* Profil-titel (kun brugernavn øverst) */
.profile-title { font-family: var(--serif); font-size: 1.7rem; margin: 2px 0 12px; }
/* Klikbare scoreboard-rækker -> se krukker */
.lb-overlay li.lb-click { cursor: pointer; }
.lb-overlay li.lb-click:hover { background: var(--parchment-2); }
.lb-overlay li.lb-click::after { content: "›"; margin-left: 6px; color: var(--muted); font-size: 1.2rem; }
/* Andens krukke-samling – modal-header */
.pj-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.pj-head .profile-ava { width: 52px; height: 52px; }
.jcol.ro { cursor: default; }

/* Krukke-detalje (åbn og kig / ødelæg) */
.modal.jar-detail { text-align: center; }
.jd-jar { width: 150px; height: 150px; margin: 4px auto 6px; position: relative; }
.jd-jar img { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.28)); }
.jd-jar.locked img { filter: grayscale(1) brightness(1.1); opacity: .3; }
.jd-jar::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, var(--glow, rgba(200,146,42,.4)) 0%, transparent 68%); }
.jd-jar.locked::after { display: none; }
.jd-name { margin: 0; font-family: var(--serif); }
.jd-tier { font-weight: 700; margin: 2px 0 6px; }
.jd-status { margin-bottom: 12px; }
.jr-name { font-family: var(--serif); font-weight: 800; font-size: 1.15rem; margin-top: 2px; }

/* Krukke-reveal: skår samler sig */
.jr-assemble { position: relative; width: 150px; height: 150px; margin: 8px auto 2px; }
.jr-core { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; background: radial-gradient(circle, rgba(200,146,42,.85), transparent 70%);
  animation: jrCore 1.4s ease-in-out infinite; }
@keyframes jrCore { 0%,100% { transform: scale(.6); opacity: .45; } 50% { transform: scale(1.6); opacity: 1; } }
.jr-shard { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px;
  object-fit: contain; animation: jrConverge 1.5s ease-in infinite; }
@keyframes jrConverge {
  0% { transform: translate(var(--dx), var(--dy)) rotate(0deg) scale(1); opacity: 0; }
  25% { opacity: .95; }
  100% { transform: translate(0,0) rotate(170deg) scale(.3); opacity: .12; }
}
.jr-dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0 2px; }
.jr-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--clay); animation: jrDot 1s infinite; }
.jr-dots span:nth-child(2) { animation-delay: .15s; }
.jr-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes jrDot { 0%,100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.jar-reveal-card.revealed .jr-jar img { animation: jarRevealPop .6s cubic-bezier(.18,.9,.3,1.3) both; }
@keyframes jarRevealPop { 0% { transform: scale(.4) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.15) rotate(4deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
/* admin: mistanke-chip */
.pc-chip.alert { background: #f6d2cc; color: #9c2a1e; font-weight: 700; }

/* =========================================================================
   Tutorial + installer-pop-up
   ========================================================================= */
.tutorial-modal, .install-modal { text-align: center; }
.tut-ico, .im-icon { font-size: 3rem; line-height: 1; margin: 2px 0 6px; }
.tut-title { font-family: var(--serif); margin: 0 0 6px; }
.tut-body { color: var(--ink); margin: 0 0 14px; line-height: 1.5; }
.tut-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 16px; }
.tut-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .2s; }
.tut-dots span.on { background: var(--clay); }
.tut-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.install-modal #imActions { display: flex; justify-content: center; margin-bottom: 6px; }
.install-modal #imText b { color: var(--ink); }
