.gm {
  --ink: #f5f2ff; --ink2: #c0b8e6; --ink3: #8a82b4; --edge: rgba(255, 255, 255, 0.12); --glass: rgba(24, 16, 58, 0.72);
  --grad: linear-gradient(135deg, #7c5cff, #ff4fd8 55%, #ffb547); --gold: linear-gradient(180deg, #ffe08a, #ffb547);
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--font); font-weight: 600; overflow-x: hidden;
  background: radial-gradient(900px 600px at 20% 0%, #3b1d70, transparent 60%), radial-gradient(800px 600px at 100% 100%, #0f4c7a, transparent 60%), #0d0824;
}
.screen[hidden] { display: none !important; }
button { font-family: inherit; }

/* ── map ── */
#mapScreen { min-height: 100vh; display: flex; flex-direction: column; }
.gm-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: rgba(13, 8, 36, 0.78); backdrop-filter: blur(14px); border-bottom: 1px solid var(--edge); }
.gm-back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; font-size: 1.6rem; line-height: 1; }
.gm-logo { flex: 1; margin: 0; font: 900 clamp(1.05rem, 4vw, 1.5rem) var(--display); letter-spacing: 0.03em; white-space: nowrap; }
.gm-logo b { background: linear-gradient(180deg, #ffffff, #c9b8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gm-lives { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 61, 110, 0.16); border: 1px solid rgba(255, 61, 110, 0.4); font-weight: 800; white-space: nowrap; }
.gm-lives small { color: var(--ink2); font-weight: 700; }
.map-scroll { flex: 1; padding: 16px 14px 40px; max-width: 560px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.daily-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 22px; background: linear-gradient(135deg, rgba(255, 181, 71, 0.22), rgba(255, 79, 216, 0.18)); border: 1px solid rgba(255, 213, 128, 0.4); margin-bottom: 18px; cursor: pointer; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35); }
.daily-card .ic { font-size: 2.4rem; }
.daily-card b { display: block; font: 800 1.08rem var(--display); }
.daily-card small { color: var(--ink2); }
.daily-card .go { margin-left: auto; padding: 10px 16px; border-radius: 14px; background: var(--gold); color: #3a2200; font-weight: 900; border: 0; cursor: pointer; white-space: nowrap; }
.map { position: relative; display: flex; flex-direction: column-reverse; gap: 0; }
.region { position: relative; padding: 18px 0; border-radius: 26px; margin: 8px 0; }
.region-name { position: sticky; top: 64px; z-index: 2; margin: 0 auto 6px; width: max-content; padding: 6px 16px; border-radius: 999px; background: rgba(13, 8, 36, 0.8); border: 1px solid var(--edge); font: 800 0.9rem var(--display); letter-spacing: 0.06em; }
.r-cave { background: linear-gradient(180deg, rgba(124, 92, 255, 0.16), rgba(124, 92, 255, 0.04)); }
.r-forest { background: linear-gradient(180deg, rgba(24, 212, 123, 0.16), rgba(24, 212, 123, 0.04)); }
.r-lake { background: linear-gradient(180deg, rgba(47, 123, 255, 0.18), rgba(47, 123, 255, 0.04)); }
.r-volcano { background: linear-gradient(180deg, rgba(255, 45, 85, 0.18), rgba(255, 45, 85, 0.04)); }
.r-tower { background: linear-gradient(180deg, rgba(166, 77, 255, 0.18), rgba(166, 77, 255, 0.04)); }
.r-stars { background: linear-gradient(180deg, rgba(63, 227, 255, 0.14), rgba(63, 227, 255, 0.03)); }
.nodes { position: relative; display: flex; flex-direction: column-reverse; }
.node-row { height: 86px; position: relative; }
.node { position: absolute; top: 8px; width: 70px; height: 70px; margin-left: -35px; border-radius: 50%; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #8e7cff, #4b2fb8 70%); box-shadow: 0 6px 0 #2c1a72, 0 10px 22px rgba(0, 0, 0, 0.45), inset 0 2px 6px rgba(255, 255, 255, 0.35); transition: transform 0.15s; }
.node b { font: 900 1.3rem var(--display); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.node .st { position: absolute; bottom: -14px; font-size: 0.85rem; letter-spacing: 1px; color: #ffcf4d; text-shadow: 0 1px 3px #000; }
.node .st i { font-style: normal; opacity: 0.25; }
.node.done { background: radial-gradient(circle at 35% 30%, #ffe08a, #e08a12 70%); box-shadow: 0 6px 0 #8a4e06, 0 10px 22px rgba(0, 0, 0, 0.45), inset 0 2px 6px rgba(255, 255, 255, 0.5); }
.node.cur { background: radial-gradient(circle at 35% 30%, #ff9ae7, #d6249f 70%); box-shadow: 0 6px 0 #7d0f5c, 0 0 0 6px rgba(255, 79, 216, 0.3), 0 0 30px rgba(255, 79, 216, 0.7); animation: bob 1.4s ease-in-out infinite; }
.node.lock { background: radial-gradient(circle at 35% 30%, #4a4466, #2a2540 70%); box-shadow: 0 6px 0 #17142a, 0 8px 16px rgba(0, 0, 0, 0.4); cursor: default; }
.node.lock b { opacity: 0.45; }
.node:not(.lock):hover { transform: scale(1.08); }
@keyframes bob { 50% { transform: translateY(-6px); } }
.path { position: absolute; inset: 0; pointer-events: none; }
.gm-how { color: var(--ink3); font-size: 0.9rem; text-align: center; line-height: 1.5; margin-top: 20px; }

/* ── game ── */
#gameScreen { position: fixed; inset: 0; overflow: hidden; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.pop { position: absolute; transform: translate(-50%, -50%); font: 900 1.25rem var(--display); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 255, 255, 0.6); animation: pop 0.9s ease-out forwards; white-space: nowrap; }
.pop.word { font-size: clamp(2rem, 9vw, 3.6rem); background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 4px 0 rgba(90, 40, 0, 0.8)) drop-shadow(0 0 20px rgba(255, 200, 80, 0.6)); animation: word 1.1s cubic-bezier(.2, .9, .3, 1.3) forwards; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -140%) scale(1); } }
@keyframes word { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(2deg); } 75% { opacity: 1; transform: translate(-50%, -55%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(0.9); } }
.hud { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
.hbtn { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--edge); background: var(--glass); color: #fff; font-weight: 900; cursor: pointer; backdrop-filter: blur(8px); }
.moves { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 62px; height: 62px; border-radius: 20px; background: var(--grad); box-shadow: 0 8px 22px rgba(255, 79, 216, 0.45); }
.moves b { font: 900 1.6rem/1 var(--display); }
.moves small { font-size: 0.62rem; font-weight: 800; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.06em; }
.moves.low { animation: low 0.6s ease-in-out infinite alternate; }
@keyframes low { to { transform: scale(1.08); box-shadow: 0 0 28px rgba(255, 61, 110, 0.9); } }
.scorebox { padding: 8px 12px; border-radius: 16px; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(8px); min-width: 0; }
.scoreline { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--ink2); }
.scoreline b { color: #fff; font: 900 1rem var(--display); }
.sbar { position: relative; height: 10px; margin-top: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.sbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--gold); transition: width 0.3s; box-shadow: 0 0 10px rgba(255, 200, 80, 0.6); }
.sbar em { position: absolute; top: 50%; transform: translate(-50%, -50%); font-style: normal; font-size: 1rem; color: rgba(255, 255, 255, 0.3); text-shadow: 0 1px 3px #000; transition: color 0.3s, transform 0.3s; }
.sbar em.on { color: #ffcf4d; transform: translate(-50%, -50%) scale(1.25); }
.goals { display: flex; gap: 6px; }
.goal { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 62px; border-radius: 16px; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(8px); }
.goal img { width: 34px; height: 34px; }
.goal .gt { font-size: 1.3rem; }
.goal b { font: 900 0.85rem var(--display); }
.goal.ok { border-color: rgba(62, 224, 143, 0.7); }
.goal.ok::after { content: '✓'; position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #3ee08f; color: #052; font-weight: 900; display: grid; place-items: center; font-size: 0.75rem; }
.boosters { position: absolute; bottom: 0; left: 0; right: 0; z-index: 4; display: flex; justify-content: center; gap: 12px; padding: 10px 12px max(14px, env(safe-area-inset-bottom)); }
.boost { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 74px; padding: 8px 4px; border-radius: 18px; border: 1px solid var(--edge); background: var(--glass); color: #fff; cursor: pointer; backdrop-filter: blur(8px); transition: transform 0.12s; }
.boost span { font-size: 1.5rem; }
.boost small { font-size: 0.68rem; color: var(--ink2); }
.boost b { position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--grad); font: 900 0.75rem/22px var(--display); }
.boost.on { border-color: #ffcf4d; box-shadow: 0 0 18px rgba(255, 207, 77, 0.7); transform: translateY(-4px); }
.boost:disabled { opacity: 0.4; cursor: default; }
.toast { position: absolute; left: 50%; bottom: 110px; z-index: 6; transform: translateX(-50%); padding: 9px 16px; border-radius: 999px; background: rgba(13, 8, 36, 0.92); border: 1px solid var(--edge); font-size: 0.9rem; opacity: 0; transition: opacity 0.25s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; }

/* ── modals ── */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(8, 4, 24, 0.7); backdrop-filter: blur(8px); }
.modal[hidden] { display: none; }
.mcard { width: min(400px, 100%); max-height: 92vh; overflow: auto; padding: 24px 20px; border-radius: 28px; text-align: center; background: linear-gradient(180deg, #2a1a5e, #170e3a); border: 1px solid rgba(201, 184, 255, 0.35); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; gap: 14px; animation: mpop 0.35s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes mpop { from { opacity: 0; transform: scale(0.85) translateY(20px); } }
.mcard h2 { margin: 0; font: 900 1.7rem var(--display); }
.mcard .sub { color: var(--ink2); margin: 0; }
.mgoals { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.mgoals .goal { width: 78px; height: 82px; }
.mgoals .goal small { font-size: 0.66rem; color: var(--ink2); padding: 0 4px; line-height: 1.1; }
.bigstars { display: flex; justify-content: center; gap: 6px; font-size: 3rem; }
.bigstars span { color: rgba(255, 255, 255, 0.15); transform: scale(0.6); transition: transform 0.4s cubic-bezier(.2, .9, .3, 1.6), color 0.3s; }
.bigstars span.on { color: #ffcf4d; transform: scale(1); text-shadow: 0 0 20px rgba(255, 207, 77, 0.8); }
.bigstars span:nth-child(2) { transform: scale(0.7) translateY(-10px); }
.bigstars span.on:nth-child(2) { transform: scale(1.2) translateY(-10px); }
.mbtn { padding: 14px 20px; border-radius: 18px; border: 0; background: var(--grad); color: #fff; font: 900 1.1rem var(--display); letter-spacing: 0.04em; cursor: pointer; box-shadow: 0 8px 0 rgba(90, 20, 90, 0.6), 0 12px 26px rgba(255, 79, 216, 0.35); }
.mbtn:active { transform: translateY(3px); box-shadow: 0 5px 0 rgba(90, 20, 90, 0.6); }
.mbtn.gold { background: var(--gold); color: #3a2200; box-shadow: 0 8px 0 #8a4e06, 0 12px 26px rgba(255, 181, 71, 0.35); }
.mbtn.ghost { background: rgba(255, 255, 255, 0.08); box-shadow: none; font-size: 0.95rem; }
.xp { color: #7dff9c; font: 900 1.1rem var(--display); }
.lb { text-align: left; display: flex; flex-direction: column; gap: 4px; }
.lb div { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.lb div.me { background: rgba(255, 79, 216, 0.2); }
.lb small { color: var(--ink3); text-align: center; }
@media (max-width: 600px) {
  .hud { grid-template-columns: auto auto 1fr; }
  .goals { grid-column: 1 / -1; justify-content: center; }
  .goal { width: 52px; height: 52px; } .goal img { width: 28px; height: 28px; }
  .boost { width: 66px; }
  .gm-lives small { display: none; }
  .gm-top .lang-switch { display: none; }
}
