/* style.css — Piaski w zagadkach */

/* ── Reset / base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #FDF6EC;
  color: #2C1A0E;
  min-height: 100dvh;
  padding: 1rem;
}

/* ── Typography helpers ───────────────────────────────────────────────────── */
h1 {
  font-size: 1.5rem;
  line-height: 1.3;
  color: #2C1A0E;
}

p { line-height: 1.6; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

/* Primary (amber) */
button.btn-primary {
  background: #C8700A;
  color: #fff;
}
button.btn-primary:hover:not(:disabled) { background: #A05808; }

/* Ghost / outlined */
button.btn-ghost {
  background: transparent;
  color: #C8700A;
  border: 2px solid #C8700A;
  width: auto;
  align-self: flex-end;
}
button.btn-ghost:hover:not(:disabled) { background: #FFF0DC; }

/* Disabled state (shared) */
button:disabled {
  background: #B0A8A0;
  border-color: #B0A8A0;
  color: #fff;
  cursor: not-allowed;
}

/* ── Text input ───────────────────────────────────────────────────────────── */
input[type="text"] {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  border: 2px solid #B0A8A0;
  border-radius: 6px;
  background: #FFF8F0;
  color: #2C1A0E;
  outline: none;
}
input[type="text"]:focus { border-color: #C8700A; }
input[type="text"]:disabled { background: #EDE8E0; color: #6B5744; }

/* ── App wrapper & fade transition ───────────────────────────────────────── */
#app {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 2rem);
  opacity: 1;
  transition: opacity 0.25s ease;
}

#app.fading { opacity: 0; }

/* ── Intro screen ─────────────────────────────────────────────────────────── */
.intro-screen {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 3rem;
}

.intro-screen h1 { font-size: 1.75rem; }

.intro-screen p {
  color: #6B5744;
  font-size: 1rem;
}

/* ── Stage screen ─────────────────────────────────────────────────────────── */
.stage-screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
  flex: 1;
}

.stage-bottom {
  margin-top: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stage-bottom > .btn-primary {
  margin-top: auto;
  margin-bottom: 1rem;
}

.stage-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6B5744;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stage-points-and-label {
  display: flex;
  gap: 0.5rem;
}

.stage-riddle {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.7;
  background: #FFF8F0;
  border-left: 4px solid #C8700A;
  padding: 1rem 1rem 1rem 0.875rem;
  border-radius: 0 6px 6px 0;
}

.stage-points {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6B5744;
}

/* Hint area */
.hint-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hint-text {
  background: #FFF8F0;
  border: 1px solid #B0A8A0;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  color: #6B5744;
}

/* On-site question section */
.question-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #FFF8F0;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #B0A8A0;
}

.submit-group {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

[hidden] {
  display: none;
}

.question-heading {
  font-size: 1.25rem;
  color: #2C1A0E;
}

.question-text {
  font-weight: 600;
  font-size: 1rem;
}

.answer-error {
  color: #B94040;
  font-size: 0.9rem;
}

.answer-success {
  color: #2E6E3E;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ── Outro screen ─────────────────────────────────────────────────────────── */
.outro-screen {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 3rem;
  text-align: center;
}

.outro-screen h1 { font-size: 1.75rem; }

.outro-screen p { color: #6B5744; }

.outro-score {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2C1A0E;
}
