﻿/* ==========================================================================
   ISOLA DELLE ABILITÀ & RIFLESSI (ACCHIAPPA AL VOLO / WHACK-A-MOLE)
   ========================================================================== */

.island-skills {
  border-top: 5px solid #f59e0b;
}

.island-skills:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 32px rgba(245, 158, 11, 0.2);
}

.skills-stage-card {
  background: linear-gradient(180deg, #ffffff 0%, #fefce8 100%);
  border: 2px solid #fde047;
}

.skills-header-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.skills-mode-tab-btn {
  font-size: 0.82rem;
  padding: 5px 10px;
}

/* Mission & Score Banner */
.skills-mission-banner {
  background: #ffffff;
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.skills-mission-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.skills-mission-badge {
  font-size: 0.72rem;
  font-weight: 900;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.skills-mission-text {
  font-size: 0.95rem;
  color: #1e293b;
  line-height: 1.25;
}

.skills-score-tracker {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 90px;
}

.skills-score-numbers {
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.skills-current-score {
  font-size: 1.4rem;
  color: #f59e0b;
}

.skills-goal-score {
  font-size: 0.85rem;
  color: #64748b;
}

.skills-progress-bar-bg {
  width: 100%;
  height: 7px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 2px;
}

.skills-progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 3D Burrows Field */
.skills-burrows-field {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  background: radial-gradient(circle at 50% 50%, #86efac 0%, #4ade80 100%);
  border: 3px solid #22c55e;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(34, 197, 94, 0.15);
}

.burrow-hole-wrapper {
  position: relative;
  background: #78350f;
  border-radius: 50% / 35%;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 8px 16px rgba(0, 0, 0, 0.6), 0 4px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease;
}

.burrow-hole-wrapper:active {
  transform: scale(0.96);
}

.burrow-dirt-back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 30%, #1c1917 0%, #451a03 100%);
  z-index: 1;
}

.burrow-creature-container {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.burrow-dirt-front {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.9) 0%, #451a03 100%);
  border-top: 2px solid #a16207;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.burrow-grass-tuft {
  font-size: 0.8rem;
  margin-top: -8px;
}

.burrow-item-sprite {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.burrow-item-sprite.pop-in {
  animation: mole-pop-in 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.burrow-item-sprite.pop-out {
  animation: mole-pop-out 0.2s ease-in forwards;
}

@keyframes mole-pop-in {
  0% { transform: translateY(40px) scale(0.4); opacity: 0; }
  70% { transform: translateY(-4px) scale(1.1); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes mole-pop-out {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(40px) scale(0.3); opacity: 0; }
}

.burrow-item-emoji {
  font-size: 2.3rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.burrow-item-name {
  font-size: 0.65rem;
  font-weight: 900;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.7);
  padding: 1px 6px;
  border-radius: 10px;
  margin-top: 1px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Floating Success/Error Splash */
.skills-floating-splash {
  position: fixed;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
  font-weight: 900;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 9999;
  animation: splash-float 0.8s ease-out forwards;
}

@keyframes splash-float {
  0% { transform: translate(-50%, -10px) scale(0.6); opacity: 1; }
  50% { transform: translate(-50%, -35px) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -55px) scale(0.9); opacity: 0; }
}

.skills-bottom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Toggle between Buche and Cesta */
.skills-type-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f1f5f9;
  border-radius: 30px;
  padding: 4px;
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
}

.skills-type-btn {
  flex: 1;
  max-width: 220px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 25px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.skills-type-btn.active {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  transform: scale(1.03);
}

.skills-category-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.skills-cat-pill-btn {
  font-size: 0.78rem;
  padding: 4px 9px;
}

/* ==========================================================================
   CATCHER GAME ARENA (CESTA AL VOLO DAL CIELO)
   ========================================================================== */

.catcher-sky-arena {
  position: relative;
  width: 100%;
  height: 230px;
  background: linear-gradient(180deg, #38bdf8 0%, #bae6fd 65%, #86efac 100%);
  border: 3px solid #0284c7;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(2, 132, 199, 0.2);
  user-select: none;
  touch-action: none;
}

.catcher-cloud {
  position: absolute;
  font-size: 2rem;
  opacity: 0.6;
  pointer-events: none;
  animation: cloud-float 16s linear infinite;
}

.cloud-1 { top: 8px; left: -10%; }
.cloud-2 { top: 40px; left: -30%; animation-delay: 8s; }

@keyframes cloud-float {
  0% { transform: translateX(0); }
  100% { transform: translateX(500px); }
}

.catcher-items-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 50px;
  pointer-events: none;
}

.catcher-falling-sprite {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.catcher-falling-emoji {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.catcher-falling-label {
  font-size: 0.62rem;
  font-weight: 900;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.7);
  padding: 1px 5px;
  border-radius: 8px;
  margin-top: 1px;
  white-space: nowrap;
}

/* Bottom Basket Track */
.catcher-basket-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.3) 0%, rgba(22, 101, 52, 0.7) 100%);
  border-top: 2px dashed #16a34a;
  cursor: ew-resize;
  touch-action: none;
}

.catcher-basket {
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.05s ease-out;
}

.catcher-basket-emoji {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.catcher-basket-label {
  font-size: 0.58rem;
  font-weight: 900;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0 4px;
  border-radius: 6px;
  margin-top: -3px;
  pointer-events: none;
}

.basket-bounce {
  animation: basket-joy 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.basket-shake {
  animation: shake 0.4s ease;
}

@keyframes basket-joy {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.25) translateY(-8px); }
  100% { transform: translateX(-50%) scale(1); }
}

/* ==========================================================================
   DINO RUNNER GAME ARENA (SCORRIMENTO CONTINUO & SALTO CON LA TESTA)
   ========================================================================== */

.runner-scroller-arena {
  position: relative;
  width: 100%;
  height: 270px;
  background: linear-gradient(180deg, #60a5fa 0%, #93c5fd 50%, #bfdbfe 75%, #bbf7d0 100%);
  border: 3px solid #2563eb;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(37, 99, 235, 0.2);
  user-select: none;
  touch-action: manipulation;
  cursor: pointer;
}

.runner-sky-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  pointer-events: none;
}

.runner-sun {
  position: absolute;
  top: 8px;
  right: 18px;
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px rgba(253, 224, 71, 0.8));
  animation: sun-pulse 4s ease-in-out infinite alternate;
}

@keyframes sun-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.12) rotate(10deg); }
}

.runner-cloud {
  position: absolute;
  font-size: 1.8rem;
  opacity: 0.7;
  pointer-events: none;
  animation: runner-cloud-drift 22s linear infinite;
}

.cloud-a { top: 12px; left: 15%; }
.cloud-b { top: 40px; left: 60%; animation-delay: 11s; }

@keyframes runner-cloud-drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(600px); }
}

.runner-hills-layer {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  height: 60px;
  background: radial-gradient(ellipse at center bottom, #86efac 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.runner-items-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.runner-item-sprite {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.15s ease;
  z-index: 5;
}

.runner-item-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.runner-item-sprite.target-glow .runner-item-bubble {
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.6), 0 4px 8px rgba(0, 0, 0, 0.15);
  animation: target-bob 1s ease-in-out infinite alternate;
}

@keyframes target-bob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.runner-item-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.runner-item-label {
  font-size: 0.62rem;
  font-weight: 900;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.85);
  padding: 1px 5px;
  border-radius: 8px;
  margin-top: 2px;
  white-space: nowrap;
}

.runner-item-popped {
  animation: item-pop-out 0.25s forwards;
}

@keyframes item-pop-out {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6) translateY(-15px); opacity: 0.8; }
  100% { transform: scale(2) translateY(-25px); opacity: 0; }
}

.runner-item-deflected {
  animation: item-deflect 0.3s forwards;
}

@keyframes item-deflect {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  100% { transform: scale(0.6) translateY(30px) rotate(45deg); opacity: 0; }
}

/* Dino Character Avatar (Facing Right) */
.runner-dino-avatar {
  position: absolute;
  left: 45px;
  bottom: 40px;
  width: 52px;
  height: 56px;
  z-index: 10;
  pointer-events: none;
  transition: filter 0.2s ease;
}

.dino-character-sprite {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dino-emoji {
  font-size: 2.8rem;
  line-height: 1;
  transform: scaleX(-1);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
  animation: dino-run-bob 0.35s ease-in-out infinite alternate;
}

.dino-jumping .dino-emoji {
  animation: none;
  transform: scaleX(-1) rotate(10deg) scale(1.08);
}

.dino-hit-success .dino-emoji {
  animation: dino-head-bump 0.35s ease;
  filter: drop-shadow(0 0 10px #fbbf24) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.dino-hit-wrong .dino-emoji {
  animation: dino-shake-flipped 0.4s ease;
  filter: drop-shadow(0 0 10px #ef4444);
}

@keyframes dino-run-bob {
  0% { transform: scaleX(-1) translateY(0) scaleY(1); }
  100% { transform: scaleX(-1) translateY(-3px) scaleY(0.96); }
}

@keyframes dino-head-bump {
  0% { transform: scaleX(-1) scale(1); }
  40% { transform: scaleX(-1) scale(1.3) translateY(-10px) rotate(8deg); }
  100% { transform: scaleX(-1) scale(1); }
}

@keyframes dino-shake-flipped {
  0%, 100% { transform: scaleX(-1) translateX(0); }
  20%, 60% { transform: scaleX(-1) translateX(-6px); }
  40%, 80% { transform: scaleX(-1) translateX(6px); }
}

.dino-puff {
  position: absolute;
  bottom: 2px;
  left: -8px;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Scrolling Ground Track */
.runner-ground-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #16a34a;
  border-top: 3px solid #15803d;
  overflow: hidden;
}

.runner-grass-strip {
  width: 100%;
  height: 12px;
  background-image: repeating-linear-gradient(
    90deg,
    #22c55e 0px,
    #22c55e 12px,
    #16a34a 12px,
    #16a34a 24px,
    #4ade80 24px,
    #4ade80 36px
  );
  background-size: 60px 100%;
}

.runner-dirt-base {
  width: 100%;
  height: 28px;
  background: #78350f;
  background-image: radial-gradient(#92400e 15%, transparent 16%), radial-gradient(#b45309 15%, transparent 16%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

/* Controls Overlay & Big Jump Button */
.runner-controls-overlay {
  position: absolute;
  bottom: 6px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 15;
}

.runner-tap-prompt {
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 10px;
  border-radius: 12px;
  backdrop-filter: blur(2px);
}

.runner-big-jump-btn {
  pointer-events: auto;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 30px;
  padding: 6px 18px;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  touch-action: manipulation;
}

.runner-big-jump-btn:active {
  transform: scale(0.92) translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsive Adjustments for Single Viewport Fit */
@media (max-width: 768px) {
  .planets-stage-card { padding: 8px 6px; }
  .solar-system-track-wrapper { padding: 6px 4px; gap: 4px; margin: 4px 0; }
  .sun-glow-core { font-size: 1.6rem; }
  .sun-label { font-size: 0.55rem; }
  
  .orbit-target-slot { min-height: 60px; max-height: 70px; padding: 2px; border-radius: 8px; }
  .orbit-number-badge { font-size: 0.55rem; padding: 0 2px; top: 2px; left: 2px; }
  .orbit-planet-emoji { font-size: 1.2rem; }
  .orbit-planet-name { font-size: 0.55rem; }
  .orbit-slot-placeholder span { font-size: 0.55rem; }
  .orbit-slot-placeholder small { display: none; }
  
  .planet-names-matching-grid { gap: 4px; margin-bottom: 4px; }
  .planet-names-matching-grid.names-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .planet-names-matching-grid.names-cols-8 { grid-template-columns: repeat(4, 1fr); }
  
  .planet-name-target-card { padding: 3px 2px; min-height: 64px; border-radius: 8px; }
  .planet-name-header { gap: 2px; margin-bottom: 1px; }
  .planet-name-text { font-size: 0.72rem; }
  .planet-speak-btn { width: 17px; height: 17px; min-width: 17px; font-size: 0.58rem; }
  .planet-syllables-badge { font-size: 0.5rem; padding: 0 3px; margin-bottom: 2px; }
  .planet-name-dropzone { min-height: 30px; max-height: 36px; border-radius: 6px; padding: 1px; }
  .planet-drop-prompt { font-size: 0.52rem; }
  .placed-emoji { font-size: 1.15rem; }
  .placed-check { font-size: 0.6rem; }
  
  .planet-drag-card { min-width: 40px; max-width: 54px; padding: 2px 3px; }
  .planet-drag-card .logic-card-emoji { font-size: 1.25rem; }
  .planet-drag-card .logic-card-label { font-size: 0.6rem; }
  .planet-card-subinfo { display: none; }
  .logic-tray-title { font-size: 0.72rem; margin-bottom: 4px; }
  .logic-options-tray { padding: 6px 4px; margin-top: 4px; }

  /* Skills Island Mobile Adjustments */
  .skills-stage-card { padding: 5px 4px; }
  .skills-type-btn { font-size: 0.74rem; padding: 4px 8px; }
  .skills-cat-pill-btn { font-size: 0.68rem; padding: 3px 6px; }
  .skills-mission-banner { padding: 4px 6px; gap: 4px; margin-bottom: 4px; }
  .skills-mission-badge { font-size: 0.58rem; padding: 2px 5px; }
  .skills-mission-text { font-size: 0.72rem; }
  .skills-current-score { font-size: 1.1rem; }
  .skills-goal-score { font-size: 0.72rem; }
  .skills-burrows-field { gap: 5px; padding: 6px 4px; margin-bottom: 4px; border-radius: 10px; }
  .burrow-hole-wrapper { height: 62px; }
  .burrow-item-emoji { font-size: 1.6rem; }
  .burrow-item-name { font-size: 0.52rem; padding: 1px 3px; }
  .burrow-dirt-front { height: 16px; }
  .catcher-sky-arena { height: 200px; margin-bottom: 4px; border-radius: 12px; }
  .catcher-falling-emoji { font-size: 1.8rem; }
  .catcher-falling-label { font-size: 0.55rem; }
  .catcher-basket-emoji { font-size: 2.1rem; }
  .catcher-basket-track { height: 44px; }
  .runner-scroller-arena { height: 230px; margin-bottom: 4px; border-radius: 12px; }
  .dino-emoji { font-size: 2.3rem; }
  .runner-dino-avatar { left: 25px; bottom: 32px; width: 44px; height: 48px; }
  .runner-ground-track { height: 32px; }
  .runner-grass-strip { height: 10px; }
  .runner-dirt-base { height: 22px; }
  .runner-item-bubble { width: 38px; height: 38px; }
  .runner-item-emoji { font-size: 1.5rem; }
  .runner-item-label { font-size: 0.52rem; padding: 1px 4px; }
  .runner-big-jump-btn { font-size: 0.82rem; padding: 4px 12px; }
  .runner-tap-prompt { font-size: 0.62rem; padding: 2px 6px; }
}
