/* v44 · fresh-reader fixes (27 Oct) */

/* cover: no stray focus frame around the page (main gets programmatic focus on every page turn) */
#main:focus, #main:focus-visible { outline: none !important; }

/* images are never cropped: show the whole picture on a soft paper background */
#main img,
#main .paper img,
.paper.v36.v36.v36 img {
  object-fit: contain !important;
}
#main .page-scene img,
#main .v36-mirrorframe img,
#main .b1-mood-figure,
#main .v35-panel-who,
#main .voice-author-badge,
#main .cast-card img,
#main .v41-cast img,
#main .v35-hostbubble img,
#main .v35-songart {
  background: radial-gradient(ellipse at 50% 45%, #fffaf0 0%, #fbeee0 70%, #f5e3d3 100%) !important;
}
#main img { object-position: center !important; }
/* p3 / p8 scene frames: the frame follows the picture instead of cutting it into an arch or a circle */
#main .v35-frame.v36-pic { height: auto !important; border-radius: 26px !important; }
#main .page-scene { height: auto !important; aspect-ratio: auto !important; }
#main .page-scene img { width: 100% !important; height: auto !important; aspect-ratio: auto !important; display: block; }
/* p11 moods: whole picture, centred, in a softly rounded card */
#main .j31-weather-scene { border-radius: 36px !important; }
#main .b1-mood-figure { height: auto !important; aspect-ratio: auto !important; max-height: 240px !important; width: auto !important; max-width: 100% !important; margin-inline: auto; display: block; border-radius: 18px; }
/* p62 mirror: picture sits inside the oval, nothing cut */
#main .v36-mirrorframe img { box-sizing: border-box !important; padding: 0 9% !important; background-clip: border-box; }

/* free sample · closing card */
.v44-sample-end {
  margin: 2rem 0 1rem;
  padding: 1.4rem 1.2rem 1.5rem;
  border-radius: 28px;
  background: linear-gradient(160deg, #fff8ee 0%, #fdeaf1 55%, #e7f4f2 100%);
  border: 2px dashed #e7a3c1;
  box-shadow: 0 10px 28px rgba(67, 32, 77, .10);
  text-align: center;
}
.v44-sample-end figure { margin: 0 auto 1rem; max-width: 420px; }
.v44-sample-end figure img {
  display: block; width: 100%; height: auto; border-radius: 20px;
  object-fit: contain !important; background: #fffaf0 !important;
}
.v44-sample-end small { display: block; color: #b04c86; font-weight: 800; margin-bottom: .3rem; }
.v44-sample-end h2 { margin: .1rem 0 .6rem; font-size: clamp(1.35rem, 5.5vw, 1.8rem); line-height: 1.5; }
.v44-sample-end p { margin: .4rem auto; max-width: 34em; line-height: 1.9; }
.v44-sample-end .v44-cta { display: flex; flex-wrap: wrap; gap: .7rem 1rem; justify-content: center; align-items: center; margin-top: 1.1rem; }
.v44-sample-end .v44-buy {
  display: inline-block; padding: .8rem 1.6rem; border-radius: 999px;
  background: #b04c86; color: #fff !important; font-weight: 800; text-decoration: none;
  box-shadow: 0 6px 16px rgba(176, 76, 134, .28);
}
.v44-sample-end .v44-buy:hover, .v44-sample-end .v44-buy:focus-visible { background: #93386f; }
.v44-sample-end .v44-more { color: #49656d; font-weight: 700; }

/* phone · p7 «قواعد على مزاجنا»: picture on top, words underneath */
@media (max-width: 480px) {
  #main .j31-rule-grid { grid-template-columns: minmax(0, 1fr) !important; }
  #main .j31-rule-tile {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    justify-items: center;
    min-width: 0;
  }
  #main .j31-rule-tile .v35-panel-who {
    grid-area: 1 / 1 !important;
    width: 88px !important; height: 116px !important; max-width: 88px !important;
    margin: .2rem auto 0;
    border-radius: 18px;
    transform: none !important;
  }
  #main .j31-rule-tile .v35-bubble {
    grid-area: 2 / 1 !important;
    width: 100% !important; max-width: none !important; min-width: 0;
    box-sizing: border-box;
  }
  #main .j31-rule-tile .v35-bubble p { word-break: normal; overflow-wrap: break-word; }
  #main .j31-rule-tile .v35-bubble::before,
  #main .j31-rule-tile .v35-bubble::after { display: none !important; }

  /* the activity-icon legend on the same page: let names wrap instead of clipping */
  #main .rules-icons, #main .legend, #main .j31-legend { flex-wrap: wrap; }
  #main .rules-icons *, #main .legend *, #main .j31-legend * { min-width: 0; white-space: normal !important; }

  /* phone · p10 «شفرتي»: one roomy column */
  #main .secret-gallery {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .6rem !important;
    width: 100% !important; max-width: 100% !important;
    box-sizing: border-box;
  }
  #main .secret-gallery > * {
    min-width: 0 !important; width: auto !important; max-width: 100% !important;
    box-sizing: border-box;
    margin-inline: 0 !important;
    transform: none !important;
    padding-inline: .9rem !important;
  }
  #main .secret-gallery .j31-glyph { width: min(100%, 92px) !important; height: auto !important; }
  #main .secret-gallery .field, #main .secret-gallery .answer-paper,
  #main .secret-gallery .rich-answer, #main .secret-gallery .answer-tools {
    min-width: 0 !important; width: 100% !important; max-width: 100% !important; box-sizing: border-box;
  }
  #main .secret-gallery button { white-space: normal; max-width: 100%; }
  #main .v36-envchip { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box; white-space: normal; }
  /* p34 dare menu: two dishes that fit */
  #main .dare-menu { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #main .dare-menu > * { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box; }
}
