:root {
  --bg: #0f1114;
  --sidebar: #12151a;
  --panel: #171a1f;
  --panel-2: #101318;
  --field: #0d1014;
  --line: #2b3139;
  --line-strong: #3a424d;
  --text: #f5f7fa;
  --muted: #8f98a6;
  --accent: #ecb731;
  --accent-hover: #f3c34f;
  --danger: #ff7373;
  --ok: #80d49a;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: MontserratMedium, Arial, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, input, select { -webkit-tap-highlight-color: transparent; }
.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(370px, 440px) minmax(0, 1fr);
}
.editor {
  min-width: 0;
  max-height: 100vh;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 18px;
  scrollbar-gutter: stable;
}
.brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.eyebrow {
  color: var(--accent);
  font-size: 9px;
  letter-spacing: .15em;
  margin-bottom: 6px;
}
h1 { font-size: 19px; line-height: 1.25; margin: 0; }
.version {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 9px;
  white-space: nowrap;
}
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  padding: 13px;
  margin-bottom: 10px;
}
.panel-title { font-size: 12px; font-weight: 700; }
.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}
.field { display: grid; gap: 6px; min-width: 0; }
.field-span-2 { grid-column: span 2; }
.field > span { color: var(--muted); font-size: 9px; }
.field-meta {
  min-height: 12px;
  color: #717b89;
  font-size: 7.5px;
  line-height: 1.35;
}
.date-input-wrap { position: relative; }
.date-input-wrap input { padding-right: 42px; cursor: pointer; }
.field-icon-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: 1px solid #343c46;
  border-radius: 6px;
  background: #171b20;
  color: #a7b0bc;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.field-icon-btn:hover { color: #fff; border-color: #566170; background: #20252c; }
.field-icon-btn img {
  width: 15px;
  height: 15px;
  display: block;
  object-fit: contain;
  opacity: .95;
}
.field-icon-btn:hover img { opacity: 1; }
.native-picker-wrap { position: relative; min-width: 0; }
.native-picker-wrap input { padding-right: 38px; }
.native-picker-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 11px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  object-fit: contain;
  pointer-events: none;
  opacity: .9;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  top: 0;
  width: 38px;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  color: var(--text);
  background-color: var(--field);
  border: 1px solid #303741;
  border-radius: 7px;
  padding: 8px 10px;
  outline: 0;
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238f98a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
input:focus-visible,
select:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #6b7686;
  outline-offset: 2px;
}
.toggles { display: grid; gap: 7px; margin-top: 11px; }
.toggle, .gold-toggle {
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 9px;
  line-height: 1.4;
  cursor: pointer;
}
.toggle input, .gold-toggle input { accent-color: var(--accent); }
.hint {
  color: var(--muted);
  margin: 0 0 10px;
  font-size: 9px;
  line-height: 1.5;
}
.hint b { color: #dce1e8; }
.editor-symbol-hint { margin-bottom: 8px; }
.layout-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 7px;
}
.layout-summary-item {
  min-width: 0;
  border: 1px solid #303741;
  background: #1b2026;
  border-radius: 7px;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
}
.layout-summary-item span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.25;
}
.layout-summary-item strong {
  color: #e4e8ed;
  font-size: 9px;
  line-height: 1.35;
  font-weight: 600;
}
.layout-clarification {
  margin: 0 0 10px;
  padding-left: 8px;
  border-left: 2px solid #3c4652;
  color: #8f99a5;
  font-size: 8px;
  line-height: 1.45;
}
@media (max-width: 430px) {
  .layout-summary { grid-template-columns: 1fr; }
}
.mini-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn {
  min-height: 34px;
  border: 1px solid #363e48;
  background: #20252c;
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 9px;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
}
.btn:hover { background: #282e36; border-color: #46505c; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #17120a;
  border-color: #e9b735;
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: #171b20; }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.symbol-palette {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.symbol-choice {
  position: relative;
  height: 52px;
  border: 1px solid #303741;
  border-radius: 7px;
  background: var(--panel-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
}
.symbol-choice:hover { border-color: #566170; }
.symbol-choice img { max-width: 43px; max-height: 44px; object-fit: contain; }
.symbol-choice small {
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-size: 8px;
  color: #aab3bf;
  background: #0b0e12;
  border: 1px solid #252b33;
  border-radius: 3px;
  padding: 1px 3px;
}
.symbol-choice.active { border: 2px solid var(--accent); }
.gold-toggle { margin: 9px 0; }
.reel-editor {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: var(--field);
  border: 1px solid #292f37;
  border-radius: 8px;
  min-height: 220px;
  overflow-x: auto;
}
.reel-col { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.reel-cell {
  width: 47px;
  height: 54px;
  border: 1px solid #303741;
  border-radius: 5px;
  background: #171b20;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  position: relative;
}
.reel-cell:hover { border-color: #667282; }
.reel-cell img { width: 42px; max-height: 49px; object-fit: contain; }
.reel-cell.golden::after {
  content: "G";
  position: absolute;
  right: 2px;
  top: 2px;
  font-size: 7px;
  line-height: 1;
  background: #f0bd35;
  color: #1c1404;
  border-radius: 2px;
  padding: 2px;
}
.selected-line { color: var(--muted); font-size: 9px; margin-top: 7px; }
.selected-line span { color: #fff; }
.rule-summary { display: grid; gap: 7px; }
.rule-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #292f37;
  padding-bottom: 6px;
  font-size: 9px;
  line-height: 1.45;
}
.rule-row:last-child { border-bottom: 0; padding-bottom: 0; }
.rule-row span:first-child { color: var(--muted); }
.rule-row strong { text-align: right; overflow-wrap: anywhere; }
.rule-ok { color: var(--ok); }
.rule-warn { color: #f2c467; }
.rule-bad { color: var(--danger); }
.rule-note { margin-top: 9px; color: #7f8895; font-size: 8px; line-height: 1.5; }
.paytable-panel details { font-size: 9px; }
.paytable-panel summary { cursor: pointer; color: #cfd5dd; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
.paytable { width: 100%; border-collapse: collapse; font-size: 8px; }
.paytable th, .paytable td { border: 1px solid #303741; padding: 5px; text-align: right; }
.paytable th:first-child, .paytable td:first-child { text-align: left; }
.paytable th { color: #adb7c4; background: #11151a; }
.smart-panel { border-color: #4d4227; background: #191914; }
.subtle { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.smart-options {
  margin-top: 10px;
  padding: 8px 9px;
  border: 1px solid #2e343d;
  border-radius: 8px;
  background: #111419;
}
.smart-bet-hint {
  margin-top: 5px;
  color: #747e8c;
  font-size: 7.5px;
  line-height: 1.45;
}
.sequence-nav {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #2e343d;
  border-radius: 8px;
  background: #101318;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}
.sequence-nav span { text-align: center; color: var(--muted); font-size: 8px; }
.sequence-nav.active span { color: var(--text); }
.actions-sticky {
  position: sticky;
  bottom: -18px;
  margin: 0 -18px -18px;
  padding: 11px 18px 18px;
  background: var(--sidebar);
  border-top: 1px solid var(--line);
  z-index: 4;
}
.btn-download {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 3px;
  line-height: 1.15;
}
.btn-download span { font-size: 10px; }
.btn-download small { font-size: 8px; font-weight: 500; opacity: .72; }
.preview-area {
  min-width: 0;
  min-height: 100vh;
  padding: 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.preview-toolbar > div { display: grid; gap: 3px; }
.preview-toolbar strong { font-size: 12px; }
.preview-toolbar span { color: var(--muted); font-size: 8px; line-height: 1.4; }
.canvas-stage {
  flex: 1;
  min-height: 360px;
  border: 1px solid #282f37;
  border-radius: 9px;
  background: #090b0e;
  padding: 10px;
  overflow: auto;
  display: grid;
  place-items: start center;
  contain: layout paint;
}
#previewCanvas {
  width: min(1265px, 100%);
  height: auto;
  display: block;
  background: #16171b;
}
.canvas-stage.native #previewCanvas { width: 1265px; max-width: none; }
.date-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 7, 10, .72);
}
.date-dialog[hidden] { display: none; }
.date-dialog-card {
  width: min(430px, 100%);
  border: 1px solid #343c46;
  border-radius: 10px;
  background: #15191f;
  padding: 14px;
}
.date-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.icon-close {
  width: 30px;
  height: 30px;
  border: 1px solid #343c46;
  border-radius: 7px;
  background: #101318;
  color: #9da7b4;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.icon-close:hover { color: #fff; border-color: #566170; }
.date-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.date-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}
.date-dialog-preview {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #2e343d;
  border-radius: 8px;
  background: #0f1216;
  display: grid;
  gap: 4px;
}
.date-dialog-preview span { color: var(--muted); font-size: 8px; }
.date-dialog-preview strong { font-size: 10px; overflow-wrap: anywhere; }
.date-dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 11px; }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  background: #e8edf2;
  color: #101317;
  border: 1px solid #cbd2da;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 9px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .12s linear, transform .12s linear;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .editor { max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-area { min-height: 70vh; }
  .actions-sticky { position: static; margin: 0; padding: 9px 0 0; border-top: 0; }
}
@media (max-width: 520px) {
  .editor, .preview-area { padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .panel-head-row { align-items: flex-start; }
  .symbol-palette { grid-template-columns: repeat(4, 1fr); }
  .reel-editor { justify-content: flex-start; }
  .reel-cell { width: 42px; height: 49px; }
  .preview-toolbar { align-items: flex-start; }
  .date-detail-grid { grid-template-columns: 1fr; }
  .date-quick-actions { grid-template-columns: 1fr; }
}

