:root { color-scheme: light; --ink:#211d27; --red:#d94b42; --red-dark:#a8322d; --paper:#fffaf4; --yellow:#ffd667; --line:#ded5ca; --muted:#766e79; }
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 100% 0, #ffd8d4 0 150px, transparent 151px), var(--paper); font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button, a { font: inherit; }
button { touch-action: manipulation; }
.topbar { height: 62px; padding: 0 16px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(33,29,39,.12); background: rgba(255,250,244,.93); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: .95rem; font-weight: 950; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 2px solid var(--ink); border-radius: 11px 11px 13px 13px; background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-3deg); }
.brand-mark i { width: 4px; height: 5px; border-radius: 10px; background: var(--ink); }
.header-actions { display:flex; align-items:center; gap:7px; }.reset-button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; font-size: .78rem; font-weight: 800; text-decoration:none; }.rules-link { color:var(--red-dark); border-color:#e7b0ab; }
main { width: min(100%, 620px); margin: 0 auto; padding: 25px 14px 60px; }
.intro { padding: 10px 4px 20px; }
.eyebrow, .section-heading p { margin: 0; color: var(--red); font-size: .68rem; font-weight: 950; letter-spacing: .13em; }
.intro h1 { margin: 5px 0 5px; font-size: clamp(2.4rem, 12vw, 4rem); line-height: 1.05; letter-spacing: -.06em; }
.intro > p:last-child { margin: 0; color: var(--muted); font-size: .9rem; font-weight: 700; }
.summary { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 7px; }
.summary > div { min-width: 0; height: 103px; padding: 12px 5px; display: grid; place-items: center; align-content: center; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.summary span { color: var(--muted); font-size: .67rem; font-weight: 850; }
.summary strong { margin-top: 2px; font-size: 2rem; line-height: 1; }
.summary small { margin-top: 4px; color: var(--muted); font-size: .67rem; font-weight: 800; }
.summary .total-card { color: #fff; border: 2px solid var(--ink); background: var(--red); box-shadow: 4px 4px 0 var(--ink); }
.summary .total-card span, .summary .total-card small { color: #fff; }
.progress { height: 10px; margin: 16px 2px 20px; overflow: hidden; border-radius: 99px; background: #e8dfd5; }
.progress span { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--red); transition: width .25s ease; }
.failure-card { padding: 16px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; border: 2px solid var(--ink); border-radius: 20px; background: var(--yellow); box-shadow: 5px 5px 0 var(--ink); }
.failure-card > div:first-child { display: grid; }
.failure-card span { font-size: .72rem; font-weight: 850; }
.failure-card strong { font-size: 1.1rem; }.failure-card strong b { margin-right: 3px; font-size: 2rem; }
.failure-actions { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.failure-actions button { min-height: 50px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 13px; font-size: .82rem; font-weight: 950; }
.failure-add { color: #fff; background: var(--ink); }.failure-add:active { transform: scale(.97); }
.failure-undo { min-width: 96px; background: #fff; }.failure-undo:disabled { opacity: .4; }
.numbers-section { margin-top: 28px; padding: 16px 10px 12px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.section-heading { padding: 0 4px 13px; display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.section-heading h2 { margin: 2px 0 0; font-size: 1.2rem; }.section-heading > span { color: var(--muted); font-size: .68rem; font-weight: 800; }
.number-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.number-cell { aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid #d9d0c5; border-radius: 8px; color: var(--ink); background: var(--paper); font-size: clamp(.62rem, 2.8vw, .9rem); font-weight: 900; cursor: pointer; transition: transform .12s ease, background .12s ease; }
.number-cell.is-filled { color: #fff; border-color: var(--ink); background: var(--red); box-shadow: inset 0 -3px 0 var(--red-dark); transform: scale(.94); }
.number-cell:focus-visible { outline: 3px solid #6754d9; outline-offset: 1px; }
.share-panel { margin-top:22px; padding:20px; border:2px solid var(--ink); border-radius:21px; background:#ffd8d4; box-shadow:5px 5px 0 var(--ink); }.share-panel>p { margin:0; color:var(--red-dark); font-size:.68rem; font-weight:950; letter-spacing:.13em; }.share-panel h2 { margin:4px 0 7px; font-size:1.28rem; }.share-panel>span { display:block; color:var(--muted); font-size:.82rem; font-weight:700; line-height:1.6; }.share-actions { margin-top:16px; display:grid; grid-template-columns:1fr 1fr; gap:8px; }.share-actions button { min-height:48px; border:2px solid var(--ink); border-radius:12px; color:var(--ink); background:#fff; font-weight:950; cursor:pointer; }.share-actions .share-main { grid-column:1/-1; color:#fff; background:var(--red); }.share-panel small { margin-top:10px; display:block; color:var(--muted); font-size:.68rem; font-weight:700; text-align:center; }
.save-note { margin: 18px 0 0; color: var(--muted); font-size: .72rem; font-weight: 750; text-align: center; }.save-note span { color: #35a96e; }
.toast { min-width: 180px; padding: 11px 16px; position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 20; border-radius: 99px; color: #fff; background: var(--ink); font-size: .82rem; font-weight: 850; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 560px) { main { padding-top: 38px; }.number-grid { gap: 7px; }.numbers-section { padding: 22px 18px 18px; }.number-cell { border-radius: 11px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
