.ls-dialog {
  --ls-ink: #fff1d2;
  --ls-muted: #c0cbba;
  --ls-brass: #ebc57c;
  --ls-line: #455247;
  --ls-paper: #1d2a22;
  --ls-dark: #142019;
  position: fixed;
  inset: 0;
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  max-height: min(880px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid #756445;
  border-radius: 16px;
  color: var(--ls-ink);
  background: var(--ls-dark);
  color-scheme: dark;
  overflow: hidden;
  font-size: .94rem;
  line-height: 1.5;
}
.ls-dialog[open] { display: flex; flex-direction: column; }
.ls-dialog::backdrop { background: #09110ddd; }
.ls-dialog *, .ls-dialog *::before, .ls-dialog *::after { box-sizing: border-box; }
.ls-dialog [hidden] { display: none; }
.ls-dialog h2, .ls-dialog h3, .ls-dialog h4, .ls-dialog p, .ls-dialog dl { margin: 0; }
.ls-dialog button { font-family: inherit; }
.ls-dialog button:focus-visible, .ls-dialog :is(input, select):focus-visible {
  outline: 2px solid #ffe2a3;
  outline-offset: 2px;
}
.ls-dialog button:disabled { opacity: .52; cursor: default; }
.ls-dialog [tabindex="-1"]:focus { outline: none; }
.ls-header {
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--ls-line);
  background: #18261e;
}
.ls-heading, .ls-header-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ls-heading h2 {
  color: var(--ls-ink);
  font-size: clamp(1.07rem, 2.4vw, 1.5rem);
  line-height: 1.17;
  letter-spacing: -.025em;
  word-break: keep-all;
}
.ls-balance { color: var(--ls-brass); font-size: .82rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ls-scroll { overflow: auto; overscroll-behavior: contain; scrollbar-color: #766342 var(--ls-dark); }
.ls-button, .ls-close, .ls-choice {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--ls-line);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--ls-ink);
  background: #24342a;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
  cursor: pointer;
}
.ls-close { padding: 0; width: 44px; font-size: 1.4rem; }
.ls-button-quiet { white-space: nowrap; color: var(--ls-muted); }
.ls-button-gold {
  border-color: #ebcb8c;
  color: #241a0b;
  background: #e8b966;
  box-shadow: inset 0 1px #ffe3a6;
  font-weight: 850;
}
@media (hover: hover) {
  .ls-dialog :is(.ls-button-quiet, .ls-close, .ls-choice):hover { color: var(--ls-ink); border-color: var(--ls-brass); }
  .ls-button-gold:not(:disabled):hover { background: #f4d393; }
}
.ls-button:not(:disabled):active, .ls-choice:active, .ls-numbers button:active { transform: scale(.98); }
.ls-counter {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 228px;
  overflow: hidden;
  border-bottom: 1px solid #746448;
  background: #111e17;
  padding: 24px clamp(20px, 5vw, 52px);
}
.ls-counter img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
.ls-counter::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #0f1b14eb, #0f1b14a0 40%, #0f1b1400 77%);
}
.ls-counter h3 {
  font-family: "Nanum Myeongjo", "Pretendard Variable", serif;
  font-size: clamp(1.55rem, 4.4vw, 2.85rem);
  line-height: 1.16;
  color: #fff5d9;
  letter-spacing: -.035em;
  font-weight: 800;
}
.ls-counter p { margin-top: 14px; font-size: clamp(.82rem, 2.6vw, 1rem); color: #e2e5d3; }
.ls-counter p strong { color: var(--ls-brass); }
.ls-departments { display: grid; gap: 24px; padding: 22px clamp(14px, 3vw, 30px) 30px; }
.ls-department h3 { margin-bottom: 9px; font-size: 1.05rem; font-weight: 800; }
.ls-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ls-grid-draw { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ls-grid-scratch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ls-product {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 0;
  color: var(--ls-ink);
  text-align: start;
  background: #1b2a21;
  overflow: hidden;
  border: 1px solid #465448;
  border-radius: 11px;
  cursor: pointer;
  transition: border-color .18s ease-out, background-color .18s ease-out;
}
.ls-product img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.52;
  object-fit: cover;
  object-position: 50% 48%;
}
.ls-product > span { display: grid; gap: 3px; padding: 10px 10px 12px; }
.ls-product strong { font-size: .96rem; color: var(--lottery-accent); word-break: keep-all; }
.ls-product small { font-size: .74rem; color: var(--ls-muted); }
@media (hover: hover) {
  .ls-product:hover { border-color: var(--lottery-accent); background: #283829; }
}
.ls-product:active { background: #304234; }

.ls-game { padding: 18px clamp(12px, 3vw, 24px) 24px; }
.ls-game-intro {
  display: grid;
  grid-template-columns: minmax(122px, 240px) 1fr;
  gap: clamp(12px, 3vw, 26px);
  align-items: center;
  margin-bottom: 16px;
  padding: 13px;
  border: 1px solid var(--ls-line);
  border-radius: 12px;
  background: #1c2a21;
}
.ls-game-intro img { display: block; width: 100%; height: auto; border-radius: 8px; aspect-ratio: 1.6; object-fit: cover; }
.ls-game-intro p:not(.ls-jackpot) { margin: 5px 0; color: var(--ls-ink); word-break: keep-all; }
.ls-game-intro div > small { color: var(--ls-muted); font-size: .78rem; }
.ls-jackpot { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15em .5em; color: var(--lottery-accent); }
.ls-jackpot strong { font-size: clamp(1.22rem, 4vw, 2.25rem); letter-spacing: -.025em; line-height: 1.1; }
.ls-jackpot > small { font-weight: 800; }
.ls-workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .62fr); gap: 14px; align-items: start; }
.ls-work, .ls-rules { min-width: 0; border: 1px solid var(--ls-line); border-radius: 12px; background: var(--ls-paper); padding: 15px; }
.ls-work h4, .ls-rules h4 { font-size: 1rem; }
.ls-entry, .ls-ticket-stage, .ls-rules { display: grid; gap: 12px; }
.ls-rules dl { display: grid; gap: 0; }
.ls-rules dl > div { display: grid; gap: 2px; border-top: 1px solid var(--ls-line); padding: 9px 0; }
.ls-rules dt { color: var(--ls-muted); font-size: .83rem; }
.ls-rules dt strong { color: var(--ls-ink); margin-right: 4px; }
.ls-rules dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 800; }
.ls-rules [data-rank="1"] dd { color: var(--lottery-accent); }
.ls-latest { border-top: 1px solid var(--ls-line); padding-top: 10px; }
.ls-latest time { font-size: .79rem; color: var(--ls-muted); }
.ls-latest p { margin-top: 3px; font-size: .87rem; color: var(--ls-brass); overflow-wrap: anywhere; }
.ls-pick-head { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ls-pick-head :is(span, small, time), .ls-bonus-title span { color: var(--ls-muted); font-size: .8rem; }
.ls-pick-head h4 span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ls-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(45px, 1fr)); gap: 5px; }
.ls-numbers button, .ls-bingo-choice span, .ls-ballset span {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 3px;
  border: 1px solid #667769;
  border-radius: 8px;
  background: #101d16;
  color: var(--ls-ink);
  font-size: .94rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.ls-numbers button { cursor: pointer; }
.ls-numbers button[aria-pressed="true"], .ls-choice[aria-pressed="true"], .ls-cover[aria-pressed="true"] {
  border-color: var(--lottery-accent);
  background: var(--lottery-accent);
  color: #142019;
}
.ls-bonus button:not([aria-pressed="true"]), .ls-ballset span.ls-special:not(.ls-hit) { border-color: #d49055; color: #ffb78e; }
.ls-serial { display: grid; grid-template-columns: 100px 1fr; gap: 8px; }
.ls-serial label { display: grid; color: var(--ls-muted); font-size: .82rem; gap: 4px; }
.ls-serial :is(select, input) { min-width: 0; width: 100%; min-height: 44px; padding: 5px 8px; color: var(--ls-ink);
  background: #111c16; border: 1px solid #657467; border-radius: 8px; font: inherit; font-size: 1rem; }
.ls-serial input { font-variant-numeric: tabular-nums; letter-spacing: .18em; }
.ls-bingo-choice, .ls-ballset { display: flex; flex-wrap: wrap; gap: 5px; }
.ls-bingo-choice span, .ls-ballset span { min-height: 40px; min-width: 38px; }
.ls-bingo-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 45px)); }
.ls-ballset strong { align-self: center; color: var(--lottery-accent); padding-right: 4px; }
.ls-ballset .ls-hit, .ls-bingo-choice .ls-hit, .ls-open-cell.ls-hit { border-color: var(--lottery-accent); color: #111d15; background: var(--lottery-accent); }
.ls-game-note { font-size: .88rem; color: var(--ls-muted); }
.ls-game-note time { color: var(--ls-brass); font-weight: 750; }
.ls-submit { width: 100%; min-height: 46px; }
.ls-callout { padding: 8px 10px; background: #122019; border-radius: 8px; color: var(--ls-muted); font-size: .9rem; overflow-wrap: anywhere; }
.ls-callout b { color: var(--ls-ink); }
.ls-ready { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #d6e0c9; font-size: .89rem; }
.ls-live-dot { display: inline-block; border-radius: 50%; width: .52em; height: .52em; background: #c6e694; }
.ls-lanes { display: flex; flex-wrap: wrap; gap: 7px; }
.ls-lanes button { flex: 1; }
.ls-cells { display: grid; gap: 7px; }
.ls-board-row small { color: var(--ls-muted); }
.ls-board { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: 7px; }
.ls-cover, .ls-open-cell, .ls-closed-cell {
  display: grid;
  place-content: center;
  min-width: 0;
  min-height: 60px;
  gap: 1px;
  padding: 4px 2px;
  color: var(--ls-ink);
  border: 1px solid #758579;
  border-radius: 8px;
  background: #27372d;
  text-align: center;
}
.ls-cover {
  border-color: #af986b;
  color: #231e14;
  background: repeating-linear-gradient(135deg, #c9b889 0 3px, #d3c299 3px 5px, #c6b48b 5px 8px);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}
.ls-scratch .ls-cover { touch-action: none; user-select: none; cursor: crosshair; }
.ls-cover.ls-window:not([aria-pressed="true"]) { color: #e5c88d; border-color: #936d38; background: #31291a; }
.ls-closed-cell { color: #9dac9e; background: #18251c; }
.ls-open-cell span { font-weight: 850; font-size: clamp(.75rem, 2vw, 1rem); overflow-wrap: anywhere; }
.ls-open-cell small { font-size: .72rem; line-height: 1.15; }
.ls-open-cell.ls-hit small { color: #172118; }
.ls-open-cell .ls-glyph { font-size: 1.38rem; }
.ls-open-cell { animation: ls-reveal .2s cubic-bezier(.22,.67,.22,1) both; animation-delay: calc(var(--tile) * 16ms); }
@keyframes ls-reveal { from { opacity: .55; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.ls-result { display: grid; gap: .2em; padding: 11px 13px; border: 1px solid var(--ls-line); border-radius: 8px; background: #17241a; }
.ls-result strong { font-size: 1.12rem; }
.ls-result span { color: var(--ls-muted); }
.ls-result:not([data-result="0"]) { border-color: #b59453; }
.ls-result:not([data-result="0"]) strong { color: var(--ls-brass); }
.ls-result[data-result="1"] { box-shadow: inset 0 0 22px #d69d453d; animation: ls-reveal .24s ease-out both; }
.ls-feedback { margin: 12px 18px 0 !important; padding: 10px; border: 1px solid #877850; border-radius: 8px; background: #332b1d; color: #fff1d2; }
.ls-feedback[data-error="true"] { border-color: #e6947d; }
.ls-tickets { display: grid; gap: 8px; padding: 15px 18px; }
.ls-ticket { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0;
  min-height: 55px; padding: 6px; background: #223228; border: 1px solid var(--ls-line); border-radius: 9px;
  color: var(--ls-ink); text-align: left; cursor: pointer; }
.ls-ticket img { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; }
.ls-ticket span { display: grid; gap: 2px; min-width: 0; }
.ls-ticket small { color: var(--ls-muted); overflow-wrap: anywhere; }
.ls-ticket b { color: var(--ls-brass); text-align: right; padding-inline-end: 6px; }
.ls-empty { display: grid; justify-items: start; gap: 12px; padding: 26px; color: var(--ls-muted); }
.lt-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 7px; }
@media (max-width: 790px) {
  .ls-grid-draw { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ls-dialog { width: min(740px, calc(100vw - 20px)); }
}
@media (max-width: 580px) {
  .ls-dialog { width: calc(100vw - 14px); max-height: calc(100dvh - 14px); border-radius: 12px; }
  .ls-header { gap: 6px; padding: 7px 9px; }
  .ls-heading, .ls-header-actions { gap: 6px; }
  .ls-close { width: 39px; }
  .ls-button-quiet { min-width: 44px; padding-inline: 8px; font-size: .79rem; }
  .ls-balance { display: none; }
  .ls-counter { min-height: 171px; padding: 16px; }
  .ls-counter img { object-position: 76% center; }
  .ls-counter::after { background: linear-gradient(90deg, #101b14f5, #101b14cc 38%, #101b1412 78%); }
  .ls-counter p { max-width: 160px; }
  .ls-departments { gap: 19px; padding: 13px; }
  .ls-grid, .ls-grid-draw, .ls-grid-scratch { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ls-game-intro { grid-template-columns: 94px minmax(0, 1fr); padding: 8px; }
  .ls-game-intro img { aspect-ratio: 1; }
  .ls-workbench { grid-template-columns: minmax(0, 1fr); }
  .ls-work, .ls-rules { padding: 10px; }
  .ls-board { gap: 5px; }
  .ls-cover, .ls-open-cell, .ls-closed-cell { min-height: 51px; }
  .ls-ticket { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .ls-ticket img { width: 40px; height: 37px; }
  .ls-ticket b { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ls-dialog *, .ls-dialog *::before, .ls-dialog *::after { animation: none; transition: none; }
}
