/* ============================================================
   GAME-CENTER.CSS — Floating Game Center Widget
   Portfolio: Amrit Kandel
   ============================================================ */

/* ── Keyframes ── */
@keyframes gc-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-10px) rotate(-2deg); }
  66%       { transform: translateY(-5px) rotate(2deg); }
}

@keyframes gc-pulse-ring {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes gc-orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes gc-item-pop {
  0%   { opacity: 0; transform: translate(var(--tx-start), var(--ty-start)) scale(0.3); }
  65%  { transform: translate(var(--tx), var(--ty)) scale(1.1); }
  100% { opacity: 1; transform: translate(var(--tx), var(--ty)) scale(1); }
}

@keyframes gc-badge-bounce {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}

@keyframes gc-shimmer-sweep {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes gc-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes gc-label-slide {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes gc-name-appear {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Backdrop ── */
.gc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: radial-gradient(ellipse at 0% 50%, rgba(99,102,241,0.05) 0%, transparent 55%);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.gc-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Outer wrapper (fixed, left-center) ── */
.game-center {
  position: fixed;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── "GAME CENTER" hover label above button ── */
.gc-label {
  font-family: var(--ff-mono, monospace);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-accent, #38bdf8);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  margin-bottom: 6px;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(56,189,248,0.7);
  pointer-events: none;
  text-align: center;
}
.game-center:hover .gc-label,
.game-center.open .gc-label {
  opacity: 1;
  transform: translateY(0);
}

/* Thin connector line between label and button */
.gc-vert-line {
  width: 1px;
  height: 14px;
  background: linear-gradient(to bottom, rgba(99,102,241,0.6), transparent);
  flex-shrink: 0;
}
.gc-vert-line-bot {
  width: 1px;
  height: 14px;
  background: linear-gradient(to top, rgba(99,102,241,0.6), transparent);
  flex-shrink: 0;
}

/* ── Trigger button ── */
.gc-trigger {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #1b1f3a 0%, #0d1229 100%);
  box-shadow:
    0 0 0 1.5px rgba(129,140,248,0.4),
    0 0 24px rgba(129,140,248,0.28),
    0 10px 40px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.1);
  animation: gc-float 4.5s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
  transition: box-shadow 0.3s ease;
}
.gc-trigger:hover,
.game-center.open .gc-trigger {
  box-shadow:
    0 0 0 2px rgba(129,140,248,0.7),
    0 0 40px rgba(129,140,248,0.5),
    0 0 70px rgba(192,132,252,0.2),
    0 14px 50px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.14);
  animation-play-state: paused;
}

/* Glass inner ring */
.gc-trigger::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(129,140,248,0.14) 0%, rgba(192,132,252,0.08) 100%);
  border: 1px solid rgba(129,140,248,0.18);
  pointer-events: none;
}

/* ── Pulse rings ── */
.gc-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(129,140,248,0.45);
  animation: gc-pulse-ring 2.8s ease-out infinite;
  pointer-events: none;
}
.gc-ring:nth-child(2) { animation-delay: 0.95s; }
.gc-ring:nth-child(3) { animation-delay: 1.9s; }

/* ── Orbit decorator ── */
.gc-orbit {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px dashed rgba(129,140,248,0.2);
  animation: gc-orbit-spin 14s linear infinite;
  pointer-events: none;
}
.gc-orbit-dot {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #a5b4fc 0%, #6366f1 100%);
  box-shadow: 0 0 10px rgba(129,140,248,0.9);
}

/* ── Game Center custom image icon ── */
.gc-icon-img {
  position: relative;
  z-index: 2;
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
.gc-trigger:hover .gc-icon-img,
.game-center.open .gc-trigger .gc-icon-img {
  transform: scale(1.1) rotate(-8deg);
}

/* ── Badge ── */
.gc-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: linear-gradient(135deg, #6366f1 0%, #c084fc 100%);
  color: #fff;
  font-family: var(--ff-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--clr-bg, #080c14);
  animation: gc-badge-bounce 2.2s ease-in-out infinite;
  z-index: 4;
}

/* ── Palette container (hover-triggered) ── */
.gc-palette {
  position: fixed;
  /* left/top set by JS to match trigger center */
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.gc-palette.open {
  pointer-events: auto;
  opacity: 1;
}

/* ── Individual game item wrapper ── */
.gc-item {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  pointer-events: none;
  opacity: 0;
  /* --tx, --ty, --tx-start, --ty-start set via JS */
  transform: translate(var(--tx, 0px), var(--ty, 0px));
  text-decoration: none;
}
.gc-palette.open .gc-item {
  pointer-events: auto;
  opacity: 1;
  animation: gc-item-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.gc-item:nth-child(1) { animation-delay: 0ms; }
.gc-item:nth-child(2) { animation-delay: 55ms; }
.gc-item:nth-child(3) { animation-delay: 110ms; }
.gc-item:nth-child(4) { animation-delay: 165ms; }
.gc-item:nth-child(5) { animation-delay: 220ms; }
.gc-item:nth-child(6) { animation-delay: 275ms; }
.gc-item:nth-child(7) { animation-delay: 330ms; }
.gc-item:nth-child(8) { animation-delay: 385ms; }

/* ── Game bubble ── */
.gc-bubble {
  width: 68px;
  height: 68px;
  border-radius: 20px;         /* squircle shape — friendlier + larger */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1.5px rgba(255,255,255,0.1),
    0 6px 28px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.15);
  transition:
    transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.gc-item:hover .gc-bubble {
  transform: scale(1.15);
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.2),
    0 10px 40px rgba(0,0,0,0.65),
    0 0 30px var(--gc-glow, rgba(99,102,241,0.5)),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Subtle glass shimmer */
.gc-bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255,255,255,0.18) 0%, transparent 55%);
  pointer-events: none;
}

/* ── Game image icon inside bubble ── */
.gc-game-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.gc-item:hover .gc-game-img {
  transform: scale(1.1);
}

/* ── Game name — always visible below the icon ── */
.gc-bubble-name {
  position: relative;
  z-index: 1;
  font-family: var(--ff-sans, sans-serif);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.92);
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  line-height: 1;
  pointer-events: none;
}

/* ── Tooltip (richer, on hover) ── */
.gc-tip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  white-space: nowrap;
  background: rgba(8,10,24,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(129,140,248,0.3);
  border-radius: 10px;
  padding: 8px 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 20;
}
.gc-item:hover .gc-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Small arrow pointing left */
.gc-tip::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid rgba(129,140,248,0.3);
}

.gc-tip-name {
  display: block;
  font-family: var(--ff-sans, sans-serif);
  font-size: 13px;
  font-weight: 700;
  color: #e8edf8;
  line-height: 1.3;
}
.gc-tip-tag {
  display: block;
  font-family: var(--ff-mono, monospace);
  font-size: 9.5px;
  color: var(--clr-accent, #38bdf8);
  letter-spacing: 0.1em;
  margin-top: 2px;
  text-transform: uppercase;
}
.gc-tip-desc {
  display: block;
  font-family: var(--ff-sans, sans-serif);
  font-size: 10.5px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
  max-width: 160px;
  white-space: normal;
  line-height: 1.4;
}
.gc-tip-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-family: var(--ff-mono, monospace);
  font-size: 9px;
  color: #c084fc;
  letter-spacing: 0.06em;
}

/* ── Palette center hub ── */
.gc-hub {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #a5b4fc 0%, #6366f1 100%);
  box-shadow: 0 0 14px rgba(99,102,241,0.8);
  pointer-events: none;
  z-index: 5;
}

/* ── "More coming soon" label in palette ── */
.gc-coming-soon {
  position: absolute;
  font-family: var(--ff-mono, monospace);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  color: rgba(129,140,248,0.4);
  white-space: nowrap;
  pointer-events: none;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease 0.35s;
}
.gc-palette.open .gc-coming-soon {
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .game-center { left: 10px; }
  .gc-trigger  { width: 64px; height: 64px; }
  .gc-icon-img { width: 36px; height: 36px; }
  .gc-bubble   { width: 58px; height: 58px; border-radius: 16px; }
  .gc-game-img { width: 32px; height: 32px; }
  .gc-tip      { display: none; }
  .gc-palette  { left: 86px !important; }
}
