/* =========================================================================
   slotgamefa.com — slot table skin ("arcade cabinet").
   Loaded only on pages that mount the game.
   ========================================================================= */

.sg-root { --cell: 74px; max-width: 980px; margin-inline: auto; }
@media (max-width: 520px) { .sg-root { --cell: 58px; } }
@media (max-width: 360px) { .sg-root { --cell: 50px; } }

.sg-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------- mode select */
.sg-menu { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.4rem; text-align: center; }
.sg-menu-title { margin: 0 0 0.3rem; font-size: 1.3rem; }
.sg-menu-sub { color: var(--muted); font-size: var(--fs-s); max-width: 52ch; margin-inline: auto; }
.sg-menu-grid { display: grid; gap: 0.8rem; margin-top: 1.2rem; }
@media (min-width: 720px) { .sg-menu-grid { grid-template-columns: repeat(2, 1fr); } }
.sg-mode {
  display: grid; gap: 0.35rem; text-align: start; cursor: pointer; font: inherit;
  background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 1.1rem; color: var(--cream);
}
.sg-mode:hover { border-color: var(--amber); }
.sg-mode-tag { font-size: var(--fs-xs); color: var(--teal); font-weight: 700; }
.sg-mode-name { font-size: 1.12rem; font-weight: 800; color: var(--amber-2); }
.sg-mode-desc { font-size: var(--fs-s); color: var(--muted); line-height: 1.75; }

/* ------------------------------------------------------------------ status */
.sg-status { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 0.8rem; }
@media (min-width: 640px) { .sg-status { grid-template-columns: repeat(4, 1fr); } }
.sg-stat { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-m); padding: 0.5rem 0.7rem; text-align: center; }
.sg-stat-l { display: block; font-size: var(--fs-xs); color: var(--muted); }
.sg-stat-v { display: block; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sg-stat[data-k="balance"] .sg-stat-v { color: var(--amber-2); }
.sg-stat[data-k="win"] .sg-stat-v { color: var(--ok); }
.sg-stat[data-k="fs"] .sg-stat-v { color: var(--teal); }

/* ----------------------------------------------------------------- cabinet */
.sg-stage { display: grid; gap: 1rem; }
.sg-cabinet {
  background: linear-gradient(180deg, #1a140d, #0d0b09);
  border: 2px solid rgba(232, 176, 75, 0.4);
  border-radius: var(--r-l); padding: 0.85rem;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), var(--shadow);
  position: relative; overflow: hidden;
}
.sg-cabinet::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 200px at 50% 0%, rgba(232, 176, 75, 0.12), transparent 70%);
}
.sg-reels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; background: rgba(0, 0, 0, 0.4); border-radius: var(--r-m); padding: 0.35rem; }
.sg-reel { position: relative; height: calc(3 * var(--cell)); overflow: hidden; border-radius: var(--r-s); background: #071c16; border: 1px solid rgba(255, 255, 255, 0.05); }
.sg-track { display: flex; flex-direction: column; }
.sg-track.is-spinning { animation: sg-scroll 0.28s linear infinite; will-change: transform; filter: blur(1px); }
@keyframes sg-scroll { from { transform: translateY(0); } to { transform: translateY(calc(-1 * var(--cell))); } }
@media (prefers-reduced-motion: reduce) { .sg-track.is-spinning { animation: none; filter: none; opacity: 0.55; } }

.sg-cell { height: var(--cell); display: grid; place-items: center; transition: opacity 0.2s; }
.sg-cell.is-dim { opacity: 0.3; }
.sg-cell.is-win .sg-symbol { box-shadow: 0 0 0 2px var(--amber), 0 0 18px rgba(232, 176, 75, 0.5); }
.sg-symbol {
  width: 84%; height: 84%; border-radius: 12px; display: grid; place-items: center;
  font-size: clamp(1.2rem, 5.4vw, 1.95rem); font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.sg-glyph-txt { font-size: 0.55em; font-weight: 800; }

.sg-msg { text-align: center; margin: 0.7rem 0 0.2rem; min-height: 1.6em; font-size: var(--fs-s); display: grid; gap: 0.2rem; }
.sg-coach { color: var(--teal); }
.sg-note { color: var(--muted); }
.sg-note.is-win { color: var(--ok); font-weight: 700; }

/* ---------------------------------------------------------------- controls */
.sg-controls { display: grid; grid-template-columns: 1fr; gap: 0.6rem; margin-top: 0.9rem; align-items: center; }
@media (min-width: 640px) { .sg-controls { grid-template-columns: auto 1fr auto; } }
.sg-bet { display: flex; align-items: center; gap: 0.4rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem; }
.sg-betbtn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink-3); color: var(--cream); font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.sg-betbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.sg-betval { display: grid; text-align: center; min-width: 92px; line-height: 1.25; }
.sg-betval-l { font-size: var(--fs-xs); color: var(--muted); }
.sg-betval strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.sg-spin {
  font: inherit; font-weight: 800; font-size: 1.15rem; cursor: pointer;
  background: linear-gradient(180deg, var(--amber-2), var(--amber)); color: #16110a;
  border: none; border-radius: 999px; padding: 0.95rem 1.5rem; min-height: 56px;
  box-shadow: 0 6px 0 #a5762a, var(--shadow);
}
.sg-spin:active { transform: translateY(3px); box-shadow: 0 3px 0 #a5762a; }
.sg-spin:disabled { opacity: 0.5; box-shadow: none; cursor: progress; }
.sg-auto { display: flex; justify-content: center; }
.sg-autobtn { font: inherit; font-size: var(--fs-s); cursor: pointer; background: var(--ink-2); color: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 0.6rem 1.1rem; min-height: 44px; }
.sg-autobtn.is-on { border-color: var(--rose); color: var(--rose); }
.sg-autobtn:disabled { opacity: 0.4; }

/* ----------------------------------------------------------------- toolbar */
.sg-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 0.9rem; }
.sg-tool { font: inherit; font-size: var(--fs-xs); cursor: pointer; background: var(--ink-2); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.85rem; min-height: 38px; }
.sg-tool:hover { color: var(--cream); border-color: var(--amber); }
.sg-tool[aria-pressed="true"] { color: var(--amber-2); border-color: var(--amber); }

/* ------------------------------------------------------------------ panels */
.sg-panel { margin-top: 1rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.1rem; }
.sg-panel-title { margin-top: 0; font-size: 1.1rem; }
.sg-panel-note { font-size: var(--fs-xs); color: var(--muted); }
.sg-panel-close { display: block; margin: 0.8rem auto 0; font: inherit; font-size: var(--fs-s); background: var(--ink-3); color: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 0.5rem 1.3rem; cursor: pointer; min-height: 42px; }
.sg-tablewrap { overflow-x: auto; }
.sg-pt, .sg-hist { font-size: var(--fs-s); min-width: 420px; }
.sg-pt th, .sg-pt td, .sg-hist th, .sg-hist td { padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--line); text-align: center; }
.sg-pt th[scope="row"] { display: flex; align-items: center; gap: 0.5rem; text-align: start; font-weight: 700; }
.sg-pt-sym .sg-symbol { width: 34px; height: 34px; font-size: 1.05rem; }
.sg-pt-sym .sg-glyph-txt { font-size: 0.5em; }
.sg-pt small { color: var(--muted); font-size: 0.72rem; }
.sg-pos { color: var(--ok); font-weight: 700; }
.sg-rules { font-size: var(--fs-s); color: #cfc0ad; }

.sg-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 0.55rem; }
.sg-line { margin: 0; text-align: center; }
.sg-linegrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; background: var(--ink-3); padding: 4px; border-radius: 6px; }
.sg-linegrid i { aspect-ratio: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.06); }
.sg-linegrid i.on { background: var(--amber); }
.sg-line figcaption { font-size: 0.7rem; color: var(--muted); margin-top: 0.25rem; }

/* ------------------------------------------------------------ live sidebar */
.sg-side { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1rem; }
.sg-side-title { margin-top: 0; font-size: var(--fs-b); }
.sg-side-list { margin: 0; display: grid; gap: 0.2rem; font-size: var(--fs-xs); }
.sg-side-list > div { display: flex; justify-content: space-between; gap: 0.6rem; border-bottom: 1px dashed var(--line); padding: 0.2rem 0; }
.sg-side-list dt { color: var(--muted); margin: 0; }
.sg-side-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sg-side-meter { margin-top: 0.8rem; }
.sg-side-meter-head { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 0.3rem; }
.sg-meter { position: relative; height: 8px; background: var(--ink-3); border-radius: 999px; overflow: hidden; }
.sg-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--amber)); }
.sg-meter i { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--cream); }
.sg-side-hint { font-size: 0.72rem; color: var(--muted); margin: 0.5rem 0 0; }

/* ------------------------------------------------------------------ modals */
.sg-modal-layer { position: fixed; inset: 0; z-index: 90; background: rgba(6, 5, 4, 0.78); display: grid; place-items: center; padding: 1rem; }
.sg-modal { background: var(--ink-2); border: 1px solid var(--amber); border-radius: var(--r-l); max-width: 460px; width: 100%; box-shadow: var(--shadow); max-height: 86vh; overflow-y: auto; }
.sg-modal-body { padding: 1.3rem; }
.sg-modal-title { margin-top: 0; color: var(--amber-2); }
.sg-modal p { font-size: var(--fs-s); color: #cfc0ad; }
.sg-modal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.sg-btn-primary, .sg-btn-ghost { font: inherit; font-weight: 800; font-size: var(--fs-s); border-radius: 999px; padding: 0.6rem 1.2rem; cursor: pointer; min-height: 44px; }
.sg-btn-primary { background: var(--amber); color: #16110a; border: none; }
.sg-btn-ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
.sg-auto-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin: 0.8rem 0; }
.sg-auto-opt { font: inherit; cursor: pointer; background: var(--ink-3); color: var(--cream); border: 1px solid var(--line); border-radius: var(--r-s); padding: 0.7rem; min-height: 46px; }
.sg-auto-opt:hover { border-color: var(--amber); }
.sg-sum { list-style: none; padding: 0; margin: 0.6rem 0; font-size: var(--fs-s); }
.sg-sum li { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 0.3rem 0; }
.sg-sum span { color: var(--muted); }
.sg-sum strong { font-variant-numeric: tabular-nums; }
.sg-sum-note { font-size: var(--fs-xs); }
.sg-cta { display: block; text-align: center; background: var(--teal); color: #06201d; font-weight: 800; border-radius: 999px; padding: 0.7rem 1.2rem; margin-top: 0.8rem; text-decoration: none; }
.sg-cta:hover { filter: brightness(1.1); text-decoration: none; }
.sg-cta-note { font-size: var(--fs-xs); color: var(--muted); text-align: center; margin: 0.4rem 0 0; }
