/**
 * Serenity Blocks — the game-wide corner tiles' base: the Serenity Hub lotus, the
 * settings button in Serenity Mode, Replays, Records and the Odyssey navigator.
 * keystone-menu.css gives the tiles their Keystone look and hides them on the main
 * menu (its dock names them instead).
 *
 * The Hub sheet itself, its tabs, the controls overlay and the in-game Sukha tile are
 * styled in keystone-hub.css; Breathing in breathing-library.css; Sukha sessions and the
 * Sukha flow in breathwork-sessions.css. Nothing here is scoped to a surface, so add
 * only rules for these tiles (the unscoped tab rules that lived here leaked onto
 * other screens — .progress-fill once stretched the Odyssey HUD bar).
 */

:root {
  --hub-transition-fast: 0.2s ease;
  --hub-transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --odyssey-navigator-visual-offset-x: -3px;
}

/* ===========================
   Hub Icon (Floating Button)
   Positioned above settings button in bottom-right
   =========================== */
.serenity-hub-icon {
  position: fixed;
  bottom: 90px;
  right: 9px;
  width: 60px;
  height: 60px;
  cursor: pointer;
  z-index: 1000;
  opacity: 1;
  transform: scale(1);
  transition: opacity var(--hub-transition-normal),
    transform var(--hub-transition-normal);
  pointer-events: all;
}

.serenity-hub-icon.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.serenity-hub-icon:hover {
  transform: scale(1.05);
}

.serenity-hub-icon:active {
  transform: scale(0.95);
}

.serenity-hub-icon.active {
  opacity: 1 !important;
  transform: scale(1);
}

/* Hub Icon SVG */
.hub-icon-svg {
  width: 100%;
  height: 100%;
  color: white;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform var(--hub-transition-fast),
    filter var(--hub-transition-fast);
}

.serenity-hub-icon:hover .hub-icon-svg {
  filter: drop-shadow(0 6px 16px rgba(255, 255, 255, 0.4));
}

/* Hub Icon Glow Effect */
.hub-icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
  filter: blur(10px);
  animation: gentle-glow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes gentle-glow {

  0%,
  100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

/* Hub Icon Pulse (when breathing is active) */
.hub-icon-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.4), transparent);
  opacity: 0;
  transition: opacity var(--hub-transition-normal);
  pointer-events: none;
}

.hub-icon-pulse.breathing-active {
  opacity: 1;
  animation: breathing-pulse 4s ease-in-out infinite;
}

@keyframes breathing-pulse {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.3;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.8;
  }
}

/* Focus state for accessibility */
.serenity-hub-icon:focus-visible {
  outline: 3px solid white;
  outline-offset: 4px;
  border-radius: 50%;
}

/* ===========================
   Serenity Settings Button
   =========================== */
.floating-settings-btn.serenity-settings {
  position: fixed;
  bottom: 30px;
  right: 30px;
  opacity: 0 !important;
  transform: scale(0.9) !important;
  transition: opacity var(--hub-transition-normal),
    transform var(--hub-transition-normal);
  pointer-events: none !important;
}

.floating-settings-btn.serenity-settings.visible {
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: all !important;
}

/* ===========================
   Replays Icon (Floating Button above High Scores)
   =========================== */
.replays-icon {
  position: fixed;
  bottom: 224px;
  right: 14px;
  /* Centered with serenity hub (60px vs 50px width) */
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  /* Hidden by default */
  transform: scale(0.9);
  transition: all var(--hub-transition-normal);
  pointer-events: none;
  /* Not clickable when hidden */
}

.replays-icon.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.replays-icon:hover {
  transform: scale(1.05);
}

.replays-icon:active {
  transform: scale(0.95);
}

/* Replays Icon SVG */
.replays-icon-svg {
  width: 100%;
  height: 100%;
  color: white;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: all var(--hub-transition-fast);
}

.replays-icon:hover .replays-icon-svg {
  filter: drop-shadow(0 6px 16px rgba(255, 255, 255, 0.4));
}

/* Replays Icon Glow Effect */
.replays-icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
  filter: blur(10px);
  animation: gentle-glow 3s ease-in-out infinite;
  pointer-events: none;
}

/* Focus state for accessibility */
.replays-icon:focus-visible {
  outline: 3px solid white;
  outline-offset: 4px;
  border-radius: 50%;
}

/* Replays mobile breakpoints removed — desktop-only */

/* ===========================
   Odyssey Navigator Icon (Floating Button above Serenity Hub)
   =========================== */
.odyssey-navigator-icon {
  position: fixed;
  bottom: 162px;
  right: 14px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1003;
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--hub-transition-normal);
  pointer-events: none;
}

.odyssey-navigator-icon.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.odyssey-navigator-icon:hover {
  transform: scale(1.05);
}

.odyssey-navigator-icon:active {
  transform: scale(0.95);
}

.odyssey-navigator-icon.active {
  opacity: 1;
  transform: scale(1.03);
}

.odyssey-navigator-icon-svg {
  width: 24px;
  height: 24px;
  color: #14f1e2;
  filter: drop-shadow(0 4px 12px rgba(20, 241, 226, 0.35));
  transition: all var(--hub-transition-fast);
}

.odyssey-navigator-icon:hover .odyssey-navigator-icon-svg,
.odyssey-navigator-icon.active .odyssey-navigator-icon-svg {
  color: #7bfff4;
  filter: drop-shadow(0 6px 18px rgba(20, 241, 226, 0.55));
}

.odyssey-navigator-icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 241, 226, 0.34), transparent);
  filter: blur(10px);
  animation: gentle-glow 3s ease-in-out infinite;
  pointer-events: none;
}

.odyssey-navigator-icon:focus-visible {
  outline: 3px solid #14f1e2;
  outline-offset: 4px;
  border-radius: 50%;
}

.odyssey-navigator-icon-svg {
  transform: translateX(var(--odyssey-navigator-visual-offset-x));
}

/* Odyssey navigator mobile breakpoints removed — desktop-only */

/* ===========================
   High Scores Icon (Floating Button above Serenity Hub)
   =========================== */
.highscores-icon {
  position: fixed;
  bottom: 162px;
  right: 14px;
  /* Centered with serenity hub (60px vs 50px width) */
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  /* Hidden by default */
  transform: scale(0.9);
  transition: all var(--hub-transition-normal);
  pointer-events: none;
  /* Not clickable when hidden */
}

.highscores-icon.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.highscores-icon:hover {
  transform: scale(1.05);
}

.highscores-icon:active {
  transform: scale(0.95);
}

/* High Scores Icon SVG */
.highscores-icon-svg {
  width: 100%;
  height: 100%;
  color: #fbbf24;
  /* Gold color for trophy */
  filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.3));
  transition: all var(--hub-transition-fast);
}

.highscores-icon:hover .highscores-icon-svg {
  color: #fcd34d;
  filter: drop-shadow(0 6px 16px rgba(251, 191, 36, 0.5));
}

/* High Scores Icon Glow Effect */
.highscores-icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3), transparent);
  filter: blur(10px);
  animation: gentle-glow 3s ease-in-out infinite;
  pointer-events: none;
}

/* Focus state for accessibility */
.highscores-icon:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 4px;
  border-radius: 50%;
}

/* Highscores mobile breakpoints removed — desktop-only */

/* ===========================
   Reduced motion and print
   =========================== */
@media (prefers-reduced-motion: reduce) {
  .serenity-hub-icon,
  .replays-icon,
  .highscores-icon,
  .odyssey-navigator-icon {
    transition: opacity 0.1s ease;
  }

  .hub-icon-glow,
  .hub-icon-pulse,
  .replays-icon-glow,
  .highscores-icon-glow,
  .odyssey-navigator-icon-glow {
    animation: none;
  }
}

@media print {
  .serenity-hub-icon,
  .replays-icon,
  .highscores-icon,
  .odyssey-navigator-icon {
    display: none;
  }
}
