/* Thai guideline board: generated numbers, never actual lottery results. */
.thai-guide {
    --g-ink: #204936;
    --g-muted: #65725e;
    padding: 17px;
    border: 1px solid #dfdfc8;
    border-radius: 20px;
    background: linear-gradient(145deg, #fffef9, #f7f8ef);
    box-shadow: inset 0 1px 0 #fff, 0 5px 20px #05261a12;
    color: var(--g-ink);
}
.thai-guide .g-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.thai-guide .g-eyebrow { margin: 0 0 2px; color: #7a683d; font-size: 11px; font-weight: 400; line-height: 1.5; }
.thai-guide h1 { margin: 0; color: #17452f; font-size: 20px; font-weight: 500; line-height: 1.4; letter-spacing: -.2px; }
.thai-guide .g-heading-mark { display: grid; place-items: center; flex: 0 0 43px; width: 43px; height: 43px; border: 1px solid #e6ddbe; border-radius: 13px; background: #f4efdd; color: #9a8148; }
.thai-guide button { font: inherit; touch-action: manipulation; -webkit-appearance: none; appearance: none; }
.thai-guide button:focus-visible { outline: 3px solid #a58133; outline-offset: 3px; }
.thai-guide .g-draw-all {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; min-height: 48px; margin: 0; padding: 10px 15px;
    border: 1px solid #0e6545; border-radius: 12px;
    background: linear-gradient(115deg, #167b54, #106545); color: #fffdf3;
    box-shadow: inset 0 1px 0 #ffffff24, 0 3px 8px #175c4020;
    font-size: 16px; font-weight: 500; line-height: 1.5; cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}
.thai-guide .g-draw-all svg { flex-shrink: 0; color: #e4d29c; }
.thai-guide .g-draw-all:disabled { opacity: .72; cursor: default; }
.thai-guide .g-choice-hint { margin: 7px 0 13px; color: #65725e; font-size: 11px; line-height: 1.6; text-align: center; }
.thai-guide .g-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.thai-guide .g-group { min-width: 0; padding: 9px 11px 11px; border: 1px solid #dde5d5; border-radius: 13px; background: #f4f7ee; }
.thai-guide .g-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin: 0 0 6px; }
.thai-guide .g-group h2 { min-width: 0; margin: 0; font-size: 13px; font-weight: 400; line-height: 1.5; }
.thai-guide .g-shuffle {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 0 0 auto;
    min-width: 44px; min-height: 44px; padding: 8px 12px;
    border: 1px solid #bfceb4; border-radius: 10px; background: #e8efdf;
    box-shadow: inset 0 1px 0 #ffffffa6; color: #365b36;
    font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap;
    cursor: pointer; transition: background 150ms ease, transform 150ms ease;
}
.thai-guide .g-shuffle svg { flex: 0 0 18px; width: 18px; height: 18px; }
.thai-guide .g-shuffle:disabled { opacity: .48; cursor: default; box-shadow: none; }
.thai-guide .g-values { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.thai-guide .g-number {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    width: max-content; max-width: 100%; min-height: 44px; padding: 4px;
    border: 1px solid transparent; border-radius: 12px; background: transparent;
    cursor: pointer; vertical-align: middle; transition: background 150ms ease;
}
.thai-guide .g-number:disabled { opacity: 1; cursor: default; }
.thai-guide .g-digit {
    display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 33px;
    overflow: hidden; border: 1px solid #e0e4d4; border-radius: 9px;
    background: linear-gradient(155deg, #fff, #f7f8ee); color: #245b3e;
    box-shadow: inset 0 1px 0 #fff, 0 2px 2px #244c2c0b;
    font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums;
    line-height: 1; user-select: none;
}
.thai-guide .g-digit-value { display: block; transform: translateY(0); }
.thai-guide .g-is-empty .g-digit { color: #9ca68f; font-size: 18px; font-weight: 400; }
.thai-guide .g-group-six {
    grid-column: 1 / -1; position: relative; isolation: isolate; overflow: hidden;
    padding: 8px 13px 15px; border-color: #1c6046;
    background: radial-gradient(ellipse at 100% 0, #39765370, transparent 70%), #154d37;
    box-shadow: inset 0 1px 0 #ffffff16; color: #f3f4e8;
}
.thai-guide .g-group-six::before {
    content: ''; position: absolute; z-index: -1; width: 160px; height: 160px;
    inset: -94px -53px auto auto; border: 1px solid #c7bc8122; border-radius: 50%;
    box-shadow: 0 0 0 21px #c7bc8106, 0 0 0 43px #c7bc8104; pointer-events: none;
}
.thai-guide .g-group-six h2 { font-size: 14px; color: #e6eace; }
.thai-guide .g-group-six .g-shuffle { padding-inline: 13px; border-color: #a4b48a70; border-radius: 22px; background: #ffffff0c; box-shadow: inset 0 1px 0 #ffffff0d; color: #eee7bd; }
.thai-guide .g-group-six .g-values { min-height: 49px; }
.thai-guide .g-group-six .g-number { gap: 5px; padding: 4px; border-radius: 26px; }
.thai-guide .g-group-six .g-digit {
    --g-ball: clamp(30px, 9vw, 36px);
    flex-basis: var(--g-ball); width: var(--g-ball); height: var(--g-ball);
    border: 1px solid #e7dba8; border-radius: 50%;
    background: radial-gradient(circle at 34% 24%, #fffef4 20%, #f8f2da 65%, #e8d7a3 100%);
    box-shadow: inset 0 1px 0 #fff, 0 3px 0 #071f1d31, 0 5px 9px #051c1624;
    color: #254f36; font-size: 24px;
}
.thai-guide .g-group-six .g-is-empty .g-digit { color: #929775; font-size: 21px; }
.thai-guide .g-group-back { background: #f0f5ef; border-color: #dbe5d8; }
.thai-guide .g-group-front .g-group-heading, .thai-guide .g-group-back .g-group-heading { justify-content: center; min-height: 25px; margin: 0 0 5px; text-align: center; }
.thai-guide .g-group-front > .g-shuffle, .thai-guide .g-group-back > .g-shuffle { width: 100%; margin-top: 7px; padding-inline: 5px; }
.thai-guide .g-group-two { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1px 10px; padding: 11px 13px; border-color: #e4d9b9; background: #f7f0de; }
.thai-guide .g-group-two h2 { grid-column: 1; color: #705b30; font-size: 14px; }
.thai-guide .g-group-two .g-values { grid-column: 1; justify-items: start; }
.thai-guide .g-group-two .g-number { margin-left: -4px; }
.thai-guide .g-group-two .g-shuffle { grid-column: 2; grid-row: 1 / 3; border-color: #d6c496; border-radius: 22px; background: #f1e5c5; color: #735b28; }
.thai-guide .g-group-two .g-digit { flex-basis: 31px; width: 31px; height: 35px; border-color: #e1d1a5; background: #fffdf3; color: #715627; font-size: 23px; }
.thai-guide .g-group-two .g-is-empty .g-digit { color: #a19777; font-size: 19px; }
.thai-guide .g-number.g-is-saved { border-color: #bbcfad; background: #e7f0dc; }
.thai-guide .g-number.g-is-saved .g-digit { border-color: #aec39f; background: #eef5e4; color: #375e36; }
.thai-guide .g-number.g-is-saved::after { content: '✓'; position: absolute; top: -3px; right: -4px; display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid #fff; border-radius: 50%; background: #34704b; color: #fff; font-size: 10px; line-height: 1; }
.thai-guide .g-group-six .g-number.g-is-saved { background: #2f694d; border-color: #7e9d69; }
.thai-guide .g-tap-hint { margin: 11px 0 8px; color: #75816b; font-size: 11px; font-weight: 400; line-height: 1.5; text-align: center; }
.thai-guide .g-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.thai-guide .g-secondary {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 0; min-height: 44px; padding: 8px 7px;
    border: 1px solid #d3dfc9; border-radius: 10px; background: #fffffa; color: #426343;
    font-size: 12px; font-weight: 400; line-height: 1.5; cursor: pointer;
    transition: background 150ms ease, transform 150ms ease;
}
.thai-guide .g-secondary svg { flex: 0 0 17px; }
.thai-guide .g-secondary:disabled { opacity: .5; cursor: default; }
.thai-guide .g-status { min-height: 18px; margin: 7px 0 0; color: #386344; font-size: 11px; line-height: 1.65; text-align: center; overflow-wrap: anywhere; }
.thai-guide .g-disclaimer { margin: 8px 0 0; padding-top: 9px; border-top: 1px solid #e1e4d5; color: #727761; font-size: 11px; font-weight: 400; line-height: 1.65; text-align: center; text-wrap: balance; }
.thai-guide .g-noscript { margin-top: 10px; color: #725a36; font-size: 12px; line-height: 1.6; }

/* Only number glyphs move; their ivory frames stay still. JS ends each reel
   individually. Every animation also has a finite upper bound. */
.thai-guide .g-is-rolling .g-digit-rolling .g-digit-value { animation: g-reel-pass 100ms linear 15; }
.thai-guide .g-is-rolling .g-digit:not(.g-digit-rolling) .g-digit-value { animation: g-reel-land 200ms cubic-bezier(.18,.7,.3,1) both; }
.thai-guide .g-is-revealed .g-number { animation: g-number-reveal 280ms ease-out both; }
.thai-guide .g-is-rolling .g-shuffle svg { animation: g-shuffle-turn 600ms ease-in-out 2; }
@keyframes g-reel-pass { 0% { transform: translateY(-17px); opacity: .24; } 45% { opacity: .9; } 100% { transform: translateY(17px); opacity: .24; } }
@keyframes g-reel-land { 0% { transform: translateY(-5px); opacity: .6; } 65% { transform: translateY(1px); opacity: 1; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes g-number-reveal { from { transform: translateY(2px); opacity: .72; } to { transform: translateY(0); opacity: 1; } }
@keyframes g-shuffle-turn { from { transform: rotate(0); } to { transform: rotate(180deg); } }

@media (hover: hover) and (pointer: fine) {
    .thai-guide .g-draw-all:hover:not(:disabled) { background: #176c4a; transform: translateY(-1px); }
    .thai-guide .g-secondary:hover:not(:disabled) { background: #edf4e5; }
    .thai-guide .g-shuffle:hover:not(:disabled) { background: #dce8d4; }
    .thai-guide .g-group-six .g-shuffle:hover:not(:disabled) { background: #ffffff12; }
    .thai-guide .g-group-two .g-shuffle:hover:not(:disabled) { background: #e9dab1; }
    .thai-guide .g-number:hover:not(:disabled):not(.g-is-saved) { background: #e2ecda; }
    .thai-guide .g-group-six .g-number:hover:not(:disabled):not(.g-is-saved) { background: #ffffff10; }
    .thai-guide .g-group-two .g-number:hover:not(:disabled):not(.g-is-saved) { background: #eee2c3; }
}
.thai-guide .g-draw-all:active:not(:disabled), .thai-guide .g-secondary:active:not(:disabled), .thai-guide .g-shuffle:active:not(:disabled) { transform: translateY(1px); }
@media (max-width: 380px) {
    .thai-guide { padding: 14px; border-radius: 18px; }
    .thai-guide h1 { font-size: 19px; }
    .thai-guide .g-heading { margin-bottom: 12px; }
    .thai-guide .g-heading-mark { flex-basis: 38px; width: 38px; height: 38px; border-radius: 11px; }
    .thai-guide .g-heading-mark svg { width: 32px; height: 32px; }
    .thai-guide .g-board { gap: 8px; }
    .thai-guide .g-group-front, .thai-guide .g-group-back { padding: 8px 8px 10px; }
    .thai-guide .g-group-front h2, .thai-guide .g-group-back h2 { font-size: 12px; line-height: 1.4; }
    .thai-guide .g-group-front > .g-shuffle, .thai-guide .g-group-back > .g-shuffle { gap: 5px; font-size: 11.5px; }
    .thai-guide .g-group-two { gap: 1px 8px; padding-inline: 11px; }
    .thai-guide .g-group-two h2 { font-size: 13px; }
    .thai-guide .g-secondary { gap: 4px; padding-inline: 4px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .thai-guide *, .thai-guide *::before, .thai-guide *::after { animation: none !important; transition: none !important; }
    .thai-guide button:hover, .thai-guide button:active { transform: none !important; }
}
html[data-reduced-motion=true] .thai-guide *, html[data-reduced-motion=true] .thai-guide *::before, html[data-reduced-motion=true] .thai-guide *::after { animation: none !important; transition: none !important; }
html[data-reduced-motion=true] .thai-guide button:hover, html[data-reduced-motion=true] .thai-guide button:active { transform: none !important; }
