:root{
  --paper: #F4EEDF;
  --paper-line: #E1D6BC;
  --ink: #262530;
  --ink-soft: #5B5A66;
  --red: #A73429;
  --red-soft: #C97A6F;
  --gold: #B08A2C;
  --green: #4C6A50;
  --white: #FFFDF7;
  --radius: 18px;
}

*{ box-sizing: border-box; }

html,body{
  margin:0; padding:0;
  min-height:100%;
  background:
    repeating-linear-gradient(to bottom, transparent, transparent 37px, var(--paper-line) 38px),
    var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
}

.stage{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  padding: 34px 20px 60px;
  max-width: 560px;
  margin: 0 auto;
}

/* --- signature: nesting rings progress --- */
.rings{
  width: 128px;
  height: 128px;
  margin-bottom: 18px;
  flex-shrink:0;
}
.ring{
  fill:none;
  stroke: var(--paper-line);
  stroke-width: 4;
  transition: stroke 0.5s ease, stroke-width 0.5s ease;
}
.ring[data-ring="1"].filled{ stroke: var(--red); }
.ring[data-ring="2"].filled{ stroke: var(--gold); }
.ring[data-ring="3"].filled{ stroke: var(--green); }
.ring[data-ring="4"].filled{ stroke: var(--red-soft); }
.ring[data-ring="5"].filled{ stroke: var(--ink); }
.ring.filled{ stroke-width: 5; }
.rings-num{
  font-family:"IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 600;
  fill: var(--ink);
}

/* --- screens --- */
.screen{
  display:none;
  width:100%;
  text-align:center;
  animation: rise 0.45s ease;
}
.screen[data-active="true"]{ display:block; }
@keyframes rise{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}

.eyebrow{
  font-family:"IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 6px;
}

.title{
  font-family:"Caveat", cursive;
  font-weight:700;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 14px;
  color: var(--ink);
}

.lede{
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 440px;
  margin: 0 auto 26px;
}

.hint{
  font-family:"IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 18px;
}

/* --- nickname form --- */
#nickname-form{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: 0 10px 24px rgba(38,37,48,0.06);
}
.field-label{
  align-self:flex-start;
  font-family:"IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
#nickname{
  width: 100%;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.15rem;
  padding: 12px 14px;
  border: 1.5px solid var(--paper-line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
#nickname:focus{ border-color: var(--red); }

.btn-primary{
  margin-top: 6px;
  width: 100%;
  font-family:"IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight:600;
  letter-spacing: 0.03em;
  color: var(--white);
  background: var(--red);
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  cursor:pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn-primary:hover:not(:disabled){ background: #8E2B21; }
.btn-primary:active:not(:disabled){ transform: scale(0.98); }
.btn-primary:disabled{
  background: var(--paper-line);
  color: var(--ink-soft);
  cursor: not-allowed;
}

/* --- quiz screen --- */
.quiz-head{
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-family:"IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.quiz-player{ color: var(--red); font-weight:600; }

.question{
  font-family: "Source Serif 4", Georgia, serif;
  font-weight:600;
  font-size: 1.4rem;
  line-height: 1.4;
  margin: 0 0 22px;
  text-align:left;
}

.options{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-bottom: 22px;
}
.option{
  text-align:left;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.02rem;
  background: var(--white);
  border: 1.5px solid var(--paper-line);
  border-radius: 12px;
  padding: 13px 16px;
  cursor:pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option:hover{ border-color: var(--gold); }
.option.selected{ border-color: var(--ink); background: #EFE9D8; }
.option.correct{
  border-color: var(--green);
  background: #E7EFE6;
}
.option.incorrect{
  border-color: var(--red);
  background: #F6E6E3;
}
.option[disabled]{ cursor: default; }

/* --- result screen --- */
.review{
  text-align:left;
  border-top: 1px solid var(--paper-line);
  margin-top: 8px;
  padding-top: 16px;
}
.review-item{
  display:flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--paper-line);
  font-size: 0.95rem;
}
.review-item:last-child{ border-bottom:none; }
.review-mark{
  flex-shrink:0;
  font-family:"IBM Plex Mono", monospace;
  font-weight:600;
}
.review-mark.ok{ color: var(--green); }
.review-mark.no{ color: var(--red); }

@media (max-width: 400px){
  .rings{ width: 104px; height: 104px; }
  .title{ font-size: 2.1rem; }
}
