/* --- 全域變數 --- */
:root {
  --font-main: "Noto Sans TC", sans-serif;
  --color-bg: #000000;
  --color-text: #ffffff;
  --color-muted: #aaaaaa;
  --color-primary: #ffcc00;
  --radius: 12px;
}

/* --- HTML & Body --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
  background-image: url('img/bg_03.jpg');
  background-size: cover;
  padding-top: 120px;
}

/* --- Header / Navbar --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1100;
  background-color: #111;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

header a {
  color: var(--color-text);
  margin-left: 20px;
  text-decoration: none;
  font-weight: 600;
}

header a:hover {
  color: var(--color-primary);
}

.navbar-collapse {
  padding-right: 30px;
}

/* --- 全站標題 --- */
h1,
h2,
h3,
h4 {
  color: var(--color-text);
}

p {
  color: var(--color-muted);
}

/* --- Sections --- */
.home-section {
  margin-top: -20px;
}

section {
  padding: 20px;
  box-sizing: border-box;
  scroll-margin-top: 120px;
}

.section-base {
  position: relative;
  /* 必須有 position 才能放偽元素 */
}

.section-base::before {
  content: "";
  display: block;
  height: 120px;
  margin-top: -100px;
  visibility: hidden;
}

/* 所有 Section 標題置中 */
.section-base h1,
.section-base h2 {
  text-align: center;
  color: var(--color-text);
  margin-bottom: 15px;
}

.section-base h1 {
  white-space: nowrap;
  font-size: clamp(36px, 5vw, 72px);
}

.section-base h2 {
  font-size: clamp(28px, 4vw, 64px);
}

.section-base h1 span,
.section-base h2 span {
  display: inline;
}


/* 段落置中 */
.section-base p {
  font-size: clamp(20px, 2vw, 32px);
  color: var(--color-text);
  line-height: 1.6;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* --- 黃金色分隔線 --- */
.gold-line {
  height: 2px;
  background-color: #CBAD90;
  margin: 20px auto;
  border-radius: 2px;
  border: none;
}

/* --- 圖片容器 --- */
.images-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.image-wrapper {
  flex: 1 1 45%;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.action-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  transition: transform 0.3s ease;
}

/* 滑鼠 hover 放大 */
.action-image:hover {
  transform: scale(1.05);
  cursor: pointer;
}

/* 無 hover 效果 class */
.action-image.no-hover:hover {
  transform: none !important;
  cursor: default;
}

/* 單張圖片 layout */
.single-image-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 5%;
}

.single-image-layout .image-wrapper {
  width: 100%;
  max-width: 1200px;
  text-align: center;
}

.map-image-wrapper {
  flex: 1 1 min(30%, 400px);
  max-width: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.map-image {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  cursor: pointer;
  border-radius: 10px;
}

/* 滑過效果 */
.map-image:hover {
  transform: scale(1.05);
}

/* 召喚師之路區塊的佈局 */
.summoner-path-section .summoner-grid {
  display: flex;
  align-items: center;
  gap: 50px;
  text-align: left;
}

.summoner-path-section .input-side {
  flex: 1;
  min-width: 300px;
  text-align: center;
}

.summoner-path-section .form-control,
.summoner-path-section .input-group-text {
  background-color: #004c9e;
  color: #ffffff;
  border: none;
}

.summoner-path-section .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.summoner-path-section #game-id-input {
  flex: 2 1 auto;
  min-width: 200px;
}

.summoner-path-section #tagline-input {
  flex: 1 1 100px;
  max-width: 160px;
}

.summoner-path-section #fetch-data-btn {
  font-weight: bold;
  color: #ffffff;
  background-color: #004c9e;
  border: none;
  transition: background-color 0.3s;
}

.summoner-path-section #fetch-data-btn:hover {
  background-color: #0066cc;
}

.summoner-path-section .share-btn:not([disabled]):hover {
  background-color: #2a2a2a !important;
}

.summoner-path-section .share-btn[disabled] {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
}

.summoner-path-section .share-btn[disabled]:active {
  pointer-events: none;
}

.summoner-path-section #share-status {
  font-size: 16px;
  margin-top: 15px;
  min-height: 24px;
}

.summoner-path-section #share-status.error {
  color: #ff6b6b;
}

.summoner-path-section #share-status.success {
  color: #00ffcc;
}

.summoner-path-section .share-popup {
  margin-top: 10px;
}

.summoner-path-section .share-popup a {
  color: #66ccff;
  text-decoration: none;
  margin: 0 5px;
}

.summoner-path-section .share-popup a:hover {
  text-decoration: underline;
}

.summoner-path-section .output-side {
  flex: 1;
  min-height: 450px;
  position: relative;
  border-radius: 10px;
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  scroll-margin-top: 100px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.summoner-path-section .user-info-box {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #fff;
}

.summoner-path-section .user-info-box .user-name-display h3 {
  font-size: 56px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
  color: #ffffff;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8);
}

.summoner-path-section .user-info-box .user-name-display p {
  font-size: 22px;
  font-weight: 500;
  color: #e0e0e0;
  margin: 4px 0;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6);
  text-align: left;
}

.summoner-path-section .user-info-box #display-user-name {
  display: block;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  color: #0d6efd;
  /* 藍色重點字 */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.summoner-path-section #radar-chart-container {
  position: relative;
  z-index: 2;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  /* 讓它靠底 */
}

.summoner-path-section #radar-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}


/* Footer 區塊樣式 */
.site-footer {
  color: var(--color-muted);
  text-align: center;
  padding: 20px 0;
}

.site-footer .footer-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
}

.site-footer .footer-logo img {
  max-height: 60px;
  height: auto;
  width: auto;
}

.error-text {
  font-weight: bold;
  margin: 0.5rem 0;
}

.loading-lol {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 120px;
}

.loading-lol div {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd700, #ffae00);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 174, 0, 0.6);
  animation: glow 1.2s infinite ease-in-out;
}

.loading-lol div:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-lol div:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes glow {

  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.4);
  }

  40% {
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.9), 0 0 30px rgba(255, 174, 0, 0.8);
  }
}

/* --- 響應式 --- */
@media (max-width: 992px) {

  .navbar-brand img {
    height: 50px;
  }

  .navbar-toggler {
    margin-right: 15px;
  }

  header nav a {
    font-size: 16px;
    padding: 8px 10px;
  }

  .home-section {
    padding-left: 15px;
    padding-right: 15px;
  }

  .section-base h1 .line1,
  .section-base h1 .line2,
  .section-base h2 .line1,
  .section-base h2 .line2 {
    display: block;
  }

  /* .section-base h1 {
    text-align: center;
  } */

  .section-base::before {
    height: 10px;
    margin-top: 0;
  }

  section {
    padding: 0;
  }

  .single-image-layout {
    padding: 0;
  }

  .images-container {
    flex-direction: column;
    align-items: center;
  }

  .map-image-wrapper {
    .map-image-wrapper {
      flex: 1 1 100%;
    }
  }

  .image-wrapper {
    display: flex;
    justify-content: center;
    max-width: 90%;
    margin-bottom: 15px;
  }

  .summoner-path-section .summoner-grid {
    flex-direction: column;
    gap: 30px;
  }

  .summoner-path-section .input-side {
    width: 100%;
    min-width: unset;
    text-align: center;
  }

  .summoner-path-section .input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }

  .summoner-path-section .input-group .form-control {
    height: 50px;
    line-height: normal;
    font-size: 18px;
  }

  .summoner-path-section .input-group .input-group-text {
    display: none;
  }

  .summoner-path-section #game-id-input,
  .summoner-path-section #tagline-input {
    flex: 1 1 100% !important;
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    border-radius: 10px !important;
  }

  .summoner-path-section #tagline-input {
    margin-top: 5px;
  }

  .summoner-path-section #fetch-data-btn {
    height: 50px;
    font-size: 18px;
    border-radius: 10px;
    padding: 0;
    margin-top: 10px;
    width: 100%;
  }

  .summoner-path-section .share-btn {
    margin-top: 15px;
  }

  .summoner-path-section .output-side {
    display: none !important;
  }

  .summoner-path-section .output-side.is-visible {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 25px 15px;
  }

  .summoner-path-section .user-info-box {
    align-items: flex-start;
    /* 靠左 */
    text-align: left;
  }

  .summoner-path-section .user-info-box .user-name-display h3 {
    font-size: 38px;
  }

  .summoner-path-section .user-info-box .user-name-display p {
    font-size: 18px;
    text-align: left;
  }

  .summoner-path-section .user-info-box #display-user-name {
    font-size: 30px;
  }

  .summoner-path-section #radar-chart-container {
    width: 180px;
    height: 180px;
    margin-top: 20px;
    align-self: flex-start;
    justify-content: flex-start;
  }

  .summoner-path-section .input-side h1 {
    text-align: center;
  }

  .summoner-path-section .input-group {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .site-footer .footer-logo {
    gap: 10px;
  }

  .site-footer .footer-logo img {
    max-height: 30px;
  }

}