.lottery-view { font-size: 1rem; }
.lottery-view [hidden] { display: none !important; }
.lottery-view .account { min-width: 0; }
.lottery-view .who-name { overflow: hidden; text-overflow: ellipsis; max-width: 12em; }
.lottery-main { width: min(1088px, calc(100% - 32px)); margin: 24px auto 48px; padding: 0; }
.lottery-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 4.5vw, 48px);
  background: linear-gradient(112deg, #123b2b, #215943);
  color: #f6fcf7;
  border-radius: var(--radius);
}
.hero-title h1 { font-size: clamp(1.9rem, 4.8vw, 3rem); margin: 0 0 8px; letter-spacing: .025em; }
.hero-title p { margin: 0; color: #e1f2e7; }
.draw-schedule {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  padding: 14px 18px;
  border: 1px solid #83b69a;
  border-radius: 9px;
  background: #123c2c;
}
.draw-schedule span { color: #d7eddf; font-size: .875rem; }
.draw-schedule time, #next-draw-placeholder { font-weight: 750; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.lottery-carryover { padding: clamp(14px, 2.2vw, 24px); }
.lottery-carryover h2 { font-size: 1.25rem; }
.lottery-carryover p { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
.lottery-amounts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.lottery-amounts > div { padding: 8px 12px; border-radius: 8px; background: var(--brand-soft); min-width: 0; }
.lottery-amounts dt { color: var(--muted); font-size: .9rem; }
.lottery-amounts dd {
  margin: 0;
  color: var(--brand);
  font-weight: 750;
  font-size: clamp(1.125rem, 2.7vw, 1.6rem);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.lottery-layout { display: grid; grid-template-columns: minmax(0, 1.17fr) minmax(0, 1fr); align-items: start; gap: 16px; margin-top: 16px; }
.lottery-sales { grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)); }
.lottery-panel { margin: 0; min-width: 0; padding: clamp(14px, 2.2vw, 24px); }
.panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.panel-heading h2 { margin: 0; font-size: 1.25rem; }
.lottery-muted { color: var(--muted); margin: 8px 0 0; }
#tickets-login { margin-top: 14px; }
.ticket-count { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.ticket-owner { display: none; margin: -7px 0 9px; font-size: .9rem; }
.pending-winnings {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 12px;
  margin: 14px 0;
  padding: 10px 12px;
  background: var(--brand-soft);
  border-radius: 8px;
  font-size: .9rem;
}
.pending-winnings strong { font-weight: 750; color: var(--brand); white-space: nowrap; }
.pending-winnings > span:last-child { flex-basis: 100%; }
.lottery-table { border-collapse: collapse; width: 100%; text-align: start; font-size: .9rem; }
.lottery-table th, .lottery-table td { text-align: start; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: normal; }
.lottery-table thead th { color: var(--muted); font-size: inherit; font-weight: 650; padding-block: 5px 8px; position: static; background: transparent; }
.lottery-table tbody tr { cursor: auto; }
.lottery-table tbody tr:hover { background: transparent; }
.lottery-table :is(th, td):first-child { padding-left: 0; }
.lottery-table :is(th, td):last-child { padding-right: 0; }
.lottery-table tbody tr:last-child :is(th, td) { border-bottom: 0; }
.lottery-table :is(strong, time), .lottery-number, .prize-value { font-variant-numeric: tabular-nums; }
.lottery-number { font-weight: 750; }
.printed-ticket {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .18em .45em;
  padding: .48em .65em .48em .82em;
  color: #23443b;
  border: 1px solid #ae9e70;
  border-left: 3px dotted #b69d65;
  border-radius: 3px;
  box-shadow: 0 2px 3px #15281c25;
  background: repeating-linear-gradient(34deg, transparent 0 4px, #788c6e15 4px 5px), linear-gradient(108deg,#f5e5b8,#fbf4d6 52%,#dce1c2);
  font-family: ui-monospace, monospace;
}
.printed-ticket strong { white-space: nowrap; letter-spacing: .07em; }
.printed-ticket > span { color: #495c4d; font-size: .83em; white-space: nowrap; }
.ticket-date { color: var(--muted); }
.ticket-prizes { margin: 0; padding: 0; list-style: none; color: var(--brand); }
.ticket-prizes li + li { margin-top: 3px; }
.ticket-prizes span { display: inline-block; white-space: nowrap; }
.ticket-table td.ticket-status { color: var(--muted); white-space: nowrap; }
.ticket-pages, #page-form { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ticket-pages { justify-content: center; margin-top: 14px; }
#page-form { justify-content: center; font-size: .9rem; }
#page-number { width: 4.6rem; padding: 4px 6px; min-height: 36px; }
.ticket-help { font-size: .9rem; margin-top: 14px; }
.round-label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.lottery-view input, .lottery-view select { background-color: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
#result-round {
  appearance: none;
  width: 100%;
  min-height: 42px;
  padding: 7px 32px 7px 10px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  margin-bottom: 14px;
}
.round-carryover { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--brand-soft); font-size: .9rem; }
.round-totals { display: block; margin-bottom: 14px; padding: 6px 12px; border-radius: 8px; background: var(--brand-soft); }
.round-totals > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; padding: 5px 0; }
.round-totals dd { margin-inline-start: auto; font-size: 1.05rem; text-align: end; }
.round-count-note { font-size: .875rem; }
:is(.prize-table, .result-table) th:first-child { word-break: auto-phrase; }
:is(.prize-table, .result-table) :is(th, td):last-child, .lottery-table .prize-count { text-align: end; }
.lottery-table :is(td.prize-count, td.prize-value) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.prize-number { display: block; }
.prize-number + .prize-number { margin-top: 3px; }
.lottery-error { grid-column: 1 / -1; grid-row: 1; color: var(--danger); margin: 0; padding: 9px 12px; border: 1px solid currentColor; border-radius: 8px; }
.lottery-dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(16px, 4vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.lottery-dialog::backdrop { background: rgb(13 25 18 / 65%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-heading h2 { font-size: 1.2rem; margin: 0; }
.login-methods { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.login-methods [aria-pressed="true"] { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
#login-form label { display: block; margin-top: 10px; }
#login-form input { width: 100%; min-height: 43px; padding: 8px 10px; margin: 4px 0; }
.form-error { color: var(--danger); margin: 7px 0; }
.form-error:empty { margin: 0; }
#login-submit { margin-top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 840px) {
  .lottery-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 540px) {
  .lottery-main { width: calc(100% - 24px); margin-top: 14px; }
  .lottery-hero { align-items: start; flex-direction: column; gap: 16px; padding: 18px; }
  .draw-schedule { padding: 10px 12px; }
  .lottery-view .who-name { display: none; }
  .ticket-owner { display: block; }
  .ticket-pages { display: grid; grid-template-columns: 1fr 1fr; }
  #page-form { grid-column: 1 / -1; grid-row: 2; }
  .ticket-prizes span, .ticket-table td.ticket-status, .lottery-table :is(td.prize-count, td.prize-value) {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

#ticket-order,.buy-actions {display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;}
#buy-count {width:7ch;font:inherit;padding:.4rem .5rem;}
#buy-total {margin-inline:.35rem;}
#buy-message:empty,#buy-balance:empty {display:none;}
#buy-message {overflow-wrap:anywhere;}

.live-draw {
  margin-block: 1rem;
  border-inline-start: .3rem solid #c59030;
}

#live-draw-digits {
  margin-block: .85rem .45rem;
  font-size: clamp(1rem, 3.7vw, 2.4rem);
  font-variant-numeric: tabular-nums;
}

.draw-digits {
  font-family: ui-monospace, monospace;
  font-weight: 750;
  letter-spacing: .06em;
}

#live-draw-candidates {
  margin-block: .45rem;
  font-weight: 650;
}

#live-draw-digits { display:flex; flex-wrap:wrap; align-items:center; gap: .3em; }
#live-draw-digits .draw-digits {
  display:inline-flex; align-items:center; justify-content:center; gap:clamp(2px,.4vw,5px);
  padding:.24em .28em; border:1px solid #857357; border-radius:999px;
  background:linear-gradient(#342f28,#857966 48%,#282621);
  box-shadow:inset 0 2px 5px #161616a8;
}
.draw-ball {
  display:grid; place-items:center; width:clamp(21px,4.7vw,45px); aspect-ratio:1;
  border-radius:50%; color:#c8c3b3; font-size:.68em; letter-spacing:0; line-height:1;
  background:radial-gradient(circle at 31% 22%,#686458,#282922 68%,#151512);
}
.draw-ball.known-ball {
  font-size:.85em; color:#312819;
  background:radial-gradient(circle at 32% 20%,#fffff3,#f8eac3 40%,#c6ae72 75%,#665a43);
  box-shadow:1px 2px 3px #15170edb;
}
.draw-ball.next-ball { color:#f6e0a1; box-shadow:inset 0 0 0 1px #cfb06e; }
