:root {
  --bg-color: #f0f0f0;
  --primary-color: #ffffff;
  --secondary-color: #eef2f5;
  --accent-color: #d9534f;
  --text-color: #34495e;
  --btn-color: #007bff;
  --btn-hover-color: #0056b3;
  --success-color: #2ecc71;
  --fail-color: #e74c3c;
  --wait-color: #95a5a6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 900px;
  background-color: var(--primary-color);
  border-radius: 16px;
  padding: 30px 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e4e8;
}

/* 사이트 헤더 스타일 */
.site-header {
  text-align: center;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 2px solid #e1e4e8;
}

.site-title {
  font-size: 3.5em;
  font-weight: 800;
  background: linear-gradient(135deg, #007bff, #0056b3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.site-subtitle {
  font-size: 1.1em;
  color: #7f8c8d;
  font-weight: 500;
  margin: 0;
}

h1, h2 {
  color: var(--text-color);
  text-align: center;
  margin-bottom: 25px;
  font-weight: 600;
}

h1 { font-size: 2.2em; }
h2 { font-size: 1.5em; }

.screen {
  display: none;
  text-align: center;
}

.screen.active {
  display: block;
}

.main-content {
  display: flex;
  gap: 40px;
}

.test-menu {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.menu-item {
  position: relative;
}

.menu-button-wrapper {
  position: relative;
  margin-bottom: 10px;
}

.best-score {
  position: absolute;
  top: -8px;
  right: 8px;
  font-size: 0.8em;
  font-weight: 600;
  color: #007bff;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #007bff;
  white-space: nowrap;
  z-index: 10;
}

.menu-item p {
  margin-top: 8px;
  font-size: 1em;
  color: #7f8c8d;
  font-weight: 500;
}

.history-panel {
  flex: 1;
  background-color: var(--secondary-color);
  padding: 20px;
  border-radius: 12px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.history-header h2 {
  margin-bottom: 0;
  text-align: left;
}

#history-list {
  list-style: none;
  height: 350px;
  overflow-y: auto;
  font-weight: 500;
  text-align: left;
}

#history-list li {
  padding: 8px 5px;
  border-bottom: 1px solid #dce1e6;
  color: #525252;
}

.btn {
  width: 100%;
  padding: 16px;
  font-size: 1.1em;
  font-weight: 600;
  color: white;
  background-color: var(--btn-color);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background-color: var(--btn-hover-color);
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.98) translateY(0);
}

.back-btn {
  margin-top: 20px;
  width: auto;
  padding: 15px 30px;
  background-color: #007bff;
  color: white;
  font-size: 1.1em;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

.btn-reset {
  width: auto;
  padding: 6px 12px;
  font-size: 0.85em;
  font-weight: 600;
  background-color: #ff4757;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset:hover {
  background-color: #ff3742;
}

.status-label {
  text-align: center;
  font-size: 2em;
  margin-bottom: 20px;
  min-height: 40px;
  font-weight: 600;
}

.results-panel {
  margin: 25px 0;
  background-color: var(--secondary-color);
  padding: 20px;
  border-radius: 12px;
  font-size: 1.2em;
  font-weight: 500;
  text-align: left;
}

.results-panel p {
  padding: 4px 0;
}

.average-label {
  text-align: center;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--accent-color);
}

#single-test-box, #key-test-box {
  width: 100%;
  height: 250px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3.5em;
  font-weight: 700;
  color: white;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s;
}

#single-test-box.red, #key-test-box.red {
  background-color: var(--fail-color);
}

#single-test-box.green, #key-test-box.green {
  background-color: var(--success-color);
}

#single-test-box.gray, #key-test-box.gray {
  background-color: var(--wait-color);
}

.multi-test-container {
  display: flex;
  gap: 30px;
}

.multi-grid-panel {
  flex: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  height: 320px;
}

.multi-grid-panel .btn-grid {
  background-color: #dce1e6;
  border: 2px solid #bdc3c7;
  height: 100%;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.1s;
}

.multi-grid-panel .btn-grid.active {
  background-color: var(--success-color);
  border-color: #27ae60;
}

.multi-info-panel {
  flex: 1;
}

#multi-button-screen .status-label {
  font-size: 1.6em;
}

#multi-back-to-main {
  display: block;
  margin: 80px auto 0;
}

#accuracy-target-area, #aim-click-target-area {
  outline: none;
}

.accuracy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-weight: 500;
}

#accuracy-screen .status-label, #aim-click-screen .status-label {
  font-size: 2em;
}

#accuracy-screen .timer-label, #aim-click-screen .timer-label {
  font-size: 2em;
  color: var(--accent-color);
}

#accuracy-target-area, #aim-click-target-area {
  position: relative;
  width: 100%;
  height: 400px;
  background-color: var(--secondary-color);
  border-radius: 12px;
  overflow: hidden;
}

.circle-target {
  position: absolute;
  background-color: var(--btn-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
  user-select: none;
  cursor: crosshair;
}

@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  .main-content, .multi-test-container {
    flex-direction: column;
    gap: 25px;
  }

  h1 {
    font-size: 1.8em;
  }

  .site-title {
    font-size: 2.8em;
  }

  .site-subtitle {
    font-size: 1em;
  }

  #history-list {
    height: 200px;
  }

  .test-menu {
    gap: 25px;
  }
}
