/* ===== App Header (frosted glass) ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: rgba(248, 249, 251, 0.78);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}
html[data-theme="dark"] .app-header {
  background: rgba(21, 23, 26, 0.78);
}
.app-header h1 {
  flex: 1;
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-family: var(--font-headline);
}

/* ===== Entry / Login ===== */
.entry {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 32px;
}
.entry-wrap {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.entry-header h1 {
  font-family: var(--font-headline);
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  text-align: left;
}
.entry-form {
  background: var(--surface-lowest);
  padding: 24px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-ambient);
}
.entry-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.entry-form .btn-primary { margin-top: 6px; }
.entry-footer {
  margin-top: 18px;
  text-align: center;
}

/* ===== Welcome Landing ===== */
.welcome {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 235, 51, 0.22), transparent 55%),
    var(--bg);
}
.welcome-header {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
}
.welcome-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 20px;
  gap: 0;
}
.welcome-icon {
  width: clamp(110px, 22vw, 160px);
  height: clamp(110px, 22vw, 160px);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  filter: drop-shadow(0 10px 22px rgba(255, 235, 51, 0.4));
  animation: bob 2.4s ease-in-out infinite;
  cursor: pointer;
}
.welcome-icon svg { width: 100%; height: 100%; }
.welcome-icon:hover {
  animation: shake 0.4s ease-in-out infinite;
}
@keyframes bob {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
@keyframes shake {
  0%,100% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-3px, 1px) rotate(-3deg); }
  40% { transform: translate(3px, -1px) rotate(3deg); }
  60% { transform: translate(-2px, 2px) rotate(-2deg); }
  80% { transform: translate(2px, -2px) rotate(2deg); }
}
.welcome-hero h1 {
  font-family: var(--font-headline);
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  max-width: 18ch;
  color: var(--text);
  margin: 0;
}
.welcome-hero .subtitle {
  color: var(--text-muted);
  font-size: clamp(.88rem, 1.8vw, 1rem);
  max-width: 34ch;
  line-height: 1.3;
  margin: 6px 0 0;
}
.welcome-hero .btn-enter { margin-top: 14px; }
.welcome-hero .admin-link { margin-top: 6px; }
.btn-enter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffeb33;
  color: #201c00;
  padding: 14px 40px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-family: var(--font-headline);
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: var(--shadow-ambient);
  transition: transform .08s, filter .15s;
}
.btn-enter:hover { filter: brightness(0.97); transform: translateY(-1px); }
.welcome-footer {
  text-align: center;
  padding: 10px 16px 24px;
}
.admin-link {
  color: var(--text-dim);
  font-size: .82rem;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
}
.admin-link:hover { color: var(--text); background: var(--surface-container); }

/* ===== Cohorts Grid ===== */
.cohorts { min-height: 100dvh; }
.cohort-grid {
  display: grid;
  gap: 16px;
  padding: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  max-width: 960px;
  margin: 0 auto;
}
.cohort-card {
  background: var(--surface-container);
  border: 0;
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.05rem;
  transition: transform .1s, background .15s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
  justify-content: space-between;
}
.cohort-card:first-child {
  background: var(--bubble-me);
  color: var(--bubble-me-text);
  box-shadow: var(--shadow-ambient);
}
.cohort-card:hover { transform: translateY(-2px); background: var(--surface-high); }
.cohort-card:first-child:hover { background: var(--bubble-me); filter: brightness(1.03); }
.cohort-card .range {
  color: var(--text-dim);
  font-size: .8rem;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
}
.cohort-card:first-child .range { color: rgba(32, 28, 0, 0.6); }

@media (min-width: 1024px) {
  .chat { max-width: 860px; margin: 0 auto; }
}

@media (max-width: 520px) {
  .welcome-hero { padding: 16px; gap: 18px; }
  .welcome-hero h1 { font-size: clamp(1.5rem, 7vw, 2rem); max-width: 100%; }
  .welcome-hero .subtitle { font-size: .9rem; }
  .btn-enter { padding: 15px 36px; font-size: 1rem; }
  .cohort-grid { padding: 14px; gap: 12px; grid-template-columns: 1fr; }
  .cohort-card { padding: 20px; min-height: 92px; }
  .entry { padding: 16px; }
  .entry-form { padding: 22px; gap: 14px; }
}

.admin-icon, .login-icon {
  width: clamp(100px, 20vw, 140px);
  height: clamp(100px, 20vw, 140px);
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 10px 22px rgba(255, 235, 51, 0.4));
  animation: bob 2.4s ease-in-out infinite;
  cursor: pointer;
}
.admin-icon svg, .login-icon svg { width: 100%; height: 100%; }
.admin-icon:hover, .login-icon:hover {
  animation: shake 0.4s ease-in-out infinite;
}

.steam path { transform-box: fill-box; transform-origin: center bottom; animation: steam 2.4s ease-out infinite; }
.steam .steam-1 { animation-delay: 0s; }
.steam .steam-2 { animation-delay: 0.4s; }
.steam .steam-3 { animation-delay: 0.8s; }
@keyframes steam {
  0%   { transform: translateY(6px) scaleY(0.8); opacity: 0; }
  15%  { opacity: 1; }
  60%  { transform: translateY(-6px) scaleY(1.05); opacity: 0.8; }
  100% { transform: translateY(-14px) scaleY(1.15); opacity: 0; }
}

.steam-d {
  transform-box: fill-box;
  transform-origin: center;
  animation: steam-dot 2.6s ease-out infinite;
  opacity: 0;
}
.steam-d1 { animation-delay: 0s; }
.steam-d2 { animation-delay: 0.3s; }
.steam-d3 { animation-delay: 0.6s; }
.steam-d4 { animation-delay: 0.9s; }
.steam-d5 { animation-delay: 1.2s; }
.steam-d6 { animation-delay: 1.5s; }
.steam-d7 { animation-delay: 1.8s; }
@keyframes steam-dot {
  0%   { transform: translateY(10px) scale(0.6); opacity: 0; }
  20%  { opacity: 0.9; }
  70%  { transform: translateY(-16px) scale(1.1); opacity: 0.7; }
  100% { transform: translateY(-28px) scale(0.4); opacity: 0; }
}

.jamo .j {
  transform-box: fill-box;
  transform-origin: center;
  animation: jamo-float 2.8s ease-out infinite;
  opacity: 0;
}
.jamo .j1 { animation-delay: 0s; }
.jamo .j2 { animation-delay: 0.35s; }
.jamo .j3 { animation-delay: 0.7s; }
.jamo .j4 { animation-delay: 1.05s; }
.jamo .j5 { animation-delay: 1.4s; }
.jamo .j6 { animation-delay: 1.75s; }
.jamo .j7 { animation-delay: 2.1s; }
@keyframes jamo-float {
  0%   { transform: translateY(14px) scale(0.6); opacity: 0; }
  20%  { opacity: 0.95; }
  70%  { transform: translateY(-10px) scale(1.1); opacity: 0.8; }
  100% { transform: translateY(-22px) scale(0.5); opacity: 0; }
}

.jamo .jW1 { animation-delay: 1.0s; fill: #695f00; }
.jamo .jX1 { animation-delay: 1.9s; fill: #695f00; }

.steam .steam-w1 { animation-delay: 0.8s; }
.steam .steam-x1 { animation-delay: 1.6s; }

/* WX 풍선 아이콘 & 수집 애니메이션 */
.wx-balloon { width: clamp(170px, 40vw, 260px); height: clamp(170px, 40vw, 260px); }
.wx-balloon svg { width: 100%; height: 100%; overflow: visible; }
.wx-text {
  letter-spacing: -4px;
  animation: wx-bounce 2.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes wx-bounce {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.03); }
}

.collect .mini {
  transform: translate(var(--sx), var(--sy));
  transform-box: fill-box;
  transform-origin: center;
  animation: collect 3.6s ease-in infinite;
  opacity: 0;
}
.collect .mi-doc     { animation-delay: 0s; }
.collect .mi-video   { animation-delay: 0.5s; }
.collect .mi-music   { animation-delay: 1.0s; }
.collect .mi-text    { animation-delay: 1.5s; }
.collect .mi-photo   { animation-delay: 2.0s; }
.collect .mi-speaker { animation-delay: 2.5s; }
.collect .mi-bulb    { animation-delay: 3.0s; }
@keyframes collect {
  0%   { transform: translate(var(--sx), var(--sy)) scale(0.4); opacity: 0; }
  15%  { transform: translate(var(--sx), var(--sy)) scale(1);   opacity: 1; }
  85%  { transform: translate(110px, 152px) scale(0.35); opacity: 0.85; }
  100% { transform: translate(110px, 152px) scale(0.1);  opacity: 0; }
}
