﻿:root {
  color-scheme: light;
  font-family: Georgia, "Times New Roman", serif;
  color: #332516;
  background: #172a34;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 15% 15%, rgb(224 174 75 / 13%), transparent 28%),
    radial-gradient(circle at 85% 85%, rgb(224 174 75 / 10%), transparent 30%),
    linear-gradient(135deg, #10232d, #223d45 55%, #13262f);
}

.card {
  position: relative;
  width: min(100%, 520px);
  padding: clamp(24px, 6vw, 44px);
  overflow: hidden;
  border: 2px solid #c59845;
  border-radius: 4px;
  background:
    linear-gradient(105deg, rgb(255 255 255 / 18%) 0 1px, transparent 1px 9px),
    linear-gradient(0deg, rgb(117 76 23 / 5%), rgb(255 248 217 / 92%)),
    #f6e7bd;
  box-shadow: 0 22px 60px rgb(0 0 0 / 35%), inset 0 0 0 7px rgb(165 116 43 / 12%);
}

.card::after {
  position: absolute;
  inset: 12px;
  border: 1px solid rgb(139 96 35 / 35%);
  pointer-events: none;
  content: "";
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  color: #8a5b1c;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
}

h1, h2 { margin-top: 0; font-weight: 700; }
h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  color: #332516;
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  text-align: center;
  text-shadow: 1px 1px 0 #fff3c9;
}
.intro {
  position: relative;
  z-index: 1;
  margin: 0 0 28px;
  color: #604a2b;
  line-height: 1.5;
  text-align: center;
}

form { position: relative; z-index: 1; display: grid; gap: 8px; }
label { margin-top: 8px; color: #4e371c; font-weight: 700; }
input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #b99654;
  border-radius: 2px;
  background: rgb(255 252 235 / 72%);
  color: #332516;
  font: inherit;
  font-size: 1rem;
}
input:focus { border-color: #8a5b1c; outline: 3px solid rgb(138 91 28 / 20%); }
.hint { margin: 0 0 4px; color: #80653d; font-size: .85rem; }

button {
  margin-top: 16px;
  padding: 13px 16px;
  border: 0;
  border-radius: 2px;
  background: #9b6820;
  color: #fff8df;
  font: inherit;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 3px 0 #634114;
}
button:hover { background: #7d5117; }
button:disabled { cursor: wait; opacity: .65; }

.status {
  position: relative;
  z-index: 1;
  min-height: 1.4em;
  margin: 20px 0 0;
  color: #604a2b;
  font-weight: 600;
  text-align: center;
}
.status.error { color: #9d2d21; }

.result-card {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding: 20px;
  border: 1px dashed #b99654;
  border-radius: 2px;
  background: rgb(255 248 217 / 65%);
}
.result-card h2 { margin-bottom: 18px; color: #4e371c; }
#result-text { margin: -10px 0 18px; color: #604a2b; line-height: 1.5; white-space: pre-wrap; }
dl { margin: 0; }
dl > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgb(160 117 50 / 35%);
}
dt { color: #80653d; }
dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
#check-result.correct { color: #28663c; }
#check-result.incorrect { color: #9d2d21; }

.success-popup {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(8 25 31 / 72%);
}
.success-popup[hidden] { display: none; }
.success-popup-card {
  position: relative;
  width: min(100%, 460px);
  padding: 34px 28px 28px;
  border: 2px solid #c59845;
  border-radius: 4px;
  background: #f6e7bd;
  box-shadow: 0 22px 60px rgb(0 0 0 / 45%);
  text-align: center;
}
.success-popup-card h2 { color: #28663c; }
.success-popup-card p { color: #4e371c; line-height: 1.6; }
.success-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  margin: 0;
  padding: 0 8px;
  background: transparent;
  color: #604a2b;
  font-size: 1.8rem;
  line-height: 1;
  box-shadow: none;
}
.success-popup-close:hover { background: transparent; color: #9d2d21; }

@media (max-width: 420px) {
  .page-shell { padding: 12px; }
  .card { border-radius: 12px; }
  dl > div { grid-template-columns: 1fr; gap: 3px; }
}
.cache-card {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #b99654;
  border-radius: 2px;
  background: rgb(255 248 217 / 55%);
}
.cache-card h2 { margin-bottom: 10px; color: #4e371c; }
#cache-text { margin: 0 0 10px; color: #604a2b; line-height: 1.5; white-space: pre-wrap; }
.cache-code { margin: 0; color: #80653d; font-size: .9rem; }
.cache-code strong { color: #4e371c; }
