:root {
  --bg-dark: #05070a;
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-surface: rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -20%, #1a2a44, var(--bg-dark) 80%);
  color: #fff;
  font-family: "Pretendard", system-ui, sans-serif;
  overflow-x: hidden;
}

/* 배경 분위기 */
.background-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(60, 100, 180, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hub-header {
  text-align: center;
  padding: 30px 20px 10px;
}
.hub-header h1 { margin: 0; font-size: 2rem; font-weight: 700; text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.hub-header p { color: #8a9bbd; margin-top: 10px; }

.hub-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  min-height: 70vh;
  padding: 20px;
  flex-wrap: wrap;
}

/* === 유리병 (Jar) === */
.jar-stage {
  position: relative;
  width: 380px;
  height: 520px;
}

.jar-container {
  position: relative;
  width: 100%; height: 100%;
}

.jar-top {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 70%; height: 40px;
  border: 4px solid var(--glass-border);
  border-radius: 15px;
  background: rgba(255,255,255,0.1);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  z-index: 5;
}

.jar {
  position: absolute;
  inset: 0;
  border-radius: 40px;
  background: var(--glass-surface);
  border: 2px solid var(--glass-border);
  box-shadow: 
    inset 0 0 30px rgba(255,255,255,0.1),
    inset 10px 0 40px rgba(0,0,0,0.4),
    0 20px 60px rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  overflow: hidden;
  z-index: 10;
}

.jar-reflection {
  position: absolute;
  top: 10%; right: 10%;
  width: 50px; height: 60%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
  border-radius: 30px;
  transform: rotate(-5deg);
  filter: blur(4px);
  pointer-events: none;
}

.jar-inner {
  position: relative;
  width: 100%; height: 100%;
}

/* === 구슬 (Marbles) === */
.marble {
  position: absolute;
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s;
  /* 배경색은 JS에서 설정함 */
}

.marble:hover {
  transform: scale(1.15) !important;
  z-index: 100;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  border-color: #fff;
}

/* 툴팁 */
.tooltip {
  position: fixed;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -140%);
  transition: opacity 0.2s;
  z-index: 200;
}
.tooltip.show { opacity: 1; }

/* === 우측 학생 목록 (Legend) === */
.legend {
  width: 220px;
  max-height: 500px;
  overflow-y: auto;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(10px);
}
.legend h2 { font-size: 1.1rem; margin-top: 0; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 10px; }

.student-list {
  list-style: none;
  padding: 0; margin: 0;
}
.student-list li { margin-bottom: 8px; }
.student-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #eee;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
}
.student-list a:hover { background: rgba(255,255,255,0.1); }
.swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
}

.footer {
    text-align: center;
}

/* =========================================
   반응형 (Responsive) 추가
========================================= */
@media (max-width: 768px) {
  .hub-header h1 { 
    font-size: 1.5rem; /* 모바일에서는 제목 크기 축소 */
  }
  
  .hub-wrap {
    flex-direction: column; /* 가로 배열에서 세로 배열로 변경 */
    gap: 20px;
    padding: 10px;
  }

  /* 유리병 크기 축소 */
  .jar-stage {
    width: 90vw; 
    max-width: 320px;
    height: 55vh;
    max-height: 450px;
  }

  /* 학생 목록 크기 및 높이 조정 */
  .legend {
    width: 90vw;
    max-width: 320px;
    max-height: 250px;
  }

  /* 모바일 환경 구슬 크기 축소 */
  .marble {
    width: 45px; 
    height: 45px;
  }
}