/* css/style.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #14002e, #2a0469, #11001a);
  background-size: 300% 300%;
  animation: bgMove 12s ease infinite;
  color: #f9fafb;
}

@keyframes bgMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
}

.nav a {
  margin-left: 12px;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.9rem;
}

.nav a:hover {
  text-decoration: underline;
}

.card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: #f97316;
  color: #111827;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.6);
}
 .input {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1rem;
}

.input::placeholder {
  color: #d1d5db;
}
/* AUTH LAYOUT */
.auth-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 35px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 40px rgba(0,0,0,0.35);
  animation: fadeIn 0.7s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.auth-sub {
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 25px;
}

/* INPUTS */
.auth-input {
  width: 100%;
  padding: 14px 16px;
  margin-top: 16px;
  border-radius: 14px;
  border: none;
  outline: none;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 1rem;
  transition: 0.2s;
}

.auth-input:focus {
  background: rgba(255,255,255,0.25);
  transform: scale(1.02);
}

/* BUTTON */
.auth-btn {
  width: 100%;
  margin-top: 28px;
  padding: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 16px;
}

.auth-btn:hover {
  transform: translateY(-2px);
}

/* SWITCH TEXT */
.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 0.95rem;
}

.auth-switch a {
  color: #fbbf24;
  margin-left: 4px;
}

/* MESSAGE */
.auth-msg {
  text-align: center;
  margin-top: 14px;
  min-height: 20px;
  font-size: 0.9rem;
}
.quiz-form {
  margin-top: 18px;
}



.field-label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

.field-label-sm {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 2px;
  display: block;
}

.divider {
  margin-top: 18px;
  margin-bottom: 12px;
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
}

/* Question card */
.question-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.6);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.question-remove-btn {
  border: none;
  background: transparent;
  color: #fca5a5;
  font-size: 0.9rem;
  cursor: pointer;
}

.options-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

@media (min-width: 640px) {
  .options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.quiz-option-btn {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  padding: 12px;
  color: white;
  width: 100%;
  border-radius: 12px;
  text-align: left;
  margin: 6px 0;
  cursor: pointer;
  transition: 0.25s;
  position: relative;
  overflow: hidden;
}

.quiz-option-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

.quiz-option-selected {
  background: #4b5563;
  box-shadow: 0 0 0 2px #fbbf24;
}
.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-row .input {
  flex: 1;
}

.btn-secondary {
  background: #111827;
  color: #f9fafb;
}

.quiz-form {
  margin-top: 18px;
}


.field-label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

.field-label-sm {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 2px;
  display: block;
}

.divider {
  margin-top: 18px;
  margin-bottom: 12px;
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
}

.question-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.6);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.question-remove-btn {
  border: none;
  background: transparent;
  color: #fca5a5;
  font-size: 0.9rem;
  cursor: pointer;
}

.options-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

@media (min-width: 640px) {
  .options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.option-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.option-row .correct-radio {
  accent-color: #fbbf24;
  cursor: pointer;
}

.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-row .input {
  flex: 1;
}

.btn-secondary {
  background: #111827;
  color: #f9fafb;
}
/* LEADERBOARD TABLE */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.lb-table thead {
  background: linear-gradient(135deg, #f97316, #facc15);
}

.lb-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #111827;
}

.lb-table td {
  padding: 10px 12px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.lb-table tr:last-child td {
  border-bottom: none;
}

/* row hover */
.lb-table tbody tr {
  transition: background 0.2s, transform 0.15s;
}

.lb-table tbody tr:hover {
  background: rgba(55, 65, 81, 0.85);
  transform: translateY(-1px);
}

/* rank pill */
.lb-table td:first-child {
  width: 50px;
}

.lb-table .rank-pill {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* top 3 colors */
.lb-row-1 .rank-pill {
  background: #facc15;
  color: #111827;
}

.lb-row-2 .rank-pill {
  background: #e5e7eb;
  color: #111827;
}

.lb-row-3 .rank-pill {
  background: #9ca3af;
  color: #111827;
}

/* others */
.lb-row-normal .rank-pill {
  background: rgba(31, 41, 55, 0.9);
  color: #e5e7eb;
}

/* responsive */
@media (max-width: 640px) {
  .lb-table th:nth-child(5),
  .lb-table td:nth-child(5) {
    display: none; /* Date hide on very small screens */
  }
}
/* highlight for current user row */
.lb-row-me {
  box-shadow: 0 0 0 2px #22c55e;
  position: relative;
}

.lb-row-me td {
  background: linear-gradient(90deg, rgba(34,197,94,0.15), transparent);
}

.lb-row-me .rank-pill {
  border: 2px solid #22c55e;
}
.timer-box {
  background: rgba(255, 65, 65, 0.15);
  color: #f87171;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.timer-progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

#timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  transition: width 0.3s linear;
}
.field-row {
    margin-bottom: 18px !important;
}

#quiz-duration {
    display: block !important;
    opacity: 1 !important;
}
