:root { --bg: #1e1033; --accent: #a855f7; --card: rgba(255,255,255,.07); --line: rgba(255,255,255,.12); --txt: #f5f3ff; --mut: #b8b0cc; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; user-select: none; -webkit-user-select: none; transition: background .3s; }
#app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 14px 70px; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.logo { font-weight: 900; font-size: 20px; letter-spacing: -.5px; }
.coins { background: var(--card); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; font-weight: 800; }
.coins b { background: var(--accent); color: #000; border-radius: 50%; width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: 4px; font-size: 14px; }
.pulse { animation: pulse .4s; }
@keyframes pulse { 50% { transform: scale(1.15); } }

.sec { font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--mut); margin: 18px 0 10px; }
.event { background: linear-gradient(90deg, #f59e0b, #ef4444); color: #fff; font-weight: 800; text-align: center; padding: 8px; border-radius: 12px; margin-bottom: 10px; animation: pulse 1.5s infinite; }
.dc { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dc small { color: var(--mut); }
.daily { width: 100%; margin-top: 10px; }
.daily.off { opacity: .5; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transition: transform .1s; }
.tile:active { transform: scale(.95); }
.tile .em { font-size: 40px; }
.tile small { color: var(--mut); font-size: 12px; }
.tile .best { font-size: 12px; margin-top: 4px; color: var(--accent); font-weight: 700; }

.row { display: flex; gap: 10px; margin-top: 14px; }
.row > * { flex: 1; }
.btn { background: var(--accent); color: #000; font-weight: 800; padding: 12px 16px; border-radius: 14px; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn.alt { background: #facc15; }
.btn.ghost { background: var(--card); color: var(--txt); border: 1px solid var(--line); }
.btn.sm { padding: 7px 12px; font-size: 14px; }

#play { flex: 1; display: flex; flex-direction: column; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; font-weight: 800; }
.icon { background: var(--card); width: 38px; height: 38px; border-radius: 50%; }
.score b { color: var(--accent); font-size: 22px; }
#stage { flex: 1; min-height: 420px; position: relative; background: rgba(0,0,0,.25); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 14px; touch-action: none; }
#stage canvas { position: absolute; inset: 0; }

.timer { font-size: 22px; font-weight: 800; }
.holes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 340px; }
.hole { aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 60%, #000 0 55%, #3b2a1a 56%); font-size: 46px; }
.tbar { position: absolute; top: 0; left: 0; right: 0; height: 8px; background: rgba(255,255,255,.1); }
.tbar div { height: 100%; transition: background .2s; }
.bigq { font-size: 40px; font-weight: 900; text-align: center; }
.word { font-size: 54px; letter-spacing: 2px; }
.hint { color: var(--mut); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ans { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 8px; font-weight: 900; font-size: 18px; }
.ans:active { transform: scale(.95); }
.ans.ok { background: #16a34a; } .ans.ko { background: #dc2626; }
.pad { position: absolute; inset: 0; font-size: 30px; font-weight: 900; }
.pad.wait { background: #7f1d1d; } .pad.go { background: #16a34a; } .pad.ok { background: #1e3a8a; } .pad.bad { background: #450a0a; }

.banner { position: fixed; bottom: 0; left: 0; right: 0; height: 54px; background: #fff; color: #111; display: grid; place-items: center; font-weight: 700; font-size: 14px; border-top: 2px solid #ddd; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 10; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 22px; padding: 20px; width: 100%; max-width: 400px; max-height: 90vh; overflow: auto; text-align: center; }
.card h2 { margin: 0 0 6px; } .card h3 { text-align: left; color: var(--mut); font-size: 14px; text-transform: uppercase; margin: 16px 0 6px; }
.card > .btn { width: 100%; margin-top: 12px; }
.bigscore { font-size: 64px; font-weight: 900; color: var(--accent); }
.gain { font-size: 22px; font-weight: 800; }
.win { color: #4ade80; font-weight: 800; }
.shoprow { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.shoprow small { color: var(--mut); } .shoprow em { color: var(--mut); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: -2px; }
.fakead small { color: var(--mut); } .adbig { font-size: 28px; font-weight: 900; padding: 40px 10px; background: linear-gradient(135deg, #f0abfc, #fde68a); color: #111; border-radius: 14px; margin: 14px 0; }
.cd { font-size: 30px; font-weight: 900; }
.tap { position: fixed; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255,255,255,.45); border: 2px solid #fff; pointer-events: none; z-index: 50; animation: tap .45s ease-out forwards; }
@keyframes tap { to { transform: scale(1.8); opacity: 0; } }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 20; animation: fade .2s; }
