/* رحلة الكلمات العربية — desktop browser layouts.
   Mobile remains owned by each screen; these rules begin at 900px. */
.section-head span{
  color:#174c6a!important;font-weight:900!important;
  text-shadow:0 1px 0 rgba(255,255,255,.72)!important;opacity:1!important
}

/* Shared legibility floor for copy that sits over illustrated game surfaces. */
body:has(#journey) .mission-copy p,
body:has(#journey) .mode-text small,
body:has(#journey) .meta{font-weight:800!important;text-shadow:0 1px 2px rgba(5,42,69,.55)}
body:has(#list.list) .packs-heading small{font-size:12px!important;font-weight:900!important;color:#fff8dc!important;text-shadow:0 2px 4px #003552}
body:has(#list.list) .trail-head p,
body:has(#list.list) .marker-copy small{font-size:11px!important;font-weight:900!important;color:#365c58!important;line-height:1.45}
body:has(#journey-count) .lead,
body:has(#journey-count) .status-note,
body:has(#journey-count) .best small,
body:has(#journey-count) .start small,
body:has(#journey-count) .guide-title span,
body:has(#journey-count) .rule p,
body:has(#journey-count) .step small{font-size:11.5px!important;font-weight:800!important;line-height:1.65}
body:has(#journey-count) .guide-title span{color:#f0e5ff!important;text-shadow:0 1px 3px #210b4a}
body:has(#chooser) .intro,
body:has(#chooser) .account-copy small,
body:has(#chooser) .password-note,
body:has(#chooser) .secure-box,
body:has(#chooser) .target-box{font-size:11.5px!important;font-weight:800!important;line-height:1.65;color:#385e72!important}
body:has(.atlas-app) .atlas-count small,
body:has(.atlas-app) .atlas-heading p,
body:has(.atlas-app) .drawer-intro span,
body:has(.atlas-app) .world-card small,
body:has(.atlas-app) .country-chip small,
body:has(.atlas-app) .country-copy small,
body:has(.atlas-app) .country-copy p{font-size:11px!important;font-weight:900!important;line-height:1.4;color:#365d60!important}
body:has(#checkBtn) .side-action .lbl{font-size:11px!important;font-weight:900!important;color:#fff!important;text-shadow:0 1px 3px #032a58}
body:has(#checkBtn) .side-action .sub,
body:has(#checkBtn) .active-clue-bar .clue-dir,
body:has(#checkBtn) .active-clue-bar .clue-more,
body:has(#checkBtn) .title-block .date{font-size:10px!important;font-weight:900!important;line-height:1.35}

@media(min-width:900px){
  :root{--kalima-desktop-shell:min(1180px,calc(100vw - 48px))}
  html,body{min-height:100%}

  /* Home hub */
  body:has(#journey)>main.app{
    width:var(--kalima-desktop-shell)!important;max-width:none!important;
    padding:42px 28px 38px!important
  }
  body:has(#journey) .top{min-height:124px}
  body:has(#journey) .top:after{width:min(390px,40vw)!important;height:92px!important}
  body:has(#journey) .hero{min-height:320px!important;padding:34px 42px!important;background-position:center 48%!important}
  body:has(#journey) .hero-mission{min-height:250px!important}
  body:has(#journey) .mission-copy{width:min(100%,430px)!important;padding-top:40px!important}
  body:has(#journey) .mission-copy h2{font-size:34px!important}
  body:has(#journey) .mission-copy p{max-width:390px!important;font-size:15px!important}
  body:has(#journey) .hero-journey{max-width:360px!important;min-height:60px!important;font-size:16px!important}
  body:has(#journey) .section-head{margin-top:24px!important}
  body:has(#journey) .section-head h2{font-size:22px!important}
  body:has(#journey) .section-head span{font-size:13px!important;color:#123f5f!important}
  body:has(#journey) .modes{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px!important}
  body:has(#journey) .mode-row{min-height:116px!important;padding:17px 18px!important}
  body:has(#journey) .mode-text b{font-size:19px!important}
  body:has(#journey) .mode-text small{font-size:13px!important;line-height:1.55}

  /* Pack library */
  body:has(#list.list)>main.app{width:var(--kalima-desktop-shell)!important;max-width:none!important;padding-inline:28px!important}
  body:has(#list.list) .packs-intro{min-height:210px!important;font-size:16px!important}
  body:has(#list.list) .packs-intro span{max-width:430px!important}
  body:has(#list.list) .list{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px!important;align-items:start}
  body:has(#list.list) .pack-card.is-open{grid-column:1/-1}
  body:has(#list.list) .pack-summary{min-height:126px!important}
  body:has(#list.list) .trail-path{grid-template-columns:repeat(4,minmax(140px,1fr))!important;gap:24px!important}

  /* Endless rules and launch surface */
  body:has(#journey-count)>main.app{
    width:min(1080px,calc(100vw - 64px))!important;max-width:none!important;
    display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);column-gap:22px;
    grid-template-rows:auto auto minmax(0,1fr) auto;
    grid-template-areas:"top top" "hero guide" "hero rules" "hero difficulty";
    padding:22px 24px 34px!important
  }
  body:has(#journey-count) .top{grid-area:top}
  body:has(#journey-count) .hero{grid-area:hero;margin-top:20px!important;align-self:stretch;padding:34px 28px!important}
  body:has(#journey-count) .guide-title{grid-area:guide;margin-top:20px!important}
  body:has(#journey-count) .rules{grid-area:rules;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body:has(#journey-count) .difficulty{grid-area:difficulty}
  body:has(#journey-count) .rule{min-height:150px!important}
  body:has(#journey-count) .rule p{font-size:12px!important}

  /* Local accounts */
  body:has(#chooser)>main.app{width:min(980px,calc(100vw - 64px))!important;max-width:none!important}
  body:has(#chooser) .brand{height:118px!important}
  body:has(#chooser) .card{padding:28px!important}
  body:has(#chooser) #chooser .accounts{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px!important}
  body:has(#chooser) #editor,body:has(#chooser) #auth{max-width:680px;margin:auto}
  body:has(#chooser) .intro{font-size:14px!important}

  /* Results */
  body:has(#result-headline)>.phone{
    width:min(920px,calc(100vw - 64px))!important;max-width:none!important;height:100dvh!important;
    display:grid!important;grid-template-columns:minmax(0,1.3fr) minmax(300px,.7fr);
    grid-template-rows:auto minmax(0,1fr)
  }
  body:has(#result-headline) .result-topbar{grid-column:1/-1}
  body:has(#result-headline) .content{min-height:0;overflow:auto;padding:24px 28px!important}
  body:has(#result-headline) .result-actions{align-self:center;padding:26px!important;background:rgba(5,47,91,.28);border-radius:24px 0 0 24px}

  /* Main atlas and legacy region chooser */
  body:has(.atlas-app) .atlas-app{width:var(--kalima-desktop-shell)!important;max-width:none!important}
  body:has(.atlas-app) .atlas-heading h1{font-size:27px!important}
  body:has(.atlas-app) .atlas-drawer{max-height:29svh!important}
  body:has(#regions)>main.screen{width:var(--kalima-desktop-shell)!important;max-width:none!important;padding:24px!important}
  body:has(#regions) .regions{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px!important;padding-bottom:90px!important}
  body:has(#regions) .region{min-height:205px!important;padding-right:56%!important}

  /* Chapter map */
  body[data-kalima-page="chapter-map"]{--scene-width:var(--kalima-desktop-shell)!important}
  body[data-kalima-page="chapter-map"] .scene{width:var(--kalima-desktop-shell)!important;max-width:none!important;margin:auto}
  body[data-kalima-page="chapter-map"] .chapter-topbar{width:min(calc(100% - 48px),1120px)!important}

  /* Daily archive and story interludes */
  body:has(#days)>main.daba-secondary{width:min(1080px,calc(100vw - 64px))!important;max-width:none!important}
  body:has(#days) .days{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:16px!important}
  body:has(>main.daba-story)>main.daba-story{width:min(720px,calc(100vw - 64px))!important;max-width:none!important}
  body:has(>main.daba-story) .page{padding:42px 48px!important}

  /* Preference survey */
  body:has(#player-token)>main{width:min(900px,calc(100vw - 64px))!important;max-width:none!important}
  body:has(#player-token) .card{width:min(760px,100%);min-height:520px;margin-inline:auto;padding:74px 80px 64px!important}
  body:has(#player-token) .option{min-height:125px!important;font-size:13px!important}

  /* Puzzle libraries and alternate crossword screen */
  body:has(#puzzleGrid)>main{width:var(--kalima-desktop-shell)!important;max-width:none!important}
  body:has(#puzzleGrid) .grid{grid-template-columns:repeat(auto-fill,minmax(190px,1fr))!important}
  body:has(#gameScreen) .game-scroll{max-width:1120px!important;padding:24px 28px 190px!important}
  body:has(#gameScreen) .bottom-panel{width:min(1120px,100%);left:50%!important;right:auto!important;transform:translateX(-50%)}
  body:has(#gameScreen) .menu-card{max-width:430px!important;padding:42px!important}

  /* Developer, policy and deletion pages */
  body:has(#hub)>main{width:min(1040px,calc(100vw - 64px))!important;max-width:none!important}
  body>main.page{width:min(900px,calc(100vw - 64px))!important;max-width:none!important;padding:34px 42px!important}
  body>main.card{width:min(760px,calc(100vw - 64px))!important;max-width:none!important;padding:34px 42px!important}
}
