/* Arrow drawing online (assets/play/arrows.js) */
.ar-main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "steps" "board" "ctrl"; gap: 10px; }
.ar-steps { grid-area: steps; }
.ar-board { grid-area: board; }
.ar-ctrl { grid-area: ctrl; }
@media (min-width: 860px) {
  .ar-main { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto 1fr; grid-template-areas: "board steps" "board ctrl"; }
}

/* the step boxes: one scrolling row on phones, wrapped like the sheet on wide screens */
.ar-steps { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; scroll-behavior: smooth; }
@media (min-width: 860px) { .ar-steps { flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; max-height: 290px; align-content: flex-start; } }
.ar-chip { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 62px; padding: 5px 6px 6px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 2px #90a4ae;
  transition: opacity .2s, transform .15s; }
.ar-ct { display: inline-flex; align-items: center; gap: 3px; }
.ar-chip b { font: 800 1.35rem/1 var(--display, sans-serif); }
.ar-arr { width: 24px; height: 24px; display: block; }
.ar-chip.ar-jump { background: #fff176; box-shadow: inset 0 0 0 2px #f9a825; }
.ar-chip.ar-cur { box-shadow: inset 0 0 0 3px var(--navy), 0 0 0 3px var(--yellow); transform: scale(1.06); }
.ar-chip.ar-done { opacity: .38; }
.ar-chip.ar-done .ar-ct::after { content: "\2713"; color: var(--green); font-weight: 900; font-size: 1.1rem; margin-left: 2px; }
.ar-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 76px; }
.ar-dots i { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 2px #546e7a; }
.ar-dots i.ar-on, .ar-chip.ar-done .ar-dots i { background: var(--green); box-shadow: none; }
.ar-easy .ar-chip { min-width: 70px; }
.ar-easy .ar-chip b { font-size: 1.55rem; }
.ar-easy .ar-arr { width: 30px; height: 30px; }
.ar-bar { display: block; width: 44px; height: 5px; border-radius: 9px; background: #e3e8ef; overflow: hidden; }
.ar-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .15s; }
.ar-chip.ar-done .ar-bar i { width: 100%; }

/* the grid */
.ar-board { border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 3px var(--line); background: #fff; display: flex; justify-content: center; }
.ar-svg { display: block; width: 100%; height: auto; max-height: calc(100vh - 380px); min-height: 200px; touch-action: manipulation; }
@supports (height: 100svh) { .ar-svg { max-height: calc(100svh - 380px); } }
@media (min-width: 860px) { .ar-svg { max-height: calc(100vh - 220px); } }
.game:fullscreen .ar-svg { max-height: calc(100vh - 260px); }
.ar-paper { fill: #fff; }
.ar-grid { fill: none; stroke: #8796a2; stroke-width: 1.1; transition: opacity 1.2s; }
.ar-frame { fill: none; stroke: #37474f; stroke-width: 2.2; }
.ar-art { opacity: 0; transition: opacity 1.4s ease; }
.ar-svg.ar-reveal .ar-art { opacity: 1; }
.ar-svg.ar-reveal .ar-grid { opacity: .35; }
.ar-svg.ar-reveal .ar-pen { opacity: 0; }
.ar-lines { stroke: var(--navy); stroke-linecap: round; fill: none; }
.ar-line { stroke-dasharray: 1; animation: ar-draw .16s ease-out; }  /* visible even without the animation */
@keyframes ar-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.ar-ghost { stroke: var(--yellow); stroke-linecap: round; opacity: 0; }
.ar-ghost.ar-on { animation: ar-ghost 2.4s ease-out; }
@keyframes ar-ghost { 10%, 75% { opacity: .9; } 100% { opacity: 0; } }
.ar-start { fill: #d32f2f; }
.ar-start-tx { fill: #d32f2f; font-family: var(--body, sans-serif); font-weight: 800; }
.ar-pen { transition: opacity .6s; pointer-events: none; }
.ar-pen.ar-ready { transition: transform .12s ease-out, opacity .6s; }
.ar-pen-shadow { fill: rgba(0, 0, 0, .25); opacity: 0; transition: opacity .2s; }
.ar-lift { transition: transform .2s; }
.ar-pen.ar-up .ar-lift { transform: translate(6px, -9px); }
.ar-pen.ar-up .ar-pen-shadow { opacity: 1; }
.ar-pen.ar-wig .ar-pen-in { animation: ar-wig .45s ease-in-out; }
@keyframes ar-wig { 20% { transform: translate(-6px, 0); } 40% { transform: translate(6px, 0); } 60% { transform: translate(-4px, 0); }
  80% { transform: translate(3px, 0); } }

/* the arrow buttons */
.ar-ctrl { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.ar-pad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 58px); gap: 6px; }
.ar-key { padding: 0; min-width: 64px; min-height: 58px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 3px #c9d3df, 0 3px 0 #c9d3df; }
.ar-key:active { transform: translateY(2px); box-shadow: inset 0 0 0 3px #c9d3df; }
.ar-karr { width: 36px; height: 36px; display: block; }
.ar-key.ar-flash { animation: ar-flash .45s 4; }
@keyframes ar-flash { 50% { background: var(--yellow); box-shadow: inset 0 0 0 3px #e0a800, 0 3px 0 #e0a800; } }
.ar-now { display: flex; align-items: center; justify-content: center; gap: 2px; border-radius: 16px; background: var(--soft); }
.ar-now b { font: 800 1.45rem/1 var(--display, sans-serif); }
.ar-now .ar-arr { width: 22px; height: 22px; }
.ar-now.ar-jump { background: #fff176; }
.ar-hint { align-self: center; }
@media (max-width: 600px) {
  .ar-board { border-radius: 10px; }
  .ar-pad { grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 50px); gap: 5px; }
  .ar-key { min-width: 60px; min-height: 50px; }
  .ar-svg { min-height: 180px; }
}
@media (min-width: 860px) { .ar-ctrl { flex-direction: column; } }
