* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
  background: #1a1a2e;
  color: #fff;
  min-height: 100vh;
  font-size: 16px;
}

/* ===== LOCK SCREEN ===== */
#lock-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
#lock-screen h1 {
  font-size: 3em; margin-bottom: 14px;
  background: linear-gradient(135deg, #f093fb, #f5576c, #4facfe);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
#lock-screen .subtitle { color: #aaa; margin-bottom: 30px; font-size: 1.1em; }
.lock-box {
  background: #16213e;
  border-radius: 16px;
  padding: 40px;
  width: 100%; max-width: 440px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lock-box .lock-icon { font-size: 3.5em; margin-bottom: 16px; }
.lock-box label {
  display: block; text-align: left;
  color: #4facfe; font-weight: bold;
  margin-bottom: 8px;
}
.lock-box input {
  width: 100%; padding: 14px;
  border: 2px solid #333; border-radius: 10px;
  background: #0f3460; color: #fff;
  font-size: 1.1em;
}
.lock-box button {
  width: 100%; padding: 14px;
  margin-top: 18px;
  border: none; border-radius: 10px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: #1a1a2e;
  font-size: 1.2em; font-weight: bold;
  cursor: pointer;
  transition: transform .2s;
}
.lock-box button:hover { transform: scale(1.03); }
.lock-error {
  color: #f44336; margin-top: 12px;
  min-height: 1.4em; font-weight: bold;
}
.lock-back { margin-top: 16px; }
.lock-back a { color: #888; text-decoration: none; font-size: 0.9em; }
.lock-back a:hover { color: #4facfe; text-decoration: underline; }

/* ===== ADMIN PANEL ===== */
#admin-panel {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}
#admin-panel.show { display: block; }

.admin-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
.admin-header h1 {
  font-size: 2em;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.admin-header .header-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.header-actions button, .header-actions a {
  padding: 10px 18px;
  border: none; border-radius: 8px;
  font-size: 0.95em; font-weight: bold;
  cursor: pointer; color: #fff;
  text-decoration: none;
  display: inline-block;
}
.btn-import { background: #1976d2; }
.btn-export { background: #388e3c; }
.btn-reset { background: #c62828; }
.btn-game { background: #667eea; }

.stats-bar {
  display: flex; gap: 16px;
  background: #16213e;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stat-item {
  display: flex; align-items: baseline; gap: 6px;
}
.stat-item .label { color: #aaa; font-size: 0.9em; }
.stat-item .value {
  color: #4facfe; font-weight: bold; font-size: 1.4em;
}

/* Add form */
.add-form {
  background: #16213e;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 2px dashed #4facfe;
}
.add-form h3 { margin-bottom: 14px; color: #4facfe; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.form-row label {
  display: block; margin-bottom: 6px;
  font-size: 0.9em; color: #aaa;
}
.form-row textarea, .form-row input {
  width: 100%; padding: 10px;
  border: 2px solid #333;
  border-radius: 8px;
  background: #0f3460;
  color: #fff;
  font-size: 1em;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
}
.form-row input { min-height: auto; }
.btn-add {
  padding: 12px 24px;
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: #fff;
  border: none; border-radius: 8px;
  font-weight: bold; cursor: pointer;
  font-size: 1em;
  height: fit-content;
}
.btn-add:hover { transform: scale(1.03); }

/* List */
.quiz-list {
  background: #16213e;
  border-radius: 12px;
  overflow: hidden;
}
.quiz-item {
  display: grid;
  grid-template-columns: 50px 1fr 1fr auto;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  align-items: center;
}
.quiz-item:last-child { border-bottom: none; }
.quiz-item:hover { background: rgba(79, 172, 254, 0.06); }
.quiz-item.editing { background: rgba(79, 172, 254, 0.12); }
.quiz-num {
  color: #4facfe; font-weight: bold; font-size: 1.1em;
  text-align: center;
}
.quiz-q, .quiz-a {
  line-height: 1.5;
  font-size: 0.95em;
  white-space: pre-wrap;
  word-break: break-word;
}
.quiz-a { color: #a5d6a7; }
.quiz-item textarea {
  width: 100%; padding: 8px;
  border: 1px solid #4facfe;
  border-radius: 6px;
  background: #0f3460;
  color: #fff;
  font-family: inherit;
  font-size: 0.95em;
  min-height: 60px;
  resize: vertical;
}
.quiz-actions {
  display: flex; gap: 6px;
}
.quiz-actions button {
  padding: 7px 12px;
  border: none; border-radius: 6px;
  font-size: 0.85em;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
}
.btn-edit { background: #1976d2; }
.btn-save { background: #388e3c; }
.btn-cancel { background: #777; }
.btn-del { background: #c62828; }

.empty-state {
  padding: 40px;
  text-align: center;
  color: #888;
}

/* File input hidden */
#import-file { display: none; }

/* Toast */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #16213e;
  border: 2px solid #4facfe;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: bold;
  z-index: 200;
  transition: transform .3s, opacity .3s;
  opacity: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
#toast.success { border-color: #4caf50; }
#toast.error { border-color: #f44336; }
