/* ======== Letter Loop (letter-loop.js / letter-loop-views.js) ======== */
.ll-banner { border-color: #14b8a6; }
.ll-banner .eng-end-banner-go { color: #0f766e; }

.ll { --ll-accent: #14b8a6; --ll-accent-dark: #0f766e; --ll-cell-bg: var(--color-surface-2, #f1f5f9); }
.ll-fam { display: inline-block; margin: 0 0 10px; padding: 3px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 700;
  background: #ccfbf1; color: #115e59; }

/* the crossword */
.ll-grid { --ll-cell: min(40px, calc((100vw - 56px) / var(--ll-cols))); display: grid; gap: 3px; justify-content: center;
  grid-template-columns: repeat(var(--ll-cols), var(--ll-cell)); margin: 4px auto 12px; }
.ll-cell { width: var(--ll-cell); height: var(--ll-cell); border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: calc(var(--ll-cell) * 0.55); background: var(--ll-cell-bg); color: var(--color-text);
  border: 2px solid rgba(20, 184, 166, 0.35); box-sizing: border-box; user-select: none; }
.ll-gap { background: transparent; border: none; }
.ll-shown { background: var(--ll-accent); border-color: var(--ll-accent); color: #fff; cursor: pointer; }
.ll-hinted { background: #fef3c7; border-color: #f59e0b; color: #92400e; cursor: default; }
.ll-new { animation: ll-pop 0.45s ease-out; }
@keyframes ll-pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* what just happened */
.ll-msg { display: flex; align-items: flex-start; justify-content: center; gap: 8px; min-height: 2.6em; margin: 0 auto 6px; max-width: 30em;
  padding: 6px 12px; border-radius: 12px; font-size: 0.95rem; line-height: 1.4; text-align: left; }
.ll-msg-idle { color: var(--color-text-muted); text-align: center; }
.ll-msg-found { background: #ccfbf1; color: #134e4a; }
.ll-msg-bonus { background: #fef3c7; color: #78350f; }
.ll-msg-nope { color: var(--color-text-muted); }
.ll-build { margin-top: 2px; font-weight: 700; color: #0f766e; }
.ll-say { appearance: none; border: none; background: rgba(255, 255, 255, 0.7); border-radius: 999px; width: 2em; height: 2em; flex: none;
  font-size: 1rem; cursor: pointer; }

.ll-preview { min-height: 1.6em; text-align: center; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.12em; color: var(--ll-accent-dark); }
.ll-wobble { animation: ll-wobble 0.4s ease-in-out; color: var(--color-text-muted); }
@keyframes ll-wobble { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* the letter wheel */
.ll-play { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 8px; }
.ll-wheel { position: relative; width: min(64vw, 320px); aspect-ratio: 1; border-radius: 50%; flex: none;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.10), rgba(20, 184, 166, 0.22)); touch-action: none; user-select: none;
  -webkit-user-select: none; -webkit-touch-callout: none; }
.ll-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ll-line polyline { fill: none; stroke: var(--ll-accent); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.ll-letter { position: absolute; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: clamp(1.2rem, 6vw, 1.7rem);
  background: var(--color-surface, #fff); color: var(--color-text); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); pointer-events: none; }
.ll-on { background: var(--ll-accent); color: #fff; }
.ll-side { display: flex; flex-direction: column; gap: 10px; }
.ll-tool, .ll-jar { position: relative; appearance: none; border: none; width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem;
  background: var(--color-surface-2, #f1f5f9); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ll-jar { cursor: default; }
.ll-tool:disabled { opacity: 0.4; cursor: default; }
.ll-tool-n { position: absolute; right: -4px; top: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: var(--ll-accent-dark); color: #fff; font-size: 0.7rem; font-weight: 800; line-height: 18px; }

.ll-tapbar { display: none; justify-content: center; gap: 10px; }
.ll-tapbar-on { display: flex; }

/* finish screen */
.ll-list { width: 100%; max-width: 30em; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.ll-list-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 10px; border-radius: 10px; background: #f0fdfa; color: #134e4a; }
.ll-bonus-line { font-weight: 700; color: #92400e; }

[data-theme="dark"] .ll-fam { background: #134e4a; color: #99f6e4; }
[data-theme="dark"] .ll-msg-found, [data-theme="dark"] .ll-list-row { background: #134e4a; color: #ccfbf1; }
[data-theme="dark"] .ll-msg-bonus { background: #422006; color: #fde68a; }
[data-theme="dark"] .ll-hinted { background: #422006; color: #fde68a; }
[data-theme="dark"] .ll-build { color: #5eead4; }
[data-theme="dark"] .ll-say { background: rgba(0, 0, 0, 0.3); }

/* ======== Down in the Letter Loop Well ========
   The puzzle is played at the bottom of the well (the Curious World room's
   PixelLab cave), on carved stone tiles and rune pebbles from PixelLab. */
.ll { --ll-accent: #4fd1c5; --ll-accent-dark: #a7f3ec; position: relative; isolation: isolate; padding: 6px 14px 22px;
  border-radius: 20px; color: #eef6f3; }
.ll::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 20px;
  background: linear-gradient(180deg, rgba(6, 14, 20, 0.55), rgba(6, 14, 20, 0.82) 60%), url("./world/inside/loop-well-arena-px.png") center top / cover no-repeat;
  image-rendering: pixelated; box-shadow: inset 0 0 0 3px rgba(79, 209, 197, 0.35); }
.ll .eng-end-top h2, .ll .eng-end-count { color: #eef6f3; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
.ll .ll-fam { background: rgba(15, 60, 66, 0.85); color: #a7f3ec; }

.ll .ll-cell { background: url("./world/inside/loop-well/game-cell-px.png") center / 100% 100% no-repeat; border: none; border-radius: 3px;
  color: #10302f; image-rendering: pixelated; }
.ll .ll-gap { background: none; }
.ll .ll-shown { background-image: url("./world/inside/loop-well/game-cell-on-px.png"); color: #eafffb;
  text-shadow: 0 0 6px rgba(79, 209, 197, 0.95), 0 2px 0 #000; }
.ll .ll-hinted { background-image: url("./world/inside/loop-well/game-cell-hint-px.png"); color: #7a4a05; }

.ll .ll-msg { background: rgba(8, 24, 30, 0.78); color: #e2f3ef; border: 2px solid rgba(79, 209, 197, 0.3); }
.ll .ll-msg-idle, .ll .ll-msg-nope { color: #b9d4cf; }
.ll .ll-msg-found { background: rgba(13, 70, 66, 0.9); color: #e6fffb; }
.ll .ll-msg-bonus { background: rgba(92, 60, 8, 0.9); color: #fde68a; }
.ll .ll-build { color: #7ee8dc; }
.ll .ll-preview { color: #a7f3ec; text-shadow: 0 0 8px rgba(79, 209, 197, 0.8), 0 2px 0 #000; }

.ll .ll-wheel { background: url("./world/inside/loop-well/game-wheel-px.png") center / 100% 100% no-repeat; image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.45)); }
.ll .ll-line polyline { stroke: #7df9ec; stroke-width: 3.6; opacity: 0.95; filter: drop-shadow(0 0 2px #4fd1c5); }
.ll .ll-letter { background: url("./world/inside/loop-well/game-pebble-px.png") center / 100% 100% no-repeat; image-rendering: pixelated;
  box-shadow: none; color: #f4fbf9; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75); }
.ll .ll-on { filter: drop-shadow(0 0 6px #4fd1c5) brightness(1.25); color: #b5fff6; }
.ll .ll-tool, .ll .ll-jar { background: url("./world/inside/loop-well/game-pebble-px.png") center / 100% 100% no-repeat; image-rendering: pixelated; }

.ll .eng-end-btn { background: #2f7f8a; color: #fff; border: 16px solid transparent; border-radius: 0; box-shadow: none; padding: 2px 10px;
  border-image: url("./world/inside/loop-well-btn-px.png") 40 fill / 16px stretch; image-rendering: pixelated; }
.ll .eng-end-btn.eng-end-secondary { filter: saturate(0.4) brightness(0.9); }
.ll .ll-list-row { background: rgba(8, 24, 30, 0.8); color: #e2f3ef; }
.ll .eng-end-results h2, .ll .eng-end-results p { color: #eef6f3; }
.ll .ll-bonus-line { color: #fde68a; }
/* Free hints used up: the badge shows the price instead of a count. */
.ll-tool-n.ll-tool-cost { right: -12px; background: #f59e0b; color: #3b2203; white-space: nowrap; }
