:root{font-family:Inter,"Noto Sans TC","Microsoft JhengHei",sans-serif;color:#302f2b;background:#fff4ba;font-size:18px;--primary:#c7192e;--muted:#65615a;--line:#e6dfcf}*{box-sizing:border-box}body{margin:0}button,a,input{touch-action:manipulation}button{font:inherit;cursor:pointer;color:inherit}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #007d7d;outline-offset:3px}button{border:0}a{color:var(--primary)}button:disabled{cursor:default}.app{max-width:560px;margin:auto;background:#fffefa;min-height:100dvh;box-shadow:0 0 60px #302f2b10}header{padding:22px 24px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-size:24px;font-weight:800}.brand b{font-size:26px;letter-spacing:-1px}.logo{display:grid;place-items:center;background:var(--primary);color:#fff;border-radius:13px;width:43px;height:43px;font-size:25px}.icon-button{width:46px;height:46px;border:1px solid var(--line);background:transparent;border-radius:50%;font-size:23px}main{padding:0 24px 170px}.intro{padding:29px 0 25px;position:relative;overflow:hidden}.eyebrow{color:#8a5800;font-size:16px;font-weight:600;letter-spacing:2px}h1{font-size:29px;letter-spacing:-1px;line-height:1.4;margin:11px 0 7px}.intro p{margin:0;color:var(--muted);font-size:18px}.intro-mark{display:none}.main-tabs{display:flex;border-bottom:1px solid var(--line);margin-bottom:25px}.main-tabs button{background:transparent;padding:16px 8px;flex:1;border-bottom:3px solid transparent;font-weight:700;font-size:20px;color:var(--muted)}.main-tabs button.active{color:var(--primary);border-color:var(--primary)}#badge{font-size:15px;background:#ffe58b;padding:3px 7px;border-radius:6px;margin-left:5px}.game-row,.section-heading,.selection-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.step{font-size:14px;background:#ffe58b;padding:5px 6px;border-radius:6px;margin-right:9px;color:#765000;vertical-align:middle}.section-label{font-weight:700}.game-button{background:transparent;font-weight:800;padding:10px 0;font-size:20px}.game-button span{font-size:16px;font-weight:500;margin-left:8px;color:#716550}.modes{display:flex;gap:6px;border:1px solid var(--line);background:#fff1bf;padding:5px;border-radius:13px;margin:16px 0 27px}.modes button{flex:1;padding:13px 4px;background:transparent;border-radius:9px;font-size:19px;font-weight:600}.modes button.active{background:white;color:var(--primary);box-shadow:0 2px 5px #302f2b12}.section-heading h2,.selection-title h2{font-size:20px;margin:0}.text-button{background:transparent;color:#716550;padding:12px 0 12px 15px;font-size:18px}.instructions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:5px 0 17px;color:var(--muted);font-size:17px}.instructions p{margin:0;line-height:1.5}#selectedCount{flex-shrink:0;color:var(--primary);font-weight:700}.number-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.number{height:62px;background:white;border:1.5px solid #dfd6c2;border-radius:13px;position:relative;font-size:27px;font-weight:650;font-variant-numeric:tabular-nums;box-shadow:0 2px 1px #302f2b04}.number[aria-pressed=true]{color:white;background:var(--primary);border-color:var(--primary);box-shadow:0 3px 6px #c7192e20}.number[aria-pressed=true]:after{content:'✓';position:absolute;right:5px;top:3px;font-size:12px}.number:disabled{background:#eeeae0;color:#a29a8b;border-style:dashed}.quick-row{display:flex;gap:10px;margin:16px 0 25px}.quick-row button{flex:1;background:#fff0b4;border:1px solid #ecd47b;border-radius:10px;min-height:52px;font-size:18px;font-weight:650}.selection-card{background:#fff4c7;padding:19px;border-radius:15px;border:1px solid #edda96}.selection-title span{font-size:16px;font-weight:600}.selected-list{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}.ball{display:inline-grid;place-items:center;background:white;border:1px solid #e5c96c;width:43px;height:43px;border-radius:50%;font-size:21px;font-weight:700}.ball.empty{border-style:dashed;color:#978c6f;background:transparent}.selected-group{width:100%;line-height:2.3}.selected-group .ball{margin:3px}.group-label{display:block;font-size:17px}.hint,.device-note{font-size:16px;color:#71654b;line-height:1.6;margin:12px 0 0}.device-note{text-align:center;margin:22px 0}.group-buttons{display:flex;gap:8px;margin:-9px 0 20px;flex-wrap:wrap}.group-buttons button{background:#fff9e8;border:1px solid #e4d4a8;border-radius:8px;padding:12px;flex:1;min-width:75px}.group-buttons button.active{border-color:#bd8210;background:#ffdf67;color:#684500}footer{position:fixed;bottom:0;width:100%;max-width:560px;display:flex;gap:15px;align-items:center;justify-content:space-between;background:#fffffff5;border-top:1px solid var(--line);padding:18px 24px max(18px,env(safe-area-inset-bottom));backdrop-filter:blur(10px);z-index:3}footer div{display:flex;flex-direction:column;gap:5px}footer span{font-size:16px;color:var(--muted)}footer strong{font-size:22px}footer button,.primary{background:var(--primary);color:white;border-radius:12px;padding:17px 22px;min-height:60px;font-size:21px;font-weight:700}footer button span{color:white;margin-left:12px;font-size:24px}footer button:disabled{background:#eee7d6;color:#746d5f}footer button:disabled span{color:#746d5f}dialog{width:calc(100% - 32px);max-width:500px;border:0;border-radius:22px;padding:25px;color:#302f2b;max-height:85dvh;overflow:auto;box-shadow:0 20px 80px #543b1833}dialog::backdrop{background:#30251566;backdrop-filter:blur(3px)}.dialog-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.dialog-top h2{font-size:25px;margin:0}.dialog-top button{width:44px;height:44px;background:#fff1bf;border-radius:50%;font-size:28px;flex-shrink:0}dialog p{color:var(--muted);line-height:1.7}dialog .primary,dialog .secondary{width:100%;margin-top:12px}.secondary{background:#fff1bf;padding:16px;border-radius:12px;font-size:20px}.game-options{display:grid;gap:12px}.game-options button{background:#fff7d9;border:1px solid #ead991;border-radius:12px;padding:17px;text-align:left;font-weight:700;font-size:23px}.game-options small{display:block;font-size:17px;font-weight:400;color:var(--muted);margin-top:7px}.help-steps{padding-left:26px;line-height:1.8}.help-steps li{margin:15px 0}summary{cursor:pointer;padding:15px 0;font-weight:700}.source-note{font-size:16px}#toast{position:fixed;bottom:120px;left:50%;transform:translateX(-50%);background:#302f2b;color:white;padding:15px 22px;border-radius:12px;z-index:20;max-width:90%;width:max-content;display:none;font-size:18px}#toast.visible{display:block}.history-heading h2{font-size:25px}.history-heading p{color:var(--muted);line-height:1.6}.empty-history{text-align:center;background:#fff4c7;padding:38px 18px;border-radius:16px;margin-top:30px}.empty-history .empty-icon{font-size:40px;color:#a7770a}.record{background:white;border:1px solid var(--line);border-radius:14px;padding:20px;margin:16px 0}.record-head{display:flex;justify-content:space-between;gap:10px;font-weight:700}.record time{display:block;color:var(--muted);font-size:16px;margin:9px 0}.record-actions{display:flex;gap:10px;margin-top:14px}.record-actions button{padding:12px;background:#fff0b4;border-radius:8px;flex:1}.record-actions .delete{background:#ffedef;color:#a61729}#reviewContent{margin:20px 0;padding:17px;background:#fff4c7;border-radius:12px}#reviewContent h3{margin:0 0 12px}#reviewContent .total{border-top:1px solid #e8d58b;padding-top:14px;font-weight:700}.preview-combos{font-size:18px;line-height:1.9;font-variant-numeric:tabular-nums;word-spacing:6px}.preview-combos div{border-bottom:1px solid #e8dbb2}[hidden]{display:none!important}@media(min-width:500px){.intro-mark{display:block;position:absolute;right:0;top:35px;font-size:45px;font-weight:900;letter-spacing:-3px;color:#e6b83b;transform:rotate(-10deg)}.intro-mark span{display:block;font-size:10px;letter-spacing:2px;text-align:center}.number{height:67px}}@media(max-width:370px){main{padding-left:16px;padding-right:16px}.number-grid{gap:7px}.number{height:56px;font-size:24px}header{padding:17px}h1{font-size:26px}.step{margin-right:5px}.section-heading h2{font-size:18px}.game-button{font-size:18px}footer{padding:14px 16px}.game-row .section-label{font-size:17px}footer button{padding:16px}.quick-row button{font-size:17px}}
footer button{flex-shrink:0;white-space:nowrap}footer div{min-width:0}@media(max-width:370px){footer button{font-size:19px;padding:15px}footer button span{margin-left:5px;font-size:21px}footer span{font-size:15px}}

/* Taiwan Lottery inspired palette: teal, sunshine yellow, and red. */
header{background:#007d7d;border-bottom:5px solid #ffda45;color:#fff}
.brand{color:#fff}.brand b{color:#ffdf52}.logo{background:#ffda45;color:#704300}
.icon-button{color:#fff;border-color:#ffffff80;background:#ffffff0d}
.intro{background:linear-gradient(135deg,#fff9d9,#ffed98);margin:0 -24px;padding:29px 24px 25px}
.intro-mark{right:24px}.intro h1{color:#593e16}
.main-tabs button.active{background:#fff8df}
.modes button.active{background:#ffda45;color:#634300;box-shadow:0 2px 5px #a87c1520}
.number[aria-pressed=true]{background:#c7192e;border-color:#ad1124;box-shadow:0 3px 6px #c7192e24}
.ball:not(.empty){background:#ffdf59;border-color:#edc638;color:#49370b}
footer{border-top:3px solid #f2cf4a}
@media(max-width:370px){.intro{margin-left:-16px;margin-right:-16px;padding-left:16px;padding-right:16px}}

#modes[hidden] + #groupControl + .number-section{margin-top:24px}
