.lottery-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}
.lottery-controls label {
    display: grid;
    gap: 6px;
    flex: 1 1 160px;
    min-width: 0;
}
.lottery-controls label { font-size: .86rem; }
.lottery-controls input,
.lottery-controls select,
.lottery-controls button {
    min-width: 0 !important;
    min-height: 44px;
}
.lottery-controls select,
.lottery-controls input { max-width: 100%; }
.lottery-stage {
    --lottery-ink: #f5f8fa;
    --lottery-highlight: #d3f2df;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .78fr);
    gap: clamp(20px, 4vw, 60px);
    padding: clamp(18px, 4vw, 44px);
    background: #12212a;
    background: radial-gradient(ellipse at 82% 30%, #28464c 0%, #192c36 45%, #12212a 85%);
    color: var(--lottery-ink);
    border: 1px solid #36505c;
    border-radius: 20px;
}
.lottery-stage h2 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.12;
    letter-spacing: -.025em;
    color: inherit;
}
.lottery-quota { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lottery-count {
    font-variant-numeric: tabular-nums;
    font-size: 2.15rem;
    line-height: 1;
    color: var(--lottery-highlight);
    font-weight: 700;
}
.lottery-reset, .lottery-receipt-note { margin: .5rem 0 1.1rem; color: #c5d3db; font-size: .88rem; }
#lotteryDrawForm .secondary {
    color: #eef6f6;
    background: #20353f;
    border: 1px solid #60808d;
}
#lotteryDrawForm .primary:enabled {
    color: #122e26;
    background: var(--lottery-highlight);
    border-color: var(--lottery-highlight);
}
#lotteryDrawForm button:enabled:hover { filter: brightness(1.12); }
#lotteryDrawForm :focus-visible { outline: 2px solid #f3faff; outline-offset: 3px; }
.lottery-display {
    display: grid;
    align-content: center;
    gap: 14px;
    min-width: 0;
    padding: 14px 0;
}
.lottery-display-art {
    min-height: 128px;
    padding: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #5d7a86;
    border-radius: 16px;
    background: repeating-linear-gradient(115deg, #234150 0 1px, #192d37 1px 11px);
    overflow: hidden;
}
.lottery-display-art:empty::before {
    content: '';
    width: 68px;
    height: 68px;
    border: 1px solid #71929e;
    border-radius: 24px;
    transform: rotate(45deg) scale(.8);
    box-shadow: inset 0 0 0 12px #264454, 0 0 32px #162a31;
}
.lottery-display-tile {
    flex: 1 1 80px;
    max-width: 210px;
    min-width: 0;
    min-height: 102px;
    padding: 8px;
    display: grid;
    place-items: center;
    border: 1px solid #577683;
    border-radius: 10px;
    background: #1c313b;
}
.lottery-display-tile img { width: 100%; height: 76px; object-fit: contain; }
.lottery-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.lottery-result-tile { grid-template-rows: auto 60px 1fr; align-content: start; gap: 4px; text-align: center; }
.lottery-result-image { width: 100%; height: 100%; }
.lottery-result-image img { display: block; height: 100%; }
.lottery-result-position { font-size: .75rem; color: #c5d3db; }
.lottery-result-title { font-size: .85rem; overflow-wrap: anywhere; }
.lottery-display-art[data-drawing] .lottery-display-tile { animation: lottery-roll 420ms ease-out 2; }
@keyframes lottery-roll {
    0%, 100% { transform: none; opacity: 1; }
    50% { transform: translateY(-9px); opacity: .6; }
}
.lottery-receipt-title { font-size: clamp(1rem, 2.2vw, 1.35rem); overflow-wrap: anywhere; }
.lottery-receipt-note { margin: .4rem 0 0; }
.lottery-feedback { min-height: 1.5em; margin-top: 10px; }
.lottery-shelf {
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: clamp(14px, 3vw, 24px);
    background: var(--card);
}
.lottery-shelf h3 { margin: 0; }
.lottery-shelf-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.lottery-filters { display: flex; flex-wrap: wrap; gap: 6px; }
button.lottery-filter {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: inherit;
    border-radius: 10px;
}
button.lottery-filter[aria-pressed="true"] { border-color: currentColor; font-weight: 700; }
button.lottery-filter:focus-visible, .lottery-rules summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lottery-preview {
    margin-top: 12px;
    width: 128px;
    height: 56px;
    object-fit: contain;
    object-position: left;
}
.lottery-prizes {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
    gap: 10px;
    padding: 0;
    margin: 14px 0 0;
}
.lottery-prizes li {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 0;
}
.lottery-item-art {
    display: grid;
    place-items: center;
    padding: 5px;
    border-radius: 6px;
    background: #273741;
}
.lottery-item-art img { width: 100%; height: 50px; object-fit: contain; }
.lottery-item-name { overflow-wrap: anywhere; }
.lottery-item-rate, .lottery-rate-summary { font-size: .84rem; font-variant-numeric: tabular-nums; }
.lottery-prizes .lottery-empty { grid-column: 1 / -1; border: 0; }
.lottery-rules { margin-top: 12px; }
.lottery-rules summary { min-height: 44px; padding-block: 11px; cursor: pointer; }
.lottery-rules p { margin: 2px 0 10px; }
.lottery-rate-summary { margin: 10px 0; font-weight: 700; }
.lottery-section { margin-top: 18px; }
.lottery-section h3 { margin-bottom: 8px; }
@media (max-width: 760px) {
    .material-ui #mainNav.show { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .lottery-stage { grid-template-columns: minmax(0, 1fr); gap: 9px; }
    .lottery-display { padding: 0; }
    .lottery-controls label { flex-basis: 100%; }
    #lotteryDrawForm .primary { flex: 1 1 130px; }
}
@media (max-width: 420px) {
    .lottery-prizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .lottery-display-art[data-drawing] .lottery-display-tile { animation: none; }
}
