/* 全頁背景 */
body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans TC", sans-serif;
  background: url("./../assets/4.png") no-repeat center center fixed;
  background-size: cover;
  position: relative;
  overflow: auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: left;
}

/* 星星閃爍效果 */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(white 1px, transparent 1px),
    radial-gradient(white 1px, transparent 1px),
    radial-gradient(white 1px, transparent 1px);
  background-size: 200px 200px, 300px 300px, 400px 400px;
  background-position:
    0 0,
    50px 100px,
    150px 200px;
  animation: twinkle 6s linear infinite;
  z-index: 0;
  pointer-events: none;
  opacity: 0.2;
}

body::after {
  animation: twinkle 8s linear infinite reverse;
  opacity: 0.15;
}
/* 螢火蟲微光點容器 */
#starfield {
  pointer-events: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  overflow: visible;
}

/* 螢火蟲光點 */
.firefly {
  position: absolute;
  width: 6px;    /* 微光點偏大可見但柔和 */
  height: 6px;
  background: radial-gradient(circle, rgba(255,255,200,0.8) 0%, rgba(255,255,200,0.1) 70%, transparent 100%);
  border-radius: 50%;
  filter: drop-shadow(0 0 6px rgba(255, 255, 180, 0.6));
  opacity: 0.6;
  animation-name: firefly-twinkle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

/* 閃爍動畫：緩慢淡入淡出 */
@keyframes firefly-twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}


/* 主要容器 */
.container {
  position: relative;
  z-index: 10;
  max-width: 90%;
  width: 480px;
  padding: 40px 30px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}

/* 文字 */
h1 {
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 2rem;
}

p {
  line-height: 1.6;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

/* Label */
label {
  font-size: 1rem;
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

/* 輸入框 */
input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.1rem;
  border-radius: 10px;
  border: none;
  outline: none;
  margin-bottom: 20px;
  box-sizing: border-box;
}

/* 按鈕 */
.container button {
  width: 100%;
  padding: 14px 0;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg, #34d399, #059669);
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
}

.container button:hover {
  background: linear-gradient(90deg, #059669, #34d399);
}

/* 響應式手機適配 */
@media (max-width: 480px) {
  .container {
    width: 90%;
    padding: 30px 20px;
  }

  h1 {
    font-size: 1.6rem;
  }

  p, label, input[type="text"], button {
    font-size: 1rem;
  }
}
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  p, label, input[type="text"], button {
    font-size: 1.05rem;
  }

  .container {
    padding: 36px 24px;
  }
}

@media (max-height: 500px) {
  .container {
    margin-top: 20px;
    margin-bottom: 20px;
  }
}



.zone-tooltip {
  position: absolute;
  background: white;
  color: #333;
  border: 2px solid #333;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  max-width: 200px;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
  pointer-events: none;
  transform: translate(-50%, -110%);
  z-index: 999;
  white-space: nowrap;
}

.zone-tooltip::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  margin-left: -8px;
  border-width: 10px 8px 0 8px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.zone-tooltip::before {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 50%;
  margin-left: -8px;
  border-width: 9px 7px 0 7px;
  border-style: solid;
  border-color: white transparent transparent transparent;
}
#zoomable {
  position: relative;
}

/* 淡入動畫 */
.fade-in {
  animation: fadeIn 0.5s ease-in forwards;
  opacity: 0;
  will-change: opacity;
}


/* 淡出動畫 */
.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}


zone-tooltip {
  position: absolute;
  background: white;
  color: #333;
  border: 2px solid #333;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  max-width: 200px;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
  pointer-events: none;
  transform: translate(-50%, -110%);
  z-index: 999;
  white-space: nowrap;
}

.zone-tooltip::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  margin-left: -8px;
  border-width: 10px 8px 0 8px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.zone-tooltip::before {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 50%;
  margin-left: -8px;
  border-width: 9px 7px 0 7px;
  border-style: solid;
  border-color: white transparent transparent transparent;
}
#zoomable {
  position: relative;
}

/* 遮罩與說明盒 */
.game-intro-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.game-intro-box {
  background: #fff;
  color: #000;
  padding: 30px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: fadeIn 0.4s ease-in-out;
}



.game-intro-box button {
  display: block;        /* 讓按鈕成為獨立區塊元素 */
  margin: 20px auto 0;   /* 自動左右外距 → 水平置中 */
  padding: 10px 20px;
  font-size: 1em;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}


.game-intro-box button:hover {
  background-color: #555;
}

/* 問號小圓按鈕 */
.help-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 45px;
  height: 45px;
  background-color: #333;
  color: white;
  font-size: 24px;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

#lang-buttons {
  margin-bottom: 10px;
  text-align: center;
}

.lang-btn {
  margin: 0 4px;
  padding: 5px 12px;
  font-size: 0.9rem;
  border-radius: 8px;
  border: none;
  background-color: #eee;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.lang-btn:hover {
  background-color: #ccc;
}

.help-text p {
  text-align: left;
  margin-bottom: 1em;
  font-size: 0.95rem;
  line-height: 1.6;
}

.game-intro-box {
  position: relative;
  background: #fff;
  color: #000;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  animation: fadeIn 0.4s ease-in-out;
  max-height: 80vh;
  box-sizing: border-box;
  overflow: hidden;
  padding-top: 50px; /* 給固定 header 空間 */
  padding-bottom: 50px; /* 給固定關閉鈕空間 */
}



/* 可滾動的中段文字區 */
.scrollable-content {
  position: relative;
  max-height: calc(80vh - 120px); /* 扣掉 header + footer 高度 */
  overflow-y: auto;
  padding-right: 8px;
  text-align: left;
}

.scrollable-content p {
  margin-bottom: 1em;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 固定底部的關閉按鈕 */
.fixed-footer {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

/* 入口容器：更柔和的玻璃感與陰影 */
.container{
  background: rgba(12, 17, 23, 0.58);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 10px 30px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,0.05) inset;
  backdrop-filter: blur(10px);
  border-radius: 18px;
}

/* 標題與段落微調：更易讀的行距與間距 */
h1{
  letter-spacing: .5px;
  line-height: 1.3;
  margin-bottom: 18px;
}
.container p{
  line-height: 1.75;
  font-size: 1.05rem;
  margin: 0 0 14px 0;
}

/* 表單：垂直排列，等寬但保留舒適間距 */
.login-fields{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;          /* ← 輸入框與按鈕的間距 */
  margin-top: 8px;
}

/* 讓輸入框與按鈕寬度一致（容器內一致寬） */
#studentId,
#startBtn{
  width: min(360px, 92vw);
  box-sizing: border-box;
  border-radius: 12px;
  font-size: 1rem;
  padding: 12px 14px;
}

/* 輸入框視覺 */
#studentId{
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  color: #0b1220;
}
#studentId::placeholder{ color:#9aa3ab; }
#studentId:focus{
  outline: none;
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgba(94,234,212,.35);
}

/* 按鈕視覺＋互動感 */
#startBtn{
  border: none;
  color: #083344;
  background: linear-gradient(180deg,#34d399,#10b981);
  box-shadow: 0 10px 24px rgba(16,185,129,.35);
  cursor: pointer;
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
}
#startBtn:hover{ filter: brightness(1.03); }
#startBtn:active{ transform: translateY(1px); }

/* 規則提示小字 */
.login-hint{
  margin-top: 10px;
  font-size: .92rem;
  opacity: .85;
}

/* 手機微調：容器 padding 與字體稍微縮 */
@media (max-width: 480px){
  .container{ padding: 28px 20px; }
  .container p{ font-size: 1rem; line-height: 1.7; }
  #studentId,#startBtn{ width: 92vw; }
}


/* ===== Leaderboard Button (次要玻璃質感) ===== */
.lb-wrap {
  margin-top: 10px;
}

.lb-btn {
  --bg1: rgba(59,130,246,.14);   /* #3B82F6 */
  --bg2: rgba(99,102,241,.14);   /* #6366F1 */
  --bd:  rgba(99,102,241,.45);
  --txt: #eaf2ff;

  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .62rem 1rem;
  border-radius: 14px;
  font: 700 15px/1.1 system-ui, -apple-system, "Segoe UI", Noto Sans, Arial;
  color: var(--txt);
  text-decoration: none;

  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  border: 1px solid var(--bd);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateZ(0);
  transition: background .2s ease, box-shadow .2s ease, transform .12s ease, border-color .2s ease;
}

.lb-btn:hover {
  background: linear-gradient(135deg, rgba(59,130,246,.22), rgba(99,102,241,.22));
  border-color: rgba(99,102,241,.7);
  box-shadow: 0 10px 28px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08);
}

.lb-btn:active { transform: translateY(1px); }

.lb-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,.35), 0 8px 24px rgba(0,0,0,.18);
}

.lb-ico {
  display: grid;
  place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,255,255,.25), rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(59,130,246,.45), rgba(99,102,241,.45));
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  font-size: 15px; /* emoji 大小 */
}

.lb-txt { letter-spacing: .02em; }
.lb-ext { opacity: .75; font-size: 14px; }

@media (max-width: 480px) {
  .lb-btn { padding: .7rem 1rem; font-size: 16px; }
  .lb-ico { width: 28px; height: 28px; font-size: 16px; }
}

