/* Word Weave - polish layer. Art direction: inked field notebook on walnut, one amber
   ink accent. Loaded last; only additive rules on existing classes. */

/* safe areas */
.ww-hud { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
.ww-play { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.overlay { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }

/* touch targets */
.ww-hud__btn, .ww-coins, .ww-tool, .ww-wheel__shuffle { min-width: 44px; min-height: 44px; }

/* screen transitions: overlays fade, sheets rise */
.overlay:not([hidden]) { animation: wwFade .22s ease-out both; }
.overlay:not([hidden]) .sheet { animation: wwRise .32s cubic-bezier(.2, 1.1, .3, 1) both; }
@keyframes wwFade { from { opacity: 0; } }
@keyframes wwRise { from { opacity: 0; transform: translateY(28px) scale(.97); } }

/* crisper cell letters, ink feel */
.ww-cell__letter { font-weight: 800; letter-spacing: .01em; text-rendering: optimizeLegibility; }
.ww-cell.is-shown { box-shadow: inset 0 -2px 0 rgba(120, 53, 15, .22), 0 1px 0 rgba(255, 255, 255, .35); }

/* letter press: quick spring */
.ww-letter { transition: transform .12s cubic-bezier(.3, 1.6, .5, 1), opacity .15s; will-change: transform; }

/* word accepted: ring expands from the wheel */
.ww-wheel-wrap { position: relative; }
.ww-ripple { position: absolute; left: 50%; top: 50%; width: 60%; aspect-ratio: 1; margin: 0; border-radius: 50%;
  border: 3px solid rgba(245, 158, 11, .75); pointer-events: none; transform: translate(-50%, -50%) scale(.6);
  animation: wwRipple .65s ease-out forwards; }
.ww-ripple--jar { left: 50%; top: 50%; width: 120%; border-color: rgba(124, 58, 237, .7); }
@keyframes wwRipple { to { transform: translate(-50%, -50%) scale(1.7); opacity: 0; border-width: 1px; } }
.ww-tool { position: relative; }

/* preview ribbon flash */
.ww-ribbon__text.is-flash { animation: wwInk .5s ease-out; }
.ww-ribbon__text.is-flash-bonus { animation: wwInkBonus .6s ease-out; }
@keyframes wwInk { 30% { transform: scale(1.08); filter: brightness(1.15); } }
@keyframes wwInkBonus { 30% { transform: scale(1.1); filter: hue-rotate(40deg) brightness(1.1); } }

/* combo badge */
.ww-combo { position: absolute; right: 10px; top: 8px; z-index: 5; min-width: 44px; padding: 4px 10px; border-radius: 999px;
  font: 800 18px/1.1 var(--font-label, system-ui); color: #fff; text-align: center; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--amber-500), var(--amber-700)); box-shadow: 0 2px 0 var(--amber-900); }
.ww-combo.is-on { animation: wwCombo .9s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes wwCombo { 0% { opacity: 0; transform: scale(.4) rotate(-10deg); } 25% { opacity: 1; transform: scale(1.15) rotate(3deg); } 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }

/* result sheet: stars and rows land in order */
.ww-won .sheet-stars span { animation: starIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.sheet-rows > * { animation: wwRow .3s ease-out both; }
.sheet-rows > *:nth-child(2) { animation-delay: .08s; }
.sheet-rows > *:nth-child(3) { animation-delay: .16s; }
.sheet-rows > *:nth-child(4) { animation-delay: .24s; }
@keyframes wwRow { from { opacity: 0; transform: translateX(-10px); } }
#complete-goal.is-in { animation: wwRow .5s .3s ease-out both; }
#complete-goal { font-weight: 700; }
.ww-hud__btn.is-flash { animation: bump .6s; }

@media (prefers-reduced-motion: reduce) {
  .ww-ripple, .ww-combo { display: none; }
  .overlay:not([hidden]), .overlay:not([hidden]) .sheet, .sheet-rows > * { animation: none; }
}
