/* =========================================================================
   slotrankfa.com — slot table skin ("reference exhibit").
   Presented like a plate in a print review: cream surface, hairline rules,
   burgundy highlights, quiet chrome.
   ========================================================================= */

.sg-root { --cell: 66px; max-width: 760px; margin-inline: auto; }
@media (max-width: 520px) { .sg-root { --cell: 54px; } }
@media (max-width: 360px) { .sg-root { --cell: 47px; } }

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

/* ------------------------------------------------------------- mode select */
.sg-menu { background: var(--paper-2); border: 1px solid var(--rule); padding: 1.3rem; text-align: center; }
.sg-menu-title { margin: 0 0 0.3rem; font-size: var(--fs-h3); }
.sg-menu-sub { color: var(--dim); font-size: var(--fs-s); max-width: 52ch; margin-inline: auto; }
.sg-menu-grid { display: grid; gap: 1rem; margin-top: 1.2rem; }
@media (min-width: 700px) { .sg-menu-grid { grid-template-columns: repeat(2, 1fr); } }
.sg-mode { display: grid; gap: 0.3rem; text-align: start; cursor: pointer; font: inherit; font-family: var(--serif); background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--gold); padding: 1.1rem; color: var(--ink); }
.sg-mode:hover { border-color: var(--wine); border-top-color: var(--wine); }
.sg-mode-tag { font-family: var(--sans); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wine); }
.sg-mode-name { font-size: 1.1rem; font-weight: 700; }
.sg-mode-desc { font-size: var(--fs-s); color: var(--ink-2); line-height: 1.8; }

/* ------------------------------------------------------------------ status */
.sg-status { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--rule); margin-bottom: 0.9rem; background: var(--paper-2); }
@media (min-width: 640px) { .sg-status { grid-template-columns: repeat(4, 1fr); } }
.sg-stat { padding: 0.55rem 0.7rem; text-align: center; border-inline-end: 1px solid var(--rule); }
.sg-stat:last-child { border-inline-end: 0; }
.sg-stat-l { display: block; font-family: var(--sans); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.sg-stat-v { display: block; font-family: var(--sans); font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sg-stat[data-k="balance"] .sg-stat-v { color: var(--wine); }
.sg-stat[data-k="win"] .sg-stat-v { color: var(--green); }
.sg-stat[data-k="fs"] .sg-stat-v { color: var(--gold); }

/* ----------------------------------------------------------------- cabinet */
.sg-stage { display: grid; gap: 1rem; }
.sg-cabinet { background: var(--paper-2); border: 1px solid var(--rule-2); padding: 0.8rem; }
.sg-reels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.sg-reel { position: relative; height: calc(3 * var(--cell)); overflow: hidden; background: var(--paper); }
.sg-track { display: flex; flex-direction: column; }
.sg-track.is-spinning { animation: sg-scroll 0.28s linear infinite; will-change: transform; }
@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; opacity: 0.5; } }

.sg-cell { height: var(--cell); display: grid; place-items: center; border-bottom: 1px solid var(--paper-3); transition: opacity 0.2s; }
.sg-cell.is-dim { opacity: 0.3; }
.sg-cell.is-win { background: rgba(142, 43, 62, 0.08); box-shadow: inset 0 0 0 2px var(--wine); }
.sg-symbol { width: 84%; height: 84%; display: grid; place-items: center; font-size: clamp(1.1rem, 5vw, 1.75rem); font-weight: 700; background: transparent !important; }
.sg-glyph-txt { font-family: var(--serif); font-size: 0.55em; font-weight: 700; }

.sg-msg { text-align: center; margin: 0.8rem 0 0.1rem; min-height: 1.6em; font-size: var(--fs-s); display: grid; gap: 0.2rem; }
.sg-coach { color: var(--gold); }
.sg-note { color: var(--dim); font-family: var(--sans); font-size: var(--fs-xs); }
.sg-note.is-win { color: var(--green); font-weight: 700; }

/* ---------------------------------------------------------------- controls */
.sg-controls { display: grid; 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; border: 1px solid var(--rule-2); background: var(--paper-2); padding: 0.25rem; }
.sg-betbtn { width: 42px; height: 42px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font-size: 1.25rem; font-weight: 700; cursor: pointer; font-family: var(--sans); }
.sg-betbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.sg-betval { display: grid; text-align: center; min-width: 96px; line-height: 1.25; font-family: var(--sans); }
.sg-betval-l { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.sg-betval strong { font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.sg-spin { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; cursor: pointer; background: var(--wine); color: #fff; border: 0; border-radius: var(--r-s); padding: 0.9rem 1.5rem; min-height: 52px; letter-spacing: 0.02em; }
.sg-spin:hover { background: var(--wine-2); }
.sg-spin:disabled { background: var(--rule-2); cursor: progress; }
.sg-auto { display: flex; justify-content: center; }
.sg-autobtn { font-family: var(--sans); font-size: var(--fs-s); cursor: pointer; background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule-2); border-radius: var(--r-s); padding: 0.6rem 1.1rem; min-height: 44px; }
.sg-autobtn.is-on { border-color: var(--wine); color: var(--wine); }
.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-family: var(--sans); font-size: var(--fs-xs); cursor: pointer; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule); border-radius: var(--r-s); padding: 0.45rem 0.85rem; min-height: 38px; }
.sg-tool:hover { border-color: var(--wine); color: var(--wine); }
.sg-tool[aria-pressed="true"] { border-color: var(--wine); color: var(--wine); background: var(--paper-3); }

/* ------------------------------------------------------------------ panels */
.sg-panel { margin-top: 1rem; background: var(--paper-2); border: 1px solid var(--rule); border-top: 3px double var(--gold); padding: 1.1rem; }
.sg-panel-title { margin-top: 0; font-size: var(--fs-h3); }
.sg-panel-note { font-size: var(--fs-xs); color: var(--dim); font-family: var(--sans); }
.sg-panel-close { display: block; margin: 0.9rem auto 0; font-family: var(--sans); font-size: var(--fs-s); background: var(--paper); color: var(--ink); border: 1px solid var(--rule-2); border-radius: var(--r-s); padding: 0.5rem 1.3rem; cursor: pointer; min-height: 42px; }
.sg-tablewrap { overflow-x: auto; }
.sg-pt, .sg-hist { font-family: var(--sans); 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(--rule); 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: 30px; height: 30px; font-size: 0.95rem; }
.sg-pt small { color: var(--dim); font-size: 0.7rem; }
.sg-pos { color: var(--green); font-weight: 700; }
.sg-rules { font-size: var(--fs-s); color: var(--ink-2); }

.sg-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.55rem; }
.sg-line { margin: 0; text-align: center; }
.sg-linegrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--rule); padding: 1px; }
.sg-linegrid i { aspect-ratio: 1; background: var(--paper); }
.sg-linegrid i.on { background: var(--wine); }
.sg-line figcaption { font-family: var(--sans); font-size: 0.68rem; color: var(--dim); margin-top: 0.25rem; }

.sg-side { display: none; }

/* ------------------------------------------------------------------ modals */
.sg-modal-layer { position: fixed; inset: 0; z-index: 90; background: rgba(26, 26, 24, 0.6); display: grid; place-items: center; padding: 1rem; }
.sg-modal { background: var(--paper-2); border: 1px solid var(--rule-2); border-top: 4px solid var(--wine); max-width: 440px; width: 100%; max-height: 86vh; overflow-y: auto; }
.sg-modal-body { padding: 1.3rem; }
.sg-modal-title { margin-top: 0; color: var(--wine); font-size: var(--fs-h3); }
.sg-modal p { font-size: var(--fs-s); color: var(--ink-2); }
.sg-modal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.sg-btn-primary, .sg-btn-ghost { font-family: var(--sans); font-weight: 700; font-size: var(--fs-s); border-radius: var(--r-s); padding: 0.6rem 1.2rem; cursor: pointer; min-height: 44px; }
.sg-btn-primary { background: var(--wine); color: #fff; border: 0; }
.sg-btn-ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--rule-2); }
.sg-auto-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: 0.8rem 0; }
.sg-auto-opt { font-family: var(--sans); cursor: pointer; background: var(--paper-2); color: var(--ink); border: 0; padding: 0.7rem; min-height: 46px; }
.sg-auto-opt:hover { background: var(--paper-3); }
.sg-sum { list-style: none; padding: 0; margin: 0.6rem 0; font-family: var(--sans); font-size: var(--fs-s); }
.sg-sum li { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--rule); padding: 0.3rem 0; }
.sg-sum span { color: var(--dim); }
.sg-sum strong { font-variant-numeric: tabular-nums; }
.sg-sum-note { font-size: var(--fs-xs); color: var(--dim); }
.sg-cta { display: block; text-align: center; background: var(--paper); border: 1px solid var(--gold); color: var(--wine); font-family: var(--sans); font-weight: 700; padding: 0.65rem 1.2rem; margin-top: 0.8rem; text-decoration: none; font-size: var(--fs-s); }
.sg-cta:hover { background: var(--paper-3); text-decoration: none; }
.sg-cta-note { font-family: var(--sans); font-size: var(--fs-xs); color: var(--dim); text-align: center; margin: 0.4rem 0 0; }
