/* SCRIPT BY - LIAM */
/* */

/* ------------------------- Header left side ------------------------- */

.header-home-link:hover .header-title {
  text-decoration: underline;
  color: var(--text);
  opacity: 1;
}

.header-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.header-brand {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 16px;
}
.theme-toggle {
  position: absolute;
  right: 16px;
  top: 60%;
  transform: translateY(-50%);
  padding: 10px 12px;
  min-width: 44px;
  border: 0px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: transparent;
  outline: none;
}
.theme-toggle:active {
  transform: translateY(calc(-50% + 1px));
}

@media (max-width: 600px) {
  .header-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 10px 16px 8px;
    position: static;
  }
  .header-brand {
    position: static;
    transform: none;
    padding-left: 0;
    margin-bottom: 0;
  }
  .theme-toggle {
    position: static;
    transform: none;
    margin: 0;
    order: 1;
  }
  .main-nav {
    margin-top: 10px;
    width: 100%;
    justify-content: flex-start;
    gap: 14px;
    padding-left: 0;
    order: 2;
  }
}
.header-logo {
  height: 22px;
  width: 22px;
  object-fit: contain;
  opacity: 0.92;
}
.header-title {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.82;
  user-select: none;
}

/* ------------------------- Navigation ------------------------- */

.main-nav {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 18px;
}
.nav-link {
  position: relative;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.04rem;
  padding: 2px 0;
  transition: color 0.18s;
  opacity: 1;
}
.header-home-link.nav-link::after {
  display: none;
}
.header-home-link:hover .header-title {
  text-decoration: none;
}
.nav-link::after {
  content: "";
  display: block;
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: #5204aa;
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
}
.nav-link:hover::after, .nav-link.active::after {
  transform: scaleX(1);
}
.nav-link.crossed {
  color: #bbb;
  text-decoration: line-through;
  opacity: 0.7;
  cursor: not-allowed;
}
.nav-link.crossed::after {
  background: #888;
}

/* ------------------------- Base & Layout ------------------------- */

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--bg, #111111);
  color: var(--text, #e0e0e0);
  opacity: 0;
  animation: pageFade 0.8s ease-out forwards;
  transition: background-color 0.35s ease, color 0.35s ease;
}
:root {
  color-scheme: dark;
  --bg: #111111;
  --surface: #1a1a1a;
  --text: #e0e0e0;
  --muted: #aaa;
  --accent: #5204aa;
  --accent-soft: #981cb8;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2f5;
  --surface: #ffffff;
  --text: #111111;
  --muted: #555555;
  --accent: #5f4cc3;
  --accent-soft: #8b5cf6;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.games-section h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.tab-panels {
  min-height: 340px;
}

#page-creations main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100vh - 120px);
  padding: 40px 20px 60px;
}

#page-creations .games-section {
  width: 100%;
  max-width: 900px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.header-home-link {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.home-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.home-hero img {
  height: 200px;
  opacity: 0.6;
}

.home-hero .chair-img {
  margin-right: -25px;
}

.home-hero .table-img {
  margin-left: -25px;
}

.game-banner {
  width: 100%;
  max-width: 552px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  margin-bottom: 18px;
}

.game-card a {
  display: inline-block;
  text-decoration: none;
}

.game-card a:focus-visible,
.game-card a:hover {
  outline: none;
}

.game-card a:hover .game-banner,
.game-card a:focus-visible .game-banner {
  transform: translateY(-1px);
}

.game-card .game-banner {
  transition: transform 0.18s ease;
}

.support-bubble-wrap {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9999;
  width: 50px;
  height: 50px;
}

.support-bubble {
  position: relative;
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 221, 0, 0.18);
  color: #1d1d1d;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.support-bubble:hover,
.support-bubble:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.support-bubble-icon {
  width: 28px;
  height: 28px;
  display: block;
}

.support-bubble-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.support-bubble-close:hover,
.support-bubble-close:focus-visible {
  opacity: 1;
  transform: scale(1.05);
}

.support-bubble-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.about-link {
  color: inherit;
  text-decoration: underline dotted;
  cursor: pointer;
}

.site-footer {
  width: 100vw;
  text-align: center;
  padding: 18px 0 12px 0;
  font-size: 0.8rem;
  color: var(--muted);
  background: none;
  letter-spacing: 0.01em;
}

.full-opacity {
  --target-opacity: 1;
}

main {
  --target-opacity: 0.4; /* default is .4 */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
  opacity: 0;
  transform: translateY(12px);
  animation: contentFade 0.9s ease-out 0.2s forwards;
  position: relative;
}

.centered-image {
  max-width: 100%;
  height: auto;
}

/* ------------------------- Header ------------------------- */

header {
  background: var(--surface);
  color: var(--text);
  padding: 10px 10px 20px 10px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: background-color 0.35s ease, color 0.35s ease;
}

header h1 {
  margin: 0 0 8px 0;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.5px;
}

header p {
  margin: 0;
  font-size: 0.98rem;
  opacity: 0.92;
}

header a {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

header a:hover {
  opacity: 0.8;
}

/*header a[target="_blank"] {
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 2px;
  cursor: pointer;
  animation: glow 2s ease-in-out infinite;
}*/

/* ------------------------- Recommendations Section ------------------------- */

.recommendations {
  margin-top: 65px;
  padding: 40px 20px;
  text-align: center;
  background: var(--surface);
  color: var(--text);
  transition: background-color 0.35s ease, color 0.35s ease;
}

.recommendations h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--text);
  padding: 0;
}

.recommendations ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recommendations li {
  margin: 10px 0;
}

.recommendations a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.recommendations a:hover {
  color: var(--accent-soft);
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}

.tab-button {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 10px 18px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease;
}

.tab-button:hover,
.tab-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(82,4,170,0.32);
}

.tab-button.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.music-gallery {
  display: grid;
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.music-album {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 24px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}

.music-cover {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 16px 40px rgba(0,0,0,0.2);
}

.music-details h3 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
}

.music-details p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.track-list {
  margin-top: 24px;
  display: grid;
  gap: 4px;
}

.track-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.06);
}

.track-title {
  margin: 0 0 12px;
  font-weight: 700;
}

.track-status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.track-item audio {
  width: 100%;
}

@media (max-width: 900px) {
  .music-album {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .tab-list {
    gap: 10px;
  }
}

/* ------------------------- Scroll Indicator ------------------------- */

.scroll-indicator {
  text-align: center;
  padding: 20px 0;
  color: var(--text);
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  animation: glow 5s ease-in-out infinite;
}

.scroll-indicator::after {
  content: "↓";
  font-size: 2rem;
  display: inline-block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* ------------------------- Modal Styles ------------------------- */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  color: #e0e0e0;
  padding: 30px;
  border: none;
  width: 90%;
  max-width: 500px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #aaa;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.close:hover {
  color: #fff;
  transform: scale(1.1);
}

#modal-title {
  margin: 0 0 20px 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  border-bottom: 2px solid #5204aa;
  padding-bottom: 10px;
}

#modal-description {
  min-height: 40px;
  border: 2px solid #444;
  padding: 15px;
  background: #333;
  color: #e0e0e0;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 1rem;
  line-height: 1.5;
  resize: none;
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
  display: block;
  height: auto;
  max-height: 60vh;
  overflow-y: auto;
}

#modal-description:focus {
  outline: none;
  border-color: #5204aa;
  box-shadow: 0 0 0 3px rgba(82, 4, 170, 0.2);
}

#modal-link {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #5204aa 0%, #23004b 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(82, 4, 170, 0.3);
}

#modal-link:hover {
  background: linear-gradient(135deg, #981cb8 0%, #5204aa 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(82, 4, 170, 0.4);
}

/* ------------------------- Animations ------------------------- */

@keyframes glow {
  0%, 100% {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
  }
  50% {
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.8), 0 0 24px rgba(82, 4, 170, 0.6);
  }
}

@keyframes pageFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes contentFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: var(--target-opacity);
    transform: translateY(0);
  }
}


/* ------------------------- Chair & Table ------------------------- */

.wiggle {
  animation: wiggle 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes wiggle {
  0% { transform: rotate(0deg) scale(1); }
  10% { transform: rotate(-8deg) scale(1.05); }
  20% { transform: rotate(8deg) scale(1.05); }
  30% { transform: rotate(-6deg) scale(1.04); }
  40% { transform: rotate(6deg) scale(1.04); }
  50% { transform: rotate(-4deg) scale(1.03); }
  60% { transform: rotate(4deg) scale(1.03); }
  70% { transform: rotate(-2deg) scale(1.01); }
  80% { transform: rotate(2deg) scale(1.01); }
  90% { transform: rotate(0deg) scale(1); }
 100% { transform: rotate(0deg) scale(1); }
}