/* ==================== */
/* Global Reset and Basic Styles */
/* ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Arial', sans-serif;
}

body {
  background: linear-gradient(to right, #2b3a3e, #3f5b5d);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: white;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
  z-index: 2; /* Higher than the grid container */
  position: relative; /* Ensure proper stacking context */
  overflow: visible !important;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  grid-template-rows: repeat(5, 120px);
  gap: 20px;
  padding: 20px;
  position: relative; /* Required for backdrop positioning */
  z-index: 0; /* Lower than buttons */
  transition: opacity 2s ease-in-out;
}

/* First Row */
.substack-button     { grid-area: 1 / 1; }
.twitter             { grid-area: 1 / 2; }
.duolingo            { grid-area: 1 / 3; }

/* Second Row */
.dropkickd-button    { grid-area: 2 / 1; }
.letterboxd          { grid-area: 2 / 2; }
.statsfm             { grid-area: 2 / 3; }

/* Third Row */
.news-button         { grid-area: 3 / 1; }
.kiss-button         { grid-area: 3 / 2; }
.spotify             { grid-area: 3 / 3; }

/* Fourth Row */
.propaganda-link     { grid-area: 4 / 1; }
.photo               { grid-area: 4 / 2; }
.vinyl               { grid-area: 4 / 3; }

/* Fifth Row */
.wip                 { grid-area: 5 / 1; }
#themeButton        { grid-area: 5 / 2; }
.secret-button       { grid-area: 5 / 3; }

/* Backdrop Element */
.grid-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(10px); /* Apply backdrop-filter here */
  background: rgba(43, 58, 62, 0.8); /* Background color for classic theme */
  border-radius: 20px; /* Match the grid container's border radius */
  z-index: -1; /* Place it behind the grid container's content */
}

* {
    -webkit-user-select: none; /* Safari/Chrome */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE/Edge */
    user-select: none;
}

/* Optional: Override for specific elements (if needed) */
.allow-select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* ==================== */
/* Theme Button */
/* ==================== */
#themeButton {
  background: none;
  border: none;
  padding: 0;
  font-size: 120px;
  cursor: pointer;
  transition: transform 0.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  position: relative;
  transform: translate(0, 0);
  z-index: 2; /* Ensure it stays above the grid container */
}

/* Spin Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==================== */
/* Button Styles */
/* ==================== */

.wip, 
.secret-button {
  background: none;
  border: none;
  padding: 0;
  font-size: 80px;
  cursor: pointer;
  transition: transform 0.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  position: relative;
  transform: translate(0, 0);
  z-index: 2; /* Ensure it stays above the grid container */
}

.wip:active .secret-button:active {
  transform: translate(10px, 0) scale(1.1); /* Move 10px right and scale up */
  transition: transform 0.2s ease-in-out; /* Faster animation for click feedback */
}

/* Spotify Button */
.spotify {
  background-color: #1DB954 !important;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 2px;
  top: auto !important;
  left: auto !important;
  position: relative;
  overflow: hidden;
  opacity: 1 !important; /* Force visibility */
  visibility: visible !important; /* Force visibility */
  transition: transform 0.6s ease, background-color 0.6s ease;
  z-index: 1000; /* Ensure it stays above the grid container */
  mix-blend-mode: normal !important;
}

.spotify .bar {
  background-color: black;
  height: 8px;
  border-radius: 10px;
  position: absolute;
  transform: none;
  z-index: 1001;
}

.spotify .bar.top {
  width: 60%;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;  
}

.spotify .bar.middle {
  width: 50%;
  top: 45%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
}

.spotify .bar.bottom {
  width: 40%;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
}

.spotify:hover {
  background-color: black;
  transform: scale(1.2);
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.7);
  animation: boomBoxPulse 1s ease-in-out infinite;
}

@keyframes boomBoxPulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1.1); }
  75% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.spotify:hover .bar {
  background-color: green;
}

/* Duolingo Button */
.duolingo {
  background-color: #00b22d;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  border: 3px solid darkgrey;
  animation: none;
}

.duolingo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}

.duolingo:hover {
  animation: spinOnce 5s ease-in-out forwards;
  background-color: black;
}

@keyframes spinOnce {
  0% { transform: rotate(0deg); }
  99% { transform: rotate(360000deg); }
  100% { transform: rotate(360000deg); }
}

/* Letterboxd Button */
.letterboxd {
  background-color: #00e054 !important; /* Green circle */
  opacity: 1 !important; 
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: visible;
  transition: transform 0.3s ease;
  z-index: 1001;
  visibility: visible !important;
  mix-blend-mode: normal !important;
}

.letterboxd::before, .letterboxd::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  transition: width 0.3s ease, height 0.3s ease, left 0.3s ease, right 0.3s ease, visibility 0.3s ease, opacity 0.3s ease;
  visibility: hidden;
  opacity: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000; /* Ensure pseudo-elements are behind the green circle */
}

.letterboxd::before {
  left: -0px;
  background-color: #FF8000; /* Orange circle */
  z-index: 1001;
}

.letterboxd::after {
  right: -0px;
  background-color: #40BCF4; /* Blue circle */
  z-index: 1001;
}

.letterboxd:hover {
  transform: scale(1.1);
  z-index: 1001;
}

.letterboxd:hover::before, .letterboxd:hover::after {
  width: 120px;
  height: 120px;
  visibility: visible;
  opacity: 1;
  z-index: 10; /* Ensure pseudo-elements stay behind the green circle */
}

.letterboxd:hover::before {
  left: -95px;
  z-index: 1001;
}

.letterboxd:hover::after {
  right: -95px;
  z-index: 1001;
}

/* Photo Button */
.photo {
  background-color: black;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  transition: transform 0.3s ease-in-out;
  position: relative;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
  z-index: 2; /* Ensure it stays above the grid container */
}

.lens {
  background: radial-gradient(circle, #444 10%, #222 60%);
  border-radius: 50%;
  width: 80%;
  height: 80%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  position: absolute;
  top: 10%;
  left: 10%;
}

.lens::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.1) 75%);
  border: 4px solid #444;
  top: 0;
  left: 0;
  box-sizing: border-box;
  z-index: -1;
  background-size: 10px 10px;
}

.lens::after {
  content: '';
  position: absolute;
  top: 25%;
  left: 25%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  z-index: 1;
}

.photo:hover::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
  transform: translate(-50%, -50%);
  animation: flashEffect 0.3s ease-out forwards;
  z-index: 2;
  pointer-events: none;
}

@keyframes flashEffect {
  0% { z-index: 99999; opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { z-index: 99999; opacity: 0.5; transform: translate(-50%, -50%) scale(1.2); }
  100% { z-index: 99999; opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* News Button */
.news-button {
  background-color: #d32f2f;
  color: white;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.news-button::before {
  content: "📰";
  font-size: 2.5em;
  position: absolute;
  transition: transform 0.3s ease;
}

.news-button:hover {
  background-color: #b71c1c;
  transform: scale(1.1);
}

.news-button:hover::before {
  transform: rotate(360deg);
  animation: float 1.5s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}  

/* Surprise Button */
.surprise {
  background-color: #222;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: none;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  background-color: transparent;
  z-index: 2;
}

.joystick {
  background-color: #ff9e00;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  position: absolute;
  top: 10px;
  left: 10px;
  transition: background-color 0.3s ease;
  box-shadow: 0 0 15px rgba(255, 158, 0, 0.7);
  z-index: 2;
}

.stick {
  background-color: #00bcd4;
  width: 10px;
  height: 40px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(15px) rotate(-25deg);
  border-radius: 5px;
  z-index: 1;
}

.stick-ball {
  background-color: #ff0000;
  width: 24px;
  height: 24px;
  position: absolute;
  top: -12px;
  left: -6px;
  transform: translateX(50%) translateY(18px);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
}

.surprise:hover {
  transform: scale(1.1);
  background-color: #444;
}

.surprise:active .joystick {
  transform: scale(0.9);
  background-color: #ff6f00;
}

.surprise:active .stick {
  transform: translate(-50%, -50%) translateY(18px) rotate(-40deg);
}

.surprise:hover .stick {
  box-shadow: 0 0 10px #00bcd4;
}

/* Propaganda Button */
.propaganda {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff0000 50%, #8b0000 80%);
  position: relative;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.propaganda-link {
  text-decoration: none;
  display: inline-block;
}

.propaganda::before {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, transparent 60%, rgba(255, 0, 0, 0.3) 80%);
  border-radius: 50%;
  animation: pulseEffect 1.5s infinite;
}

@keyframes pulseEffect {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.propaganda:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(255, 0, 0, 0.9);
}

.propaganda:active {
  animation: shake 0.3s linear;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.propaganda .symbol {
  font-size: 18px;
  font-weight: bold;
  color: #ff4c4c;
  text-transform: uppercase;
  text-align: center;
}

/*  Button */
.kiss-button {
  background: url('pic/solavi.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  cursor: pointer;
  position: fixed; /* Default relative positioning within the grid */
  width: 120px;
  height: 120px;
  display: inline-block;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: transparent;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 10;
  overflow: visible;
}

.kiss-button.free {
  position: fixed !important;
  z-index: 1010;
  cursor: pointer;
  transition: transform 0.1s linear;
  contain: layout;
}

.bounce-trail {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1; /* Trail stays behind button */
}

/* Hover and active effects */
.kiss-button:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 223, 0, 0.8);
}

.kiss-button:active {
  transform: scale(0.95);
}

/* Ray Container */
.rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Individual Ray */
.ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 0;
  background: rgba(255, 223, 0, 0.8);
  transform-origin: top center;
  opacity: 0;
  animation: none;
}

/* Ray Animation */
@keyframes ray-expand {
  0% {
    height: 0;
    opacity: 1;
  }
  100% {
    height: 150px;
    opacity: 0;
  }
}

/* Ray Direction */
.ray:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg); }
.ray:nth-child(2) { transform: translate(-50%, -50%) rotate(45deg); }
.ray:nth-child(3) { transform: translate(-50%, -50%) rotate(90deg); }
.ray:nth-child(4) { transform: translate(-50%, -50%) rotate(135deg); }
.ray:nth-child(5) { transform: translate(-50%, -50%) rotate(180deg); }
.ray:nth-child(6) { transform: translate(-50%, -50%) rotate(225deg); }
.ray:nth-child(7) { transform: translate(-50%, -50%) rotate(270deg); }
.ray:nth-child(8) { transform: translate(-50%, -50%) rotate(315deg); }

/* Active Effect */
.kiss-button:active {
  transform: scale(0.95);
}

/* Trigger Ray Animation on Click */
.kiss-button:active .ray {
  animation: ray-expand 0.5s ease-out forwards;
}

.love-message {
  position: absolute;
  color: red;
  font-size: 20px;
  font-weight: bold;
  pointer-events: none;
  transform: translate(0, 0);
  transition: transform 2s ease, opacity 2s ease;
  opacity: 1;
  z-index: 10000;
}

/* ==================== */
/* Vinyl and Video Popup Styles */
/* ==================== */

.vinyl-link {
  text-decoration: none;
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

.vinyl {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 50%; /* Circle by default */
  background: radial-gradient(circle, #4E3629, #8C5E3C); /* Brown vinyl background */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
  z-index: 20; /* Keeps the same z-index */
  transition: transform 0.3s ease-in-out, border-radius 0.3s ease-in-out, box-shadow 0.3s ease-in-out; /* Smooth transition */
  transform: scale(1); /* Initial size */
  transform-origin: center center; /* Make sure it expands from the center */
  overflow: hidden; /* Prevents the content from overflowing the new rounded corners */
}

/* On hover, the circle's borders overflow and transform into a rounded square */
.vinyl:hover {
  border-radius: 15px; /* Transform the vinyl into a rounded square (squared circle) */
  transform: scale(1.1); /* Slightly expand outward */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* Increase shadow on hover */
  z-index: 20; /* Keep it at the same z-index */
}

/* Record - The inner part of the vinyl doesn't change */
.record {
  position: relative;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, #7A4E29 60%, #AA5B3A 85%, #7A4E29 100%); /* Darker brown color for vinyl */
  border-radius: 50%;
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.1);
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Keep the record's size and position unchanged */
  transition: none; /* No transition for the record */
}

.record::before {
  content: '';
  position: absolute;
  width: 90%;
  height: 90%;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05), 
              0 0 0 10px rgba(255, 255, 255, 0.02), 
              0 0 0 20px rgba(255, 255, 255, 0.01);
}

.record::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, #d4d4d4 40%, #a6a6a6 100%);
  border-radius: 50%;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.record .center-hole {
  position: absolute;
  width: 2px;
  height: 2px;
  background: black;
  border-radius: 10%;
  z-index: 3;
}

.vinyl .record {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #000;
  box-shadow: inset 0 0 6px #555;
  transition: transform 0.5s ease-in-out;
  z-index: 15;
}

.arm {
  position: absolute;
  width: 80px;
  height: 15px;
  background: #5B3D2B; /* Darker brown for the arm */
  border-radius: 4px;
  transform-origin: center right;
  transition: transform 0.3s ease-in-out;
  right: -10px;
  top: 2%;
  opacity: 0;
  z-index: 15;
}

.stylus-base {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  right: 0;
  top: 50%;
  opacity: 0;
  z-index: 15;
}

.grooves {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: repeating-conic-gradient(black 0deg 45deg, transparent 45deg 90deg, black 90deg 135deg);
  opacity: 0.6;
  pointer-events: none;
  z-index: 15;
}

/* Vinyl hover effects - These parts appear when hovered */
.vinyl:hover .wood-box {
  opacity: 1;
}

.vinyl:hover .arm {
  opacity: 1;
  transform: rotate(320deg);
  overflow: visible;
}

.vinyl:hover .stylus-base {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(320deg);
  overflow: visible;
}

.draggable {
  position: fixed;
  cursor: move;
  user-select: none;
  z-index: 10000; /* Ensure it's above other elements */
}

.-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9998;
  display: none;
}

#musicPlayer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: none;
  cursor: move;
  position: absolute;
  user-select: none;
}

#musicPlayer * {
  user-select: none;
}

.drag-handle {
  height: 30px;
  width: 100%;
  background: #333;
  cursor: move;
  border-radius: 5px 5px 0 0;
}

#musicPlayer.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ipod-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  background: #f0f0f0;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  z-index: 10000;
  display: none;
}

.ipod-screen {
  background: #000;
  border-radius: 5px;
  height: 180px;
  margin-bottom: 15px;
  overflow: hidden;
}

.click-wheel {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: #e0e0e0;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ipod-btn {
  border: none;
  background: none;
  padding: 5px;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease;
}

.shuffle-btn {
  position: absolute;
  top: 10px; /* Position it above the play/pause button */
  background-color: #505050; /* Default gray */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.shuffle-icon {
  font-size: 24px; /* Size of the shuffle icon */
  color: #fff;    /* Icon color */
}

.shuffle-btn:hover .shuffle-icon {
  color: #00ccff; /* Change color when hovered */
}

.shuffle-btn:active .shuffle-icon {
  color: #ffcc00; /* Change color when clicked */
  background-color: #00ccff; /* Bright blue when active */
  box-shadow: 0 0 10px #00ccff; /* Glow effect */
  border-radius: 5px;
}

.playpause {
  position: absolute;
  bottom: 10px;
}

/* iPod-like theme */
body.theme-retro .ipod-popup {
  background: #383838;
  color: #00ffcc;
}

body.theme-retro .click-wheel {
  background: #505050;
}

#videoPlayer {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 640px;
  height: 400px;
  background-color: #111;
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(0,0,0,0.6);
  z-index: 999;
  overflow: hidden;
}

#videoPlayer iframe {
  width: 100%;
  height: calc(100% - 50px);
  border: none;
  border-radius: 0 0 10px 10px;
}

.video-controls {
  height: 50px;
  background-color: #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  color: white;
  font-family: sans-serif;
}

.video-controls button {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.pin-btn {
  opacity: 0.5;
}

.pin-btn.active {
  opacity: 1;
}

.video-resize-bar {
  height: 12px;
  cursor: ns-resize;
  background: #444;
  width: 100%;
}

/* ==================== */
/* Stats.fm Button */
/* ==================== */
.statsfm {
  background-color: #2b3a3e;
  color: limegreen;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  z-index: 2; /* Ensure it stays above the grid container */
}

.statsfm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  z-index: 2;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.statsfm .overlay {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  transition: visibility 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
}

.statsfm:hover .overlay {
  visibility: visible;
  opacity: 1;
}

.statsfm .overlay img {
  width: 50%;
  height: auto;
  object-fit: contain;
}

.statsfm:hover img {
  opacity: 1;
}

/* Existing Twitter Button Styling */
.twitter {
  background-color: black;
  color: white;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: transform 0.3s ease-in-out;
  z-index: 2; /* Ensure it stays above the grid container */
  transform-style: preserve-3d; /* Enable 3D transformations */
}

.twitter img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}

/* Twitter Button on Hover - 3D tilt towards the viewer */
.twitter:hover {
  animation: spin 3s linear infinite;
  background-color: black;
  transform: rotateY(45deg); /* Tilt towards the viewer on hover */
  z-index: 3; /* Ensure the button appears above other elements */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Wrestling Button */
.dropkickd-button {
  display: inline-block;
  width: 120px;
  height: 120px;
  border-radius: 50%; /* Initially circular */
  background-color: #4A1F44; /* Dark purple background for the wrestling ring */
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  line-height: 120px; /* Vertically center text */
  border: 5px solid #3A0E35; /* Darker purple border for the ring */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden; /* Prevent overflow */
  cursor: pointer;
  transition: all 0.6s ease; /* Smooth transition for scaling */
  transform-origin: center; /* Ensure the expansion happens from the center */
  z-index: 10; /* Ensure the button is on top of other elements */
}

/* On hover, the circle's borders flood outward to form the squared circle */
.dropkickd-button:hover {
  border-radius: 15px; /* Transform the button into a squared circle */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* Increase shadow on hover */
  z-index: 20; /* Ensure it covers other elements when expanded */
}

/* Ring posts at the four corners */
.dropkickd-button .top-left-post,
.dropkickd-button .top-right-post,
.dropkickd-button .bottom-left-post,
.dropkickd-button .bottom-right-post {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: #C74E85; /* Purple color for ring posts */
  border-radius: 50%;
  opacity: 0; /* Initially hidden */
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 99999; /* Ensure posts are above the button */
}

/* Top-left corner post */
.dropkickd-button .top-left-post {
  top: -20px; /* Position above the button */
  left: -20px; /* Position left of the button */
}

/* Top-right corner post */
.dropkickd-button .top-right-post {
  top: -20px; /* Position above the button */
  right: -20px; /* Position right of the button */
}

/* Bottom-left corner post */
.dropkickd-button .bottom-left-post {
  bottom: -20px; /* Position below the button */
  left: -20px; /* Position left of the button */
}

/* Bottom-right corner post */
.dropkickd-button .bottom-right-post {
  bottom: -20px; /* Position below the button */
  right: -20px; /* Position right of the button */
}

/* Ring ropes (stretch from each corner) */
.dropkickd-button .rope-top,
.dropkickd-button .rope-bottom,
.dropkickd-button .rope-left,
.dropkickd-button .rope-right {
  content: "";
  position: absolute;
  background-color: #F0A7D1; /* Light purple ropes */
  opacity: 0; /* Initially hidden */
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999; /* Make sure ropes appear below posts but above the button */
}

/* Top rope */
.dropkickd-button .rope-top {
  top: 50%;
  left: -40px;
  width: 120%;
  height: 5px;
  transform: translateY(-50%);
}

/* Bottom rope */
.dropkickd-button .rope-bottom {
  bottom: 50%;
  left: -40px;
  width: 120%;
  height: 5px;
  transform: translateY(50%);
}

/* Left rope */
.dropkickd-button .rope-left {
  top: -40px;
  left: 50%;
  height: 120%;
  width: 5px;
  transform: translateX(-50%);
}

/* Right rope */
.dropkickd-button .rope-right {
  top: -40px;
  right: 50%;
  height: 120%;
  width: 5px;
  transform: translateX(50%);
}

/* On hover, make the ropes and posts visible and animate */
.dropkickd-button:hover .top-left-post,
.dropkickd-button:hover .top-right-post,
.dropkickd-button:hover .bottom-left-post,
.dropkickd-button:hover .bottom-right-post {
  opacity: 1; /* Show the ring posts */
}

.dropkickd-button:hover .rope-top,
.dropkickd-button:hover .rope-bottom,
.dropkickd-button:hover .rope-left,
.dropkickd-button:hover .rope-right {
  opacity: 1; /* Show the ropes */
  transform: translateX(0) translateY(0); /* Stretch the ropes to the corners */
}

/* Center logo in the middle of the ring */
.dropkickd-button .logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Center the logo */
  width: 80px;
  height: 80px;
  background-image: url('https://dropkickd.com/assets/logoMobile-Bvdlcwd2.webp');
  background-size: contain;
  background-repeat: no-repeat;
  transition: opacity 0.3s ease;
  opacity: 0; /* Initially hidden */
  z-index: 10; /* Ensure logo stays on top of the ring */
}

.dropkickd-button:hover .logo {
  opacity: 1; /* Make logo appear when hovered */
}
/* Substack Button Styling (Default) */
.substack-button {
  background-color: #FF6A13; /* Default orange background */
  color: white;
  border-radius: 50%; /* Circular shape */
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: transform 0.3s ease-in-out;
  z-index: 2; /* Ensure it stays above the grid container */
  transform-style: preserve-3d; /* Enable 3D transformations */
  position: relative; /* Ensure correct positioning */
  border: 2px solid #FF6A13; /* Default orange border */
  background-image: url('https://github.com/kritiquekapital/marjork/blob/main/css/pic/Psych-Flower%20%2304.png'); /* Default image */
  background-size: cover; /* Ensure the image is fully covered within the button */
  background-position: center; /* Center the image */
}

/* Ensure the image is fully visible and positioned correctly */
.substack-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  opacity: 1; /* Make sure the image is fully visible */
  transition: opacity 0.3s ease-in-out; /* Smooth transition for opacity */
}

#minesweeper-game {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background-color: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

#minesweeper-grid {
  display: grid;
  gap: 2px;
  user-select: none;
}

.tile {
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 20px;
  transition: background 0.2s, transform 0.2s;
  box-sizing: border-box;
}

.minesweeper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.close-button {
  font-size: 18px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 6px 10px;
}

.tile.pulse {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 10px rgba(255, 255, 255, 0.4); }
  100% { transform: scale(1); }
}

.minesweeper-controls {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  align-items: center;
}

.difficulty-select,
.new-game-button,
.fullscreen-button,
.close-button {
  padding: 6px 12px;
  font-weight: bold;
}

@media (max-width: 768px) {
  .mobile-only {
    display: inline-block;
  }

  #minesweeper-game.mobile-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #000;
    padding: 0;
    margin: 0;
    overflow: hidden;
    z-index: 9999;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-header {
    flex: 0 0 auto;
    padding: 4px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #111;
    border-bottom: 2px solid #0ff;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-controls {
    display: flex;
    gap: 6px;
    flex-grow: 1;
    overflow-x: auto;
    align-items: center;
  }

  #minesweeper-game.mobile-fullscreen .difficulty-select,
  #minesweeper-game.mobile-fullscreen .new-game-button,
  #minesweeper-game.mobile-fullscreen .fullscreen-button,
  #minesweeper-game.mobile-fullscreen .close-button {
    font-size: 10px;
    padding: 4px 6px;
    background: linear-gradient(45deg, #f06, #0cf, #ff0);
    background-size: 400% 400%;
    animation: rainbow 5s ease infinite;
    color: #000;
    border: 2px solid #00ccff;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    text-transform: uppercase;
    white-space: nowrap;
  }

  #minesweeper-game.mobile-fullscreen #minesweeper-grid {
    flex-grow: 1;
    display: grid;
    gap: 2px;
    padding: 6px;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    justify-items: center;
  }

  /* Responsive tile sizing (max available height/width) */
  #minesweeper-game.mobile-fullscreen[data-difficulty="easy"] .tile {
    height: calc((100vh - 180px) / 8);
    width: calc((100vw - 20px) / 10);
  }

  #minesweeper-game.mobile-fullscreen[data-difficulty="medium"] .tile {
    height: calc((100vh - 180px) / 14);
    width: calc((100vw - 20px) / 12);
  }

  #minesweeper-game.mobile-fullscreen[data-difficulty="hard"] .tile {
    height: calc((100vh - 180px) / 20);
    width: calc((100vw - 20px) / 14);
  }

  .tile {
    font-size: min(4vw, 16px);
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-info,
  #minesweeper-game.mobile-fullscreen .minesweeper-stats {
    padding: 4px 10px;
    background-color: #111;
    font-size: 11px;
    color: #0ff;
    font-family: 'Press Start 2P', monospace;
    border: 2px solid #fff;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    flex: 0 0 auto;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-stats .wins,
  #minesweeper-game.mobile-fullscreen .minesweeper-stats .booms {
    flex: 1;
    text-align: center;
    margin: 0;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-timer {
    flex: 1;
    text-align: left;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-best-time {
    flex: 1;
    text-align: right;
    color: #888;
    opacity: 0.5;
  }
}

  #minesweeper-game.mobile-fullscreen .minesweeper-header {
    flex: 0 0 auto;
    padding: 6px 8px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #111;
    border-bottom: 2px solid #0ff;
    z-index: 10;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-controls {
    display: flex;
    gap: 6px;
    flex-grow: 1;
    overflow-x: auto;
    align-items: center;
  }

  #minesweeper-game.mobile-fullscreen .difficulty-select,
  #minesweeper-game.mobile-fullscreen .new-game-button,
  #minesweeper-game.mobile-fullscreen .fullscreen-button,
  #minesweeper-game.mobile-fullscreen .close-button {
    font-size: 10px;
    padding: 4px 6px;
    background: linear-gradient(45deg, #f06, #0cf, #ff0);
    background-size: 400% 400%;
    animation: rainbow 5s ease infinite;
    color: #000;
    border: 2px solid #00ccff;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    text-transform: uppercase;
    white-space: nowrap;
  }

  #minesweeper-game.mobile-fullscreen #minesweeper-grid {
    flex-grow: 1;
    display: grid;
    gap: 2px;
    padding: 6px;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }

  /* TILE SIZE BASED ON SCREEN DIMENSIONS — SAFE NO OVERFLOW */
  #minesweeper-game.mobile-fullscreen[data-difficulty="easy"] .tile {
    width: calc((100vw - 24px) / 10);
    height: calc((100vh - 200px) / 8);
  }

  #minesweeper-game.mobile-fullscreen[data-difficulty="medium"] .tile {
    width: calc((100vw - 24px) / 12);
    height: calc((100vh - 200px) / 14);
  }

  #minesweeper-game.mobile-fullscreen[data-difficulty="hard"] .tile {
    width: calc((100vw - 24px) / 14);
    height: calc((100vh - 200px) / 20);
  }

  .tile {
    font-size: min(4vw, 16px);
  }

  .minesweeper-username {
    font-family: monospace;
    margin-left: 12px;
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #aaa;
    background-color: #111;
    color: #0ff;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-info,
  #minesweeper-game.mobile-fullscreen .minesweeper-stats {
    padding: 4px 10px;
    background-color: #111;
    font-size: 11px;
    color: #0ff;
    font-family: 'Press Start 2P', monospace;
    border: 2px solid #fff;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    flex: 0 0 auto;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Hard fullscreen = inline stats */
  #minesweeper-game.mobile-fullscreen[data-difficulty="hard"] .minesweeper-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
  }

  #minesweeper-game.mobile-fullscreen[data-difficulty="hard"] .minesweeper-stats .wins,
  #minesweeper-game.mobile-fullscreen[data-difficulty="hard"] .minesweeper-stats .booms {
    flex: 1;
    text-align: center;
    margin: 0;
  }

  /* Stack stats on easy/medium */
  #minesweeper-game.mobile-fullscreen:not([data-difficulty="hard"]) .minesweeper-stats .wins,
  #minesweeper-game.mobile-fullscreen:not([data-difficulty="hard"]) .minesweeper-stats .booms {
    display: block;
    text-align: left;
    margin: 4px 0;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-timer {
    flex: 1;
    text-align: left;
  }

  #minesweeper-game.mobile-fullscreen .minesweeper-best-time {
    flex: 1;
    text-align: right;
    color: #888;
    opacity: 0.5;
  }
}

/* Leaderboard panel container */
.leaderboard-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  max-width: 480px;
  max-height: 640px;
  background-color: rgba(25, 25, 25, 0.95);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 999;
  overflow: auto;
}

/* Leaderboard header row with sort buttons */
.leaderboard-header {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.sort-btn {
  background-color: #222;
  border: 2px solid #00ffff;
  padding: 6px 12px;
  color: #00ffff;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  font-family: monospace;
  transition: background 0.3s;
}
.sort-btn:hover {
  background-color: #00ffff;
  color: black;
}

/* Leaderboard list */
.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: monospace;
  font-size: 0.95rem;
}
.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #555;
}

/* Back button (reuse .close-button if available) */
.leaderboard-panel .back-button {
  align-self: center;
  margin-top: 1rem;
  padding: 6px 12px;
  background: #222;
  color: #00ffff;
  border: 2px solid #00ffff;
  border-radius: 6px;
  font-family: monospace;
  cursor: pointer;
  transition: background 0.3s;
}
.leaderboard-panel .back-button:hover {
  background: #00ffff;
  color: black;
}

/* Rainbow animation */
@keyframes rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
