body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #101418;
  color: #eef1f5;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h1 a:hover {
  color: #7ec7ff;
}

#appFooter {
  text-align: center;
  color: #6b7785;
  font-size: 12px;
  padding: 16px;
}

#layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

#mapWrap,
#guessWrap {
  position: relative;
}

#revealMap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid #2b3a46;
}

#guessMap {
  width: 100%;
  height: 520px;
  border-radius: 12px;
  border: 1px solid #2b3a46;
}

.panelTitle {
  margin: 0 0 6px;
  color: #c8d2dc;
  font-size: 14px;
}

.controls {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

button,
select {
  background: #17222c;
  color: #eef1f5;
  border: 1px solid #2b3a46;
  border-radius: 8px;
  padding: 8px 12px;
}

button.active {
  border-color: #7ec7ff;
  box-shadow: inset 0 0 0 1px #7ec7ff;
}

#hints,
#results {
  margin-top: 12px;
}

.screen.hidden {
  display: none;
}

.panel {
  background: #17222c;
  border: 1px solid #2b3a46;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.formRow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.formLabel {
  flex: 0 0 180px;
  color: #c8d2dc;
  font-size: 14px;
}

.formRow select,
.formRow input {
  flex: 1;
}

.formRow input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
}

.pickerRow {
  gap: 24px;
  align-items: flex-start;
}

.pickerGroup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.pickerGroup .formLabel {
  flex: none;
}

.picker {
  display: inline-flex;
  border: 1px solid #2b3a46;
  border-radius: 8px;
  overflow: hidden;
  background: #0f1820;
}

.picker button {
  background: transparent;
  border: none;
  border-right: 1px solid #2b3a46;
  border-radius: 0;
  color: #c8d2dc;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  min-width: 36px;
}

.picker button:last-child {
  border-right: none;
}

.picker button:hover {
  background: #1c2a36;
}

.picker button.selected {
  background: #2c6fb1;
  color: #fff;
}

.muted {
  color: #94a3b8;
  font-size: 13px;
  margin: 4px 0;
}

.rules {
  margin: 8px 0;
  padding-left: 18px;
  color: #d8dee5;
  font-size: 14px;
}

.rules li {
  margin-bottom: 4px;
}

.scoringGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 12px;
}

.scoringFactor {
  background: #0f1820;
  border: 1px solid #2b3a46;
  border-radius: 8px;
  padding: 10px 12px;
}

.factorName {
  font-size: 13px;
  font-weight: 600;
  color: #ffd9b8;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.factorTag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #94a3b8;
  background: #1c2a36;
  border: 1px solid #2b3a46;
  border-radius: 4px;
  padding: 1px 6px;
}

.factorDesc {
  font-size: 13px;
  color: #c8d2dc;
  line-height: 1.45;
}

.scoringNotes {
  border-top: 1px solid #2b3a46;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #c8d2dc;
}

.scoringNotes strong {
  color: #ffd9b8;
  font-weight: 600;
}

.hintItem {
  margin: 4px 0;
}

.hintImage img,
.imageLightbox img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.hintImage img {
  display: block;
  margin-top: 6px;
  max-width: 240px;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid #2b3a46;
  cursor: zoom-in;
}

.imageLightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: 24px;
}

.imageLightbox img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
  .scoringGrid {
    grid-template-columns: 1fr;
  }
}

button.primary {
  background: #2c6fb1;
  border-color: #5fa0e0;
}

button.secondary {
  background: #1e2a36;
}

#historyList {
  margin-bottom: 10px;
}

.historyItem {
  display: grid;
  grid-template-columns: 90px 80px 1fr auto;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #2b3a46;
  font-size: 13px;
  align-items: baseline;
}

.historyItem:last-child {
  border-bottom: none;
}

.historyItem .score {
  font-weight: bold;
  color: #7ec7ff;
}

.historyItem.clickable {
  cursor: pointer;
}

.historyItem.clickable:hover {
  background: #1c2a36;
}

.submitGuessBtn {
  margin-top: 8px;
  width: 100%;
}

#resultMap {
  width: 100%;
  height: 420px;
  border-radius: 12px;
  border: 1px solid #2b3a46;
  margin-bottom: 12px;
}

.numberedMarker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

.numberedMarker.target {
  background: #ff6b6b;
}

.numberedMarker.guess {
  background: #6ea5ff;
}

.maplibregl-popup-content {
  background: #17222c;
  color: #eef1f5;
  border: 1px solid #2b3a46;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.maplibregl-popup-tip {
  border-top-color: #17222c !important;
  border-bottom-color: #17222c !important;
  border-left-color: #17222c !important;
  border-right-color: #17222c !important;
}

.maplibregl-popup-close-button {
  color: #c8d2dc;
  font-size: 18px;
  padding: 2px 6px;
}

.roundsTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.roundsTable th,
.roundsTable td {
  padding: 6px 8px;
  border-bottom: 1px solid #2b3a46;
  text-align: left;
}

.roundsTable th {
  color: #94a3b8;
  font-weight: normal;
  font-size: 12px;
  text-transform: uppercase;
}

.roundsTable .numCell {
  text-align: right;
  color: #7ec7ff;
}

.roundsTable .passCell {
  color: #4ade80;
}

.roundsTable .failCell {
  color: #ff6b6b;
}

.roundsTable tfoot td {
  border-bottom: none;
  border-top: 2px solid #2b3a46;
}

.statsGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.statCell {
  background: #0f1820;
  border: 1px solid #2b3a46;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.statNum {
  font-size: 22px;
  font-weight: bold;
  color: #7ec7ff;
}

.homeGrid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 720px) {
  .homeGrid {
    grid-template-columns: 1fr;
  }
}

.homeAside .panel {
  position: sticky;
  top: 12px;
}

.leaderboardItem {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #2b3a46;
  align-items: baseline;
  font-size: 13px;
}

.leaderboardItem:last-child {
  border-bottom: none;
}

.leaderboardItem .rank {
  color: #94a3b8;
  text-align: right;
}

.leaderboardItem .lbScore {
  color: #7ec7ff;
  font-weight: bold;
}

.dailySubmit {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.dailySubmit input[type="text"] {
  flex: 1;
  padding: 8px;
  background: #0f1820;
  border: 1px solid #2b3a46;
  color: #eef1f5;
  border-radius: 8px;
}

#gameMeta {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

#gameMeta .hidden {
  display: none;
}

#roundIndicator,
#timerIndicator {
  background: #17222c;
  border: 1px solid #2b3a46;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  color: #c8d2dc;
}

#timerIndicator.warning {
  color: #ffb86b;
  border-color: #ffb86b;
}

#timerIndicator.danger {
  color: #ff6b6b;
  border-color: #ff6b6b;
}

.scoreBig {
  font-size: 36px;
  font-weight: bold;
  color: #7ec7ff;
  margin: 8px 0;
}

.breakdown {
  font-size: 14px;
  color: #c8d2dc;
}

.breakdown div {
  margin: 2px 0;
}
