@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body { background: #f0f4ff; font-family: 'Nunito', sans-serif; min-height: 100vh; }

/* ── Login ───────────────────────────────────────────────── */
#loginPage {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px 16px;
  background: linear-gradient(160deg, #e63946 0%, #c1121f 40%, #9d0208 100%);
}
.login-card {
  background: white; border-radius: 24px; width: 100%;
  max-width: 380px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.login-header {
  background: linear-gradient(135deg, #e63946, #c1121f);
  padding: 32px 28px 24px; text-align: center; color: white;
}
.login-header .logo { font-size: 52px; margin-bottom: 8px; }
.login-header h1 { font-size: 22px; font-weight: 900; letter-spacing: -0.5px; }
.login-header p  { font-size: 13px; font-weight: 600; opacity: 0.85; margin-top: 4px; }
.login-body { padding: 28px 24px 24px; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px; color: #666; margin-bottom: 6px;
}
.form-group input {
  width: 100%; padding: 12px 14px; border: 2px solid #eee; border-radius: 12px;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 600; color: #222;
  outline: none; transition: border-color 0.2s;
}
.form-group input:focus { border-color: #e63946; }
.error-msg {
  background: #fff0f0; color: #c1121f; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-weight: 700;
  margin-bottom: 14px; display: none;
}
.btn-primary {
  display: block; width: 100%; padding: 13px;
  background: linear-gradient(135deg, #e63946, #c1121f); border: none; border-radius: 12px;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800; color: white;
  cursor: pointer; transition: opacity 0.2s, transform 0.1s; margin-bottom: 10px;
}
.btn-primary:hover  { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
  display: block; width: 100%; padding: 13px; background: #f5f5f5; border: none;
  border-radius: 12px; font-family: 'Nunito', sans-serif;
  font-size: 15px; font-weight: 800; color: #555; cursor: pointer; transition: background 0.2s;
}
.btn-secondary:hover { background: #eee; }
.btn-viewer {
  display: block; width: 100%; padding: 13px;
  background: white; border: 2px solid #ffd4d7; border-radius: 12px;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800;
  color: #c1121f; cursor: pointer; transition: background 0.2s, border-color 0.2s;
  margin-top: 10px;
}
.btn-viewer:hover { background: #fff5f6; border-color: #e63946; }
.login-divider { text-align: center; font-size: 12px; font-weight: 700; color: #aaa; margin: 14px 0 10px; }
.login-help {
  margin-top: 12px; text-align: center; font-size: 12px; line-height: 1.5;
  color: #888; font-weight: 700;
}

/* ── App ─────────────────────────────────────────────────── */
#appPage { display: none; padding: 16px 16px 40px; }
.page { max-width: 680px; margin: 0 auto; }

/* Header */
.header {
  background: linear-gradient(135deg, #e63946 0%, #c1121f 100%);
  border-radius: 20px; padding: 18px 20px 16px; margin-bottom: 14px;
  box-shadow: 0 6px 24px rgba(198,18,31,0.3); position: relative; overflow: hidden;
}
.header::before { content:'🎢'; position:absolute; font-size:90px; opacity:0.08; top:-10px; left:-10px; }
.header::after  { content:'🎡'; position:absolute; font-size:90px; opacity:0.08; bottom:-20px; right:-5px; }
.header-top { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.header-top h1 { font-size:22px; font-weight:900; color:white; letter-spacing:-0.5px; }
.header-top p  { color:rgba(255,255,255,0.85); font-size:13px; font-weight:600; margin-top:2px; }
.user-chip {
  display:flex; align-items:center; gap:8px;
  background:rgba(255,255,255,0.2); border-radius:30px; padding:5px 12px 5px 6px; flex-shrink:0;
}
.user-avatar {
  width:28px; height:28px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:900; color:white; flex-shrink:0;
}
.user-chip .user-name { font-size:13px; font-weight:800; color:white; }
.header-bottom { display:flex; justify-content:space-between; align-items:center; margin-top:12px; }
.score {
  background:rgba(255,255,255,0.2); border-radius:30px;
  padding:5px 16px; color:white; font-size:13px; font-weight:700;
}
.logout-btn {
  background:rgba(255,255,255,0.15); border:none; border-radius:20px;
  color:white; font-family:'Nunito',sans-serif; font-size:12px; font-weight:700;
  padding:5px 12px; cursor:pointer; transition:background 0.2s;
}
.logout-btn:hover { background:rgba(255,255,255,0.25); }
.mode-banner {
  background: #fff5d9; color: #8f6200; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 14px; font-size: 13px; font-weight: 800;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Progress */
.progress-wrap {
  background:white; border-radius:14px; padding:14px 18px;
  margin-bottom:14px; box-shadow:0 2px 10px rgba(0,0,0,0.07);
}
.progress-players-title {
  margin-bottom: 8px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px; color: #999;
}
.player-progress-list { display:flex; flex-direction:column; gap:10px; }
.player-progress-row  { display:block; }
.player-progress-main { min-width:0; }
.player-progress-top {
  display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:5px;
}
.player-progress-name {
  font-size:12px; font-weight:800; color:#333; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.player-progress-score { font-size:11px; font-weight:700; color:#888; flex-shrink:0; }
.player-progress-bar-bg { height:8px; background:#eee; border-radius:999px; overflow:hidden; }
.player-progress-bar {
  height:100%; border-radius:999px; width:0%;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.player-progress-empty { font-size:12px; font-weight:700; color:#aaa; padding-top:2px; }

.confetti-msg {
  display:none; text-align:center;
  background:linear-gradient(135deg,#e63946,#c1121f); color:white;
  border-radius:14px; padding:14px; margin-bottom:14px;
  font-size:17px; font-weight:800; box-shadow:0 4px 16px rgba(198,18,31,0.3);
}

/* Sections */
.section { margin-bottom:16px; }
.section-title {
  font-size:12px; font-weight:800; text-transform:uppercase;
  letter-spacing:1.5px; color:#888; margin-bottom:8px; padding-left:4px;
}
.card        { background:white; border-radius:14px; box-shadow:0 2px 10px rgba(0,0,0,0.06); overflow:hidden; }
.card-scroll { overflow-x:auto; }

/* Column header row */
.col-header-row {
  display:grid; align-items:center;
  padding:8px 12px; background:#f9f9f9; border-bottom:2px solid #f0f0f0; min-width:0;
}
.col-head { display:flex; flex-direction:column; align-items:center; gap:2px; }
.col-head-avatar {
  width:26px; height:26px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:900; color:white;
}
.col-head-label {
  font-size:9px; font-weight:800; text-transform:uppercase;
  letter-spacing:0.3px; color:#aaa; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; max-width:36px; text-align:center;
}
.col-head.mine .col-head-label { color:#e63946; }

/* Item wrap */
.item-wrap            { border-bottom:1px solid #f2f2f2; }
.item-wrap:last-child { border-bottom:none; }

/* Item row */
.item {
  display:grid; align-items:center;
  padding:10px 12px; transition:background 0.15s; user-select:none; min-width:0;
}
.item-wrap:hover .item { background:#fafafa; }

.item-icon     { font-size:19px; text-align:center; }
.item-info     { min-width:0; padding:0 8px; }
.item-name-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.item-name     { font-size:14px; font-weight:700; color:#222; transition:color 0.2s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item-desc     { font-size:11px; color:#999; font-weight:600; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item-tag      { font-size:10px; font-weight:800; padding:2px 7px; border-radius:20px; letter-spacing:0.3px; text-transform:uppercase; flex-shrink:0; }
.tag-extreme { background:#ffe0e0; color:#c1121f; }
.tag-thrill  { background:#fff0d4; color:#e07b00; }
.tag-family  { background:#e0f5e8; color:#1a7a3a; }
.tag-water   { background:#d4eeff; color:#0066bb; }
.tag-fun     { background:#f5e0ff; color:#8800cc; }
.tag-bingo   { background:#fff8d4; color:#b07800; }

/* Mijn checkbox */
.check-mine        { display:flex; align-items:center; justify-content:center; cursor:pointer; padding:4px; }
.check-mine:active { opacity:0.7; }
.checkbox {
  width:26px; height:26px; border:2.5px solid #ddd; border-radius:8px;
  display:flex; align-items:center; justify-content:center; transition:all 0.2s; flex-shrink:0;
}
.checkbox.evidence-placeholder { color:#c8c8c8; font-size:13px; font-weight:900; text-transform:lowercase; }
.item.done .checkbox        { background:#e63946; border-color:#e63946; }
.item.done .checkbox::after { content:'✓'; color:white; font-weight:900; font-size:14px; }
.item.done .item-name       { text-decoration:line-through; color:#aaa; }
.item.done .item-tag        { opacity:0.4; }

/* Evidence */
.evidence-box {
  position:relative; width:32px; height:32px; border-radius:10px;
  display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden;
}
.evidence-box.empty          { cursor:pointer; }
.evidence-box.empty .checkbox { background:#fff; }
.evidence-box.loading        { opacity:0.55; pointer-events:none; }
.evidence-box.has-thumb      { cursor:pointer; background:#f4f4f4; }
.evidence-box.has-thumb img {
  width:100%; height:100%; object-fit:cover; display:block; border-radius:10px;
  border:2px solid #fff; box-shadow:0 0 0 2px #e9e9e9 inset;
}
.evidence-box.sound {
  cursor:pointer; background:linear-gradient(135deg,#4f6ef7,#6f42c1);
  box-shadow:0 8px 18px rgba(79,110,247,0.22);
}
.evidence-sound-icon {
  color:white; font-size:16px; font-weight:900; line-height:1;
  display:flex; align-items:center; justify-content:center;
  width:100%; height:100%;
}
.evidence-input { display:none; }
.evidence-remove {
  position:absolute; top:-4px; right:-4px;
  width:17px; height:17px; border-radius:50%;
  border:2px solid white; background:#e63946; color:white;
  font-size:9px; font-weight:900; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 8px rgba(0,0,0,0.18);
}
.evidence-remove:hover { transform:scale(1.08); }
.evidence-legacy { cursor:pointer; }

/* Andere speler kolom */
.check-other { display:flex; align-items:center; justify-content:center; padding:4px; cursor:default; }
.check-dot {
  width:22px; height:22px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; transition:all 0.3s;
}
.check-dot.checked::after { content:'✓'; color:white; font-size:12px; font-weight:900; }
.check-evidence {
  width:24px; height:24px; border-radius:8px; overflow:hidden; cursor:pointer;
  border:2px solid #fff; box-shadow:0 0 0 2px #e6e6e6 inset;
  background:#f3f3f3; display:flex; align-items:center; justify-content:center;
}
.check-evidence img   { width:100%; height:100%; object-fit:cover; display:block; }
.check-evidence.sound {
  background:linear-gradient(135deg,#4f6ef7,#6f42c1);
  box-shadow:0 0 0 2px rgba(110,110,180,0.12) inset;
}

/* ── Foto strip ────────────────────────────────────────── */
.photo-strip {
  display:flex; align-items:center; gap:7px;
  padding:6px 12px 8px 50px;
  overflow-x:auto; background:#fdfcfc;
  scrollbar-width:thin; scrollbar-color:#ddd transparent;
}
.photo-strip::-webkit-scrollbar       { height:3px; }
.photo-strip::-webkit-scrollbar-thumb { background:#ddd; border-radius:3px; }

/* Thumbnail */
.thumb-wrap { position:relative; flex-shrink:0; }
.thumb {
  width:54px; height:54px; border-radius:9px; object-fit:cover; display:block;
  border:2.5px solid #eee; cursor:pointer; transition:border-color 0.2s, transform 0.15s;
}
.thumb:hover { border-color:#e63946; transform:scale(1.06); }
.thumb-label {
  position:absolute; bottom:0; left:0; right:0;
  background:rgba(0,0,0,0.58); color:white;
  font-size:8px; font-weight:800; text-align:center;
  padding:2px 3px; border-radius:0 0 7px 7px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  pointer-events:none;
}
.thumb-del {
  position:absolute; top:-5px; left:-5px;
  width:18px; height:18px; border-radius:50%;
  background:#e63946; color:white; border:2px solid white;
  font-size:9px; font-weight:900; line-height:1;
  cursor:pointer; display:none; align-items:center; justify-content:center;
  transition:transform 0.15s;
}
.thumb-wrap:hover .thumb-del { display:flex; }
.thumb-del:hover              { transform:scale(1.15); }

/* Upload-knop */
.upload-btn {
  width:40px; height:40px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  border:2px dashed #ccc; background:#f8f8f8;
  cursor:pointer; font-size:18px; transition:all 0.2s;
}
.upload-btn:hover          { border-color:#e63946; background:#fff0f0; }
.upload-btn.loading        { opacity:0.5; pointer-events:none; animation:spin 1s linear infinite; }
.upload-btn input[type=file] { display:none; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Reset */
.reset-btn {
  display:block; width:100%; margin-top:14px; padding:13px;
  background:#f0f0f0; border:none; border-radius:14px;
  font-family:'Nunito',sans-serif; font-size:14px; font-weight:700; color:#888;
  cursor:pointer; transition:background 0.2s;
}
.reset-btn:hover { background:#e5e5e5; color:#555; }

/* Locaties */
.location-panel {
  margin-top:16px; background:white; border-radius:16px; padding:16px;
  box-shadow:0 2px 10px rgba(0,0,0,0.06);
}
.location-top {
  display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:8px;
}
.location-title    { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:#888; }
.location-subtitle { font-size:13px; font-weight:700; color:#666; line-height:1.45; margin-bottom:12px; }
.location-btn {
  border:none; border-radius:999px; padding:10px 14px;
  font-family:'Nunito',sans-serif; font-size:12px; font-weight:800; cursor:pointer;
  color:white; background:linear-gradient(135deg,#e63946,#c1121f);
  white-space:nowrap;
}
.location-btn.stop       { background:#607d8b; }
.location-map-wrap.hidden { display:none; }
#locationMap {
  width:100%; height:320px; border-radius:14px; overflow:hidden; background:#eef3f8;
}
.location-pin {
  width:18px; height:18px; border-radius:50%;
  border:3px solid white; box-shadow:0 3px 10px rgba(0,0,0,0.25);
}

/* WS dot */
.ws-dot         { width:8px; height:8px; border-radius:50%; display:inline-block; margin-left:4px; vertical-align:middle; }
.ws-dot.online  { background:#4caf50; }
.ws-dot.offline { background:#f44336; }

/* ── Lightbox ──────────────────────────────────────────── */
#lightbox {
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,0.88); z-index:1000;
  align-items:center; justify-content:center; padding:16px;
}
#lightbox.open { display:flex; }
.lb-box {
  position:relative; display:flex; flex-direction:column;
  align-items:center; gap:12px;
  max-width:min(92vw, 760px); max-height:92vh;
}
#lbImg {
  max-width:100%; max-height:calc(92vh - 90px);
  border-radius:14px; object-fit:contain;
  box-shadow:0 12px 60px rgba(0,0,0,0.6);
}
#lbAudio {
  width:min(92vw, 560px); max-width:100%;
  background:white; border-radius:16px;
  padding:10px; box-shadow:0 12px 60px rgba(0,0,0,0.45);
}
.lb-info      { display:flex; align-items:center; gap:14px; color:white; font-size:13px; font-weight:700; }
.lb-user-badge { display:flex; align-items:center; gap:7px; }
.lb-user-av {
  width:24px; height:24px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:900; color:white;
}
.lb-counter { color:rgba(255,255,255,0.6); font-size:12px; }
.lb-date    { color:rgba(255,255,255,0.6); font-size:12px; }
.lb-close {
  position:absolute; top:-14px; right:-14px;
  width:34px; height:34px; border-radius:50%;
  background:white; border:none; font-size:15px; font-weight:900;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  color:#333; box-shadow:0 2px 10px rgba(0,0,0,0.3); transition:transform 0.15s;
}
.lb-close:hover { transform:scale(1.1); }
.lb-nav {
  position:fixed; top:50%; transform:translateY(-50%);
  width:46px; height:46px; border-radius:50%;
  background:rgba(255,255,255,0.18); border:none; color:white;
  font-size:22px; cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background 0.2s; z-index:1001;
}
.lb-nav:hover    { background:rgba(255,255,255,0.32); }
.lb-nav.hidden   { display:none; }
#lbPrev { left:12px; }
#lbNext { right:12px; }
.lb-del {
  background:rgba(230,57,70,0.85); border:none; color:white;
  border-radius:20px; padding:5px 14px; font-family:'Nunito',sans-serif;
  font-size:12px; font-weight:800; cursor:pointer; transition:background 0.2s;
}
.lb-del:hover  { background:#e63946; }
.lb-del.hidden { display:none; }
.hidden { display:none !important; }
