:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #f2f5f9;
  --line: #dce3ed;
  --text: #17284b;
  --muted: #7d8797;
  --accent: #1588f4;
  --accent-soft: #e7f3ff;
  --gold: #ffb51f;
  --danger: #dd5161;
  --shadow: 0 18px 48px rgba(30, 53, 88, .12);
  --shadow-soft: 0 8px 22px rgba(30, 53, 88, .10);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100dvh; overscroll-behavior: none; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 820px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(14px, env(safe-area-inset-left));
}

.topbar {
  height: 84px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  grid-template-areas: "back brand coin";
  gap: 12px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 249, 252, .94);
  border-bottom: 1px solid rgba(214, 222, 233, .72);
  backdrop-filter: blur(18px);
}

.brand-lockup { grid-area: brand; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; min-width: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.brand-mark svg { width: 28px; height: 28px; fill: none; stroke: var(--text); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-weight: 900; letter-spacing: -.03em; }
.brand-tagline { color: var(--muted); font-size: 11px; margin-top: 2px; }

.icon-button, .coin-pill { border: 1px solid var(--line); color: var(--text); background: var(--surface); cursor: pointer; box-shadow: var(--shadow-soft); }
.icon-button { grid-area: back; width: 48px; height: 48px; border-radius: 16px; font-size: 34px; line-height: .8; display: grid; place-items: center; }
.coin-pill { grid-area: coin; justify-self: end; min-height: 50px; display: flex; align-items: center; gap: 9px; padding: 7px 10px 7px 8px; border-radius: 18px; font-weight: 900; }
.coin-icon, .coin-mini {
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #ffc945, #f59c00);
  border: 2px solid #ffe38d;
  box-shadow: inset 0 -2px 0 rgba(160, 98, 0, .18);
  border-radius: 50%;
  font-weight: 900;
}
.coin-icon { width: 34px; height: 34px; font-size: 18px; }
.coin-mini { width: 22px; height: 22px; font-size: 12px; vertical-align: -4px; }
.coin-plus { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #919aa8; font-size: 19px; line-height: 1; }

.main-content { padding: 24px 0 34px; }
.view { display: none; animation: viewIn .22s ease; }
.active-view { display: block; }
.hidden { display: none !important; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1, h2, p { margin-top: 0; }
h1 { margin: 10px 0 14px; font-size: clamp(38px, 8vw, 58px); line-height: .98; letter-spacing: -.055em; }
h2 { letter-spacing: -.035em; }
.eyebrow { display: inline-block; color: var(--accent); font-size: 12px; letter-spacing: .14em; font-weight: 900; }

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 450px;
  padding: 30px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: auto -90px -160px auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(21,136,244,.13), rgba(21,136,244,0) 68%);
}
.hero-copy { position: relative; z-index: 2; max-width: 470px; }
.hero-copy p, .section-heading p { max-width: 560px; color: var(--muted); line-height: 1.55; }
.hero-preview { position: relative; z-index: 2; height: 165px; display: flex; justify-content: center; align-items: center; }

.primary-button, .secondary-button, .danger-button {
  border: 0;
  border-radius: 17px;
  min-height: 54px;
  font-weight: 900;
  cursor: pointer;
}
.primary-button { position: relative; z-index: 2; width: 100%; color: #fff; background: linear-gradient(145deg, #2999ff, #0879df); box-shadow: 0 13px 26px rgba(21,136,244,.25); }
.primary-button:active { transform: translateY(1px) scale(.995); }
.secondary-button { color: var(--text); background: var(--surface-soft); border: 1px solid var(--line); }
.danger-button { width: 100%; color: var(--danger); background: #fff4f5; border: 1px solid #f4cdd2; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.feature-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  min-height: 92px;
  padding: 16px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.feature-card:active { transform: scale(.99); }
.feature-card strong, .feature-card small { display: block; }
.feature-card small { color: var(--muted); margin-top: 4px; line-height: 1.25; }
.feature-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.chevron { color: #a2abb8; font-size: 28px; }

.objective-card { position: relative; margin-top: 18px; padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.objective-card h2 { margin: 8px 0 16px; }
.objective-card p { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.goal-reward { position: absolute; top: 20px; right: 20px; font-weight: 900; }
.progress-track, .flow-track { overflow: hidden; height: 8px; border-radius: 999px; background: #e7ecf3; }
.progress-fill, .flow-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2496fb, #6db8ff); transition: width .25s ease; }

.game-view { min-height: calc(100dvh - 110px); }
.game-heading { text-align: center; padding: 8px 8px 14px; }
.game-heading h2 { margin: 8px 0 5px; font-size: clamp(28px, 6vw, 40px); }
.game-heading p { color: var(--muted); margin-bottom: 0; font-size: 18px; }
.game-progress-row { width: min(100%, 680px); margin: 0 auto 12px; display: flex; align-items: center; gap: 14px; }
.game-stats { display: flex; gap: 8px; }
.stat-chip { min-width: 66px; padding: 8px 11px; border-radius: 14px; text-align: center; background: var(--surface); border: 1px solid var(--line); }
.stat-chip span, .stat-chip strong { display: block; }
.stat-chip span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.stat-chip strong { margin-top: 2px; font-size: 17px; }
.flow-track { flex: 1; }

.board-wrap {
  position: relative;
  width: min(100%, 690px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 28px;
  background: var(--surface);
  border: 2px solid #cbd4e0;
  box-shadow: 0 18px 45px rgba(34, 55, 91, .14), inset 0 0 0 7px #f4f6f9;
}
.board { width: 100%; height: auto; display: block; aspect-ratio: var(--board-ratio, 1); touch-action: manipulation; overflow: visible; }

.path-arrow { cursor: pointer; outline: none; transform-origin: center; transform-box: fill-box; }
.path-arrow .arrow-shadow { fill: none; stroke: rgba(24, 42, 73, .11); stroke-width: 18; stroke-linecap: round; stroke-linejoin: round; transform: translate(0, 3px); }
.path-arrow .arrow-stroke { fill: none; stroke: var(--arrow-line, #17284b); stroke-width: var(--arrow-width, 11); stroke-linecap: var(--arrow-cap, round); stroke-linejoin: round; filter: drop-shadow(0 2px 2px var(--arrow-glow, rgba(23,40,75,.10))); transition: stroke .12s ease, filter .12s ease, opacity .12s ease; }
.path-arrow .arrow-head { fill: var(--arrow-line, #17284b); filter: drop-shadow(0 2px 2px var(--arrow-glow, rgba(23,40,75,.10))); transition: fill .12s ease, filter .12s ease, opacity .12s ease; }
.path-arrow .hit-area { fill: none; stroke: transparent; stroke-width: 44; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; }
.path-arrow:focus-visible .arrow-stroke { stroke: var(--accent); }
.path-arrow.hinting .arrow-stroke, .path-arrow.hinting .arrow-head { animation: hintPulse .82s ease-in-out infinite; }
.path-arrow.blocked { animation: blocked .28s ease; }
.path-arrow.leaving .arrow-stroke, .path-arrow.leaving .arrow-head { stroke: var(--active-line, #1588f4); fill: var(--active-line, #1588f4); filter: drop-shadow(0 0 7px rgba(21,136,244,.42)); }
.path-arrow.leaving .arrow-shadow { opacity: .2; }
.path-arrow.leaving::after { content: ""; }
@keyframes hintPulse { 50% { stroke: var(--accent); fill: var(--accent); filter: drop-shadow(0 0 9px rgba(21,136,244,.58)); } }
@keyframes blocked { 25% { transform: translateX(-7px) rotate(-1deg); } 55% { transform: translateX(7px) rotate(1deg); } 80% { transform: translateX(-3px); } }

.board-message { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--text); background: rgba(255,255,255,.86); backdrop-filter: blur(8px); z-index: 10; }

.game-controls { width: min(100%, 620px); margin: 18px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.control-button { min-height: 104px; display: grid; place-items: center; align-content: center; gap: 5px; color: var(--text); background: transparent; border: 0; cursor: pointer; }
.control-icon { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 21px; color: #24569d; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft); font-size: 34px; }
.control-button strong { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.control-button small { color: var(--accent); font-weight: 900; }
.control-button:active .control-icon { transform: scale(.95); }
.hint-icon { font-size: 28px; }

.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 22px; }
.section-heading h1 { margin-bottom: 12px; }
.collection-ring { flex: 0 0 auto; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) 6%, #e4e9f0 0); font-weight: 900; box-shadow: inset 0 0 0 10px var(--bg); }

.skin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.skin-card { overflow: hidden; padding: 0; color: var(--text); text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); cursor: pointer; }
.skin-card.equipped { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21,136,244,.12), var(--shadow-soft); }
.skin-preview { min-height: 142px; display: grid; place-items: center; background: var(--preview-bg, linear-gradient(145deg, #fff, #f3f6fa)); }
.mini-arrow { width: 115px; height: 82px; overflow: visible; }
.mini-arrow path { fill: none; stroke: var(--arrow-line, #17284b); stroke-width: var(--arrow-width, 10); stroke-linecap: var(--arrow-cap, round); stroke-linejoin: round; filter: drop-shadow(0 3px 3px var(--arrow-glow, rgba(23,40,75,.12))); }
.mini-arrow polygon { fill: var(--arrow-line, #17284b); filter: drop-shadow(0 3px 3px var(--arrow-glow, rgba(23,40,75,.12))); }
.skin-meta { padding: 15px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.skin-meta strong, .skin-meta small { display: block; }
.skin-meta small { color: var(--muted); margin-top: 3px; }
.price-tag { color: #c78100; font-weight: 900; }

.level-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; }
.level-button { position: relative; aspect-ratio: 1; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-soft); font-weight: 900; cursor: pointer; }
.level-button.current { color: #fff; background: var(--accent); border-color: var(--accent); }
.level-button.perfect::after { content: "★"; position: absolute; top: 3px; right: 5px; color: var(--gold); font-size: 10px; }
.level-button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }

.settings-list { display: grid; gap: 11px; }
.setting-row { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { color: var(--muted); margin-top: 4px; line-height: 1.3; }
.setting-row input { width: 48px; height: 27px; accent-color: var(--accent); }
.privacy-note { margin: 16px 0; padding: 18px; border-radius: var(--radius-lg); color: #155d9e; background: var(--accent-soft); border: 1px solid #c3e1ff; }
.privacy-note p { margin: 7px 0 0; color: #4e7598; line-height: 1.5; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: end center; padding: 16px; background: rgba(22, 36, 58, .48); backdrop-filter: blur(8px); }
.modal { position: relative; width: min(100%, 560px); max-height: 90dvh; overflow-y: auto; padding: 28px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); animation: modalIn .22s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(30px); } }
.modal-close { position: absolute; top: 14px; right: 16px; width: 39px; height: 39px; display: grid; place-items: center; border: 0; border-radius: 13px; color: var(--text); background: var(--surface-soft); font-size: 25px; cursor: pointer; }
.modal h2 { margin: 8px 42px 10px 0; font-size: 30px; }
.modal p { color: var(--muted); line-height: 1.55; }
.modal-preview { min-height: 190px; display: grid; place-items: center; margin: 18px 0; border-radius: 22px; background: var(--preview-bg, linear-gradient(145deg, #fff, #f2f5f9)); border: 1px solid var(--line); }
.modal-preview .mini-arrow { width: 160px; height: 115px; }
.modal-actions { display: grid; gap: 10px; }
.reward-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; color: var(--muted); border-top: 1px solid var(--line); }
.reward-row strong { color: var(--text); }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 100; transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; color: #fff; background: var(--text); box-shadow: var(--shadow); font-weight: 800; animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Cosmetic line skins */
.skin-clean { --arrow-line: #17284b; --arrow-width: 10.5; --arrow-glow: rgba(23,40,75,.10); --preview-bg: linear-gradient(145deg,#fff,#f4f6fa); }
.skin-ocean { --arrow-line: #087fdc; --arrow-width: 11; --arrow-glow: rgba(8,127,220,.24); --preview-bg: linear-gradient(145deg,#eff9ff,#d8efff); }
.skin-coral { --arrow-line: #f06478; --arrow-width: 11; --arrow-glow: rgba(240,100,120,.20); --preview-bg: linear-gradient(145deg,#fff6f7,#ffe4e8); }
.skin-mint { --arrow-line: #22ad82; --arrow-width: 11; --arrow-glow: rgba(34,173,130,.20); --preview-bg: linear-gradient(145deg,#f1fff9,#d9f8ea); }
.skin-grape { --arrow-line: #7656d9; --arrow-width: 11; --arrow-glow: rgba(118,86,217,.22); --preview-bg: linear-gradient(145deg,#faf7ff,#e9e2ff); }
.skin-graphite { --arrow-line: #414a5b; --arrow-width: 12; --arrow-glow: rgba(65,74,91,.18); --preview-bg: linear-gradient(145deg,#f5f6f8,#dfe3e8); }
.skin-candy { --arrow-line: #ed4e91; --arrow-width: 9; --arrow-glow: rgba(237,78,145,.22); --preview-bg: repeating-linear-gradient(135deg,#fff 0 12px,#ffe7f1 12px 24px); }
.skin-chrome { --arrow-line: #7b8797; --arrow-width: 12; --arrow-glow: rgba(80,94,112,.30); --preview-bg: linear-gradient(145deg,#fff,#d9dee5 45%,#f8fafc 70%,#cbd1da); }
.skin-ice { --arrow-line: #58b9e8; --arrow-width: 10; --arrow-glow: rgba(76,190,240,.48); --preview-bg: linear-gradient(145deg,#f5fdff,#dff6ff); }
.skin-pixel { --arrow-line: #e58b27; --arrow-width: 10; --arrow-cap: square; --arrow-glow: rgba(229,139,39,.18); --preview-bg: linear-gradient(145deg,#fff9e8,#ffe7ad); }
.skin-neon { --arrow-line: #a4f21d; --arrow-width: 9; --arrow-glow: rgba(164,242,29,.65); --preview-bg: #17212c; }
.skin-lava { --arrow-line: #f05b2a; --arrow-width: 12; --arrow-glow: rgba(240,91,42,.55); --preview-bg: linear-gradient(145deg,#311820,#130f17); }
.skin-aurora { --arrow-line: #8a62f0; --arrow-width: 11; --arrow-glow: rgba(100,111,255,.55); --preview-bg: linear-gradient(145deg,#e2fff7,#ece2ff); }
.skin-holo { --arrow-line: #24aab5; --arrow-width: 10; --arrow-glow: rgba(115,208,255,.52); --preview-bg: linear-gradient(135deg,#ffd9f4,#c9fff6,#d9d3ff,#fff5bf); }
.skin-galaxy { --arrow-line: #9182ff; --arrow-width: 11; --arrow-glow: rgba(137,111,255,.68); --preview-bg: radial-gradient(circle at 25% 30%,#fff 0 2px,transparent 3px),radial-gradient(circle at 70% 65%,#aff 0 2px,transparent 3px),linear-gradient(145deg,#2c2768,#11142c); }
.skin-gold { --arrow-line: #dca31d; --arrow-width: 12; --arrow-glow: rgba(236,180,43,.58); --preview-bg: linear-gradient(145deg,#fff8cf,#f3d16e,#a56b0f); }

.hero-preview .mini-arrow { position: absolute; width: 180px; height: 120px; animation: float 3s ease-in-out infinite; }
.hero-preview .mini-arrow:nth-child(1) { transform: translate(-54px, 8px) rotate(-5deg); animation-delay: -.4s; }
.hero-preview .mini-arrow:nth-child(2) { transform: translate(48px, -13px) rotate(6deg); animation-delay: -1.4s; opacity: .78; }
.hero-preview .mini-arrow:nth-child(3) { transform: translate(8px, 35px) rotate(-2deg) scale(.82); animation-delay: -2.1s; opacity: .52; }
@keyframes float { 50% { translate: 0 -8px; } }

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }

@media (max-width: 620px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .topbar { height: 74px; grid-template-columns: 48px 1fr auto; }
  .brand-tagline { display: none; }
  .brand-mark { display: none; }
  .hero-card { min-height: 420px; padding: 24px; }
  .hero-preview { height: 150px; }
  .quick-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 78px; }
  .main-content { padding-top: 18px; }
  .game-progress-row { display: grid; grid-template-columns: auto 1fr; }
  .board-wrap { border-radius: 24px; }
  .game-controls { gap: 8px; }
  .control-icon { width: 60px; height: 60px; border-radius: 19px; }
  .skin-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .skin-preview { min-height: 120px; }
  .level-grid { grid-template-columns: repeat(4, 1fr); }
  .section-heading { align-items: center; }
}

@media (min-width: 700px) {
  .modal-backdrop { place-items: center; }
}

/* --------------------------------------------------------------------------
   Polished gameplay renderer inspired by the supplied motion reference.
   The board intentionally uses a clean solid background: no dot grid.
   -------------------------------------------------------------------------- */
:root {
  --board-bg: #fbfcff;
  --arrow-outline: #13244a;
  --arrow-core: #ffffff;
  --arrow-active: #1c8df4;
  --arrow-active-core: #bfe4ff;
  --particle-colour: #2d9bf5;
}

.game-heading { padding-top: 2px; }
.game-heading .eyebrow { color: #4c75cb; }
.game-heading h2 { letter-spacing: -.045em; }

.board-wrap {
  isolation: isolate;
  min-height: 320px;
  overflow: hidden;
  background: var(--board-bg);
  border: 1px solid rgba(163, 177, 204, .42);
  box-shadow:
    0 18px 48px rgba(33, 53, 91, .11),
    0 2px 8px rgba(33, 53, 91, .07),
    inset 0 1px 0 rgba(255,255,255,.96);
  transition: box-shadow .35s ease, transform .35s ease, background .35s ease;
}

.board-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(70, 143, 245, .055), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,.8), rgba(248,250,255,.42));
}

.board-wrap.board-success {
  box-shadow:
    0 22px 60px rgba(33, 130, 237, .19),
    0 0 0 4px rgba(55, 156, 245, .10),
    inset 0 1px 0 rgba(255,255,255,.96);
}

.board { position: relative; z-index: 1; padding: clamp(8px, 2vw, 18px); }
.fx-canvas, .tap-effects {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.tap-effects { overflow: hidden; }

.path-arrow {
  cursor: pointer;
  outline: none;
  transform-origin: center;
  transform-box: fill-box;
  will-change: transform, opacity, filter;
}
.path-arrow.reveal {
  animation: arrowReveal .34s cubic-bezier(.2,.82,.3,1) both;
  animation-delay: calc(var(--arrow-index, 0) * 18ms);
}
@keyframes arrowReveal {
  from { opacity: 0; transform: scale(.93); }
  to { opacity: 1; transform: scale(1); }
}

.path-arrow .arrow-outline,
.path-arrow .arrow-core,
.path-arrow .arrow-shine {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.path-arrow .arrow-outline {
  stroke: var(--arrow-outline);
  stroke-width: 11.5;
  filter: drop-shadow(0 2px 1.5px rgba(22, 39, 78, .16));
  transition: stroke .13s ease, filter .13s ease, opacity .13s ease;
}
.path-arrow .arrow-core {
  stroke: var(--arrow-core);
  stroke-width: 5.9;
  transition: stroke .13s ease, opacity .13s ease;
}
.path-arrow .arrow-shine {
  stroke: rgba(255,255,255,.48);
  stroke-width: 1.35;
  transform: translateY(-1.15px);
  opacity: .72;
}
.path-arrow .arrow-head-outline {
  fill: var(--arrow-outline);
  filter: drop-shadow(0 2px 1.5px rgba(22, 39, 78, .16));
  transition: fill .13s ease, filter .13s ease, opacity .13s ease;
}
.path-arrow .arrow-head-core {
  fill: var(--arrow-core);
  pointer-events: none;
  transition: fill .13s ease, opacity .13s ease;
}
.path-arrow .hit-area {
  fill: none;
  stroke: transparent;
  stroke-width: 48;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: stroke;
}

.path-arrow:active:not(.departing) { filter: brightness(1.04); }
.path-arrow:focus-visible .arrow-outline { stroke: var(--accent); }
.path-arrow:focus-visible .arrow-head-outline { fill: var(--accent); }

.path-arrow.hinting .arrow-outline,
.path-arrow.hinting .arrow-head-outline {
  animation: polishedHint 1.05s ease-in-out infinite;
}
.path-arrow.hinting .arrow-core,
.path-arrow.hinting .arrow-head-core {
  animation: polishedHintCore 1.05s ease-in-out infinite;
}
@keyframes polishedHint {
  50% { stroke: #2d9bf5; fill: #2d9bf5; filter: drop-shadow(0 0 9px rgba(45,155,245,.58)); }
}
@keyframes polishedHintCore { 50% { stroke: #dff2ff; fill: #dff2ff; } }

.path-arrow.departing .arrow-outline,
.path-arrow.departing .arrow-head-outline {
  stroke: var(--arrow-active);
  fill: var(--arrow-active);
  filter: drop-shadow(0 0 8px rgba(28,141,244,.60));
}
.path-arrow.departing .arrow-core,
.path-arrow.departing .arrow-head-core {
  stroke: var(--arrow-active-core);
  fill: var(--arrow-active-core);
}
.path-arrow.departing .arrow-shine { opacity: .95; }

.path-arrow.blocked { animation: none; }
.path-arrow.blocked .arrow-outline,
.path-arrow.blocked .arrow-head-outline {
  animation: blockedColour .42s ease;
}
@keyframes blockedColour {
  35% { stroke: #ef6680; fill: #ef6680; filter: drop-shadow(0 0 8px rgba(239,102,128,.42)); }
}

.motion-trail {
  fill: none;
  stroke: var(--arrow-active);
  stroke-width: 17;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .16;
  filter: blur(5px);
  pointer-events: none;
}
.motion-trail-core {
  fill: none;
  stroke: var(--arrow-active);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .5;
  pointer-events: none;
}

.tap-ripple {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 3px solid rgba(37, 148, 245, .52);
  border-radius: 50%;
  animation: tapRipple .52s cubic-bezier(.15,.7,.3,1) forwards;
}
.tap-ripple.blocked-ripple { border-color: rgba(239,102,128,.55); }
@keyframes tapRipple {
  from { opacity: .9; transform: scale(.45); box-shadow: 0 0 0 0 rgba(37,148,245,.24); }
  to { opacity: 0; transform: scale(3.8); box-shadow: 0 0 0 10px rgba(37,148,245,0); }
}

.clear-banner {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 50%;
  width: min(78%, 330px);
  padding: 20px 22px 18px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 26px;
  color: var(--text);
  background: rgba(255,255,255,.91);
  border: 1px solid rgba(187, 210, 236, .76);
  box-shadow: 0 22px 55px rgba(36,75,126,.20);
  backdrop-filter: blur(14px);
  animation: clearBannerIn .48s cubic-bezier(.2,.9,.28,1.18) both;
}
.clear-banner-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  border-radius: 50%;
  background: linear-gradient(145deg,#44adff,#147eea);
  box-shadow: 0 10px 24px rgba(27,135,240,.32);
}
.clear-banner strong { font-size: clamp(22px, 5vw, 32px); letter-spacing: -.04em; }
.clear-banner small { margin-top: 5px; color: var(--muted); font-weight: 700; }
@keyframes clearBannerIn {
  from { opacity: 0; transform: translate(-50%, -43%) scale(.76); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.coin-pill.coin-bump { animation: coinBump .55s cubic-bezier(.2,.9,.3,1.25); }
@keyframes coinBump {
  40% { transform: scale(1.12) rotate(-1deg); box-shadow: 0 10px 30px rgba(245,166,0,.30); }
}

.game-controls { margin-top: 14px; }
.control-icon {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,#fff,#f5f8fd);
  border-color: rgba(177,191,215,.58);
  box-shadow: 0 10px 24px rgba(35,57,95,.10), inset 0 1px 0 #fff;
  transition: transform .16s ease, box-shadow .16s ease;
}
.control-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,rgba(255,255,255,.7),transparent 45%);
  pointer-events: none;
}
.control-button:active .control-icon { transform: scale(.92); box-shadow: 0 4px 12px rgba(35,57,95,.10); }

/* Each skin changes the tube outline, inner fill and particle/trail colours. */
.skin-clean { --arrow-outline:#13244a; --arrow-core:#fff; --arrow-active:#1689f1; --arrow-active-core:#c6e8ff; --particle-colour:#2c9bf5; }
.skin-ocean { --arrow-outline:#087ac8; --arrow-core:#eefaff; --arrow-active:#0ba5f7; --arrow-active-core:#d8f3ff; --particle-colour:#21b3ff; }
.skin-coral { --arrow-outline:#e65470; --arrow-core:#fff3f5; --arrow-active:#ff7590; --arrow-active-core:#ffe2e8; --particle-colour:#ff8097; }
.skin-mint { --arrow-outline:#15956e; --arrow-core:#ecfff8; --arrow-active:#24c997; --arrow-active-core:#d9fff2; --particle-colour:#31d6a4; }
.skin-grape { --arrow-outline:#6545c3; --arrow-core:#f6f2ff; --arrow-active:#8c6aff; --arrow-active-core:#e8e0ff; --particle-colour:#9679ff; }
.skin-graphite { --arrow-outline:#353e4e; --arrow-core:#f5f7fa; --arrow-active:#6b778c; --arrow-active-core:#e4e8ee; --particle-colour:#8591a4; }
.skin-candy { --arrow-outline:#e43d83; --arrow-core:#fff3f8; --arrow-active:#ff66aa; --arrow-active-core:#ffd9eb; --particle-colour:#ff76b7; }
.skin-chrome { --arrow-outline:#69778a; --arrow-core:#f8fbff; --arrow-active:#9aa8bb; --arrow-active-core:#fff; --particle-colour:#b9c5d3; }
.skin-ice { --arrow-outline:#3aa4d7; --arrow-core:#effcff; --arrow-active:#65d1ff; --arrow-active-core:#ddf8ff; --particle-colour:#85ddff; }
.skin-pixel { --arrow-outline:#d47b17; --arrow-core:#fff7df; --arrow-active:#f4a22e; --arrow-active-core:#ffedbd; --particle-colour:#ffb543; }
.skin-neon { --arrow-outline:#5b8516; --arrow-core:#eaffba; --arrow-active:#a8f329; --arrow-active-core:#efffc9; --particle-colour:#b9ff3e; }
.skin-lava { --arrow-outline:#b63b19; --arrow-core:#ffe3d9; --arrow-active:#ff6736; --arrow-active-core:#ffe0d3; --particle-colour:#ff7a48; }
.skin-aurora { --arrow-outline:#6551bf; --arrow-core:#f1edff; --arrow-active:#9d7cff; --arrow-active-core:#e7ddff; --particle-colour:#7eddd2; }
.skin-holo { --arrow-outline:#168994; --arrow-core:#efffff; --arrow-active:#43cfd5; --arrow-active-core:#d9ffff; --particle-colour:#e680db; }
.skin-galaxy { --arrow-outline:#4e429c; --arrow-core:#e8e5ff; --arrow-active:#927eff; --arrow-active-core:#e2dcff; --particle-colour:#c58cff; }
.skin-gold { --arrow-outline:#a56b00; --arrow-core:#fff2b2; --arrow-active:#f4b720; --arrow-active-core:#fff0a3; --particle-colour:#ffc843; }

/* Update collection previews to use the same outlined-tube construction. */
.mini-arrow path { stroke: var(--arrow-outline, #13244a); stroke-width: 10.5; }
.mini-arrow path.core { stroke: var(--arrow-core, #fff); stroke-width: 5.2; filter: none; }
.mini-arrow polygon { fill: var(--arrow-outline, #13244a); }
.mini-arrow polygon.core { fill: var(--arrow-core, #fff); filter: none; }

@media (max-width: 620px) {
  .board { padding: 6px; }
  .board-wrap { min-height: 300px; border-radius: 26px; }
  .game-heading h2 { font-size: 25px; }
  .game-heading p { font-size: 15px; }
  .game-progress-row { margin-bottom: 9px; }
  .control-icon { width: 58px; height: 58px; }
}

.flying-coin {
  position: fixed;
  z-index: 120;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  color: #fff7bf;
  background: radial-gradient(circle at 35% 30%,#fff5a4 0 12%,#ffc739 13% 56%,#ec9800 58% 100%);
  border: 2px solid #fff2a4;
  box-shadow: 0 4px 11px rgba(208,126,0,.30), inset 0 0 0 2px rgba(185,105,0,.22);
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
  will-change: transform, opacity;
}
