/* Surcouche 2.4.0 : fenêtres HTML (S24Fenetres). Propriétaire : chantier B (CONTRAT_J4J5.md §6).
   Style des fenêtres de la 2.4 (Accueil.cadre / boutonRouge, Compte.saisie) : fond #F4F1F8, bord doré #C9A64B de 3,
   rayon 10, titre #3E3150 de 30, trait doré 420 × 2, bouton rouge = accueil_dialogue_ok.png du jeu, voile noir 60 %.
   Unités de l'écran du jeu : var(--u) = hauteur du canevas / 640 (S24.placerCouche). Police : celle du système, comme
   les TextView de la 2.4 (Typeface.DEFAULT). */
#s24-couche {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; --u: 1px;
  overflow: hidden; color: #333; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", Roboto, "Yu Gothic UI",
    "Meiryo", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
#s24-couche *, #s24-couche *::before, #s24-couche *::after { box-sizing: border-box; }

/* ---- fenêtre (cadre + montrerDialogue) */
.s24-voile {
  position: absolute; inset: 0; z-index: 30; pointer-events: auto; background: rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s linear;
}
.s24-voile.visible { opacity: 1; }
.s24-voile.sortie { opacity: 0; transition-duration: .12s; pointer-events: none; }
.s24-fenetre {
  display: flex; flex-direction: column; align-items: center; flex: none;
  background: #F4F1F8; border: max(2px, calc(3 * var(--u))) solid #C9A64B; border-radius: calc(10 * var(--u));
  padding: calc(16 * var(--u)) calc(28 * var(--u)) calc(20 * var(--u));
  max-width: calc(100% - 20 * var(--u)); max-height: calc(100% - 16 * var(--u)); overflow: auto; overscroll-behavior: contain;
  /* largeur calculée sans la barre verticale (Chrome, overflow:auto) : pas de barre horizontale pour ces quelques px */
  overflow-x: hidden;
  transform: scale(.85); transition: transform .15s ease-out, translate .2s ease-out;
}
.s24-voile.visible .s24-fenetre { transform: scale(1); }
.s24-titre { color: #3E3150; font-weight: bold; font-size: calc(30 * var(--u)); line-height: 1.25; text-align: center; }
.s24-trait {
  flex: none; width: calc(420 * var(--u)); max-width: 100%; height: max(1px, calc(2 * var(--u))); background: #C9A64B;
  margin: calc(8 * var(--u)) 0 calc(18 * var(--u));
}

/* ---- textes */
.s24-texte {
  white-space: pre-wrap; overflow-wrap: anywhere; text-align: center; color: #333; font-size: calc(24 * var(--u));
  line-height: calc(1.17em + 4 * var(--u)); max-width: 100%;
}
.s24-message { line-height: calc(1.17em + 6 * var(--u)); }
.s24-defile {
  width: calc(600 * var(--u)); max-width: 100%; max-height: calc(330 * var(--u)); overflow-y: auto; flex: none;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.s24-section {
  align-self: stretch; text-align: left; color: #3E3150; font-weight: bold; font-size: calc(22 * var(--u));
  margin-top: calc(10 * var(--u)); line-height: 1.3;
}

/* ---- boutons rouges (accueil_dialogue_ok.png), liens */
.s24-bouton {
  display: flex; align-items: center; justify-content: center; flex: none; margin: 0; border: 0;
  padding: 0 calc(8 * var(--u)); color: #fff; font-family: inherit; font-weight: bold; line-height: 1; white-space: nowrap;
  background: url(../StreamingAssets/yuudachi/accueil_dialogue_ok.png) center / 100% 100% no-repeat;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; max-width: 100%;
}
.s24-sans-image-ok .s24-bouton { background: #C8102E; border-radius: calc(6 * var(--u)); }
.s24-bouton:active { filter: brightness(.88); }
.s24-bouton:disabled { filter: grayscale(.7) brightness(.85); cursor: default; }
.s24-bouton:focus-visible { outline: max(1px, calc(2 * var(--u))) solid #C9A64B; outline-offset: max(1px, calc(2 * var(--u))); }
.s24-boutons { display: flex; justify-content: center; align-items: center; gap: calc(16 * var(--u)); flex: none; max-width: 100%; }
.s24-choix { display: flex; flex-direction: column; align-items: center; flex: none; }
.s24-lien {
  color: #3E3150; font-weight: bold; font-size: calc(24 * var(--u)); text-align: center; cursor: pointer;
  /* interligne fixe : « normal » varie selon la police du système (Meiryo ≈ 1,5) et la fenêtre インフォメーション n'a
     qu'une quinzaine d'unités de marge sur les 624 de l'écran */
  line-height: 1.3;
  padding: calc(8 * var(--u)) calc(16 * var(--u)) calc(4 * var(--u)); touch-action: manipulation; flex: none;
}
.s24-lien:active { opacity: .6; }

/* ---- saisie (Compte.saisie) : fond blanc, bord #D8C79A, 24 */
.s24-saisie {
  display: block; width: 100%; margin: 0; font: inherit; font-size: calc(24 * var(--u)); color: #222; background: #fff;
  border: max(1px, calc(2 * var(--u))) solid #D8C79A; border-radius: calc(6 * var(--u));
  padding: calc(8 * var(--u)) calc(14 * var(--u)); outline: none; -webkit-appearance: none; appearance: none;
  -webkit-user-select: text; user-select: text; flex: none;
}
.s24-saisie::placeholder { color: #9A9A9A; }
.s24-saisie:focus { border-color: #C9A64B; box-shadow: 0 0 0 max(1px, calc(1.5 * var(--u))) rgba(201, 166, 75, .35); }
textarea.s24-saisie { resize: none; min-height: calc(120 * var(--u)); line-height: 1.35; }

/* ---- pages plein écran (不具合報告, web) : sous les fenêtres */
.s24-page {
  position: absolute; inset: 0; z-index: 20; pointer-events: auto; background: #F3F0F8; color: #2F2640;
  overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; opacity: 0; transition: opacity .15s linear;
}
.s24-page.visible { opacity: 1; }
.s24-page input, .s24-page textarea { -webkit-user-select: text; user-select: text; }
.s24-web { display: flex; flex-direction: column; background: #000; overflow: hidden; }
.s24-web-barre {
  flex: none; display: flex; align-items: center; gap: calc(14 * var(--u)); height: calc(56 * var(--u));
  padding: 0 calc(12 * var(--u)) 0 calc(18 * var(--u)); background: #201A30; color: #fff; font-size: calc(20 * var(--u));
  border-bottom: max(1px, calc(2 * var(--u))) solid #C9A64B;
}
.s24-web-titre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.s24-web-lien { color: #E2C062; font-weight: bold; text-decoration: none; white-space: nowrap; }
.s24-web-fermer {
  font: inherit; font-weight: bold; color: #201A30; background: #C9A64B; border: 0; border-radius: calc(6 * var(--u));
  height: calc(40 * var(--u)); padding: 0 calc(18 * var(--u)); cursor: pointer; touch-action: manipulation;
}
.s24-web iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }

/* ---- toasts (Toast Android), par-dessus tout */
#s24-toasts {
  position: absolute; left: 0; right: 0; bottom: 12%; z-index: 50; display: flex; justify-content: center;
  pointer-events: none;
}
.s24-toast {
  max-width: 80%; padding: calc(10 * var(--u)) calc(24 * var(--u)); border-radius: calc(26 * var(--u));
  background: rgba(50, 50, 50, .92); color: #fff; font-size: max(13px, calc(22 * var(--u))); line-height: 1.35;
  text-align: center; white-space: pre-line; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); opacity: 0; transition: opacity .2s linear;
}
.s24-toast.visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .s24-voile, .s24-fenetre, .s24-page, .s24-toast { transition-duration: .01s !important; }
}
