@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  --ink: #092e37;
  --masthead: #0a3039;
  --muted: #526d73;
  --teal: #09cebe;
  --deep-teal: #007a70;
  --pale: #e0f8f6;
  --lime: #c9f928;
  --bg: #f3f7f7;
  --paper: #fff;
  --line: #e0ecec;
  --shadow: 0 8px 24px #17474c09, 0 1px 2px #17474c06;
  --wrap: 1220px;
  --type-page: clamp(1.375rem, 4.7vw, 2rem);
  --type-section: clamp(1.0625rem, 2.8vw, 1.25rem);
  --type-card: .9375rem;
  --type-label: .8125rem;
  --card-radius: 16px;
  --nav-inset: env(safe-area-inset-bottom, 0px);
  --font-ui: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-family: var(--font-ui);
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}

:root:lang(ja) { --font-ui: Inter, "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif; }
:root:lang(ko) { --font-ui: Inter, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
:root:lang(th) { --font-ui: Inter, "Noto Sans Thai", Tahoma, system-ui, sans-serif; }

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; font-size: 16px; line-height: 1.5; background: linear-gradient(180deg, #e3f8f5 0, var(--bg) 365px); }
.page-scroll { display: contents; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button, a, input, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid #007d72; }
a { color: inherit; text-decoration: none; }
button { border: 0; background: none; }
h1, h2, h3, p { margin: 0; }
.symbol-library { width: 0; height: 0; position: absolute; overflow: hidden; }
.icon { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 10; transform: translateY(-150%); background: var(--paper); border-radius: 8px; padding: 10px 14px; }
.skip-link:focus { transform: none; }

.masthead { border-bottom: 1px solid #18434a; background: var(--masthead); color: #effbfa; }
.masthead :focus-visible { outline-color: #8bf3e6; }
.masthead-inner { width: min(var(--wrap), calc(100% - 56px)); margin: auto; min-height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 44px; border-radius: 10px; }
.brand img { display: block; width: 156px; height: auto; }
.header-tools { display: flex; align-items: center; gap: 12px; }
.header-button { position: relative; display: grid; justify-items: center; gap: 1px; padding: 3px 5px; min-width: 38px; border-radius: 8px; font-size: 10px; }
.header-button:hover { background: #16424a; }
.notification-dot { position: absolute; width: 7px; height: 7px; right: 7px; top: 4px; border-radius: 50%; background: #ff5459; box-shadow: 0 0 0 2px var(--masthead); }
.desktop-only, .desktop-nav { display: none; }
.bottom-nav {
  grid-area: 2 / 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  padding: 4px max(8px, env(safe-area-inset-right, 0px), calc((100% - 680px) / 2)) calc(5px + var(--nav-inset))
    max(8px, env(safe-area-inset-left, 0px), calc((100% - 680px) / 2));
  border-top: 1px solid #e4eff1;
  border-radius: 18px 18px 0 0;
  background: var(--paper);
  box-shadow: 0 -4px 18px #23647e0b;
}
.bottom-nav > a {
  display: grid; min-width: 0; min-height: 52px;
  border-radius: 12px; color: #365561; touch-action: manipulation;
}
.bottom-nav .nav-item {
  display: grid; grid-template-rows: 36px auto; align-content: start; justify-items: center; gap: 2px;
  min-width: 0; padding: 3px 2px 4px;
  font-size: clamp(.6875rem, 3.1vw, .78125rem); font-weight: 650; line-height: 1.35;
}
.nav-icon { position: relative; display: grid; place-items: center; }
.nav-activity-dot { display: none; }
.bottom-nav .nav-icon { width: 36px; height: 36px; }
.bottom-nav .nav-label { align-self: start; max-width: 100%; text-align: center; text-wrap: balance; overflow-wrap: anywhere; }
.bottom-nav .icon { width: 22px; height: 22px; stroke-width: 1.85; }
.bottom-nav .nav-activity-dot {
  position: absolute; display: block; inset: 4px 3px auto auto; width: 6px; height: 6px;
  border-radius: 50%; background: #ff363d; box-shadow: 0 0 0 2px white;
}
.bottom-nav a[aria-current="page"] { background: #e6f8f5; color: #006d66; }
.bottom-nav a[aria-current="page"] .nav-label { font-weight: 750; }
.bottom-nav .nav-games .nav-icon {
  border-radius: 50%; background: linear-gradient(145deg, #0db9b3, #007f86);
  color: white; --nav-ball-dot: #008c91;
}
.bottom-nav .nav-games[aria-current="page"] .nav-icon { box-shadow: 0 0 0 2px #b5ebe4; }
.bottom-nav a:focus-visible { outline-offset: -3px; }
@media (hover: hover) {
  .bottom-nav a:hover:not([aria-current]) { color: #075850; background: #eef8f5; }
}
@media (max-width: 359px) {
  .bottom-nav {
    column-gap: 2px;
    padding-inline: max(6px, env(safe-area-inset-left, 0px)) max(6px, env(safe-area-inset-right, 0px));
  }
  .bottom-nav .nav-item { padding-inline: 1px; }
}

.container { width: min(var(--wrap), calc(100% - 56px)); margin: 22px auto 0; }
main[tabindex="-1"]:focus { outline: none; }
.wallet { display: flex; justify-content: space-between; align-items: center; gap: 16px 22px; padding: 17px 22px; background: var(--paper); border-radius: 21px; border: 1px solid #fff; box-shadow: var(--shadow); }
.wallet-value { display: flex; align-items: center; gap: 13px; min-width: 0; }
.wallet-badge { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; background: var(--pale); color: #00766c; border-radius: 14px; }
.wallet-label { color: var(--muted); font-size: 12px; font-weight: 650; margin-bottom: 1px; }
.wallet-number { display: flex; align-items: baseline; gap: 3px; font-size: clamp(24px, 4.5vw, 37px); font-weight: 850; line-height: 1.1; letter-spacing: -.075em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wallet-number span:first-child { font-size: .72em; }
.balance-tools { display: flex; gap: 2px; align-self: end; padding-bottom: 1px; }
.icon-button { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 8px; padding: 0; color: #416367; }
.icon-button:hover { background: var(--pale); color: var(--ink); }
.icon-button .icon { width: 19px; height: 19px; }
.wallet-actions { display: flex; align-items: center; gap: 9px; }
.button { min-height: 44px; border-radius: 12px; padding: 10px 18px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; font-size: 14px; transition: background-color .16s, color .16s, box-shadow .16s; }
.button-lime { background: var(--lime); color: #153300; }
.button-lime:hover { background: #b9eb18; }
.button-outline { border: 1px solid #bacfd0; background: #fff; color: var(--ink); }
.button-outline:hover { background: #e9f8f6; border-color: #83c6be; }
.button-dark { background: var(--ink); color: #fff; }
.button-dark:hover { background: #07565a; }
.wallet-actions .button { min-width: 87px; }

.home-overview { display: contents; }
.hero { margin-top: 14px; position: relative; display: flex; align-items: center; min-height: 228px; isolation: isolate; overflow: hidden; border-radius: 22px; background: linear-gradient(105deg, #d0fbf5 0%, #a0f4e8 51%, #25d8c8 100%); border: 1px solid #bef5ed; box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; z-index: -1; width: 550px; height: 270px; border-radius: 100%; background: #e9fff5a8; filter: blur(20px); left: -150px; top: -160px; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .32; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 15px 15px; mask-image: linear-gradient(90deg, transparent 30%, #000 85%, transparent); }
.hero-content { padding: 23px 0 34px clamp(26px, 5%, 66px); width: 65%; position: relative; z-index: 1; }
.hero-kicker { color: #105b57; font-size: 12px; letter-spacing: .13em; font-weight: 750; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hero-kicker::before { content: ""; width: 15px; height: 2px; background: #008b80; border-radius: 5px; }
.hero h1 { font-weight: 850; font-size: clamp(29px, 4vw, 50px); line-height: 1.12; letter-spacing: -.045em; width: max-content; max-width: 100%; }
.hero h1 mark { margin-left: 5px; display: inline-block; background: var(--lime); color: var(--ink); border-radius: .25em; padding: 0 .18em .04em; font-weight: 900; letter-spacing: -.075em; }
.hero p { margin-top: 10px; color: #1e5d5d; font-size: 13px; }
.hero-action { margin-top: 15px; padding: 7px 12px 7px 14px; min-height: 34px; font-size: 12px; }
.hero-action .icon { width: 15px; height: 15px; }
.carousel-dots { position: absolute; display: flex; align-items: center; justify-content: center; gap: 5px; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2; }
.carousel-dots button { padding: 0; height: 23px; width: 23px; display: grid; place-items: center; border-radius: 12px; }
.carousel-dots button::before { content: ""; height: 7px; width: 7px; background: #22686b52; border-radius: 10px; }
.carousel-dots button[aria-pressed="true"]::before { background: #087d72; width: 16px; }

.hero-art { width: 51%; right: 0; position: absolute; inset-block: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 70% 41%; opacity: .78; mask-image: linear-gradient(90deg, transparent, #000 43%); }
.hero-art[data-campaign="welcome"] img { object-position: 66% 39%; mix-blend-mode: multiply; }

.quickbar { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.notice, .shortcuts { min-height: 60px; border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.notice { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 14px; text-align: left; }
.notice > .icon { width: 21px; height: 21px; color: #00a696; }
.notice-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #305458; }
.notice .more, .text-link { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; color: #205b5d; font-size: 12px; font-weight: 700; }
.notice .more { margin-left: auto; }
.more .icon, .text-link .icon { width: 15px; height: 15px; }
.notice:hover, .shortcut:hover { background: #effbf9; }
.shortcuts { display: flex; align-items: stretch; padding: 5px 7px; }
.shortcut { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 11px; border-radius: 12px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.shortcut-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #e0f9f6; color: #106a67; }
.shortcut-icon .icon { width: 19px; height: 19px; }

.dashboard { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; margin-top: 20px; }
.side-column { display: grid; align-content: start; gap: 16px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; min-height: 33px; gap: 12px; margin-bottom: 9px; }
.section-heading h2 { font-size: 21px; display: flex; align-items: center; gap: 8px; font-weight: 820; letter-spacing: -.03em; }
.section-heading h2::before { content: ""; width: 4px; height: 18px; border-radius: 5px; background: #09cdbc; }
.text-link:hover { color: #00776d; text-decoration: underline; }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.game-card { min-width: 0; min-height: 106px; position: relative; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 11px; padding: 12px 13px; border-radius: 17px; box-shadow: var(--shadow); border: 1px solid #fff; background: #fff; }
.game-card:hover { border-color: #a9e7df; }
.game-card h3 { width: max-content; max-width: 100%; font-size: 17px; font-weight: 790; letter-spacing: -.035em; line-height: 1.25; }
.game-meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 10px; margin-top: 4px; }
.game-meta span + span { color: #436770; }
.game-meta span { white-space: nowrap; }
.game-card-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.game-card .button { min-height: 28px; padding: 4px 11px; font-size: 12px; }
.number-stack { width: 69px; height: 64px; isolation: isolate; position: relative; }
.ball { display: inline-grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border-radius: 50%; font-size: 14px; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; background: radial-gradient(circle at 32% 22%, #d5fff8 0%, #5df5e6 20%, #12d8c9 62%, #04b8aa 100%); color: #07323b; box-shadow: inset 0 -2px 3px #007a7130; }
.ball-lime { background: radial-gradient(circle at 32% 22%, #f6ffc5 0%, #dffc61 20%, #c3f02d 62%, #a9da15 100%); box-shadow: inset 0 -2px 3px #63910030; }
.number-stack .ball { position: absolute; border: 1.5px solid #fff; width: 35px; height: 35px; font-size: 15px; box-shadow: 0 2px 5px #0a7c6c20, inset 0 -3px 4px #008d7633; }
.number-stack .ball:nth-child(1) { left: 17px; top: 0; z-index: 1; }
.number-stack .ball:nth-child(2) { left: 1px; top: 26px; z-index: 2; }
.number-stack .ball:nth-child(3) { left: 33px; top: 26px; z-index: 3; }
.timer { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.timer span { padding: 3px; min-width: 18px; text-align: center; border-radius: 4px; background: #103940; color: #fff; line-height: 1; }
.button[data-closed="true"] { background: #e8edee; color: #4f6568; }
.button[data-closed="true"]:hover { background: var(--pale); color: var(--deep-teal); }

.draw-list, .winner-list { display: grid; background: #fff; padding: 0 12px; border-radius: 17px; box-shadow: var(--shadow); }
.draw-row { display: grid; width: 100%; min-width: 0; text-align: left; grid-template-columns: minmax(82px, 1fr) auto minmax(15px, 1fr); align-items: center; gap: 8px; padding: 9px 1px; min-height: 53px; border-bottom: 1px solid #edf3f3; }
.draw-row:last-child, .winner-row:last-child { border-bottom: 0; }
.draw-row:hover { background: #f7fdfb; }
.draw-row > span:first-child { display: grid; gap: 2px; }
.draw-row strong { font-size: 13px; white-space: nowrap; }
.draw-row small { color: var(--muted); font-size: 10px; }
.draw-balls { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.draw-row .ball { width: 25px; height: 25px; font-size: 11px; }
.draw-end { display: flex; align-items: center; justify-content: end; gap: 4px; }
.draw-end .icon { width: 15px; height: 15px; color: #3b6669; }
.draw-tag { border-radius: 6px; background: #e1f8f5; color: #216260; padding: 4px 5px; font-size: 10px; white-space: nowrap; }
.winner-row { min-height: 38px; display: grid; align-items: center; grid-template-columns: 1.1fr 1fr auto; gap: 5px; border-bottom: 1px solid #edf3f3; font-size: 12px; white-space: nowrap; }
.winner-row span:nth-child(2) { color: var(--muted); }
.winner-row strong { border-radius: 15px; background: #d7fa5e; color: #1a390d; font-size: 11px; padding: 4px 8px; font-variant-numeric: tabular-nums; text-align: right; }
.site-footer { text-align: center; color: #4a676c; font-size: 11px; padding: 22px 10px 26px; }
.site-footer a:hover { color: var(--deep-teal); text-decoration: underline; }

.inner-page { max-width: 970px; margin: auto; min-height: 51vh; }
.page-head { margin: 12px 0 20px; }
.page-head h1 { font-size: var(--type-page); line-height: 1.25; letter-spacing: -.025em; margin-bottom: 6px; }
.page-head p, .panel-copy, .form-hint { color: var(--muted); font-size: 14px; line-height: 1.6; }
.inner-page .game-card { min-height: 115px; }
.inner-page .wallet { margin-bottom: 18px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-row button { padding: 8px 13px; border-radius: 24px; font-size: 13px; border: 1px solid var(--line); background: #fff; font-weight: 650; }
.filter-row button:hover { border-color: #59cfc1; }
.filter-row button[aria-pressed="true"] { color: #075850; background: #d9f9f4; border-color: #8ce1d5; }

.inner-page:has(.results-page) { max-width: 1160px; }
.results-head { display: flex; align-items: center; min-height: 116px; margin-bottom: 14px; padding: 18px clamp(16px, 3vw, 30px); border: 1px solid #caeeea; border-radius: 20px; background: #dbf8f4; }
.results-head h1 { font-size: clamp(26px, 4vw, 39px); font-weight: 850; letter-spacing: -.055em; line-height: 1.2; }
.results-head p { margin-top: 6px; color: #3b6368; font-size: clamp(11px, 1.6vw, 14px); line-height: 1.45; }
.results-filters { min-width: 0; margin-bottom: 18px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.results-filters .filter-row { position: relative; flex-wrap: nowrap; gap: 5px; margin: 0; padding: 3px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #bfdcda transparent; }
.results-filters button { flex: 0 0 auto; min-height: 35px; border-color: transparent; padding: 5px clamp(10px, 1.6vw, 18px); color: #375c62; font-size: 13px; white-space: nowrap; }
.results-filters button:hover { background: #edf9f7; border-color: transparent; }
.results-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.results-filters button:focus-visible { outline-offset: -2px; }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; margin-bottom: 9px; }
.results-heading h2 { display: flex; align-items: center; gap: 7px; font-size: clamp(17px, 2.2vw, 22px); font-weight: 820; }
.results-heading h2::before { content: ""; width: 4px; height: 1em; border-radius: 4px; background: var(--teal); }
.result-sources, .official-game-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.result-sources a, .official-game-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted); font-size: 13px; font-weight: 750; }
.result-sources .icon { width: 17px; height: 17px; }
.result-sources [aria-current], .official-game-links [aria-current] { border-color: var(--ink); background: var(--ink); color: #fff; }
.result-sources a:hover:not([aria-current]), .official-game-links a:hover:not([aria-current]) { border-color: var(--deep-teal); color: var(--deep-teal); }
.official-draw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 410px), 1fr)); gap: 12px; }
.official-results-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 8px 16px; margin-bottom: 14px; }
.official-results-toolbar .official-game-links { margin: 0; }
.official-issue-search { flex: 0 1 252px; min-width: 0; }
.official-issue-search .form-error:empty { display: none; }
.official-draw-card { align-content: start; }
.official-draw-card h3 { flex: 1; min-width: 0; margin: 0; font-size: 17px; }
.official-draw-card .result-card-foot:empty { display: none; }
.official-rounds, .official-round { display: grid; gap: 6px; }
.official-round + .official-round { padding-top: 6px; border-top: 1px solid var(--line); }
.official-round-label { color: var(--ink); font-size: 12px; font-weight: 750; }
.official-draw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; color: var(--muted); font-size: 12px; }
.official-draw-meta .text-link { margin-inline-start: auto; }
.official-history { margin-top: 16px; }
.official-history .page-card-heading > span, .official-history-issue time { color: var(--muted); font-size: 13px; }
.official-history ol { margin: 0; padding: 0; list-style: none; }
.official-history li { display: flex; flex-wrap: wrap; align-items: start; gap: 8px 16px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.official-history-issue { display: flex; flex: 0 0 105px; flex-direction: column; gap: 5px; font-size: 13px; }
.official-history-issue a { align-self: start; color: var(--deep-teal); font-weight: 750; }
.official-history-issue a:hover, .official-history-issue a[aria-current] { text-decoration: underline; }
.results-variant { min-height: 34px; padding: 5px 8px; border: 1px solid #c3dcdc; border-radius: 9px; background: var(--paper); color: var(--ink); font-size: 13px; }
.results-grid { display: grid; gap: 10px; }
.result-card { display: grid; grid-template-rows: auto 1fr auto; gap: 9px; width: 100%; min-width: 0; padding: 12px; text-align: left; border: 1px solid #dfeeed; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.result-card:hover { border-color: #75cfc4; }
.result-card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.result-card-head .hall-game-icon { --category-tint: #e1f8f5; --category-color: #08776d; flex: 0 0 36px; width: 36px; border-radius: 10px; }
.result-card-head .hall-monogram { font-size: 12px; }
.result-card-head > strong { flex: 1; min-width: 0; font-size: 16px; font-weight: 800; line-height: 1.3; }
.result-issue { display: inline-block; flex: 0 0 auto; padding: 4px 6px; border-radius: 6px; background: #edf3f4; color: #3a6068; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-number-field { display: grid; align-items: center; min-width: 0; min-height: 57px; padding: 8px; border-radius: 10px; background: #f3f9f9; }
.result-balls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.result-balls-long { display: grid; grid-template-columns: repeat(10, minmax(0, 32px)); }
.result-ball { display: grid; place-items: center; width: 32px; max-width: 100%; aspect-ratio: 1; border: 1px solid #bfe8e3; border-radius: 50%; background: #d5f7f1; color: #063e3e; font-size: 14px; font-weight: 830; font-variant-numeric: tabular-nums; line-height: 1; }
.result-balls-long .result-ball:nth-child(-n+2) { background: #a9f0e5; border-color: #91ddd3; }
.result-zones { display: flex; flex-wrap: wrap; align-items: start; gap: 6px 9px; }
.result-zone { display: grid; gap: 3px; }
.result-zone-label { color: var(--muted); font-size: 10px; line-height: 1.25; }
.result-zone-extra { padding-inline-start: 7px; border-inline-start: 1px solid #d7e8e8; }
.result-zone-extra .result-ball { background: #e6efff; border-color: #ccdcfa; color: #2e4e86; }
.result-zones-ssq .result-zone:first-child .result-ball { background: #fce8e8; border-color: #f0cfd1; color: #913444; }
.result-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.result-card-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }
.result-card-link { display: inline-flex; align-items: center; gap: 2px; color: #136960; font-weight: 750; }
.result-card-link .icon { width: 14px; height: 14px; }
.result-detail { display: grid; gap: 12px; }
.result-detail .result-number-field { min-height: 70px; }
.result-detail dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.result-detail dl > div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.result-detail dt { color: var(--muted); font-size: 12px; }
.result-detail dd { margin: 3px 0 0; color: var(--ink); font-size: 14px; font-weight: 750; }

@media (min-width: 610px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
}
@media (min-width: 1000px) {
  .results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-card { min-height: 150px; }
}

.hall-game-icon { display: grid; place-items: center; width: clamp(36px, 7vw, 56px); aspect-ratio: 1; border-radius: clamp(9px, 1.7vw, 15px); background: var(--category-tint); color: var(--category-color); }
.hall-game-icon .icon { width: 68%; height: 68%; }
.hall-monogram { display: grid; place-items: center; width: 67%; aspect-ratio: 1; border-radius: 50%; border: 2px solid currentColor; font-weight: 850; font-size: clamp(13px, 2.1vw, 19px); letter-spacing: -.06em; }
.empty-state { min-height: 148px; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--muted); font-size: 14px; text-align: center; }
.empty-state .icon { color: #45938e; }

dialog { width: min(540px, calc(100% - 30px)); max-height: min(89dvh, 800px); padding: 0; border: 1px solid #e1eeea; border-radius: 23px; background: white; color: var(--ink); box-shadow: 0 15px 75px #052e3850; }
dialog::backdrop { background: #042a36a0; backdrop-filter: blur(2px); }
body:has(dialog[open]) { overflow: hidden; }
.sheet-inner { padding: 19px 22px 22px; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sheet-header h2 { font-size: 22px; letter-spacing: -.03em; }
.sheet-header .icon-button { margin-right: -4px; }
.form-label { display: grid; gap: 8px; min-width: 0; font-size: 14px; font-weight: 650; }
.form-error { color: #a92738; font-size: 13px; margin: 0; }
.form-error:empty { display: none; }
.language-dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; border-radius: 23px; }
.language-dialog .icon-button { width: 44px; height: 44px; }
.language-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.language-option { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #f5faf9; font-size: .9375rem; text-align: start; overflow-wrap: anywhere; }
.language-option:hover { border-color: #8ad3cb; }
.language-option[aria-pressed="true"] { border-color: var(--deep-teal); background: var(--pale); color: #00695e; font-weight: 700; }
.language-option .icon { width: 17px; height: 17px; visibility: hidden; }
.language-option[aria-pressed="true"] .icon { visibility: visible; }
.language-options[aria-busy="true"] .language-option { cursor: progress; }
.language-error { margin-top: 10px; }
.picker { display: flex; gap: 7px; flex-wrap: wrap; }
.picker-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.picker-form legend { font-size: 14px; font-weight: 750; margin-bottom: 9px; padding: 0; }
.picker-ball { border-radius: 50%; width: 38px; height: 38px; border: 1px solid #cce4e1; background: #f5fcfb; font-size: 13px; font-weight: 750; padding: 0; }
.picker-ball:hover { border-color: #44bdb0; }
.picker-ball[aria-pressed="true"] { background: #a4f6ea; border-color: #28b6a8; }
.picker-ball[data-group="1"][aria-pressed="true"] { background: #ddfa77; border-color: #98c311; }
.toast { position: fixed; z-index: 12; bottom: calc(89px + var(--nav-inset)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 10px 16px; border-radius: 13px; color: #fff; background: #103a40; font-size: 13px; box-shadow: 0 8px 22px #07323f3b; }

.page-back { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; color: var(--deep-teal); font-size: 13px; font-weight: 700; }
.page-back:hover { text-decoration: underline; }
.page-back .icon { width: 15px; height: 15px; rotate: 180deg; }
.page-card { min-width: 0; padding: clamp(14px, 2.2vw, 24px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.page-card h2 { font-size: 19px; line-height: 1.3; }
.page-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.page-field { min-width: 0; width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #c5d9d6; border-radius: 10px; background: #fff; font-size: 15px; transition: border-color .16s, box-shadow .16s; }
.page-field:focus { outline: none; border-color: var(--deep-teal); box-shadow: 0 0 0 3px #007a7014; }
.page-field:disabled { background: #f0f4f3; color: var(--muted); }
select.page-field { appearance: none; padding-inline-end: 34px; background-image: linear-gradient(45deg, transparent 50%, #526d73 50%), linear-gradient(135deg, #526d73 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.page-field[aria-invalid="true"] { border-color: #ad3246; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-actions .icon { width: 17px; height: 17px; }
.page-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.page-pagination .button { min-height: 42px; padding-inline: 15px; }
.detail-layout { display: grid; align-items: start; gap: 16px; }
.detail-tools { min-width: 0; display: grid; align-content: start; gap: 12px; }
.detail-tools > .button { justify-self: start; }
.detail-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px; }
.detail-search .form-error { grid-column: 1 / -1; }
.detail-search button { min-height: 42px; }
.result-detail.page-card { gap: 13px; }
.result-detail .page-card-heading { margin-bottom: 0; }
.result-detail .result-number-field { padding: 12px; }
.result-history, .messages-card, .selection-card { margin-top: 16px; }
.result-history-row { display: grid; grid-template-columns: minmax(94px, 1fr) minmax(0, 4fr) auto; align-items: center; gap: 7px; min-height: 46px; padding: 7px 8px; border-bottom: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.result-history-row:last-child { border-bottom: 0; }
.result-history-row:hover, .result-history-row[aria-current] { background: #effaf8; }
.result-history-row > strong { overflow-wrap: anywhere; }
.result-history-numbers { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.result-history-numbers > span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #d4ebe8; border-radius: 50%; background: var(--pale); font-size: 11px; font-weight: 750; }
.picker-form { display: grid; gap: 16px; }
.picker-form .page-card-heading { margin-bottom: 0; }
.picker-round { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 14px; background: var(--pale); border-radius: 13px; }
.picker-round span { font-weight: 700; }
.picker-round small { display: block; color: var(--muted); }
.picker-round [hidden] { display: none; }
.picker-round .form-error, .picker-round .picker-timing { flex-basis: 100%; }
.picker-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.picker-modes button { display: grid; place-items: center; gap: 3px; padding: 8px 4px; min-height: 54px; border: 1px solid var(--line); background: #fff; border-radius: 11px; }
.picker-modes button:hover { border-color: #44bdb0; }
.picker-modes button[aria-pressed="true"] { color: #075850; background: #d9f9f4; border-color: #28b6a8; }
.picker-modes small { font-variant-numeric: tabular-nums; }
.picker-orders h2 { margin-bottom: 8px; }
.picker-review { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border-radius: 13px; background: var(--pale); }
.picker-review > div { flex: 1 1 155px; overflow-wrap: anywhere; }
.picker-review > div strong { font-size: 13px; }
.picker-clock { color: var(--deep-teal); font-size: 25px; font-variant-numeric: tabular-nums; }
.article-copy { display: grid; align-content: start; justify-items: start; gap: 12px; }
.article-copy p, .article-copy li, .help-list p { color: var(--muted); font-size: 16px; line-height: 1.8; }
.article-copy > p, .article-copy > ul, .article-copy > ol { max-width: 75ch; }
.help-list summary { min-height: 52px; }
.form-error:empty { display: none; }
.article-copy ol, .article-copy ul { display: grid; gap: 7px; margin: 0; padding-left: 21px; }
.asset-credits { margin-top: 16px; }
.page-link-list { display: grid; gap: 10px; }
.page-link-card { display: flex; align-items: center; gap: 13px; }
.page-link-card:hover { border-color: #8ddbd3; }
.page-link-card > .icon { color: var(--deep-teal); }
.page-link-card > span { flex: 1; }
.page-link-card small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.6; }
.help-list details + details { border-top: 1px solid var(--line); }
.help-list summary { padding: 14px 2px; cursor: pointer; font-weight: 750; }
.help-list details p { margin-bottom: 8px; }
.help-list details[open] { padding-bottom: 13px; }
.notice-page .winner-list { padding: 0; border: 0; box-shadow: none; }
.notice-page .winner-row { min-height: 44px; }
.welcome-banner { display: grid; gap: 9px; justify-items: start; padding: clamp(19px, 5vw, 54px); margin: 10px 0 16px; border: 1px solid #b8ece5; border-radius: 22px; background: linear-gradient(110deg, #d0fbf5, #5de4d5); }
.welcome-banner > span { display: inline-flex; align-items: center; gap: 5px; color: var(--deep-teal); font-size: 14px; font-weight: 750; }
.welcome-banner .icon { width: 18px; height: 18px; }
.welcome-banner h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.15; letter-spacing: -.045em; }
.welcome-banner mark { padding: .01em .16em; border-radius: .22em; background: var(--lime); color: var(--ink); }
.welcome-banner p { color: #305458; font-size: 14px; }
.welcome-banner > div { margin-top: 6px; }

@media (min-width: 850px) {
  .detail-layout { grid-template-columns: minmax(0, 1.8fr) minmax(275px, 1fr); }
}

@media (max-width: 980px) {
  .masthead-inner, .container { width: calc(100% - 36px); }
  .header-tools { gap: 6px; }
  .dashboard { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; }
  .game-card { gap: 7px; padding-inline: 8px; }
  .number-stack { transform: scale(.87); transform-origin: left center; width: 59px; }
  .draw-tag { display: none; }
}

@media (max-width: 740px) {
  body { background: var(--bg); }
  .masthead { border-bottom: 0; }
  .masthead-inner { width: calc(100% - 28px); min-height: 61px; gap: 8px; }
  .brand img { width: clamp(110px, 33vw, 132px); }
  .header-tools { gap: 4px; }
  .header-button { min-width: 33px; padding-inline: 4px; }
  .container { width: calc(100% - 24px); margin-top: 2px; }
  .wallet { padding: 12px 11px; min-height: 71px; gap: 6px; border-radius: 17px; }
  .wallet-badge { display: none; }
  .wallet-value { gap: 4px; }
  .wallet-label { font-size: 11px; }
  .wallet-number { font-size: clamp(25px, 6.4vw, 35px); }
  .wallet-actions { gap: 5px; }
  .wallet-actions .button { min-width: 49px; min-height: 32px; padding: 5px 11px; font-size: 12px; }
  .balance-tools { margin-left: 2px; gap: 0; }
  .balance-tools .icon-button { width: 25px; height: 25px; }
  .balance-tools .icon { width: 15px; height: 15px; }
  .hero { margin-top: 10px; min-height: 181px; border-radius: 17px; }
  .hero-content { width: 73%; padding: 15px 0 28px 16px; }
  .hero-kicker { font-size: 10px; margin-bottom: 8px; letter-spacing: .07em; }
  .hero h1 { font-size: clamp(27px, 6.2vw, 41px); }
  .hero p { font-size: 11px; margin-top: 8px; }
  .hero-action { font-size: 11px; margin-top: 10px; min-height: 29px; padding-block: 4px; }
  .hero-art { width: 45%; }
  .carousel-dots { bottom: 3px; }
  .quickbar { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 9px; }
  .notice { min-height: 37px; padding: 6px 9px; gap: 6px; }
  .notice > .icon { width: 18px; height: 18px; }
  .notice-text { font-size: 11px; }
  .notice .more { font-size: 11px; }
  .shortcuts { min-height: 65px; display: grid; grid-template-columns: repeat(4, 1fr); }
  .shortcut { flex-direction: column; gap: 4px; padding: 2px 3px; font-size: 11px; }
  .shortcut-icon { width: 40px; height: 33px; }
  .shortcut-icon .icon { width: 20px; height: 20px; }
  .dashboard { display: block; margin-top: 13px; }
  .side-column { margin-top: 13px; gap: 12px; }
  .section-heading { min-height: 24px; margin-bottom: 6px; }
  .section-heading h2 { font-size: 18px; gap: 6px; }
  .section-heading h2::before { height: 15px; }
  .game-grid { gap: 7px; }
  .game-card, .inner-page .game-card { min-height: 93px; gap: 3px; padding: 8px 5px; border-radius: 13px; }
  .number-stack { transform: scale(.71); width: 47px; }
  .game-card h3 { white-space: nowrap; font-size: clamp(13px, 3.6vw, 16px); }
  .game-meta { display: grid; gap: 2px; font-size: 9px; margin-top: 3px; }
  .game-card-bottom { margin-top: 4px; }
  .game-card .button { min-height: 25px; font-size: 10px; padding-inline: 7px; }
  .timer span { min-width: 15px; padding: 2px; }
  .timer { gap: 1px; font-size: 9px; }
  .draw-row { min-height: 44px; padding-block: 6px; }
  .draw-tag { display: block; }
  .winner-row { min-height: 33px; }
  .inner-page { padding-top: 12px; }
  .results-filters { margin-bottom: 11px; }
  .inner-page .page-head { margin: 8px 0 12px; }
  .page-head p { font-size: 12px; }
  dialog { margin: auto auto 0; width: 100%; max-height: 86dvh; border-radius: 23px 23px 0 0; }
  .sheet-inner { padding: 15px 16px calc(17px + env(safe-area-inset-bottom)); }
  .site-footer { padding: 15px 8px 18px; }
}

@media (max-width: 365px) {
  .masthead-inner, .container { width: calc(100% - 16px); }
  .wallet { padding-inline: 8px; }
  .wallet-actions .button { padding-inline: 7px; }
  .game-card .number-stack { transform: scale(.61); width: 41px; }
  .game-card-bottom { gap: 3px; }
  .game-card .button { padding-inline: 5px; }
  .draw-list { padding-inline: 8px; }
  .draw-row { gap: 4px; }
  .draw-row .ball { width: 22px; height: 22px; }
  .result-card-head > strong { font-size: 14px; }
  .result-ball { width: 28px; font-size: 12px; }
}

@media (min-width: 1024px) {
  :root {
    --desktop-header-height: 113px;
    --bg: #f3f6f6;
    --line: #dce4df;
    --shadow: none;
    --panel-radius: 14px;
  }
  body { display: flex; flex-direction: column; padding-bottom: 0; background: var(--bg); }
  .masthead { position: sticky; top: 0; z-index: 5; flex: 0 0 auto; border-bottom-color: var(--line); }
  .masthead-inner { min-height: 65px; }
  .brand img { width: 145px; }
  .desktop-navigation { display: block; background: #fff; color: var(--ink); }
  .desktop-navigation-inner { display: flex; align-items: stretch; gap: 24px; width: min(var(--wrap), calc(100% - 56px)); min-height: 47px; margin: auto; }
  .desktop-nav { display: flex; align-items: stretch; flex: 1; gap: 2px; }
  .desktop-nav a { display: flex; align-items: stretch; border-bottom: 2px solid transparent; color: #3c5151; }
  .desktop-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 37px;
    padding: 0 clamp(12px, 1.5vw, 22px);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
  }
  .desktop-nav .icon { width: 16px; height: 16px; }
  .desktop-nav a:hover { color: var(--deep-teal); }
  .desktop-nav a[aria-current] { color: var(--deep-teal); border-bottom-color: var(--deep-teal); }
  .desktop-navigation :focus-visible { outline-color: var(--deep-teal); }
  .game-menu { position: relative; flex: 0 0 auto; align-self: center; }
  .game-menu summary { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: #f6f8f5; cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; }
  .game-menu summary:hover, .game-menu[open] summary { background: #e8f1eb; }
  .game-menu summary::-webkit-details-marker { display: none; }
  .game-menu summary .icon { width: 18px; height: 18px; color: var(--deep-teal); }
  .game-menu summary .game-menu-chevron { width: 14px; height: 14px; margin-left: 6px; rotate: 90deg; }
  .game-menu[open] .game-menu-chevron { rotate: -90deg; }
  .game-menu-list { position: absolute; top: calc(100% + 10px); left: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; width: 455px; max-height: calc(100dvh - var(--desktop-header-height) - 16px); overflow: auto; padding: 9px; border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--paper); box-shadow: 0 12px 30px #06333b19; }
  .game-menu-list a { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 38px; padding: 5px 7px; border-radius: 8px; font-size: 13px; font-weight: 650; }
  .game-menu-list a:hover { background: var(--pale); }
  .game-menu-list .hall-game-icon { --category-color: var(--deep-teal); --category-tint: var(--pale); width: 25px; flex: 0 0 25px; border-radius: 7px; }
  .game-menu-list .hall-monogram { border-width: 1px; font-size: 8px; }
  .header-tools { gap: 3px; }
  .header-button, .header-button.desktop-only { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 8px; font-size: 12px; white-space: nowrap; }
  .header-button .icon { width: 19px; height: 19px; }
  .notification-dot { inset: 8px auto auto 24px; }
  .header-wallet.desktop-only { display: flex; align-items: center; gap: 1px; margin-right: 9px; padding: 2px 10px 2px 0; border-right: 1px solid #456162; }
  .header-balance { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 5px 4px 0; border-radius: 5px; font-size: 12px; white-space: nowrap; }
  .header-balance .icon { width: 17px; height: 17px; color: #8bf3e6; }
  .header-balance strong { color: #b8f8ee; font-size: 15px; font-variant-numeric: tabular-nums; }
  .header-wallet .icon-button { width: 27px; height: 28px; color: #d8eceb; }
  .header-wallet .icon-button .icon { width: 16px; height: 16px; }
  .header-wallet .icon-button:hover { color: #173b44; }
  .bottom-nav { display: none; }
  .container { margin-top: 24px; scroll-margin-top: calc(var(--desktop-header-height) + 16px); }
  .site-footer { margin-top: auto; padding: 28px 12px 22px; }
  .toast { bottom: 20px; }

  .button, .page-field { border-radius: 9px; }
  .page-card { border: 1px solid var(--line); border-radius: var(--panel-radius); }
  .inner-page .page-head h1, .results-head h1 { font-weight: 750; letter-spacing: -.035em; }

  .home-overview .hero {
    margin: 0;
    min-height: clamp(304px, 25vw, 362px);
    border: 0;
    border-radius: var(--panel-radius);
    background: #10363b;
    color: #fbfcf5;
  }
  .home-overview .hero::before, .home-overview .hero::after, .hero-art { display: none; }
  .campaign-photo > img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .campaign-photo[data-campaign="welcome"] > img { object-position: 63% 56%; }
  .campaign-photo[data-campaign="results"] > img { object-position: 54% 54%; filter: saturate(.83); }
  .campaign-photo[data-campaign="games"] > img { object-position: 53% 50%; filter: saturate(.8); }
  .hero-photo.desktop-only { display: block; position: absolute; inset: 0 0 0 auto; width: 61%; height: 100%; pointer-events: none; mask-image: linear-gradient(90deg, transparent, #000 32%); }
  .home-overview .wallet { display: none; }
  .hero-content { width: 59%; padding: 22px 0 52px clamp(30px, 4vw, 57px); }
  .hero-kicker { color: #b0ded6; font-size: 13px; letter-spacing: .12em; margin-bottom: 16px; }
  .hero-kicker::before { width: 23px; height: 1px; background: #8bbab0; }
  .hero h1 { font-size: clamp(43px, 4.6vw, 67px); font-weight: 740; line-height: 1.1; }
  .hero h1 mark { background: none; color: var(--lime); border-radius: 0; padding: 0; margin-left: .2em; font-weight: 750; }
  .hero p { margin-top: 14px; color: #ceebe4; font-size: 15px; }
  .hero-action { min-height: 42px; margin-top: 23px; padding-inline: 16px; background: var(--lime); color: #092c32; font-size: 13px; }
  .hero-action:hover { background: #dbff65; color: #092c32; }
  .hero-action:focus-visible, .carousel-dots button:focus-visible { outline-color: #adf4d5; }
  .carousel-dots { left: clamp(30px, 4vw, 57px); bottom: 15px; transform: none; gap: 15px; }
  .carousel-dots button { position: relative; width: auto; height: 30px; padding-bottom: 3px; border-radius: 0; color: #b8d2ca; font-size: 12px; }
  .carousel-dots button::before { position: absolute; inset: auto 0 0; width: 100%; height: 1px; border-radius: 0; background: #719888; }
  .carousel-dots button[aria-pressed="true"] { color: #eff9df; font-weight: 750; }
  .carousel-dots button[aria-pressed="true"]::before { width: 100%; height: 2px; background: var(--lime); }
  .carousel-label.desktop-only { display: block; }
  .home-overview .quickbar { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 0; }
  .home-overview .notice { min-height: 43px; padding: 0 2px; border-radius: 0; background: transparent; }
  .home-overview .notice > .icon { width: 17px; height: 17px; color: var(--deep-teal); }
  .home-overview .notice:hover .notice-text { text-decoration: underline; }
  .home-overview .shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 66px; padding: 0; border-block: 1px solid var(--line); border-radius: 0; background: transparent; }
  .home-overview .shortcut { justify-content: start; gap: 11px; padding: 8px 18px; border-right: 1px solid var(--line); border-radius: 0; font-size: 13px; }
  .home-overview .shortcut:first-child { padding-left: 2px; }
  .home-overview .shortcut:last-child { border-right: 0; }
  .home-overview .shortcut-icon { width: 40px; height: 40px; border-radius: 9px; background: #e8f0e9; color: #27685c; }
  .home-overview .shortcut-icon .icon { display: none; }
  .shortcut-illustration.desktop-only { display: block; width: 24px; height: 24px; }
  .picker-orders.desktop-only { display: block; }
  .dashboard { grid-template-columns: minmax(0, 1.68fr) minmax(332px, 1fr); gap: 25px; margin-top: 25px; }
  .dashboard .section-heading { margin-bottom: 9px; }
  .dashboard .section-heading h2 { font-size: 21px; font-weight: 740; letter-spacing: -.025em; }
  .dashboard .section-heading h2::before { display: none; }
  .dashboard .game-grid { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 15px; border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--paper); }
  .dashboard .game-card {
    grid-template: "icon title meta actions" auto / 36px minmax(94px, 1fr) minmax(101px, 1fr) minmax(127px, auto);
    gap: 0 10px;
    min-height: 56px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .dashboard .game-card:last-child { border-bottom: 0; }
  .dashboard .game-card > div:last-child { display: contents; }
  .dashboard .number-stack { display: none; }
  .home-game-icon.desktop-only { display: block; grid-area: icon; }
  .home-game-icon .hall-game-icon { width: 35px; }
  .hall-game-icon, .result-card-head .hall-game-icon, .game-menu-list .hall-game-icon {
    background: var(--emblem-bg, #e8f1e9);
    color: var(--emblem-ink, #266b5d);
  }
  .hall-game-icon[data-emblem-family="k3"], .hall-game-icon[data-emblem-family="qxc"] { --emblem-bg: #f5ebd9; --emblem-ink: #93662b; }
  .hall-game-icon[data-emblem-family="pk10"], .hall-game-icon[data-emblem-family="fc3d"] { --emblem-bg: #e5edf5; --emblem-ink: #315a8c; }
  .hall-game-icon[data-emblem-family="dart"], .hall-game-icon[data-emblem-family="ssq"] { --emblem-bg: #f5e8e7; --emblem-ink: #935252; }
  .hall-game-icon[data-emblem-family="dlt"] { --emblem-bg: #eeeaf5; --emblem-ink: #735891; }
  .hall-game-icon .icon, .hall-monogram { display: none; }
  .game-emblem.desktop-only { display: block; width: 70%; height: 70%; }
  .dice-game-emblem.desktop-only { display: inline-flex; }
  .dice-game-emblem .hall-game-icon { width: 34px; }
  .dashboard .game-card h3 { grid-area: title; font-size: 15px; font-weight: 700; }
  .dashboard .game-meta { grid-area: meta; margin: 0; font-size: 11px; }
  .dashboard .game-card-bottom { grid-area: actions; justify-content: end; gap: 10px; margin: 0; }
  .dashboard .game-card .button { min-width: 56px; }
  .timer { gap: 0; color: #387267; font-size: 12px; }
  .timer span { min-width: 17px; padding: 0; background: none; color: inherit; }
  .draw-list, .winner-list { border: 1px solid var(--line); border-radius: var(--panel-radius); }
  .draw-row strong { font-weight: 700; }
  .draw-tag, .winner-row strong { background: none; color: var(--deep-teal); }
  .draw-balls .ball { background: #e7f1eb; color: #095b51; box-shadow: none; }
  .draw-balls .ball-lime { background: #eef3d8; color: #485625; }

  .inner-page, .inner-page:has(.results-page) { max-width: none; }
  .results-head { position: relative; isolation: isolate; overflow: hidden; min-height: 118px; padding: 15px 24px; border: 1px solid #dce7e0; border-radius: var(--panel-radius); background: #eaf2ed; }
  .results-head > div { position: relative; z-index: 1; }
  .results-photo.desktop-only { position: absolute; inset: 0 0 0 auto; display: block; width: 41%; mask-image: linear-gradient(90deg, transparent, #000 32%); }
  .results-filters { border-radius: var(--panel-radius); }
  .results-grid { gap: 15px; }
  .result-card { min-height: 160px; padding: 14px; border-radius: var(--panel-radius); }
  .result-number-field { border-radius: 5px; background: #f4f7f3; }
  .result-detail .page-card-heading h2 { display: flex; align-items: center; gap: 8px; }
  .result-title-emblem.desktop-only { display: inline-block; }
  .result-title-emblem .hall-game-icon { width: 29px; }
  .welcome-banner { position: relative; isolation: isolate; overflow: hidden; border: 0; border-radius: var(--panel-radius); background: #163a3e; color: #fff; }
  .welcome-banner > :not(picture) { position: relative; z-index: 1; }
  .welcome-banner > span, .welcome-banner p { color: #cce8de; }
  .welcome-photo.desktop-only { position: absolute; inset: 0 0 0 auto; display: block; width: 55%; mask-image: linear-gradient(90deg, transparent, #000 34%); }
}

.mobile-only { display: none; }

@media (max-width: 1023px) {
  :root {
    --mobile-gutter: clamp(12px, 4vw, 24px);
    --mobile-safe-top: env(safe-area-inset-top, 0px);
  }

  body:not(.dice-route, .deposit-route) {
    display: grid; grid-template: minmax(0, 1fr) auto / minmax(0, 1fr); height: 100dvh; overflow: hidden;
  }
  body:not(.dice-route, .deposit-route) .page-scroll {
    display: block; grid-area: 1 / 1; overflow: auto; background: inherit; background-attachment: local;
  }
  body:not(.dice-route, .deposit-route) .toast {
    position: relative; grid-area: 1 / 1; align-self: end; justify-self: center; margin-bottom: 12px;
    inset: auto; transform: none; pointer-events: none;
  }

  .masthead-inner, .container { width: calc(100% - 2 * var(--mobile-gutter)); }
  body[data-page]:not([data-page="home"]) .masthead { display: none; }
  body[data-page="home"] {
    --home-masthead-height: calc(68px + var(--mobile-safe-top));
    background: linear-gradient(var(--masthead) calc(var(--home-masthead-height) + 38px), var(--bg) 0);
  }
  body[data-page="home"] .masthead { padding-top: var(--mobile-safe-top); }
  body[data-page="home"] .masthead-inner { min-height: 68px; }
  body[data-page="home"] .header-button { min-width: 44px; min-height: 44px; align-content: center; }
  body[data-page="home"] .container { margin-top: 0; }
  body[data-page="home"] .wallet { border-color: #e5eeeb; box-shadow: 0 6px 16px #0c393b14; }

  body:is([data-page="results"], [data-page="official-results"]) .container { margin-top: 0; }

  body:is([data-page="results"], [data-page="official-results"]) .inner-page { padding-top: 0; }
  .results-head {
    position: relative; isolation: isolate; overflow: hidden; min-height: calc(135px + var(--mobile-safe-top));
    margin: 0 calc(-1 * var(--mobile-gutter)) 12px; padding: calc(22px + var(--mobile-safe-top)) var(--mobile-gutter) 22px;
    border: 0; border-radius: 0 0 24px 24px; background: #0d353a; color: #f7fffd;
  }
  .results-head > div { max-width: min(310px, 66%); min-width: 0; }
  .results-head h1 { font-size: clamp(28px, 7.8vw, 40px); line-height: 1.14; overflow-wrap: anywhere; }
  .results-head p { color: #c2e4df; font-size: 12px; line-height: 1.45; }
  .results-photo.mobile-art {
    position: absolute; inset: 0 0 0 auto; z-index: -1; width: min(58%, 480px);
    mask-image: linear-gradient(90deg, transparent, #000 74%); opacity: .8;
  }
  .results-photo.mobile-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 58% 46%; }
  .result-sources {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px;
    border: 1px solid #dbeae6; border-radius: 14px; background: #e8f2ef; margin-bottom: 10px;
  }
  .result-sources a {
    justify-content: center; min-width: 0; min-height: 42px; padding: 5px 6px; text-align: center;
    border-color: transparent; border-radius: 10px; background: transparent; overflow-wrap: anywhere;
  }
  .result-sources a[aria-current] { background: #fff; color: #0a5d55; box-shadow: 0 1px 5px #18474815; }
  .result-sources a:focus-visible { outline-offset: -1px; }
  .results-filters .filter-row { scrollbar-width: none; }


  .page-back.mobile-only { display: inline-flex; }
  .inner-page:has(> .page-back:first-child + .page-head) {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; align-content: start;
    padding-top: calc(14px + var(--mobile-safe-top));
  }
  .inner-page:has(> .page-back:first-child + .page-head) > :nth-child(n+3) { grid-column: 1 / -1; min-width: 0; }
  .inner-page > .page-back:first-child:has(+ .page-head) {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--ink);
    border: 1px solid #daeae6; border-radius: 13px; background: var(--paper);
  }
  .inner-page > .page-back:first-child:has(+ .page-head) .icon { width: 23px; height: 23px; }
  .inner-page > .page-back:first-child:has(+ .page-head) span { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .inner-page > .page-back:first-child + .page-head { align-self: center; margin: 0 0 13px; padding-top: 5px; }
  .inner-page > .page-back:first-child + .page-head h1 { font-size: var(--type-page); line-height: 1.2; overflow-wrap: anywhere; }
  body[data-page="welcome"] .inner-page { padding-top: calc(14px + var(--mobile-safe-top)); }

  html:not(:lang(zh)) .wallet, html:not(:lang(zh)) .account-wallet-top { flex-wrap: wrap; }
  html:not(:lang(zh)) .notice-text { min-width: 0; }
  html:not(:lang(zh)) .account-shortcuts a > span:last-child { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  html:not(:lang(zh)) .game-card h3, html:not(:lang(zh)) .game-meta span,
  html:not(:lang(zh)) .result-sources a { white-space: normal; overflow-wrap: anywhere; }
  html:not(:lang(zh)) .shortcuts { overflow: auto; }
  html:not(:lang(zh)) .shortcut { white-space: normal; text-align: center; }
  html:not(:lang(zh)) .hero h1 { width: auto; }
  html:not(:lang(zh)) .dice-sidebar > * { white-space: normal; text-align: center; }
}

@media (max-width: 365px) {
}

/* Shared spacing and touch targets for the mobile page families. */
@media (max-width: 1023px) {
  .page-scroll { scrollbar-gutter: stable; overscroll-behavior-y: contain; }
  .container { padding-bottom: 20px; }
  .page-field { min-height: 48px; font-size: 16px; }
  .page-card { padding: 18px; border-radius: 16px; }
  .page-card-heading { flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; }
  .page-head p, .form-hint { font-size: 14px; }
  .section-heading { min-height: 36px; margin-bottom: 10px; }
  .section-heading h2 { font-size: 20px; }
  .text-link { min-height: 32px; font-size: 13px; }
  .wallet { padding: 16px; border: 1px solid #e0eae7; border-radius: 18px; gap: 10px; }
  .wallet-value { flex: 1; flex-wrap: wrap; gap: 8px; }
  .wallet-label { font-size: 12px; }
  .wallet-number { font-size: clamp(26px, 7vw, 34px); letter-spacing: -.05em; }
  .wallet-actions .button { min-height: 38px; padding-inline: 13px; font-size: 13px; }
  .balance-tools .icon-button { width: 28px; height: 32px; }
  .hero { min-height: 198px; margin-top: 14px; border-radius: 18px; }
  .hero-content { padding: 20px 0 32px 18px; }
  .hero-kicker { font-size: 12px; }
  .hero p { max-width: 190px; font-size: 13px; line-height: 1.6; }
  .hero-action { min-height: 36px; font-size: 13px; padding-inline: 14px; }
  .notice { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); }
  .notice-text, .notice .more { font-size: 12px; }
  .shortcuts { min-height: 80px; padding: 8px 4px; border: 1px solid var(--line); }
  .shortcut { min-height: 60px; font-size: 13px; gap: 6px; }
  .dashboard { margin-top: 20px; }
  .side-column { margin-top: 20px; gap: 20px; }
  .dashboard .game-grid { gap: 10px; }
  .dashboard .game-card { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 12px; min-height: 148px; border: 1px solid var(--line); border-radius: 15px; }
  .dashboard .number-stack { display: none; }
  .dashboard .home-game-icon.desktop-only { display: block; }
  .dashboard .home-game-icon .hall-game-icon { width: 32px; border-radius: 9px; }
  .dashboard .home-game-icon .hall-monogram { font-size: 13px; }
  .dashboard .game-card h3 { font-size: 16px; line-height: 1.4; letter-spacing: -.02em; }
  .dashboard .game-meta { gap: 2px 7px; margin-top: 4px; font-size: 12px; }
  .dashboard .game-card-bottom { margin-top: 10px; gap: 8px; }
  .dashboard .game-card .button { min-height: 34px; font-size: 13px; padding: 5px 12px; }
  .dashboard .timer { font-size: 12px; }
  .dashboard .timer span { min-width: 18px; padding: 3px; }
  .results-head { min-height: calc(128px + var(--mobile-safe-top)); }
  .results-head p { font-size: 14px; line-height: 1.6; }
  .result-sources a { font-size: 13px; }
  .results-filters .filter-row button { min-height: 42px; padding-inline: 13px; font-size: 14px; }
  .result-card { padding: 16px; border-radius: 16px; }
  .result-card-head strong { font-size: 16px; }
  .result-card-foot { min-height: 32px; font-size: 13px; }
  .result-number-field { padding: 12px; min-height: 64px; }
  .result-history-row { grid-template-columns: minmax(78px, .8fr) minmax(0, 2fr) auto; min-height: 58px; padding-block: 12px; font-size: 14px; }
  .result-history-numbers > span { width: 28px; height: 28px; font-size: 12px; }
  .picker-ball { width: 44px; height: 44px; font-size: 16px; }
  .picker-review { padding: 14px; gap: 12px; }
  .picker-review .button { width: 100%; }
  .help-list summary { padding-block: 18px; font-size: 16px; }
}

@media (min-width: 1024px) {
  .page-card { padding: 24px; }
  .inner-page { padding-bottom: 32px; }
  .desktop-nav .nav-item { padding-inline: clamp(16px, 2vw, 26px); }
  .header-button { font-size: 14px; }
  .home-overview .hero { min-height: 260px; }
  .dashboard .game-card { min-height: 72px; }
  .game-menu-list a { min-height: 44px; }
  :root { --masthead: #07474c; }
  .masthead { background: linear-gradient(105deg, #073e43, #09635f); }
  .desktop-navigation { border-bottom: 1px solid #dde9e9; }
  .desktop-nav a { margin-right: 4px; border-bottom-width: 3px; }
  .desktop-nav a[aria-current] { color: #006b66; border-bottom-color: #00877f; background: #e8f6f3; }
  .game-menu summary { border-color: #c8dfdb; background: #f4faf8; }
  .game-menu-list { right: 0; left: auto; }
  body:is([data-page="games"], [data-page="results"], [data-page="official-results"], [data-page="activities"]) .inner-page { max-width: none; }
  .result-history-row { min-height: 56px; font-size: 14px; }
  .article-copy { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
