/* 공통 셸: 홈 버튼 · 지오퍼스 UI · 고정 사이트 헤더 */

:root {
  --site-header-height: 44px;
}

.site-fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10060;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(139, 94, 60, 0.12);
  box-shadow: 0 1px 8px rgba(139, 94, 60, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-fixed-header__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 960px);
  margin: 0 auto;
  padding: 6px 10px;
  box-sizing: border-box;
  min-height: 40px;
}

.site-fixed-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-secondary, #6b5c50);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.site-fixed-header__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: 5px;
  font-size: 0.55em;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(145deg, var(--geopus-brown, #8b5e3c), var(--geopus-brown-pressed, #734e32));
  box-shadow: 0 1px 0 rgba(115, 78, 50, 0.22);
}

.site-fixed-header__name {
  color: var(--geopus-brown, #8b5e3c);
}

.site-fixed-header__stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.site-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.site-stat-badge__label {
  opacity: 0.88;
}

.site-stat-badge__value {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.site-stat-badge--today {
  color: #2d6a4a;
  background: linear-gradient(180deg, #eef8f2 0%, #e2f2e9 100%);
  border-color: rgba(74, 155, 110, 0.28);
  box-shadow: 0 1px 0 rgba(74, 155, 110, 0.12);
}

.site-stat-badge--today .site-stat-badge__value {
  color: #1f7a4f;
}

.site-stat-badge--total {
  color: #7a5a12;
  background: linear-gradient(180deg, #fff9ec 0%, #fff3d9 100%);
  border-color: rgba(212, 168, 67, 0.38);
  box-shadow: 0 1px 0 rgba(180, 130, 40, 0.12);
}

.site-stat-badge--total .site-stat-badge__value {
  color: #9a7218;
}

.site-fixed-header__teacher {
  flex-shrink: 0;
  margin-left: auto;
  padding: 4px 9px;
  border-radius: var(--radius-pill, 980px);
  border: 1.5px solid rgba(14, 165, 233, 0.35);
  background: rgba(255, 255, 255, 0.95);
  color: #0369a1;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(14, 165, 233, 0.1);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .site-fixed-header__name {
    display: none;
  }

  .site-fixed-header__row {
    gap: 6px;
    padding: 6px 8px;
  }

  .site-stat-badge {
    padding: 3px 6px;
    font-size: 0.58rem;
  }

  .site-stat-badge__value {
    font-size: 0.66rem;
  }
}

.site-page-footer {
  margin-top: 20px;
  padding: 12px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(139, 94, 60, 0.14);
  text-align: center;
}

.site-page-footer .copyright-header-line {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-tertiary, #9a8f85);
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.geo-home-btn {
  position: fixed;
  top: max(calc(var(--site-header-height, 44px) + 8px), calc(env(safe-area-inset-top, 0px) + var(--site-header-height, 44px) + 4px));
  left: max(12px, env(safe-area-inset-left, 0px));
  z-index: 10050;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-pill, 980px);
  background: var(--bg-card, #fff);
  color: var(--geopus-brown, #8b5e3c);
  font-family: var(--font, system-ui, sans-serif);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-soft, 0 2px 20px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--separator, rgba(60, 60, 67, 0.12));
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring, ease), background 0.15s ease;
}

.geo-home-btn:hover {
  transform: scale(1.03);
  background: var(--geopus-green-soft, #e8f5ee);
}

.geo-home-btn:active {
  transform: scale(0.97);
}

.geo-home-btn__icon {
  font-size: 17px;
  line-height: 1;
}

.geopus-toast-root {
  position: fixed;
  z-index: 10040;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: min(360px, calc(100vw - 32px));
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.32s var(--ease-spring, ease);
}

.geopus-toast-root.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.geopus-toast-root--bottom-right {
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
}

.geopus-toast-root--stage {
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px);
}

.geopus-toast-root--stage.is-visible {
  transform: translateX(-50%) translateY(0);
}

.geopus-toast-bubble {
  flex: 1;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-modal);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-primary);
}

.geopus-toast-bubble strong {
  color: var(--geopus-brown);
}

.geopus-toast-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.geopus-companion {
  position: fixed;
  z-index: 9000;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: min(280px, calc(100vw - 80px));
  pointer-events: none;
}

.geopus-companion__img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.12));
}

.geopus-companion__bubble {
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
  animation: geopusBubbleIn 0.35s var(--ease-spring, ease);
}

@keyframes geopusBubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.geopus-welcome-scene {
  width: 100%;
  max-width: 320px;
  margin: 0 auto var(--space-md, 20px);
  border-radius: var(--radius-card, 20px);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.geopus-welcome-scene img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 480px) {
  .geo-home-btn {
    padding: 9px 12px;
    font-size: 14px;
  }

  .geopus-toast-img,
  .geopus-companion__img {
    width: 64px;
    height: 64px;
  }
}
