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

:root {
  /* Light theme - Prison interrogation room */
  --bg-primary: #e8e6e1;
  --bg-secondary: #d4d2cc;
  --bg-card: #f5f4f0;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #757575;
  --border-color: #3a3a3a;
  --accent-crous: #d97706;
  --accent-prison: #dc2626;
  --success: #16a34a;
  --error: #dc2626;
  --shadow: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
  /* Dark theme - Prison cell */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-card: #252525;
  --text-primary: #e8e6e1;
  --text-secondary: #b8b8b8;
  --text-muted: #8a8a8a;
  --border-color: #404040;
  --accent-crous: #f59e0b;
  --accent-prison: #ef4444;
  --success: #22c55e;
  --error: #ef4444;
  --shadow: rgba(0, 0, 0, 0.5);
}

body {
  font-family: "Courier New", monospace;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px var(--shadow);
}

.theme-toggle:hover {
  transform: scale(1.05);
  border-color: var(--accent-crous);
}

.sun-icon,
.moon-icon {
  position: absolute;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.moon-icon {
  opacity: 0;
  transform: rotate(180deg);
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: rotate(180deg);
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  padding: 40px 20px;
  border-bottom: 3px solid var(--border-color);
  margin-bottom: 40px;
  position: relative;
}

.case-number {
  font-size: 14px;
  font-weight: bold;
  color: var(--accent-prison);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.title {
  margin: 20px 0;
}

.title-main {
  display: block;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: bold;
  letter-spacing: 4px;
  color: var(--text-primary);
  text-shadow: 2px 2px 0 var(--shadow);
  line-height: 1.2;
}

.title-sub {
  display: block;
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--text-secondary);
  letter-spacing: 8px;
  margin-top: 10px;
  font-weight: normal;
}

.score-board {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-top: 30px;
  padding: 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

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

.score-label {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-weight: bold;
}

.score-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--success);
  font-family: "Courier New", monospace;
}

.score-value.incorrect {
  color: var(--error);
}

.score-divider {
  width: 2px;
  height: 50px;
  background: var(--border-color);
}

/* Game Area */
.game-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .game-area {
    grid-template-columns: 1fr 1fr;
  }
}

.evidence-photo {
  background: var(--bg-card);
  border: 3px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 8px 16px var(--shadow);
}

.photo-label {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--accent-prison);
  margin-bottom: 15px;
  text-align: center;
}

.photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  overflow: hidden;
  border-radius: 4px;
}

.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading.active {
  opacity: 1;
}

.loading-bar {
  width: 60%;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loading-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent-crous);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  to {
    left: 100%;
  }
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: bold;
}

/* Interrogation Panel */
.interrogation-panel {
  background: var(--bg-card);
  border: 3px solid var(--border-color);
  border-radius: 8px;
  padding: 30px 20px;
  box-shadow: 0 8px 16px var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.question {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  text-align: center;
  margin-bottom: 30px;
  letter-spacing: 2px;
  color: var(--text-primary);
  font-weight: bold;
  line-height: 1.4;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.verdict-btn {
  background: var(--bg-secondary);
  border: 3px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: "Courier New", monospace;
  position: relative;
  overflow: hidden;
}

.verdict-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.verdict-btn:hover::before {
  left: 100%;
}

.verdict-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--shadow);
}

.verdict-btn:active {
  transform: translateY(-2px);
}

.crous-btn {
  border-color: var(--accent-crous);
}

.crous-btn:hover {
  background: var(--accent-crous);
  color: white;
}

.jail-btn {
  border-color: var(--accent-prison);
}

.jail-btn:hover {
  background: var(--accent-prison);
  color: white;
}

.verdict-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-icon {
  font-size: 48px;
  line-height: 1;
}

.btn-text {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 3px;
}

.btn-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Adding share button styles */
.share-btn {
  margin-top: 20px;
  background: #1da1f2;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.share-btn:hover {
  background: #1a91da;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

.share-btn:active {
  transform: translateY(0);
}

/* Result Panel */
.result-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.result-panel.show {
  opacity: 1;
  pointer-events: all;
}

.result-content {
  background: var(--bg-card);
  border: 3px solid var(--border-color);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  max-width: 500px;
  width: 100%;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.result-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.result-panel.correct .result-text {
  color: var(--success);
}

.result-panel.incorrect .result-text {
  color: var(--error);
}

.result-text {
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 3px;
  margin-bottom: 15px;
}

.result-detail {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.6;
}

.next-btn {
  background: var(--accent-crous);
  color: white;
  border: none;
  padding: 16px 40px;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 2px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  transition: all 0.3s ease;
}

.next-btn:hover {
  background: var(--accent-prison);
  transform: scale(1.05);
}

/* Contribute page styles */
.contribute-area {
  max-width: 800px;
  margin: 0 auto 40px;
}

.contribute-intro {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 30px;
  text-align: center;
}

.contribute-intro p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.contribute-intro p:last-child {
  margin-bottom: 0;
}

.warning {
  color: var(--accent-prison);
  font-weight: bold;
  font-size: 14px;
  background: var(--bg-secondary);
  padding: 15px;
  border-radius: 4px;
  border-left: 4px solid var(--accent-prison);
}

.contribute-form {
  background: var(--bg-card);
  border: 3px solid var(--border-color);
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 8px 16px var(--shadow);
}

.form-section {
  margin-bottom: 30px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.label-text {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.label-hint {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.form-select,
.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: "Courier New", monospace;
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-crous);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.url-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.url-input {
  flex: 1;
}

.remove-btn {
  background: var(--accent-prison);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.remove-btn:hover {
  background: #b91c1c;
  transform: scale(1.05);
}

.add-url-btn {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  width: 100%;
}

.add-url-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent-crous);
  color: var(--accent-crous);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.submit-btn {
  background: var(--accent-crous);
  color: white;
  border: none;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 2px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.submit-btn:hover:not(:disabled) {
  background: var(--accent-prison);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.back-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  border: 2px solid var(--border-color);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  border-radius: 8px;
  text-align: center;
  font-family: "Courier New", monospace;
  transition: all 0.3s ease;
  display: block;
}

.back-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent-crous);
  color: var(--accent-crous);
}

/* Footer */
.footer {
  border-top: 3px solid var(--border-color);
  padding: 30px 20px;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.credits {
  font-size: 14px;
  color: var(--text-secondary);
}

.github-link,
.repo-link {
  color: var(--accent-crous);
  text-decoration: none;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.github-link:hover,
.repo-link:hover {
  color: var(--accent-prison);
  text-decoration: underline;
}

@media (max-width: 767px) {
  .container {
    padding: 10px;
  }

  .header {
    padding: 20px 10px;
    margin-bottom: 20px;
  }

  .score-board {
    gap: 20px;
    padding: 15px;
  }

  .game-area {
    gap: 20px;
  }

  .evidence-photo,
  .interrogation-panel {
    padding: 15px;
  }

  .verdict-btn {
    padding: 20px;
  }

  .btn-icon {
    font-size: 36px;
  }

  .btn-text {
    font-size: 20px;
  }

  .result-content {
    padding: 30px 20px;
  }

  .result-icon {
    font-size: 60px;
  }

  .result-text {
    font-size: 24px;
  }

  .result-detail {
    font-size: 16px;
  }

  .contribute-form {
    padding: 20px;
  }

  .contribute-intro {
    padding: 20px;
  }

  .url-input-group {
    flex-direction: column;
  }

  .remove-btn {
    width: 100%;
  }
}
