:root{
  --nick-orange:#ff6f00;
  --slime:#6bd425;
  --deep-sky:#00a7ff;
  --ink:#141414;
  --paper:#fffaf3;
  --shadow: rgba(0,0,0,.18);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: system-ui,-apple-system, Segoe UI, Roboto, Arial, Noto Sans, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--ink);
  background:
    radial-gradient(1200px 420px at 50% -260px, var(--slime) 0 55%, transparent 56%) no-repeat,
    radial-gradient(460px 260px at 12% 16%, rgba(255,111,0,.16) 0 55%, transparent 56%) no-repeat,
    radial-gradient(420px 240px at 90% 22%, rgba(0,167,255,.14) 0 55%, transparent 56%) no-repeat,
    linear-gradient(180deg, #fff 0, var(--paper) 30%, #fff 100%);
  min-height:100svh;
}

header{ position:relative; padding: clamp(18px, 4vw, 36px) 16px 10px; text-align:center; }

.title{
  display:inline-block;
  font-weight:1000;
  font-size: clamp(22px, 5vw, 44px);
  letter-spacing:.5px;
  color:white;
  background: var(--nick-orange);
  padding:.35em .65em;
  border-radius: 18px;
  box-shadow: 0 6px 0 #c65600, 0 10px 20px rgba(0,0,0,.15);
  transform: rotate(-1deg);
}

.subtitle{ margin:.85rem auto 0; max-width: 860px; color:#10410a; font-weight:650; }

.wrap{ width:min(1100px, 92vw); margin: 18px auto 52px; display:grid; grid-template-columns: 1fr; gap:18px; }
@media (min-width:900px){ .wrap{grid-template-columns: 1fr 1fr} }

.card{
  background:#ffffff;
  border:3px solid var(--ink);
  border-radius:24px;
  padding:18px;
  box-shadow: 0 8px 0 var(--shadow);
}

.card h2{ margin:0 0 10px; font-size:clamp(18px, 2.6vw, 24px); display:flex; align-items:center; gap:.55rem; }

.tag{
  display:inline-block;
  font-size:.8rem;
  background: var(--slime);
  color:#0c2a02;
  padding:.25rem .55rem;
  border-radius:999px;
  border:2px solid #0c2a02;
}

.actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}

.btn{
  appearance:none;
  border:none;
  cursor:pointer;
  background: var(--nick-orange);
  color:white;
  font-weight:900;
  padding:.72rem 1rem;
  border-radius: 14px;
  box-shadow:0 4px 0 #c65600;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:.55rem;
}

.btn.secondary{ background: var(--deep-sky); box-shadow:0 4px 0 #007ec2; }
.btn.ghost{ background:#fff; color:#000; border:2px solid #000; box-shadow:none; }
.btn:active{ transform: translateY(1px); box-shadow: 0 3px 0 rgba(0,0,0,.3); }

input[type="text"], textarea{
  width:100%;
  padding:.75rem 1rem;
  border:2px solid #333;
  border-radius:12px;
  font-size:1rem;
}

.stack{ display:grid; gap:12px; }

.hint{ font-size:.95rem; color:#333; }
.tiny{ font-size:.88rem; color:#444; }

.success{ background:#e7ffe8; border:2px solid #35a145; padding:12px; border-radius:12px; }
.error{ background:#fff0f0; border:2px solid #cc3b3b; padding:12px; border-radius:12px; }

.qr-box{
  display:grid;
  place-items:center;
  aspect-ratio: 1 / 1;
  background: repeating-linear-gradient(45deg, #f7f7f7 0 12px, #efefef 12px 24px);
  border:3px dashed var(--deep-sky);
  border-radius: 18px;
  overflow:hidden;
  margin-top:.5rem;
}

.qr-box img{ width: min(80%, 360px); height:auto; image-rendering: pixelated; }
.qr-placeholder{ text-align:center; padding:12px; color:#666; font-weight:700; }

.progress{
  display:flex;
  align-items:center;
  gap:8px;
  margin:10px 0 4px;
  flex-wrap:wrap;
}

.dot{ width:14px; height:14px; border-radius:999px; border:2px solid #111; background:#fff; }
.dot.on{ background: var(--slime); }

.puzzle{
  border:2px dashed rgba(0,0,0,.35);
  border-radius:16px;
  padding:12px;
  background: #fff7ea;
}

.grid{
  display:grid;
  grid-template-columns: repeat(8, 1fr);
  gap:6px;
  margin-top:10px;
}

.bit{
  aspect-ratio: 1/1;
  border:2px solid #111;
  border-radius:10px;
  display:grid;
  place-items:center;
  font-weight:900;
  background:#fff;
  user-select:none;
}

.bit.on{ background: rgba(107,212,37,.35); }

.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

footer{ text-align:center; padding:26px 16px; color:#333; font-size:.95rem; }

/* Multiple-choice puzzle UI */
.mcqGrid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.mcqBtn{
  border: 3px solid #0b3b13;
  background: rgba(255,255,255,.75);
  border-radius: 18px;
  padding: 14px 12px;
  cursor:pointer;
  box-shadow: 0 6px 0 rgba(11,59,19,.35);
  transition: transform .05s ease;
}
.mcqBtn:active{ transform: translateY(2px); }
.mcqEmoji{
  font-size: 40px;
  line-height: 1.1;
  font-weight: 800;
}

/* Progress dots */
.progress{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.dot{
  width: 14px; height: 14px;
  border-radius: 99px;
  background: rgba(0,0,0,.12);
  border: 2px solid rgba(0,0,0,.25);
}
.dot.done{ background: var(--slime); border-color: #0b3b13; }
.dot.now{ background: var(--deep-sky); border-color: #054a73; }

/* Leaderboard table */
.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
  background: rgba(255,255,255,.7);
}
.table th, .table td{
  padding: 10px 10px;
  border-bottom: 2px solid rgba(0,0,0,.08);
  text-align:left;
  font-weight: 800;
}
.table th{ background: rgba(107,212,37,.25); }

/* Times block */
.times{
  display:grid;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(255,255,255,.75);
  border-radius: 16px;
  border: 2px solid rgba(0,0,0,.12);
}
.times .total{
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px dashed rgba(0,0,0,.15);
}

/* Campus map */
#campusMap{
  margin-top: 12px;
  padding: 12px;
  background: white;
  border-radius: 16px;
  border: 2px solid rgba(0,0,0,.08);
}
#campusMap svg{
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.08));
}
