:root { --ink: #1e2347; --ink2: #5b6080; --bg: #fff8ec; --card: #ffffff; --coral: #ff6b5b; --sun: #ffc94a; --mint: #36c58f; --violet: #7a5cff; }
html, body, #app { margin: 0; min-height: 100%; }
body { background: radial-gradient(circle at 10% 0%, #ffe7d6 0, transparent 40%), radial-gradient(circle at 100% 20%, #e6e0ff 0, transparent 38%), var(--bg); color: var(--ink); font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif; }
.g-app { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; box-sizing: border-box; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.g-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.g-logo { display: flex; gap: 3px; background: none; border: 0; padding: 0; cursor: pointer; }
.g-logo span { width: 38px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.5rem; color: #fff; box-shadow: 0 3px 0 rgba(30,35,71,.18); transform: rotate(-3deg); }
.g-logo span:nth-child(even) { transform: rotate(3deg); }
.g-logo .c-sun { color: var(--ink); }
.c-coral { --c: var(--coral); --t: #ffe9e5; } .c-sun { --c: var(--sun); --t: #fff4d1; } .c-mint { --c: var(--mint); --t: #dcf7ec; } .c-violet { --c: var(--violet); --t: #ebe6ff; }
.g-logo span { background: var(--c); }
.g-lang { display: flex; gap: 6px; }
.g-lang button { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 2px solid transparent; background: rgba(255,255,255,.7); cursor: pointer; font-weight: 700; font-size: .85rem; }
.g-lang button.on { border-color: var(--ink); background: #fff; }
.g-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(30,35,71,.07); padding: 5px; border-radius: 18px; margin-bottom: 14px; }
.g-tabs button { min-height: 46px; border: 0; border-radius: 14px; background: transparent; font-weight: 800; cursor: pointer; transition: all .2s; }
.g-tabs button.on { background: var(--ink); color: #fff; box-shadow: 0 4px 12px rgba(30,35,71,.25); }
.g-badge { display: inline-block; margin: 0 0 12px; padding: 5px 12px; border-radius: 999px; background: #fff; font-size: .78rem; font-weight: 700; color: var(--ink2); box-shadow: 0 1px 0 rgba(30,35,71,.1); }
.g-ask { background: var(--ink); color: #fff; border-radius: 22px; padding: 18px 20px; margin-bottom: 16px; position: relative; overflow: hidden; }
.g-ask::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--violet); opacity: .5; }
.g-ask p { margin: 0; font-size: 1rem; line-height: 1.4; opacity: .95; position: relative; z-index: 1; }
.g-big { display: block; font-size: 2.2rem; font-weight: 900; letter-spacing: -.02em; color: var(--sun); margin-bottom: 4px; position: relative; z-index: 1; }
.g-timeline { position: relative; display: grid; gap: 10px; padding-left: 0; margin-bottom: 18px; }
.g-timeline[data-shake] { animation: shake .4s; }
.g-end { font-size: .75rem; font-weight: 800; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; padding-left: 52px; }
.g-row-t { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; position: relative; }
.g-row-t::before { content: ""; position: absolute; left: 19px; top: -12px; bottom: -12px; width: 3px; background: repeating-linear-gradient(to bottom, #c9c3b5 0 6px, transparent 6px 10px); z-index: 0; }
.g-node { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 900; }
.g-slot { min-height: 62px; border: 2.5px dashed #cfc7b5; border-radius: 18px; display: flex; align-items: center; padding: 0 16px; color: #a59f90; font-size: .9rem; background: rgba(255,255,255,.5); }
.g-card { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; min-height: 62px; padding: 10px 14px; text-align: left; background: var(--t); border: 2.5px solid var(--c); border-radius: 18px; box-shadow: 0 4px 0 var(--c); cursor: pointer; line-height: 1.3; font-weight: 600; font-size: .95rem; transition: transform .12s, box-shadow .12s; }
.g-card:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--c); }
.g-card:disabled { cursor: default; }
.g-card.placed { animation: pop .3s; }
.g-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.g-txt { flex: 1; }
.g-year { margin-left: auto; font-size: 1.15rem; font-weight: 900; background: var(--ink); color: #fff; padding: 4px 10px; border-radius: 10px; animation: flip .5s both; font-variant-numeric: tabular-nums; }
.g-mark { font-size: 1.3rem; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.g-card.ok { background: #d9f7e8; border-color: #1fa774; box-shadow: 0 4px 0 #1fa774; } .g-card.ok .g-mark { background: #1fa774; }
.g-card.ko { background: #ffe1de; border-color: #e0463a; box-shadow: 0 4px 0 #e0463a; } .g-card.ko .g-mark { background: #e0463a; }
.g-card.dim { opacity: .55; }
.g-card.win { animation: bounce .6s both; }
.g-pool { display: grid; gap: 10px; margin-bottom: 14px; }
.g-pool .g-card { animation: pop .3s both; }
.g-letter { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.c-sun .g-letter { color: var(--ink); }
.g-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.g-btn { min-height: 50px; padding: 0 22px; border-radius: 16px; border: 2.5px solid var(--ink); background: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.g-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.g-btn.primary { background: var(--coral); color: #fff; border-color: var(--ink); }
.g-btn:disabled { opacity: .4; box-shadow: none; cursor: default; }
.g-dots { display: inline-flex; gap: 5px; vertical-align: middle; margin-left: 4px; }
.g-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); }
.g-dots i.used { background: #fff; opacity: .4; }
.g-small, .g-hint { font-size: .85rem; color: var(--ink2); margin: 6px 0; font-weight: 600; }
.g-hint { background: #fff; padding: 8px 12px; border-radius: 12px; display: inline-block; }
.g-result { margin-top: 16px; }
.g-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 20px; }
.g-banner.good { background: var(--mint); } .g-banner.bad { background: var(--sun); }
.g-banner h3 { margin: 0; font-size: 1.3rem; }
.g-emoji { font-size: 2.2rem; animation: bounce .8s infinite alternate; }
.g-src { list-style: none; padding: 0; margin: 12px 0; font-size: .82rem; color: var(--ink2); display: grid; gap: 4px; }
.g-src b { color: var(--ink); }
.srcs a { margin-left: 8px; color: var(--ink); text-decoration: underline; }
.g-share { width: 100%; box-sizing: border-box; margin-top: 8px; font: inherit; border-radius: 12px; padding: 8px; }
.g-stats { margin-top: 26px; background: #fff; border-radius: 22px; padding: 14px 16px; }
.g-stats h4 { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); }
.g-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.g-grid div { display: grid; background: #fff8ec; border-radius: 14px; padding: 8px 2px; }
.g-grid b { font-size: 1.5rem; }
.g-grid span { font-size: .68rem; color: var(--ink2); font-weight: 700; }
.g-foot { margin-top: 18px; text-align: center; font-size: .75rem; color: var(--ink2); }
@keyframes pop { from { transform: scale(.92); opacity: .5; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes bounce { 0% { transform: translateY(0); } 40% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
@keyframes flip { from { transform: rotateX(90deg); opacity: 0; } to { transform: rotateX(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 380px) { .g-logo span { width: 32px; height: 38px; font-size: 1.2rem; } }
.g-year { font-size: .95rem; padding: 3px 8px; }
.g-ico { width: 36px; height: 36px; font-size: 1.3rem; }
.g-card { gap: 10px; padding: 10px 12px; font-size: .92rem; }

.g-app { padding-bottom: 96px; }
.g-logo span { width: 34px; height: 42px; font-size: 1.3rem; }
.g-tag { font-size: 1.25rem; font-weight: 800; line-height: 1.3; margin: 8px 0 18px; }
.g-hero { display: flex; align-items: center; gap: 16px; width: 100%; box-sizing: border-box; text-align: left; padding: 20px; border-radius: 24px; border: 3px solid var(--ink); background: var(--coral); color: #fff; box-shadow: 0 6px 0 var(--ink); cursor: pointer; transition: transform .1s, box-shadow .1s; }
.g-hero:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.g-hero b { display: block; font-size: 1.5rem; }
.g-hero small { display: block; opacity: .95; font-size: .9rem; margin-top: 2px; }
.g-hero-ico { flex: none; width: 54px; height: 54px; border-radius: 50%; background: #fff; color: var(--coral); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.g-h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); margin: 26px 0 10px; }
.g-modes { display: grid; gap: 12px; }
.g-mode { display: flex; align-items: center; gap: 14px; width: 100%; box-sizing: border-box; text-align: left; padding: 14px; border-radius: 20px; background: var(--t); border: 2.5px solid var(--c); box-shadow: 0 4px 0 var(--c); cursor: pointer; }
.g-mode:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--c); }
.g-mode b { display: block; font-size: 1.1rem; }
.g-mode small { color: var(--ink2); font-weight: 600; }
.g-back { background: none; border: 0; font-weight: 800; color: var(--ink2); padding: 8px 0; cursor: pointer; min-height: 44px; }
.g-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,248,236,.94); backdrop-filter: blur(8px); border-top: 1px solid rgba(30,35,71,.1); z-index: 5; }
.g-nav button { flex: 1; max-width: 170px; min-height: 52px; border: 0; border-radius: 16px; background: transparent; font-weight: 800; font-size: .8rem; cursor: pointer; display: grid; place-items: center; gap: 0; color: var(--ink2); }
.g-nav button span { font-size: 1.2rem; }
.g-nav button.on { background: var(--ink); color: #fff; }
.g-rule { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin-bottom: 10px; border-radius: 18px; background: var(--t); border: 2.5px solid var(--c); }
.g-rule p { margin: 4px 0 0; font-size: .92rem; line-height: 1.4; }
.g-btn.small { min-height: 42px; font-size: .85rem; margin-top: 8px; }
.g-lang button, .g-nav button, .g-back, .g-logo { font-family: inherit; }
.g-logo span { width: 30px; height: 38px; font-size: 1.15rem; border-radius: 10px; }
.g-lang button { white-space: nowrap; padding: 0 10px; font-size: .8rem; }
.g-head { gap: 8px; }
.g-nav { position: static; background: none; backdrop-filter: none; border-top: 0; padding: 0; margin-top: 22px; }
.g-nav button { background: rgba(255,255,255,.7); }
.g-nav button.on { background: var(--ink); }
.g-app { padding-bottom: 28px; }
@media (max-width: 340px) { .g-logo span { width: 26px; height: 34px; font-size: 1rem; } .g-lang button { padding: 0 7px; } }
