:root{
  --max: 900px;

  --cream: #f5e6c9;
  --cream2:#f2d9b2;

  --ink: #1a1a1a;

  --blue1:#1f334c;
  --blue2:#16263b;

  --shadow: 0 18px 50px rgba(0,0,0,0.25);
  --shadow2: 0 12px 35px rgba(0,0,0,0.22);

  --radius: 22px;
  --radius2: 26px;

  --header-h: 64px;
}

html{
  font-size: 18px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-size: .8rem;
  font-family: 'ABeeZee', sans-serif;
  background: linear-gradient(
    to bottom,
    #8fd3ff 0%,     /* bright sky */
    #5bb8ff 50%,    /* deeper sky */
    #4cc9a6 100%    /* green-blue transition */
  );
  color: var(--ink);
}
img{ display:block; max-width:100%; }
a{ text-decoration:none; color: inherit; }

/* Layout container */
.container{
  width: min(var(--max), calc(100% - 10px));
  margin: 0 auto;
}

.container-wide{
  max-width: none;
}

/* ===== Topbar ===== */
.topbar{
  position: sticky;
  top:0;
  z-index: 20;
  background: rgba(250,241,221,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding: 0;
  height: 64px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 10px;
}

.logo{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.logo img{
  width:100%;
  height:100%;
  object-fit: cover; /* use contain if your logo has whitespace */
}

.brand-text{ line-height: 1.05; }
.brand-title{ font-weight: 400; letter-spacing: -0.2px; }
.brand-tagline{ font-size: 12px; opacity: 0.75; margin-top: 2px; }

.links{
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
}
.links a{
  padding: 8px 10px;
  border-radius: 12px;
  color: rgba(0,0,0,0.65);
}
.links a:hover{
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.85);
}

.actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Pills & buttons */
.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.58);
  font-size: 18px;
  color: rgba(0,0,0,0.70);
}
.pill-dot{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.08);
}

.btn{
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap: 10px;
  background-color:  rgba(255,255,255,0.10);
}
.btn-outline{
  border-color: rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.);
  font-size: 12px;
}
.btn-outline:hover{ background: rgba(255,255,255,0.75); }

.btn-primary{
  background: linear-gradient(180deg, #ff9b37, #ff7f00);
  color: #111;
  box-shadow: 0 10px 25px rgba(255,127,0,0.24);
}

/* ===== Hero ===== */
.hero{
  margin: 0;
  border-radius: 0;
  overflow:hidden;
  box-shadow: none;
}

/* Blue background with subtle “texture” (no image needed) */
.blue-hero{
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(255,255,255,0.14), transparent 60%),
    radial-gradient(700px 450px at 90% 30%, rgba(255,156,60,0.18), transparent 55%),
    radial-gradient(1000px 700px at 40% 120%, rgba(120,180,255,0.10), transparent 60%),
    linear-gradient(180deg, var(--blue1), var(--blue2));
}

.hero{
  padding: 24px;
  color: rgba(255,255,255,0.92);
}

/* Top layout: copy left, cards right */
.hero-copy{
  text-align: center;
}

.hero-copy h1{
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.6px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.hero-copy p{
  margin: 0;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
  max-width: 70ch;
}

.hero-buttons{
  margin-top: 16px;
}

.hero-right{
  position: absolute;
  right: 24px;
  top: 130px;
  width: 420px;
  display:flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Cards ===== */
.card{
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow2);
}

.card-head{
  padding: 12px 14px 10px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
    color: rgba(255,255,255,0.98);
  background: rgba(255,255,255,0.1);
  font-size: 24px;
}
.card-title{
  display:flex;
  align-items:center;
  gap: 10px;
}
.icon-badge{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.08);
}

.link{
  color: rgba(255,255,255,0.98);
  font-size: 18px;
}


/* Person card content */

.person-card,
.timeline-card,
.map-card,

.pick {
  margin-top: 24px;
  margin-bottom: 24px;
}

.person-inner{
  padding: 14px 14px 14px;
  display: grid;
  grid-template-columns: 150px 1fr; /* match the thumbnail width */
  gap: 14px;
  align-items: center;
  color: rgba(255,255,255,0.98);
  background: rgba(255,255,255,0.05);
}

.person-inner h3 {
  font-weight: normal;
}

.person-thumb{
  width: 150px;
  height: 200px;
  border-radius: 18px;
  overflow:hidden;
  border: 1px solid rgba(0,0,0,0.10);
  background-color: rgba(255,255,255,0.98);
}
.person-thumb img{
  width:100%;
  height:100%;
  object-fit: cover;
}
.person-info h2{
  margin: 2px 0 6px;
  font-size: 24px;
  letter-spacing: -0.2px;
}
.person-info p{
  margin: 0 0 10px;
  line-height: 1.35;
  font-size: 18px;
}
.person-actions{
  display:flex;
  gap: 10px;
}

/* Mini buttons */
.btn-mini{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 18px;
  border: 1px solid rgba(0,0,0,0.10);
}
.btn-mini-warm{
  background: #111;
  color: #f0cf92;
}
.btn-mini-quiz{
  background: #f0cf92;
  color: #111;
}

/* Timeline card */
.timeline-head{
  padding-bottom: 6px;
}
.mini-timeline{
  padding: 0 14px 14px;
  background: rgba(255,255,255,0.05);

}

span{
  font-size: 14px;
}

.line{
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.10);
}

.dots{
  margin-top: -12px;
  display:flex;
  justify-content: space-between;
  padding: 0 6px;
}
.dot{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255);
  border: 1px solid rgba(0,0,0,0.10);
}
.dot.active{
  background: #ff9b37;
  border-color: rgba(255,155,55,0.85);
  box-shadow: 0 10px 18px rgba(0,0,0,0.20);
}

.labels{
  margin-top: 10px;
  display:flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 18px;
}

/* MAP CARD */

.indexmap-title{
  display: flex;
  align-items: baseline;   /* aligns text properly */
  gap: 10px;
}

.indexmap-title h4{
  margin: 0;
  font-size: 1.2rem;
}

.indexmap-sub{
  opacity: 0.75;
  font-size: 0.95rem;
}

.indexmap-card{
  padding: 0;
  margin-bottom: 24px;
}

.indexmap-inner{
  display: flex;
  justify-content:center ;
}

.indexmap-inner img{
  width: 100%;
  height: auto;          /* tweak this */
  object-fit: cover;
  border-radius: 0 0 14px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.15);
}

/* Make the top blocks match the tile style */
.top-panels{
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.top-panels .card{
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}

/* Optional: make them feel more "tile-like" */
.top-panels .card-head{
  padding: 12px 14px 0;
}

.top-panels .person-inner,
.top-panels .mini-timeline{
  padding: 12px 14px 14px;
}

/* ===== Pick strip (bottom-left) ===== */
.pick{
  margin-top: 18px;
  width: 100%;
}

.pick-head h3{
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.3px;
}
.pick-head p{
  margin: 6px 0 12px;
  color: rgba(255,255,255,0.70);
}

.strip{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.tile{
  border-radius: 18px;
  overflow:hidden;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}
.tile.featured{
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
}

.tile-img{
  position: relative;
  aspect-ratio: 4 / 5;
  background: rgba(0,0,0,0.10);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.tile-img img{
  width:100%;
  height:100%;
  object-fit: cover;
}

/* MINI TILE – completely separate component */

/* MINI TILE: standalone (no dependency on .tile) */
.tile-mini{
  border-radius: 9px;
  overflow:hidden;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 5px 12px rgba(0,0,0,0.18);
}

.tile-mini-link{
  display:block;
  text-decoration:none;
  color: inherit;
}

.tile-mini-img{
  position: relative;
  aspect-ratio: 4 / 5;
  background: rgba(0,0,0,0.10);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.tile-mini-img img{
  width:100%;
  height:100%;
  object-fit: cover;
}

.tile-mini-body{
  padding: 8px 10px;
  text-align: center;
}
.tile-mini-body h4{
  margin: 6px 0 2px;
  font-size: 0.95rem;
  font-weight: 900;
}
.tile-mini-body .meta{
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 400;
}

/* Sandwich layout (3, timeline full width, 3) */
.timeline-sandwich{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin: 10px 0 18px;
}
.timeline-wide{
  grid-column: 1 / -1;
}

.era-section{
  margin-top: 40px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

/* Era grids: 4 across for the mini tiles */
.era-mini-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.era-mini-grid--3{
  display: grid;
  grid-template-columns: repeat(3, auto);  /* tiles size to content */
  justify-content: center;                 /* centres the whole row */
  gap: 28px;                               /* space between tiles */
  margin: 0 0 26px;
}

/* ===== Continent sections: title + 4 mini tiles ===== */

.continent-section{
  margin: 22px 0;
}

.fig-row{
  margin: 34px 0;
}  

.fig-row-head{
  margin: 0 0 12px;
  color: rgba(255,255,255,0.92);
}

.fig-row-head h2{
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.3px;
}

.fig-row-head p{
  margin: 6px 0 0;
  color: rgba(255,255,255,0.75);
  font-size: 16px;
}

/* this replaces .strip inside continent sections */
.continent-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tile-mini-link{
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tile-mini-body{
  margin-top: auto;
}

/* Responsive */
@media (max-width: 1000px){
  .continent-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px){
  .continent-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .continent-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 1000px){
  .era-mini-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px){
  .timeline-sandwich{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .era-mini-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .timeline-sandwich{ grid-template-columns: 1fr; }
  .era-mini-grid{ grid-template-columns: 1fr; }
}

.today-badge{
  position:absolute;
  left: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 18px;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.18);
}

.tile-body{
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 16px;
  align-items: center;
}

.tile-link{
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tile-body h4{
  margin: 0 0 6px;
  color: rgba(255,255,255,0.92);
  letter-spacing: -0.2px;
  font-size: 18px;
}
.meta{
  color: rgba(255,255,255,0.66);
  font-size: 16px;
  margin-bottom: 10px;
}
.tile-actions{
  margin-top: auto;
  display: flex;
  gap: 10px;
}

/* ===== Footer ===== */
.footer{
  border-top: 1px solid rgba(0,0,0,0.08);
  background: rgba(250,241,221,0.7);
}
.footer-inner{
  padding: 0;
  min-height: 60px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
}
.small{ font-size: 12px; opacity: 0.75; }
.footer-right{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}


/* =========================
   CHARACTER PAGE (Julius Caesar) 
   ========================= */




.main-surface{
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.10);
}


.hero{
  background: transparent;
}

.character-hero{
  padding: 24px 0;
}

.character-hero .character-bg{
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(255,255,255,0.14), transparent 60%),
    radial-gradient(700px 450px at 90% 30%, rgba(255,156,60,0.18), transparent 55%),
    radial-gradient(1000px 700px at 40% 120%, rgba(120,180,255,0.10), transparent 60%),
    linear-gradient(180deg, var(--blue1), var(--blue2));
}

.character-hero .ch-card{
  display: grid;
  grid-template-columns: 160px 1fr 280px;
  gap: 18px;
  align-items: center;
  padding: 18px;
  color: rgba(255,255,255,0.92);
}

/* Portrait */
.character-hero .ch-portrait{
  width: 160px;
  height: 120px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
}

.character-hero .ch-portrait img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Middle content */
.character-hero .ch-main h1{
  margin: 0 0 6px;
  font-size: clamp(26px, 3.2vw, 50px);
  letter-spacing: -0.6px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.character-hero .ch-subtitle{
  margin: 0 0 12px;
  color: rgba(255,255,255,0.72);
  font-style: italic;
}

.character-hero .ch-facts{
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
  color: rgba(255,255,255,0.88);
}
.character-hero .ch-facts li{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.25;
}
.character-hero .ch-bullet{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.65);
  margin-top: 6px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.10);
}
.character-hero .ch-facts strong{
  color: rgba(255,255,255,0.92);
  margin-right: 6px;
}

/* CTA button (keeps your button vibe, but scoped) */
.character-hero .ch-cta{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  color: rgba(255,255,255,0.92);
  transition: transform .15s ease, background .15s ease;
}
.character-hero .ch-cta:hover{
  transform: translateY(-1px);
}

/* Right callout card */
.character-hero .ch-callout{
  padding: 12px 12px;
  border: 1px solid rgba(255,255,255,0.18);
}
.character-hero .ch-callout-title{
  margin-bottom: 6px;
}
.character-hero .ch-callout-text{
  color: rgba(255,255,255,0.70);
  line-height: 1.3;
}

/* ===== Character header (reusable) ===== */
.char-head{
  display:grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
  align-items:center;
  padding: 34px 20px;              
  box-shadow: var(--shadow2);
  color: rgba(255,255,255,0.92);
}

/* portrait-shaped image */
.char-portrait{
  width: 190px;
  height: 260px;                  
  border-radius: 18px;
  overflow:hidden;
}

.char-portrait img{
  width:100%;
  height:100%;
  object-fit: cover;
}

.char-main h1{
  margin:0 0 8px;
  font-size: clamp(28px, 3.4vw, 60px);
  letter-spacing: -0.6px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.char-subtitle{
  margin:0 0 14px;
  color: rgba(255,255,255,0.72);
  font-style: italic;
}

.char-facts{
  margin:0 0 16px;
  padding-left: 18px;              /* simple bullets */
  display:grid;
  gap: 8px;
  color: rgba(255,255,255,0.86);
}
.char-facts strong{
  color: rgba(255,255,255,0.92);
}

.char-cta{
  color: rgba(255,255,255,0.92);
}
.char-cta:hover{ background: rgba(255,255,255,0.16); }

.char-callout{
  border-radius: 18px;
  padding: 14px;
  background-color:  rgba(255,255,255,0.1);
}
.char-callout-title{ font-weight: 400; margin-bottom: 8px; }
.char-callout-text{ color: rgba(255,255,255,0.70); font-weight:400; line-height: 1.35; }

.tl-strip{
  margin-top: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow2);
  color: rgba(255,255,255,0.92);
}

.tl-title{
  display:flex;
  align-items:center;
  gap: 10px;
  letter-spacing: -0.2px;
  margin-bottom: 10px;
}

.tl-star{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display:grid;
  place-items:center;

  font-size: 18px;
}

.tl-bar{
  position: relative;
  padding: 12px 10px 18px;


}

/* the line behind the dots */
.tl-line{
  position:absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.12);
}

/* labels */
.tl-ticks{
  position: relative;
  z-index: 1;
  display:flex;
  justify-content: space-between;
  gap: 10px;
}

.tl-tick{
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.78);
  font-size: 18px;
  padding: 6px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.tl-tick:hover{
  color: rgba(255,255,255,0.92);
}
.tl-tick.active{
  color: #fff;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

/* dots aligned under labels */
.tl-dots{
  position: relative;
  z-index: 1;
  margin-top: 10px;
  display:flex;
  justify-content: space-between;
  padding: 0 12px;
}

.tl-dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
}
.tl-dot.active{
  background: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.55);
  box-shadow: 0 10px 18px rgba(0,0,0,0.22);
}

/* responsive tweaks */
@media (max-width: 520px){
  .tl-tick{ font-size: 15px; padding: 6px 6px; }
  .tl-bar{ padding: 12px 8px 18px; }
}

/* Responsive */
@media (max-width: 900px){
  .char-head{ grid-template-columns: 160px 1fr; }
  .char-callout{ grid-column: 1 / -1; }
  .char-portrait{ width:160px; height: 230px; }
}
@media (max-width: 520px){
  .char-head{ grid-template-columns: 1fr; }
  .char-portrait{ width:100%; height: 320px; }
}

/* ===== Map + Real-world stories section (blue + white) ===== */
.rw-grid{
  display:grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
  margin-top: 14px;
}

.rw-card{

  box-shadow: var(--shadow2);
  color: rgba(255,255,255,0.92);
  overflow:hidden;
}

.rw-head{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 12px 14px;
}

.rw-head h3{
  margin:0;
  font-size: 18px;
  letter-spacing: -0.2px;
}

.rw-dot{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 15px;
}

/* Map block */
.rw-map{
  padding: 12px 14px 10px;
}
.rw-map img{
  width:100%;
  height: 320px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
}
.rw-map-label{
  margin-top: 10px;
  color: rgba(255,255,255,0.72);
  font-size: 15px;
}

/* Level chooser */
.rw-level{
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.rw-level-title{
  color: rgba(255,255,255,0.80);
  font-size: 15px;
  margin-bottom: 10px;
}
.rw-level-buttons{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
.rw-level-btn{
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.92);
  padding: 8px 12px;            /* smaller than your main buttons */
}
.rw-level-btn:hover{
  background: rgba(255,255,255,0.16);
}

/* Stories list */

.rw-list{
  padding: 12px 14px 16px;
  display: grid;
  gap: 14px;                 /* was 12px */
}

.rw-item{
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 16px;             /* was 12px */
  border-radius: 18px;
  align-items: start;        /* ✅ stops weird vertical centering */
  min-height: 92px;          /* ✅ gives each item presence */
}

.rw-item-icon{
  width: 40px;
  height: 70px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  font-size: 18px;
}

.rw-item-title{
  margin-bottom: 4px;
}

.rw-item-text{
  color: rgba(255,255,255,0.72);
  line-height: 1.35;
  font-size: 16px;
  margin-bottom: 8px;
}

.rw-link{
  font-size: 15px;
  color: rgba(255,255,255,0.86);
}

.rw-link:hover{
  color: rgba(255,255,255,0.98);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ===== Level panel ===== */
.level-panel{
  padding: 14px;
  box-shadow: var(--shadow2);
  color: rgba(255,255,255,0.92);
}

/* pill-like tabs */
.level-tabs{
  display:flex;
  justify-content:center;
  gap: 10px;
  margin-bottom: 12px;
}

.level-tab{
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.86);
  font-size: 15px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.level-tab:hover{
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.level-box-text p{
  margin: 0 0 12px;
  break-inside: auto;
  text-indent: 2em;
}


/* selected tab */
.level-tab.is-active{
  background: rgba(255,255,255,0.20);
  border-color: rgba(255,255,255,0.30);
  color: rgba(255,255,255,0.98);
}

/* big display box */
/* ===== Book-style biography box ===== */
/* ===== Book-style biography box ===== */
.level-box{
  padding: 18px 20px;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(255,255,255,0.55), transparent 60%),
    linear-gradient(180deg, #f3c98b, #e49a3f);

  border: 1px solid rgba(120, 80, 40, 0.35);
  min-height: 60vh;
  max-height: 80vh;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.25),
    0 10px 28px rgba(0,0,0,0.25);

  color: black;

  /* ✅ NEW: make flex work */
  display: flex;
  flex-direction: column;
}

/* Title stays at the top */
.level-box-title{
  margin-bottom: 8px;
}

/* The text area expands to fill remaining space */
.level-box-text{
  flex: 1;
  min-height: 0;          /* ✅ important for flex children */
  margin: 0;

  font-weight: 400;       /* (optional) less “bold wall of text” */
  line-height: 1.55;

  /* ✅ book columns */
  column-count: 2;
  column-gap: 28px;
  column-rule: 1px solid black;

  text-align: left;
  hyphens: auto;

  /* ✅ optional: if text can exceed the box */
  overflow: auto;
}

/* Responsive */
@media (max-width: 900px){
  .rw-grid{ grid-template-columns: 1fr; }
  .rw-map img{ height: 240px; }
}

@media (max-width: 1050px){
  .hero-right{
    position: static;
    width: auto;
    margin-top: 16px;
  }
  .pick{
    max-width: none;
  }
}

@media (max-width: 780px){
  .links{ display:none; }
  .strip{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px){
  .hero{ padding: 18px; }
  .strip{ grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 860px){
  .character-hero .ch-card{
    grid-template-columns: 140px 1fr;
  }
  .character-hero .ch-callout{
    grid-column: 1 / -1;
  }
  .character-hero .ch-portrait{
    width: 140px;
    height: 110px;
  }
}

@media (max-width: 520px){
  .character-hero .ch-card{
    grid-template-columns: 1fr;
  }
  .character-hero .ch-portrait{
    width: 100%;
    height: 180px;
  }
}

/* ===== Modal ===== */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999;
}

.modal.is-open{ display: block; }

.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

.modal-dialog{
  position: relative;
  width: min(560px, calc(100% - 28px));
  margin: 8vh auto 0;
  border-radius: 18px;
  height: 85%;

  /* blue background + white text */
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(255,255,255,0.14), transparent 60%),
    radial-gradient(700px 450px at 90% 30%, rgba(255,156,60,0.18), transparent 55%),
    linear-gradient(180deg, var(--blue1), var(--blue2));
  color: rgba(255,255,255,0.92);

  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-dialog{
  position: relative;
  width: min(560px, calc(100% - 28px));
  margin: 8vh auto 0;
  border-radius: 18px;
  padding: 16px 16px 14px;
  height: 85%;

  /* your background etc... */

  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow);

  /* ✅ add these */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Custom modal scrollbar ===== */
.-webkit-scrollbar,
.modal-extra::-webkit-scrollbar{
  width: 10px;
}

.-webkit-scrollbar-track,
.modal-extra::-webkit-scrollbar-track{
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}

.-webkit-scrollbar-thumb,
.modal-extra::-webkit-scrollbar-thumb{
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.55),
    rgba(255,255,255,0.25)
  );
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0.15); /* creates breathing space */
}

.-webkit-scrollbar-thumb:hover,
.modal-extra::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.75),
    rgba(255,255,255,0.40)
  );
}

.modal-title{
  margin: 0 0 10px;
  letter-spacing: -0.2px;
}

.modal-close{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.92);
  color: black;
  cursor: pointer;
}
.modal-close:hover{ background: rgba(255,255,255,0.16); }

.modal-actions{
  margin-top: 12px;
  display:flex;
  justify-content:flex-end;
  gap: 10px;
}

.modal-img{
  width: 100%;      
  flex: 0 0 auto;          
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 14px;
  display: none;          
  border: 1px solid rgba(255,255,255,0.14);
}

/* ✅ make the story area scroll inside the modal */
.modal-extra{
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 6px; /* room for scrollbar */
}

/* optional: keep paragraphs readable */
.modal-extra{
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}

.modal-extra p{ margin: 0 0 10px; }
.modal-extra p:last-child{ margin-bottom: 0; }

/*Button modals */

/* Base modal */
.modal { position: fixed; inset: 0; display:none; z-index: 9999; }
.modal.is-open { display:block; }
.modal__backdrop { position:absolute; inset:0; background: rgba(0,0,0,0.55); }
.modal__panel {
  position: relative;
  width: min(560px, calc(100% - 24px));
  margin: 8vh auto;
  border-radius: 18px;
  padding: 18px;
  background: rgba(20, 32, 52, 0.96);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.modal__close { position:absolute; top:10px; right:10px; }

/* Shared media area */
.modal__media img { width: 100%; height: auto; border-radius: 14px; display:block; }

/* Variant A: TOP buttons (compact, no big image, "game card" feel) */
.modal.modal--top .modal__panel {
  width: min(560px, calc(100% - 24px));
  margin: 12vh auto;
  padding: 20px;
}
.modal.modal--top .modal__media { display:none !important; }
.modal.modal--top #modalTitle { font-size: 28px; margin-top: 6px; }
.modal.modal--top #modalBody { font-size: 16px; line-height: 1.45; }

/* Variant B: STORY modals (image + story layout) */
.modal.modal--story .modal__panel {
  width: min(560px, calc(100% - 24px));
}
.modal.modal--story .modal__media { display:block; margin-bottom: 12px; }
.modal.modal--story #modalTitle { font-size: 26px; }

/* Make the rw item feel clickable */
.rw-item-link{
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.rw-item-link:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10);
}

.bio-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:14px;
}

.bio-controls button{
  padding:10px 14px;
  border-radius:12px;
  border:0;
  cursor:pointer;
}

.bio-controls button:disabled{
  opacity:.45;
  cursor:default;
}

.bio-progress{
  font-size:14px;
  opacity:.75;
}

/* Bigger quiz text inside the top modal */

#topModal .quiz-meta{
  font-size: 18px;
}

#topModal .quiz-q{
  font-size: 26px;   /* Main question */
  line-height: 1.3;
}

#topModal .quiz-choice{
  font-size: 20px;   /* Answer buttons */
  padding: 14px 16px;
  color: #fff;
}

#topModal #quizExplain{
  font-size: 14px;   /* Explanation text */
  line-height: 1.5;
  padding-bottom: 14px;
}

#topModal .quiz-finish{
  font-size: 20px;
}

/* Make the modal not ridiculously tall */
#topModal .modal-dialog{
  max-height: 95vh;           /* keeps it shorter */
  overflow: auto;             /* scroll inside if needed */
}

/* Size variants (we'll toggle these with JS) */
#topModal .modal-dialog.modal--sm{ width: min(560px, calc(100% - 24px)); }
#topModal .modal-dialog.modal--md{ width: min(560px, calc(100% - 24px)); }
#topModal .modal-dialog.modal--lg{ width: min(560px, calc(100% - 24px)); }

/* ===== Top Modal Image ===== */
#topModal .topmodal-media{
  max-width: 520px;         /* controls overall image size */
  margin: 0 auto 14px;      /* centers the container */
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: center;  /* centers image horizontally */
}

#topModal .topmodal-media img{
  width: auto;
  height: 290px;
  display: block;           /* important for proper centering */
}

/* Tighten quiz spacing so it doesn't feel airy */
#topModal .quiz-meta{ margin: 10px 0 10px; }
#topModal .quiz-choices{ gap: 10px; }

/* Make the Next button clearer in the quiz modal */
#topModal #nextBtn{
  font-size: 18px;          /* bigger text */
  padding: 12px 18px;       /* chunkier button */
  color: #ffffff;           /* ensure text is bright */
}

/* Rival intro Start button text */
#topModal #rivalStartBtn{
  color: #fff;
}

.topmodal-media, #topModalBody {
  pointer-events: none;
}
#topModalMount {
  pointer-events: auto;
}

/* Quiz answer buttons */
.quiz-choices .quiz-choice{
  display: flex;
  font-size: 12px;       /* smaller text */
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 12px 10px;    /* slightly tighter */
}

#topModal .btn{
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 14px;
}

/* Smaller, rounded Next button */
#topModal #nextBtn{
  padding: 6px 14px;        /* smaller */
  font-size: 13px;          /* smaller text */
  border-radius: 999px;     /* fully rounded pill */
  min-height: auto;
  font-weight: 400;         /* lighter than headings */
}

/* Only buttons inside the Alternate Game modal */
#topModal .btn,
#topModal .btn-outline {
  font-weight: 400;
}

.modal-extra{
  font-size: 14px !important;
  line-height: 1.45;
}


/* REGION GRID (2 rows of 3) */
.region-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 900px){
  .region-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .region-grid{ grid-template-columns: 1fr; }
}

.region-card{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  text-decoration:none;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

.region-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
}

.region-dot{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.10);
}

.region-text h4{
  margin: 0;
  font-weight: 950;
}
.region-text .meta{
  margin-top: 4px;
  opacity: 0.8;
}

/* ===== MAP (minimal) ===== */

.map-wrap{
  position: relative;
  border-radius: 18px;
  overflow: hidden;
}

.map-img{
  display: block;
  width: 100%;
  height: auto;
}

/* SVG overlay sits exactly on top */
.map-zones{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.map-zones *{
  pointer-events: auto;
}

/* Invisible clickable tiles */
.zone{
  fill: transparent;
  stroke: transparent;
}

/* Optional: tiny hint on hover/focus so kids know it's clickable */
a:hover .zone,
a:focus .zone,
a:focus-visible .zone{
  fill: rgba(255,255,255,0.06);
  stroke: rgba(255,255,255,0.35);
  stroke-width: 2;
  cursor: pointer;
}

/* Article modal grid */
#articlesGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Mobile layout */
@media (max-width: 640px) {
  #articlesGrid {
    grid-template-columns: 1fr;
  }
}