.riddle-page {
  max-width: 1160px;
  margin: auto;
  padding: 2.5rem 1rem 4rem;
  font-family: system-ui, sans-serif;
  color: #20392b;
}
.riddle-heading { text-align: center; margin-bottom: 2rem; }
.riddle-heading h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin: 0; }
.riddle-heading p { margin: .6rem 0 0; }
.riddle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1.5rem; }
.riddle {
  margin: 0;
  overflow: hidden;
  border: 1px solid #b99660;
  border-radius: 1.25rem;
  background: #fff7e8;
  box-shadow: 0 12px 32px #312a1919;
}
.riddle-card { display: grid; gap: .85rem; padding: 1.3rem; cursor: pointer; list-style: none; }
.riddle-card::-webkit-details-marker { display: none; }
.riddle-edition { color: #664721; font-weight: 700; font-size: .9rem; }
.riddle-title { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; }
.riddle-art { position: relative; display: block; }
.riddle-scene { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; object-position: center top; border-radius: .65rem; }
.riddle-badge { position: absolute; top: 13%; left: 5.8%; width: 9.5%; height: 24%; display: grid; place-items: center; background: #1e3428; border-radius: 34%; box-shadow: inset 0 0 0 1px #a98c52; }
.riddle-badge img { width: 92%; height: 92%; object-fit: contain; }
.riddle-question { font-size: 1.1rem; line-height: 1.6; font-weight: 700; min-height: 3.5em; }
.riddle-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.riddle-option { display: flex; align-items: center; gap: .5rem; padding: .55rem; background: #fffcf5; border: 1px solid #d8ba8b; border-radius: .55rem; }
.riddle-option b { display: inline-grid; place-items: center; flex: 0 0 1.65rem; height: 1.65rem; border-radius: 50%; background: #e0e9df; }
.riddle-open, .riddle-form button {
  font: inherit; font-weight: 700; color: white; background: #244b36;
  padding: .65rem .85rem; border: 1px solid #244b36; border-radius: .55rem;
}
.riddle-open { text-align: center; }
.riddle-form { border-top: 1px solid #d8ba8b; padding: 1rem 1.3rem 1.3rem; }
.riddle-entry { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.riddle-entry input { font: inherit; min-width: 0; flex: 1 1 7rem; padding: .6rem; border: 1px solid #87683f; border-radius: .55rem; color: #20392b; background: white; }
.riddle-form button { cursor: pointer; }
.riddle-form button:disabled { opacity: .55; cursor: default; }
.riddle-result { margin: .65rem 0; font-weight: 700; }
.riddle-result:empty { margin: 0; }
.riddle-result[data-state="wrong"], .riddle-result[data-state="invalid"] { color: #8a2523; }
.riddle-result[data-state="valid"] { color: #1a5e39; }
.riddle :focus-visible { outline: 3px solid #a46316; outline-offset: 2px; }
.riddle-card:focus-visible { outline-offset: -5px; }
@media (max-width: 700px) { .riddle-grid { grid-template-columns: 1fr; } }
.riddle-grid + .riddle-grid { margin-top: 1.5rem; }
.riddle-links, .riddle-filters { display: flex; flex-wrap: wrap; gap: .85rem; }
.riddle-links { justify-content: center; margin-top: 1rem; }
.riddle-links a, .riddle-panel summary, .riddle-filters button {
  border: 1px solid #244b36;
  border-radius: .55rem;
  padding: .55rem .85rem;
  color: #244b36;
  background: #fff;
}
.riddle-panel { padding: .9rem; background: #f6f0e4; border-radius: .8rem; margin-bottom: 1.5rem; }
.riddle-panel summary { width: fit-content; cursor: pointer; font-weight: 700; }
.riddle-panel label { display: block; margin-top: .8rem; }
.riddle-page select { font: inherit; padding: .4rem; border: 1px solid #795e37; background: #fff; border-radius: .45rem; }
.riddle-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: .5rem; }
.riddle-stats div { padding: .6rem; background: #fff; border-radius: .45rem; }
.riddle-stats dd { font-size: 1.4rem; font-weight: bold; margin: 0; }
.riddle-archive-list { flex: 0 0 100%; padding: 0; list-style: none; }
.riddle-archive-list li { padding: .75rem; border-bottom: 1px solid #d8ba8b; }
.riddle-archive-list li span { display: block; }
.riddle-page [hidden] { display: none; }
.riddle-views { font-size: .9rem; color: #624b32; }
.riddle-wrong { padding: .55rem .75rem; border-radius: .5rem; background: #f8e5bc; color: #583917; font-weight: 700; text-align: center; }
.riddle-meta { color: #355b46; font-weight: 700; font-size: .95rem; }
.riddle-scene.riddle-upload { aspect-ratio:auto; max-height:650px; object-fit:contain; background:#e9e3d5; }
.riddle-learning { background:#e6f1e7; border:1px solid #88ac91; padding:.85rem; border-radius:.65rem; margin:.7rem 0; }
.riddle-learning a { display:inline-block; margin-inline-end:1rem; color:#185839; text-decoration:underline; }
.riddle-archive-list li { display:flex; gap:1rem; align-items:center; background:#fff; border-radius:.8rem; margin:.5rem 0; }
.riddle-archive-list img { width:112px; height:82px; object-fit:contain; background:#f4eee1; border-radius:.55rem; flex-shrink:0; }
.riddle-archive-list a { font-weight:bold; font-size:1.1rem; }
.riddle-solved-tag { color:#17633c; font-weight:700; margin-top:.3rem; }
.riddle-feature-heading,.riddle-next{margin-inline:auto;max-width:47rem}
.riddle-feature-heading{margin-bottom:.4rem}.riddle-next{margin-bottom:1rem;color:#355b46}
.riddle-grid{grid-template-columns:minmax(0,1fr);max-width:47rem;margin-inline:auto}
.riddle-page>.riddle-grid{margin-bottom:1.8rem}
.riddle-question{min-height:0;margin:0 0 .8rem}
.riddle-art img{max-height:17rem}
.riddle-card:after{content:'افتح البطاقة';font-weight:700;color:#244b36}
.riddle[open]>.riddle-card:after{content:'أخفِ البطاقة'}
.riddle-form .riddle-option{min-height:46px;text-align:start;color:#20392b;background:#fff;border-color:#b79663}
.riddle-form .riddle-option:not(:disabled):hover,.riddle-form .riddle-option[data-correct]{background:#e6f1e7;border-color:#367255}
.riddle-form .riddle-option[data-correct]{opacity:1}
.riddle-hint{margin-bottom:.75rem;color:#355b46}.riddle-hint summary{cursor:pointer;font-weight:750}
.riddle-adventure{margin:2rem auto;max-width:47rem}
.riddle-adventure-series{border:1px solid #d8ba8b;border-radius:1rem;padding:clamp(.8rem,3vw,1.4rem);background:#f8f4e9;margin-bottom:1rem}
.riddle-adventure-series h3{font-size:1.3rem;margin:0 0 .4rem}
.riddle-adventure-series ol{padding:0;list-style:none;display:grid;gap:.7rem}
.riddle-adventure-series li>strong{display:block;margin:.45rem 0}
.riddle-adventure-locked{padding:.55rem .8rem;border:1px solid #d9d8c9;border-radius:.6rem;background:white}
.riddle-adventure-locked time{display:block;color:#496457}
@media(max-width:500px){.riddle-form .riddle-options{grid-template-columns:1fr}.riddle-card,.riddle-form{padding:.85rem}}
