/* QuizMe - białe tło, klasyczne kolory, mobile-first */
:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12);
  --green: #16a34a;
  --green-bg: #dcfce7;
  --green-soft: rgba(22, 163, 74, 0.2);
  --red: #dc2626;
  --red-bg: #fee2e2;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--white);
  min-height: 100vh;
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Karty na białym tle */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* Przyciski */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px 24px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

/* Pole tekstowe */
input[type="text"] {
  width: 100%;
  padding: 16px 18px;
  font-size: 18px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

/* Landing */
.landing-header {
  text-align: center;
  padding: 48px 0 32px;
  color: var(--gray-800);
}

.landing-header h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  color: var(--gray-800);
}

.landing-header .sub {
  font-size: 18px;
  color: var(--gray-600);
  margin-bottom: 32px;
}

.landing-cta .btn {
  font-size: 20px;
  padding: 20px;
}

/* Jak to działa */
.how-section {
  margin-top: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--gray-200);
}

.how-section h2 {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
  color: var(--gray-800);
}

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

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--gray-50);
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.step-num {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.step p {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--gray-800);
}

/* Create quiz */
.create-step {
  display: none;
}

.create-step.active {
  display: block;
}

.create-subtitle {
  font-size: 16px;
  color: var(--gray-600);
  margin-bottom: 8px;
  font-weight: 600;
}

.question-text-create {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.4;
  color: var(--gray-800);
}

.create-nav-single .btn {
  margin-top: 16px;
}

.create-step h2 {
  font-size: 22px;
  margin-bottom: 24px;
  color: var(--gray-800);
}

.create-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.create-nav .btn {
  flex: 1;
}

/* Pytania w tworzeniu */
.question-block {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.question-block:last-child {
  border-bottom: none;
}

.question-block label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.question-block input.question-text {
  margin-bottom: 12px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.option-row input {
  flex: 1;
  margin-bottom: 0;
}

.option-row .opt-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  font-size: 20px;
  flex-shrink: 0;
}

.option-row.correct input {
  border-color: #22c55e;
  background: #f0fdf4;
}

.option-row .mark-correct {
  padding: 10px 14px;
  font-size: 14px;
  width: auto;
}

/* Quiz (robienie) */
.quiz-start .card {
  text-align: center;
  padding: 36px 24px;
}

.quiz-start h1 {
  font-size: 26px;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.quiz-start .meta {
  color: var(--gray-600);
  font-size: 16px;
  margin-bottom: 28px;
}

.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.quiz-question h2 {
  font-size: 20px;
  margin-bottom: 24px;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-options .btn {
  text-align: left;
  padding: 18px 20px;
  font-weight: 600;
  font-size: 17px;
  background: var(--gray-100);
  color: var(--gray-800);
  border: 2px solid transparent;
  transition: background 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.quiz-options .btn:hover:not(:disabled) {
  background: var(--gray-200);
}

.quiz-options .btn:disabled {
  cursor: default;
}

/* Odpowiedź poprawna (wybrana przez gracza) – świeci na zielono */
.quiz-options .btn.correct {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(22, 163, 74, 0.4);
}

/* Odpowiedź błędna (wybrana przez gracza) – świeci na czerwono */
.quiz-options .btn.wrong {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);
}

/* Prawidłowa odpowiedź, której nie wybrano – przezroczysty zielony */
.quiz-options .btn.correct-reveal {
  background: var(--green-soft);
  color: var(--green);
  border: 2px solid rgba(22, 163, 74, 0.5);
  box-shadow: 0 0 12px rgba(22, 163, 74, 0.25);
}

.btn-skip {
  display: none !important; /* Ukryty – nie ma opcji pomijania przy rozwiązywaniu */
}


.replacement-hint {
  font-size: 14px;
  color: var(--gray-600);
  margin: -8px 0 16px 0;
}

/* Wynik quizu */
.result-screen {
  text-align: center;
  padding: 32px 24px;
}

.result-score {
  font-size: 72px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 16px;
}

.result-text {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 28px;
  color: var(--gray-800);
}

.result-form input {
  margin-bottom: 12px;
}

.result-form .btn {
  margin-top: 8px;
}

/* Ranking */
.ranking-title {
  color: var(--gray-800);
  text-align: center;
  padding: 32px 0 24px;
}

.ranking-title h1 {
  font-size: 24px;
  font-weight: 800;
}

.ranking-list {
  list-style: none;
}

.ranking-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 18px;
  font-weight: 600;
}

.ranking-list li.highlight {
  background: var(--green-bg);
  border-radius: var(--radius-sm);
  border: 2px solid var(--green);
}

.ranking-list .pos {
  width: 36px;
  font-weight: 800;
  color: var(--gray-600);
}

.ranking-list .name {
  flex: 1;
}

.ranking-list .score {
  color: var(--primary);
  font-weight: 800;
}

.ranking-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-bar {
  background: var(--gray-100);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.link-bar span {
  flex: 1;
  color: var(--gray-600);
}

.link-bar .btn {
  width: auto;
  padding: 10px 16px;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.add-option-btn {
  margin-top: 8px;
  padding: 12px;
  font-size: 15px;
  width: 100%;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 16px;
  display: inline-block;
}

.back-link:hover {
  text-decoration: underline;
}

@media (min-width: 600px) {
  .landing-header h1 {
    font-size: 34px;
  }
  .container {
    padding: 32px 24px;
  }
}
