/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --serif: 'Newsreader', ui-serif, Georgia, Cambria, 'Times New Roman', serif;
  --sans: 'Roboto', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html, body {
  font-family: var(--sans) !important;
  background-color: rgb(2 6 23);
  color: rgb(241 245 249);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  height: 100%;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

/* Top Navigation */
.top-nav {
  background-color: rgb(2 6 23 / 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(255 255 255 / 0.05);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(to bottom right, rgb(99 102 241), rgb(79 70 229));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px -3px rgb(49 46 129 / 0.3);
}

.logo svg {
  width: 1.25rem;
  height: 1.25rem;
  color: white;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(241 245 249);
  letter-spacing: -0.025em;
}

.brand-subtitle {
  font-size: 0.6875rem;
  color: rgb(148 163 184);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  color: rgb(241 245 249);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.nav-btn:hover {
  background-color: rgb(255 255 255 / 0.1);
}

.nav-btn svg {
  width: 1rem;
  height: 1rem;
}

.streak-badge {
  background-color: rgb(255 255 255 / 0.05);
  border-radius: 9999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  color: rgb(241 245 249);
}

.streak-badge span {
  font-weight: 600;
  color: rgb(165 180 252);
}

/* Main Container */
.main-container {
  display: flex;
  flex: 1;
  height: calc(100vh - 60px);
}

/* Map Container */
.map-container {
  flex: 1;
  position: relative;
  background-color: rgb(15 23 42);
}

.map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Hide Leaflet controls completely */
.leaflet-control-container {
  display: none !important;
}

/* Sidebar */
.sidebar {
  width: 24rem;
  background-color: rgb(2 6 23);
  border-left: 1px solid rgb(255 255 255 / 0.05);
  overflow-y: auto;
}

.sidebar-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cards */
.card {
  background-color: rgb(15 23 42 / 0.6);
  border: 1px solid rgb(255 255 255 / 0.05);
  border-radius: 0.75rem;
  padding: 1rem;
}

.card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(148 163 184);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card h4 svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Instruction Card */
.instruction-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background-color: rgb(99 102 241 / 0.1);
  border: 1px solid rgb(129 140 248 / 0.2);
  border-radius: 0.75rem;
  padding: 1rem;
}

.instruction-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  background-color: rgb(99 102 241);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.instruction-icon svg {
  width: 1rem;
  height: 1rem;
  color: white;
}

.instruction-text h3 {
  font-size: 1rem;
  font-weight: 600;
  color: rgb(241 245 249);
  margin-bottom: 0.25rem;
}

.instruction-text p {
  font-size: 1rem;
  color: rgb(203 213 225);
}

/* Guess Form */
.guess-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(148 163 184);
  margin-bottom: 0.5rem;
}

#theme-guess-input, #vertex-guess-input {
  width: 100%;
  padding: 1rem;
  background-color: rgb(15 23 42);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 0.5rem;
  color: rgb(241 245 249);
  font-size: 1rem;
}

#theme-guess-input::placeholder, #vertex-guess-input::placeholder {
  color: rgb(148 163 184);
}

#theme-guess-input:focus, #vertex-guess-input:focus {
  outline: none;
  border-color: rgb(129 140 248);
  box-shadow: 0 0 0 1px rgb(129 140 248);
}

.form-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.submit-btn {
  height: 3rem;
  padding: 0 1.5rem;
  background-color: rgb(99 102 241);
  border: none;
  border-radius: 0.5rem;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background-color: rgb(79 70 229);
}

.attempts-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.attempts-bar {
  width: 8rem;
  height: 0.5rem;
  background-color: rgb(30 41 59);
  border-radius: 9999px;
  overflow: hidden;
}

.attempts-progress {
  height: 100%;
  background-color: rgb(129 140 248);
  width: 0%;
  transition: width 0.2s;
}

.attempts-dots {
  display: flex;
  gap: 0.375rem;
}

.attempts-dots span {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: rgb(51 65 85);
}

.attempts-dots span.used {
  background-color: rgb(129 140 248);
}

/* Tokens */
.tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.token-chip.category {
  border: 1px solid rgb(74 222 128 / 0.3);
  background-color: rgb(34 197 94 / 0.1);
  color: rgb(220 252 231);
}

.token-chip.qualifier {
  border: 1px solid rgb(251 191 36 / 0.3);
  background-color: rgb(245 158 11 / 0.1);
  color: rgb(254 243 199);
}

.token-chip .dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
}

.token-chip.category .dot {
  background-color: rgb(74 222 128);
}

.token-chip.qualifier .dot {
  background-color: rgb(251 191 36);
}

/* Revealed Locations */
#revealed-list {
  list-style: none;
}

#revealed-list li {
  padding: 1rem 0;
  font-size: 1rem;
  color: rgb(203 213 225);
  border-bottom: 1px solid rgb(255 255 255 / 0.05);
}

#revealed-list li:last-child {
  border-bottom: none;
}

.revealed-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(74 222 128 / 0.2);
  background-color: rgb(34 197 94 / 0.05);
  color: rgb(220 252 231);
}

.revealed-item .dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: rgb(74 222 128);
  flex-shrink: 0;
}

/* Result Card */
.result-card {
  text-align: center;
  padding: 2rem;
}

.result-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background-color: rgb(255 255 255 / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.result-icon svg {
  width: 2rem;
  height: 2rem;
}

.result-card h3 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.result-card p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.score-display {
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.3), rgb(0 0 0 / 0.2));
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.score-number {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
}

.score-label {
  font-size: 1rem;
  color: rgb(148 163 184);
  letter-spacing: 0.025em;
}

.streak-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
}

.streak-display svg {
  width: 1.25rem;
  height: 1.25rem;
  color: rgb(251 191 36);
}

.streak-display span:first-of-type {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(251 191 36);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 3.5rem;
  width: 100%;
  background-color: rgb(255 255 255 / 0.1);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  color: rgb(241 245 249);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background-color: rgb(255 255 255 / 0.15);
}

.copy-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgb(0 0 0 / 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 32rem;
  background-color: rgb(15 23 42);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
}

.close-btn {
  width: 1.5rem;
  height: 1.5rem;
  background: none;
  border: none;
  color: rgb(148 163 184);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
  color: rgb(203 213 225);
}

.modal-body p {
  margin-bottom: 1rem;
}

.modal-body ul {
  list-style: none;
}

.modal-body li {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.modal-body li::before {
  content: "•";
  color: rgb(129 140 248);
  font-weight: 700;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgb(255 255 255 / 0.05);
  }
}

@media (max-width: 640px) {
  .nav-actions {
    gap: 0.5rem;
  }
  
  .nav-btn span {
    display: none;
  }
  
  .streak-badge span {
    display: none;
  }
}

/* Win state */
.win-state {
  border-color: rgb(74 222 128 / 0.3);
  background-color: rgb(34 197 94 / 0.1);
}

.win-state .result-icon svg {
  color: rgb(110 231 183);
}

/* Lose state */
.lose-state {
  border-color: rgb(251 113 133 / 0.3);
  background-color: rgb(244 63 94 / 0.1);
}

.lose-state .result-icon svg {
  color: rgb(252 165 165);
}

/* Copied state */
.copied {
  background-color: rgb(34 197 94 / 0.2);
  border-color: rgb(74 222 128 / 0.3);
}
/* Puzzles List */
.puzzles-list {
  max-height: 60vh;
  overflow-y: auto;
}

.puzzle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  background-color: rgb(15 23 42);
  border: 1px solid rgb(255 255 255 / 0.05);
  cursor: pointer;
  transition: all 0.2s;
}

.puzzle-item:hover {
  background-color: rgb(30 41 59);
  border-color: rgb(129 140 248 / 0.3);
}

.puzzle-item.active {
  background-color: rgb(99 102 241 / 0.1);
  border-color: rgb(129 140 248 / 0.3);
}

.puzzle-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.puzzle-title {
  font-weight: 600;
  color: white;
}

.puzzle-date {
  font-size: 0.875rem;
  color: rgb(148 163 184);
}

.puzzle-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgb(148 163 184);
}

.puzzle-status.completed {
  color: rgb(74 222 128);
}

.puzzle-status-icon {
  width: 1rem;
  height: 1rem;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid rgb(51 65 85);
  border-top: 2px solid rgb(129 140 248);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* Score Card */
.score-card {
  background-color: rgb(15 23 42 / 0.6);
  border: 1px solid rgb(255 255 255 / 0.05);
  border-radius: 0.75rem;
  padding: 1rem;
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.score-header h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(148 163 184);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.score-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.score-bar {
  width: 100%;
  height: 0.5rem;
  background-color: rgb(30 41 59);
  border-radius: 9999px;
  overflow: hidden;
}

.score-progress {
  height: 100%;
  background: linear-gradient(to right, rgb(34 197 94), rgb(16 185 129));
  transition: width 0.3s ease;
}

/* Score Breakdown */
.score-breakdown {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.score-breakdown-detail {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 1rem;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.score-item .score-label {
  font-size: 0.75rem;
  color: rgb(148 163 184);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.score-item .score-points {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(165 180 252);
}

/* Reveals Label */
.reveals-label {
  font-size: 0.75rem;
  color: rgb(148 163 184);
  text-align: center;
  margin-top: 0.25rem;
}