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

body {
  background: #1a1a1a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  padding: 2rem 1rem;
  max-width: 3840px;
  margin: 0 auto;
}

a {
  color: #7ab3ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #fff;
}

/* Sort bar */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #888;
}

.sort-bar select {
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #444;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}

.sort-bar select:hover {
  border-color: #666;
}

/* Index page: puzzle list */
.puzzle-list {
  list-style: none;
  padding-left: 100px;
}

.puzzle-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #2a2a2a;
}

.puzzle-list li:last-child {
  border-bottom: none;
}

.puzzle-title {
  font-size: 1.1rem;
  font-weight: 500;
}

.puzzle-meta {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.2rem;
}

.puzzle-meta span + span::before {
  content: "\00b7";
  margin: 0 0.4rem;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.pagination button {
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #444;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}

.pagination button:hover:not(:disabled) {
  background: #3a3a3a;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

.page-info {
  font-size: 0.9rem;
  color: #888;
}

/* Puzzle page */
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #888;
}

.back-link:hover {
  color: #7ab3ff;
}

/* Exolve dark theme overrides */
.xlv-frame {
  background: #1a1a1a !important;
  color: #e0e0e0 !important;
  transform: scale(1);
  transform-origin: top left;
}

.xlv-title, .xlv-setter, .xlv-preamble {
  color: #e0e0e0 !important;
}

.xlv-clues-box {
  color: #e0e0e0 !important;
}

.xlv-clue {
  color: #ccc !important;
}

.xlv-curr-clue {
  color: #fff !important;
  background: #333 !important;
}

.xlv-status {
  color: #ccc !important;
}

/* Solved banner */
.solved-banner {
  display: none;
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: #1a3a1a;
  border: 1px solid #4caf50;
  border-radius: 6px;
  color: #4caf50;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.solved-banner.visible {
  display: block;
}

.upload-link {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #2a2a2a;
  font-size: 0.9rem;
}

/* Upload form */
.upload-form {
  margin-top: 1.5rem;
}

.upload-form h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.75rem;
}

.upload-form input[type="file"],
.upload-form input[type="password"],
.upload-form button {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
}

.upload-form input[type="password"] {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #e0e0e0;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  width: 200px;
}

.upload-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.upload-form button {
  background: #7ab3ff;
  color: #1a1a1a;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

.upload-form button:hover {
  background: #5a9ae6;
}

.upload-msg {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.upload-msg.success {
  color: #4caf50;
}

.upload-msg.error {
  color: #ff6b6b;
}
