:root{--bg:#0b1020;--panel:#121a2c;--panel-2:#182238;--text:#edf3ff;--muted:#9cabbe;--line:#2a3650;--accent:#5ea1ff;--danger:#ff6b6b;--success:#53d89b;--shadow:0 18px 45px rgba(0,0,0,.25);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color-scheme:dark}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;background:radial-gradient(circle at top,#17233e 0,#0b1020 38rem);color:var(--text);min-height:100vh}a{color:#8bc1ff;text-decoration:none}a:hover{text-decoration:underline}button,input,select,textarea{font:inherit}button{cursor:pointer}code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.topbar{position:sticky;top:0;z-index:1000;display:flex;justify-content:space-between;align-items:center;padding:.85rem max(1rem,calc((100vw - 1180px)/2));background:rgba(8,13,25,.88);backdrop-filter:blur(16px);border-bottom:1px solid rgba(255,255,255,.08)}.brand{font-weight:900;color:#fff;font-size:1.05rem}.topbar nav{display:flex;gap:.9rem;align-items:center}.topbar nav a{color:#dbe7f8;font-size:.92rem}.container{width:min(1180px,calc(100% - 2rem));margin:0 auto;padding:2rem 0 4rem}.card{background:linear-gradient(180deg,rgba(26,37,61,.96),rgba(16,24,42,.96));border:1px solid rgba(255,255,255,.09);border-radius:20px;padding:1.25rem;box-shadow:var(--shadow)}.card h1,.card h2,.card h3{margin-top:0}.stack{display:grid;gap:1rem}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.span-2{grid-column:span 2}label{display:grid;gap:.42rem;color:#dbe5f4;font-size:.92rem;font-weight:650}input,select,textarea{width:100%;border:1px solid #35425e;background:#0e1628;color:#fff;border-radius:11px;padding:.76rem .85rem;outline:none}input:focus,select:focus,textarea:focus{border-color:#67a7ff;box-shadow:0 0 0 3px rgba(94,161,255,.18)}textarea{min-height:100px;resize:vertical}.button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #41506c;border-radius:12px;padding:.72rem 1rem;background:#1c2942;color:#fff;font-weight:800;text-decoration:none;transition:.18s ease}.button:hover{transform:translateY(-1px);text-decoration:none;border-color:#6f83a7}.button.primary{background:linear-gradient(135deg,#2c7df0,#5aa8ff);border-color:#75b5ff;color:#07111f}.button.danger{background:#3b202a;border-color:#74404f}.button:disabled{opacity:.45;cursor:not-allowed;transform:none}.button.wide{width:100%}.button-row{display:flex;gap:.7rem;flex-wrap:wrap}.hero{display:grid;grid-template-columns:1.4fr .6fr;gap:2rem;align-items:center;padding:3rem 0}.hero h1{font-size:clamp(2.4rem,6vw,5.5rem);line-height:.95;margin:.5rem 0 1rem;letter-spacing:-.05em}.hero p{font-size:1.08rem;color:#bcc8da;line-height:1.7;max-width:760px}.hero-icon{font-size:7rem;text-align:center;filter:drop-shadow(0 15px 30px rgba(0,0,0,.3))}.hero-icon.giant{font-size:10rem}.eyebrow{text-transform:uppercase;letter-spacing:.15em;font-weight:900;font-size:.72rem;color:#85baff}.feature-grid,.stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.feature-grid p,.muted{color:var(--muted);line-height:1.55}.auth-card{max-width:520px;margin:4rem auto}.wide-card{max-width:920px}.team-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem}.team-choice{position:relative;background:#10192a;border:1px solid #33405a;border-radius:14px;padding:.9rem;text-align:center;display:grid;gap:.25rem;cursor:pointer}.team-choice input{position:absolute;opacity:0}.team-choice:has(input:checked){border-color:var(--team);box-shadow:0 0 0 3px color-mix(in srgb,var(--team) 28%,transparent);background:color-mix(in srgb,var(--team) 12%,#10192a)}.team-swatch{font-size:1.75rem}.team-choice small{color:var(--muted);font-size:.72rem}.invite-banner{display:flex;gap:1rem;align-items:center;border-left:5px solid var(--team);background:color-mix(in srgb,var(--team) 12%,#10192a);padding:1rem;border-radius:12px;margin-bottom:1rem}.invite-banner>span{font-size:2.5rem}.invite-banner small{display:block;color:var(--muted);margin-top:.2rem}.flash{padding:.9rem 1rem;border-radius:12px;margin-bottom:1rem;border:1px solid}.flash.success{background:rgba(83,216,155,.12);border-color:rgba(83,216,155,.45)}.flash.error{background:rgba(255,107,107,.12);border-color:rgba(255,107,107,.45)}.dashboard-head{display:flex;justify-content:space-between;gap:1rem;align-items:stretch;margin-bottom:1rem}.character-card,.rank-card{background:linear-gradient(135deg,color-mix(in srgb,var(--team) 26%,#131c31),#11192b);border:1px solid color-mix(in srgb,var(--team) 55%,#33405a);border-radius:20px;padding:1.2rem;display:flex;align-items:center;gap:1rem}.character-card{flex:1}.character-card h1{margin:.2rem 0;font-size:clamp(1.6rem,4vw,2.5rem)}.character-card p{margin:.2rem 0;color:#d5dfed}.character-icon{font-size:3.7rem}.rank-card{min-width:260px}.rank-card div{display:grid;gap:.18rem}.rank-card strong{font-size:1.3rem}.rank-icon{font-size:2.8rem}.journey-controls{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1rem}.journey-controls h2{margin-bottom:.35rem}.status{margin:0;color:var(--muted)}.status.active{color:var(--success)}.stat-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:1rem}.stat{background:#111a2d;border:1px solid #2e3a53;border-radius:16px;padding:1rem;display:grid;gap:.3rem}.stat span{font-size:.8rem;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}.stat strong{font-size:clamp(1.5rem,4vw,2.25rem)}.map-card{padding:0;overflow:hidden;margin-bottom:1rem}.map-toolbar{padding:1rem 1.2rem;display:flex;justify-content:space-between;gap:1rem;align-items:center}.map-toolbar h2{margin:0 0 .25rem}.map-toolbar p{margin:0;color:var(--muted)}.map{height:440px;background:#0a1120}.world-map{height:580px;border-radius:20px;overflow:hidden;border:1px solid var(--line);margin-bottom:1rem}.pill,.live-pill{display:inline-flex;align-items:center;padding:.45rem .7rem;border-radius:999px;background:#202d47;color:#c9d5e7;font-size:.8rem;font-weight:800;white-space:nowrap}.live-pill{color:#6ce3a8}.capture-toast{position:absolute;z-index:800;left:50%;bottom:1rem;transform:translateX(-50%);background:#08111f;border:1px solid #6aa9ff;border-radius:999px;padding:.75rem 1rem;box-shadow:var(--shadow);font-weight:900}.map-card{position:relative}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:1rem}.progress{height:12px;background:#0b1220;border-radius:999px;overflow:hidden;border:1px solid #32405a}.progress span{display:block;height:100%;background:linear-gradient(90deg,#4d92f5,#78d4ff)}.badges{display:flex;gap:.55rem;flex-wrap:wrap}.badge{padding:.5rem .7rem;border:1px solid #3a4863;border-radius:999px;background:#111a2a;font-size:.85rem}.inline-form{display:flex;gap:.7rem;align-items:end}.inline-form select{flex:1}.disclosure,.safety{margin-top:1rem;border-radius:14px;padding:1rem;line-height:1.5}.disclosure{background:#25213a;border:1px solid #514a78}.safety{background:#2c2118;border:1px solid #65482d}.ad-slot{min-height:90px;border:1px dashed #3b4964;border-radius:14px;margin:1rem 0;display:grid;place-items:center;color:var(--muted);background:#0d1526;text-align:center;padding:1rem}.house-ad{font-weight:900;color:#fff}.ad-slot.milestone{border-style:solid;border-color:#79b8ff;box-shadow:0 0 0 4px rgba(94,161,255,.18),var(--shadow);animation:adPulse 1.2s ease-in-out 2}@keyframes adPulse{50%{transform:scale(1.01)}}.page-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.page-title h1{margin:.25rem 0 0;font-size:2.2rem}.standings{display:grid;gap:.55rem}.standing{display:grid;grid-template-columns:2rem 1rem 1fr auto;gap:.7rem;align-items:center;padding:.65rem;border-bottom:1px solid rgba(255,255,255,.07)}.place{color:var(--muted);text-align:center}.dot{display:inline-block;width:.75rem;height:.75rem;border-radius:50%;margin-right:.35rem}.tabs{display:flex;gap:.5rem;overflow:auto;padding-bottom:.75rem;margin-bottom:1rem}.tabs a{white-space:nowrap;padding:.65rem .85rem;border-radius:10px;background:#111a2b;color:#becade}.tabs a.active{background:#2c7df0;color:#fff}.check-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}.check{padding:.65rem;border-radius:10px;background:#10192a}.check.ok strong{color:var(--success)}.check.bad strong{color:var(--danger)}.install-wrap{max-width:900px}.team-admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.team-admin{border-top:4px solid var(--team);display:grid;gap:.75rem}.checkbox{display:flex;align-items:center;gap:.6rem}.checkbox input{width:auto}.rank-list{display:grid;gap:.6rem}.rank-row{display:grid;grid-template-columns:90px 60px 150px 1fr 85px auto;gap:.55rem;align-items:center;padding:.55rem;border-bottom:1px solid rgba(255,255,255,.07)}.link-grid{display:grid;gap:.65rem}.team-link{display:grid;grid-template-columns:50px 1fr auto;gap:.8rem;align-items:center;border-left:5px solid var(--team);background:#10192a;padding:.8rem;border-radius:12px}.team-link>span{font-size:2rem}.team-link div{min-width:0}.team-link input{margin-top:.3rem}.details{display:grid;grid-template-columns:150px 1fr;gap:.65rem}.details dt{color:var(--muted)}.details dd{margin:0}.code-block{display:block;white-space:pre-wrap;overflow-wrap:anywhere;background:#09111f;padding:1rem;border-radius:12px;border:1px solid #303e58}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:.75rem;border-bottom:1px solid rgba(255,255,255,.08);vertical-align:top}th{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}td small{display:block;color:var(--muted);margin-top:.25rem}.link-button{background:none;border:0;color:#8fc2ff;padding:0}footer{display:flex;justify-content:space-between;gap:1rem;padding:1.2rem max(1rem,calc((100vw - 1180px)/2));border-top:1px solid rgba(255,255,255,.07);color:#738198;font-size:.8rem}
.leaflet-container{font-family:inherit}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#111a2d;color:#fff}.leaflet-control-attribution{font-size:9px}
@media(max-width:850px){.hero{grid-template-columns:1fr;padding:2rem 0}.hero-icon{display:none}.feature-grid,.stat-grid,.two-col,.team-admin-grid{grid-template-columns:1fr 1fr}.dashboard-head{display:grid}.rank-card{min-width:0}.team-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.rank-row{grid-template-columns:70px 50px 1fr}.rank-row input:nth-of-type(3){grid-column:1/-1}.journey-controls{align-items:flex-start}}
@media(max-width:600px){.container{width:min(100% - 1rem,1180px);padding-top:1rem}.topbar{padding:.75rem}.topbar nav{gap:.55rem}.topbar nav a{font-size:.8rem}.form-grid,.feature-grid,.stat-grid,.two-col,.team-admin-grid,.check-grid{grid-template-columns:1fr}.span-2{grid-column:auto}.hero h1{font-size:2.6rem}.journey-controls,.dashboard-head,.page-title{display:grid}.button-row>.button{flex:1}.map{height:360px}.world-map{height:480px}.rank-row{grid-template-columns:62px 48px 1fr}.rank-row input:nth-of-type(3),.rank-row input:nth-of-type(4){grid-column:1/-1}.team-link{grid-template-columns:42px 1fr}.team-link .button{grid-column:1/-1}.details{grid-template-columns:1fr}.details dd{margin-bottom:.5rem}footer{display:grid}.inline-form{display:grid}.team-picker{grid-template-columns:1fr 1fr}}

/* GPS permission and map reliability */
.journey-copy{flex:1;min-width:0}.journey-buttons{align-self:center}.permission-notice{display:flex;align-items:flex-start;gap:.75rem;margin-top:.9rem;padding:.8rem .9rem;border:1px solid #46648e;border-radius:13px;background:#10223b;color:#dceaff;max-width:760px}.permission-notice .permission-icon{font-size:1.55rem;line-height:1}.permission-notice strong{display:block;margin-bottom:.2rem}.permission-notice p{margin:0;color:#b9cbe2;line-height:1.45}.permission-notice.granted{border-color:#397e63;background:#102a22}.permission-notice.granted p{color:#bfe8d5}.permission-notice.denied{border-color:#8e4b55;background:#2b171d}.permission-notice.denied p{color:#f2c5cb}.map{position:relative;width:100%;isolation:isolate}.map-error{height:100%;display:grid;place-content:center;gap:.35rem;text-align:center;padding:1.5rem;color:#dce7f7}.map-error span{color:var(--muted)}
@media(max-width:600px){.permission-notice{padding:.75rem}.journey-buttons{width:100%}.journey-buttons .button{flex:1}.map-toolbar{align-items:flex-start}.map-toolbar p{font-size:.88rem}}


/* Legacy permission-dialog styles retained for upgrade compatibility. */
.hidden{display:none!important}
body.permission-open{overflow:hidden}
.permission-dialog{position:fixed;inset:0;z-index:3000;display:grid;place-items:center;padding:1rem;background:rgba(2,6,15,.82);backdrop-filter:blur(8px)}
.permission-dialog-card{width:min(540px,100%);max-height:calc(100vh - 2rem);overflow-y:auto;background:linear-gradient(180deg,#19243b,#101827);border:1px solid #40506d;border-radius:20px;padding:clamp(1.25rem,4vw,2rem);box-shadow:0 28px 90px rgba(0,0,0,.55)}
.permission-dialog-card h2{margin:.3rem 0 .65rem;font-size:clamp(1.65rem,5vw,2.25rem)}
.permission-dialog-card>p{line-height:1.55;color:#c3d0e2}
.permission-dialog-card strong{color:#fff}
.permission-actions{display:grid;grid-template-columns:1fr 1fr;gap:.75rem;margin-top:1.1rem}
.permission-actions .button{min-height:52px}
.permission-recovery{margin-top:1rem;border:1px solid #884653;border-radius:14px;padding:.95rem 1rem;background:#2c171e;color:#ffd8de}
.permission-recovery ol{margin:.7rem 0 0;padding-left:1.25rem}
.permission-recovery li+li{margin-top:.4rem}
.permission-dialog-message{min-height:1.4rem;margin:.8rem 0 0;color:#9fc7ff!important;font-weight:700}
.location-status{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-top:1rem;border:1px solid #40506d;border-radius:14px;padding:.8rem .9rem;background:#101a2d}
.location-status>div{min-width:0}
.location-status-label{display:block;color:var(--muted);font-size:.75rem;margin-bottom:.15rem;text-transform:uppercase;letter-spacing:.08em}
.location-status.permission-granted{background:#102a22;border-color:#397e63}
.location-status.permission-granted strong{color:#8df0be}
.location-status.permission-needed{background:#10223b;border-color:#46648e}
.location-status.permission-needed strong{color:#a9d0ff}
.location-status.permission-denied{background:#2b171d;border-color:#8e4b55}
.location-status.permission-denied strong{color:#ffb8c1}
.location-status.permission-unavailable{background:#2d2512;border-color:#806b35}
.location-status.permission-unavailable strong{color:#ffe09b}
@media(max-width:600px){
  .permission-actions{grid-template-columns:1fr}
  .location-status{align-items:stretch;flex-direction:column}
  .location-status .button{width:100%}
}
.status-label{display:inline-flex;align-items:center;border-radius:999px;padding:.28rem .55rem;font-size:.76rem;font-weight:900}.status-label.enabled{background:rgba(83,216,155,.13);border:1px solid rgba(83,216,155,.42);color:#8be8ba}.status-label.paused{background:rgba(255,184,92,.12);border:1px solid rgba(255,184,92,.42);color:#ffd09a}.bulk-operation-status:not(:empty){padding:.7rem .8rem;border-radius:10px;background:#10192a;border:1px solid #33405a}
