/* Loanword. All rules scoped under .lnw-* (the app inlines only this file). */

/* the map */
.lnw-map { position: relative; width: 100%; aspect-ratio: 400 / 324; margin: auto 0; animation: lnwIn .8s ease-out both; }
@keyframes lnwIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lnw-svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.lnw-svg path.lnw-land { fill: #262d4a; stroke: #0a0e1a; stroke-width: .5; stroke-linejoin: round; transition: fill .7s ease; }
.lnw-svg path.lnw-cha { fill: rgba(252,192,80,.55); }
.lnw-svg path.lnw-te { fill: rgba(169,155,255,.6); }
.lnw-svg path.lnw-ask { fill: #3a4370; stroke: var(--text); stroke-width: 1; animation: lnwAsk 1.2s ease-in-out infinite alternate; }
@keyframes lnwAsk { to { fill: #59649c; } }
.lnw-svg text.lnw-w { font: 800 18px var(--sans); paint-order: stroke; stroke: #0a0e1a; stroke-width: 4.5px; stroke-linejoin: round; text-anchor: middle; opacity: 0; transition: opacity .35s; }
.lnw-svg text.lnw-cha { fill: var(--gold); }
.lnw-svg text.lnw-te { fill: var(--violet-bright); }
.lnw-svg text.lnw-on { opacity: 1; animation: lnwPop .45s cubic-bezier(.3,1.6,.5,1) both; transform-box: fill-box; transform-origin: center; }
@keyframes lnwPop { from { transform: scale(.4); } to { transform: none; } }
.lnw-eu text.lnw-w { font-size: 5.8px; stroke-width: 1.4px; }
.lnw-eu text.lnw-nl { font-size: 6.3px; }
.lnw-svg.lnw-zoomed .lnw-words, .lnw-svg.lnw-zoomed .lnw-glow { opacity: 0; transition: opacity .3s; }
.lnw-glow { fill: var(--violet-bright); opacity: 0; transition: opacity .5s; }
.lnw-glow.lnw-on { opacity: .75; animation: lnwGlow 1.4s ease-in-out 3 alternate; }
@keyframes lnwGlow { to { opacity: .35; } }
.lnw-route { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lnw-rcha { stroke: var(--gold); }
.lnw-rte { stroke: var(--violet-bright); }
.lnw-macau circle { fill: var(--gold); }
.lnw-macau text { font: 700 16px var(--sans); fill: var(--text); text-anchor: middle; paint-order: stroke; stroke: #0a0e1a; stroke-width: 3px; }

/* things on the map */
.lnw-rider { position: absolute; width: 15%; transform: translate(-50%, -78%); pointer-events: none; transition: opacity .4s; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.lnw-camel { width: 13%; transform: translate(-50%, -82%) scaleX(-1); }
.lnw-west { transform: translate(-50%, -78%) scaleX(-1); }
.lnw-gone { opacity: 0 !important; pointer-events: none; }
.lnw-cup { all: unset; position: absolute; width: 17%; min-width: 48px; min-height: 48px; transform: translate(-50%, -62%); cursor: pointer; transition: opacity .4s, transform .4s; animation: lnwDrop .7s cubic-bezier(.3,1.5,.5,1) .3s both; -webkit-tap-highlight-color: transparent; }
.lnw-cup img { display: block; width: 100%; filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.lnw-cup.lnw-gone { transform: translate(-50%, -62%) scale(.6); }
@keyframes lnwDrop { from { transform: translate(-50%, -160%); opacity: 0; } to { transform: translate(-50%, -62%); opacity: 1; } }
.lnw-hit { all: unset; position: absolute; width: 56px; height: 56px; transform: translate(-50%, -70%); border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lnw-cup:focus, .lnw-hit:focus { outline: none; }
#controls.lnw-quiet { opacity: .35; transition: opacity .3s; }
.lnw-g { color: var(--gold); }
.lnw-v { color: var(--violet-bright); }

/* English, three times */
.lnw-eng { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.lnw-row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 50px 52px 1fr 76px; align-items: center; gap: 6px; min-height: 56px; padding: 4px 10px 4px 6px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(169,155,255,.18); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lnw-row img { width: 50px; height: 40px; object-fit: contain; }
.lnw-when { font: 800 13px var(--sans); color: var(--dim); }
.lnw-who { font: 600 15px/1.2 var(--sans); color: var(--text); }
.lnw-gap { height: 34px; border-radius: 10px; border: 2px dashed rgba(169,155,255,.55); display: flex; align-items: center; justify-content: center; font: 700 18px var(--serif); color: var(--gold); }
.lnw-row.lnw-set .lnw-gap { border-style: solid; border-color: var(--gold); background: rgba(252,192,80,.1); }
.lnw-row.lnw-set { pointer-events: none; }
.lnw-bank { display: flex; justify-content: center; gap: 10px; padding-top: 8px; }

@media (max-height: 700px) {
  .lnw-row { min-height: 50px; }
  .lnw-row img { height: 34px; }
}
@media (prefers-reduced-motion: reduce) { .lnw-map, .lnw-cup, .lnw-glow.lnw-on, .lnw-svg path.lnw-ask { animation: none; } }
