/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  transition: background-color var(--transition), color var(--transition);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 10vh;
  background: linear-gradient(to bottom, #143c7d, transparent);
  z-index: 1000;
  pointer-events: none;
}

/* ===== App Shell ===== */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-top: calc(10vh + 8px);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== Typography ===== */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

/* ===== Layout Helpers ===== */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-grow {
  flex: 1;
}

.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }

.mt-auto { margin-top: auto; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

/* ===== Header ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 16px;
}

.app-header__back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
  line-height: 1;
}

.app-header__back:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.app-header__title {
  font-size: 1.1rem;
  font-weight: 600;
}

.app-header__spacer {
  width: 40px;
}

/* ===== View Transitions ===== */
.view-enter {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
