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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #1e1e1e;
  color: #e0e0e0;
}

.header {
  background: #2d2d2d;
  padding: 15px 20px;
  border-bottom: 1px solid #3e3e3e;
  display: flex;
  align-items: center;
  gap: 20px;
}

.home-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #3e3e3e;
  color: #e0e0e0;
  text-decoration: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.home-btn:hover {
  background: #4a4a4a;
  color: #4ec9b0;
  border-color: #4ec9b0;
}

.home-btn svg {
  transition: transform 0.2s;
}

.home-btn:hover svg {
  transform: translateX(-2px);
}

.header h2 {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
}

.container {
  display: flex;
  flex: 1;
  gap: 10px;
  padding: 10px;
  min-height: 0;
}

.editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #3e3e3e;
  border-radius: 4px;
  overflow: hidden;
  background: #1e1e1e;
}

.right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.panel-label {
  background: #252526;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #b0b0b0;
  border-bottom: 1px solid #3e3e3e;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#editor {
  flex: 1;
  min-height: 0;
}

.preview-panel {
  flex: 2;
  display: flex;
  flex-direction: column;
  border: 1px solid #3e3e3e;
  border-radius: 4px;
  overflow: hidden;
  background: white;
}

#preview {
  flex: 1;
  border: none;
  background: white;
}

.challenge-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #3e3e3e;
  border-radius: 4px;
  overflow: hidden;
  background: #1e1e1e;
  min-height: 0;
}

.challenge-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  color: #d4d4d4;
  line-height: 1.6;
  font-size: 13px;
}

.challenge-content h3 {
  color: #4ec9b0;
  margin-bottom: 10px;
  font-size: 14px;
}

.challenge-content p {
  margin-bottom: 10px;
}

.challenge-content code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  color: #ce9178;
  font-family: "Courier New", monospace;
}

.example-box {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid #007acc;
  padding: 10px;
  margin: 10px 0;
  border-radius: 3px;
  font-size: 12px;
}

.check-button {
  background: #007acc;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.check-button:hover {
  background: #005a9e;
}

.refresh-button {
  background: #3e3e3e;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-right: 8px;
}

.refresh-button:hover {
  background: #4a4a4a;
}

.result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.result-box {
  background: #2d2d2d;
  border: 2px solid #4ec9b0;
  border-radius: 8px;
  padding: 30px;
  max-width: 500px;
  text-align: center;
}

.result-box.failed {
  border-color: #f48771;
}

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

.result-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #4ec9b0;
}

.result-box.failed .result-title {
  color: #f48771;
}

.result-message {
  font-size: 14px;
  color: #b0b0b0;
  margin-bottom: 20px;
  line-height: 1.6;
}

.result-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.next-button {
  background: #4ec9b0;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.next-button:hover {
  background: #3eb39a;
}

.retry-button {
  background: #646695;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.retry-button:hover {
  background: #54577a;
}

.requirement-list {
  text-align: left;
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 12px;
}

.requirement-item {
  padding: 4px 0;
}

.requirement-item.pass {
  color: #4ec9b0;
}

.requirement-item.fail {
  color: #f48771;
}
