body {
    padding: 0;
}

#audio-visualizer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(30vh + 80px);
    z-index: 1001;
    pointer-events: none;
    opacity: 0.7;
}

.viewer-view {
  position: fixed;
  inset: 0;
  background-color: rgba(20, 22, 25, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow: hidden;
}
.viewer-view-content {
  position: relative;
  width: 100%;
  height: 100%;
}
.viewer-view-content img {
  position: absolute;
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  cursor: grab;
  border-radius: 4px;
  transform-origin: 0 0; /* Align CSS transform with JS calculations */
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1002;
}
.viewer-view-content img.grabbing { cursor: grabbing; }

.viewer-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: rgba(17, 17, 17, 0.6);
  padding: 0.75rem;
  border-radius: 2rem;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1003;
}
.viewer-button {
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
  color: #111;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.2s;
}
.viewer-button:hover {
  background-color: #fff;
  transform: scale(1.1);
}
.viewer-button svg {
    display: block;
    width: 28px;
    height: 28px;
}

#puzzle-btn {
    margin-top: 1.5rem;
}

/* Audio Player Styles */
.audio-player-container {
    position: fixed;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background-color: rgba(17, 17, 17, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.player-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.player-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: all 0.2s;
}
.player-btn:hover {
    color: #e0218a; /* Magenta theme color */
}
.player-btn:hover svg {
    transform: scale(1.1);
}

.time-seek-group {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.time-display {
    font-size: 0.85rem;
    color: #ccc;
    font-family: monospace;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

.seek-bar, .volume-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}
.seek-bar::-webkit-slider-thumb, .volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #e0218a;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(224, 33, 138, 0.8);
    transition: transform 0.2s;
}
.seek-bar:hover, .volume-bar:hover {
    background: rgba(255,255,255,0.3);
}
.seek-bar:hover::-webkit-slider-thumb, .volume-bar:hover::-webkit-slider-thumb {
    transform: scale(1.2);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.volume-bar {
    width: 80px;
}