/* ISAN POKER V9 · Welcome popup (poster / cinematic). Namespace: .isan-welcome-
   Scoped only to #isan-welcome. Does not touch v8.css, app.js, v8.js or Admin. */
[hidden] { display: none !important; }

.isan-welcome {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(8, 9, 12, .8);
  isolation: isolate;
}

.isan-welcome-dialog {
  position: relative; display: flex; flex-direction: column;
  width: min(100%, 560px);
  max-height: 92vh; max-height: 92dvh;
  background: #08090c;
  border: 1px solid rgba(233, 191, 113, .6);
  border-radius: 13px; overflow: hidden;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .6);
}
.isan-welcome-dialog:focus { outline: none; }

.isan-welcome-top {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 12px;
  border-top: 3px solid #8d1628;
  border-bottom: 1px solid rgba(233, 191, 113, .25);
}
.isan-welcome-emblem { flex: none; width: 40px; height: 40px; object-fit: contain; }
.isan-welcome-kicker {
  flex: 1; min-width: 0; margin: 0;
  font: 700 12px/1.35 'IBM Plex Sans Thai', system-ui, sans-serif;
  letter-spacing: .1em; color: #e9bf71;
}
.isan-welcome-close {
  flex: none; width: 44px; height: 44px;
  border: 1px solid rgba(233, 191, 113, .5); border-radius: 8px;
  background: #1a1514; color: #fff4dc;
  font: 600 24px/1 system-ui, sans-serif; cursor: pointer;
}

/* Intro is shown only in cinematic mode, for ~1.2s, and never blocks the poster. */
.isan-welcome-intro { display: none; }
.isan-welcome[data-mode="cinematic"]:not(.is-intro-done) .isan-welcome-intro {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; background: #09090b;
}
.isan-welcome-intro img { width: min(40%, 120px); height: auto; object-fit: contain; }
.isan-welcome-intro strong {
  font: 700 clamp(16px, 4vw, 22px)/1.2 Georgia, serif; letter-spacing: .12em; color: #f6deb0;
}
.isan-welcome[data-mode="cinematic"]:not(.is-intro-done) .isan-welcome-scroll { display: none; }

.isan-welcome-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px;
}
.isan-welcome-scroll:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.isan-welcome-poster {
  display: block; width: 100%; height: auto; margin: 0 auto;
  object-fit: contain; border-radius: 6px;
}
.isan-welcome-note {
  margin: 10px 2px 0; font: 400 12px/1.6 'IBM Plex Sans Thai', system-ui, sans-serif; color: #e2d3be;
}

.isan-welcome-actions {
  flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 10px; border-top: 1px solid rgba(233, 191, 113, .22);
}
.isan-welcome-btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 46px; padding: 8px 10px; border-radius: 8px; border: 1px solid #e9bf71;
  font: 600 14px/1.3 'IBM Plex Sans Thai', system-ui, sans-serif; text-decoration: none;
}
.isan-welcome-btn--gold { background: #e9bf71; color: #15100a; }
.isan-welcome-btn--ghost { background: #15110f; color: #fff0cd; border-color: #a8793f; }

.isan-welcome-line {
  flex: none; display: flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 10px 8px;
  font: 600 13px/1.3 'IBM Plex Sans Thai', system-ui, sans-serif; color: #e9bf71;
}

.isan-welcome :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
body.isan-welcome-active { overflow: hidden; }

@media (max-width: 360px) {
  .isan-welcome-btn { font-size: 13px; padding: 8px 6px; }
}
@media (prefers-reduced-motion: no-preference) {
  .isan-welcome-dialog { animation: isan-welcome-in .32s ease-out both; }
}
@keyframes isan-welcome-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: none; }
}
