:root {
  color-scheme: dark;
  font-family: "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  color: #fff1d8;
  background: #2a1b15;
  --gold: #efcf8b;
  --soft: #e9cfa7;
  --edge: rgba(236, 196, 125, .48);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(270deg, #20130ee8, #24140d38 62%, #1d100363), url('./desert-lobby.webp') left center / cover no-repeat fixed;
}
.home { display: grid; align-items: center; }
h1, h2, p, figure, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible, .lobby-actions button:focus-visible, select:focus-visible, .province:focus-visible { outline: 3px solid #fff4c0; outline-offset: 3px; }
.shell, .inner {
  padding-block: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-bottom));
  padding-inline: max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-left));
}
.shell { width: min(56%, 560px); }
.brand { display: flex; align-items: center; gap: 10px; margin-block-end: 12px; }
.brand img { width: clamp(48px, 9vw, 74px); height: auto; flex: none; border-radius: 22%; filter: drop-shadow(0 4px 10px #170d08); }
.brand p { font-size: 12px; color: var(--gold); }
.brand h1 { margin-block-start: 2px; font-size: clamp(23px, 4.1vw, 44px); line-height: 1.18; text-shadow: 0 2px 13px #160d08; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 7px 10px;
  border: 1px solid var(--edge); border-radius: 11px;
  background: linear-gradient(145deg, #563625f2, #372319f5);
  box-shadow: 0 3px 0 #1c100ade, inset 0 1px 0 #f9d7a82f;
}
.choice:hover, .choice:focus-visible { filter: brightness(1.12); }
.choice:active { transform: translateY(1px); }
.choice strong, .choice small { display: block; }
.choice strong { font-size: clamp(13px, 2.05vw, 18px); line-height: 1.45; }
.choice small { color: var(--soft); margin-top: 1px; font-size: clamp(9px, 1.47vw, 12px); line-height: 1.45; }
.choice--wide, .choice--play { grid-column: 1 / -1; }
.choice--play {
  min-height: 58px; border-color: #f1d594; background: linear-gradient(125deg, #f2d291, #db9e58);
  color: #2b190d; box-shadow: 0 3px 0 #825226, inset 0 1px 0 #ffedb9;
}
.choice--play small { color: #532e14; }
.choice--play strong { font-size: clamp(16px, 2.5vw, 21px); }
.icon { width: 34px; height: 34px; flex: none; object-fit: contain; }
.home .choice--play { grid-column: auto; }
.home nav.choices .choice {
  background: url('../education/leather-frame.png') center / 100% 100% no-repeat;
  border-color: transparent;
  color: #fff1d8;
}
.home nav.choices .choice small { color: var(--soft); }
.home nav.choices .choice.choice--lesson {
  background-image: url('../education/parchment-frame.png');
  color: #2e1a10;
}
.home nav.choices .choice.choice--lesson small { color: #573821; }
.choice--lesson { border-color: #dcb378; }
.choice.choice--lesson, .lesson-letter .choice {
  background: url('../education/parchment-frame.png') center / 100% 100% no-repeat;
  border-color: transparent;
  color: #2e1a10;
}
.choice.choice--lesson small, .lesson-letter .choice small { color: #573821; }
.lesson-letter { padding: 14px; border: 1px solid #a77747; border-radius: 10px; background: #362319eb; }
.lesson-letter > p { margin: 4px 0 12px; color: var(--soft); font-size: 13px; }
.lesson-letter header { display: flex; gap: 10px; align-items: center; }
.lesson-letter img { width: 50px; height: 50px; object-fit: contain; }
.lesson-letter h2 { font-size: clamp(19px, 3.4vw, 26px); }
.lesson-letter header p { font-size: 12px; color: var(--gold); }
.lesson-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr)); gap: 7px; }
.lesson-letter .choice { width: 100%; min-width: 0; }
.lesson-letter .choice img { width: 34px; height: 34px; }
.lesson-back {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 44px;
  padding: 4px 13px;
  background: url('../education/leather-frame.png') center / 100% 100% no-repeat;
  color: #fff1d8;
  font-size: 13px;
}
.lesson-back img { width: 26px; height: 26px; }
.inner { display: grid; gap: 16px; min-height: 100vh; min-height: 100dvh; }
.map-layout { grid-template-columns: minmax(246px, .85fr) minmax(246px, 1fr); align-items: center; }
.about-layout { justify-items: start; align-items: center; }
.paper {
  width: min(100%, 520px); padding: clamp(12px, 2vw, 22px);
  background: #2a1b14f2; border: 1px solid var(--edge); box-shadow: 0 7px 30px #140c09aa;
  border-radius: 15px;
}
.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-block-end: 8px; }
.page-head h1 { color: var(--gold); font-size: clamp(21px, 3.2vw, 33px); }
.back { display: inline-flex; gap: 7px; align-items: center; min-height: 44px; padding-inline: 10px; border: 1px solid var(--edge); border-radius: 8px; }
.back span { font-size: 19px; }
.paper h2 { font-size: 17px; color: #fff1d8; }
.paper p, .paper dd { color: var(--soft); font-size: 13px; line-height: 1.7; }
.paper label { display: block; margin-block-start: 9px; font-size: 13px; color: var(--gold); }
.paper select { width: 100%; min-height: 44px; color: #fff1d8; background: #3f291c; border: 1px solid var(--edge); border-radius: 8px; font: inherit; padding: 4px 8px; }
.province-name { min-height: 1.7em; margin-block: 4px 6px; }
.paper dt { margin-block: 8px 1px; color: var(--gold); font-weight: 700; font-size: 13px; }
.version { padding-top: 8px; margin-top: 12px; border-top: 1px solid var(--edge); }
.map { display: grid; justify-items: center; min-width: 0; padding: 8px; background: #251914e8; border: 1px solid var(--edge); border-radius: 15px; }
.map svg { width: 100%; height: min(70vh, 570px); display: block; }
.map figcaption { font-size: 12px; color: var(--soft); margin-block: 2px 4px; }
.province { fill: #835b3a; stroke: #eacc91; stroke-width: 2px; cursor: pointer; }
.province:hover, .province:focus-visible, .province[aria-pressed="true"] { fill: #4e9c95; stroke: #fff0bc; stroke-width: 4px; outline: none; }
@media (max-height: 350px) and (min-width: 600px) {
  .brand { margin-block-end: 8px; }
  .choice { min-height: 44px; padding-block: 4px; }
  .choice--play { min-height: 48px; }
}
@media (max-width: 595px) {
  .shell { width: min(100%, 480px); }
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map svg { height: auto; aspect-ratio: 1000 / 903; }
}

.lobby-actions { display: flex; flex-wrap: wrap; gap: 8px 15px; padding-top: 6px; }
.lobby-actions a, .lobby-actions button { display: inline-flex; min-height: 44px; align-items: center; font-size: 12px; color: var(--gold); text-decoration: underline; }

.lobby-actions button {
  padding-inline: 0;
  border: 0;
  background: none;
  font-family: inherit;
  text-underline-offset: 4px;
}
.lobby-actions button[aria-pressed="false"] { color: var(--soft); text-decoration-style: dotted; }

.lobby-actions [hidden] { display: none; }
