/* ==========================================================================
   공강.io — 공통 스타일
   톤: 또렷한 모던 — near-black 잉크 + 확신 있는 블루 액센트, 크리스프한 형상
   ========================================================================== */

:root {
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;

  /* 잉크(무채색) — 쿨하고 또렷하게 */
  --ink: #0b0b12;
  --ink-soft: #52525b;
  --ink-faint: #9a9aa6;

  /* 표면 / 경계선 */
  --surface: #ffffff;
  --surface-2: #f6f6f9;
  --line: #e7e7ec;
  --line-strong: #d6d6de;

  /* 액센트 — 확신 있는 블루 */
  --accent: #2f6bff;
  --accent-strong: #1e50e6;
  --accent-soft: #eef2ff;
  --accent-ink: #1e3aa8;
  --accent-light: #8aa9ff; /* 다크 배경용 */

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(11, 11, 18, 0.04);
  --shadow-md: 0 1px 3px rgba(11, 11, 18, 0.05), 0 8px 24px rgba(11, 11, 18, 0.06);
  --shadow-lg: 0 2px 6px rgba(11, 11, 18, 0.06), 0 18px 40px rgba(11, 11, 18, 0.10);
  --shadow-accent: 0 10px 28px rgba(47, 107, 255, 0.22);

  --ring: 0 0 0 3px var(--accent-soft);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   히어로
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(72px, 12vw, 136px) 0 clamp(52px, 8vw, 92px);
  background:
    radial-gradient(120% 120% at 100% 0%, var(--accent-soft) 0%, transparent 55%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

.hero-title {
  font-size: clamp(2.2rem, 6.2vw, 4.25rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.045em;
  color: var(--ink);
  /* 한국어를 단어(띄어쓰기) 단위로만 줄바꿈 — 단어 중간 끊김 방지 */
  word-break: keep-all;
}

.hero-brand {
  color: var(--accent);
}

.hero-sub {
  margin-top: 22px;
  max-width: 42ch;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--ink-soft);
  letter-spacing: -0.01em;
  word-break: keep-all;
}

/* --------------------------------------------------------------------------
   미니게임 그리드
   -------------------------------------------------------------------------- */

.games {
  padding: clamp(56px, 8vw, 88px) 0;
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.game-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 30px 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

a.game-card:hover,
a.game-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.game-card--soon {
  opacity: 0.5;
  cursor: default;
  background: var(--surface-2);
  box-shadow: none;
}

.game-icon {
  width: 68px;
  height: 68px;
  margin-bottom: 14px;
}

.game-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.game-desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  white-space: pre-line;
}

.game-badge {
  margin-top: 14px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
}

.game-card--soon .game-badge {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   공강 메모판
   -------------------------------------------------------------------------- */

.memo {
  padding: clamp(56px, 8vw, 88px) 0;
  border-top: 1px solid var(--line);
}

.section-desc {
  margin-top: -24px;
  margin-bottom: 28px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.memo-composer {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.memo-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.memo-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.memo-field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.memo-field input,
.memo-field select {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.memo-field input:focus,
.memo-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.memo-preview {
  margin-top: 22px;
  padding: 16px 20px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-ink);
  letter-spacing: -0.01em;
  text-align: center;
}

.memo-submit {
  display: block;
  margin: 22px auto 0;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 14px 42px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.12s ease;
}

.memo-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.memo-submit:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.memo-submit:disabled {
  opacity: 0.35;
  cursor: default;
}

.memo-list {
  list-style: none;
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.memo-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 0;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.memo-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.memo-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.memo-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.memo-meta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.memo-like {
  margin-left: auto;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.memo-like:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.memo-like.liked {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  cursor: default;
}

/* --------------------------------------------------------------------------
   푸터 (출처) — 다크 블록으로 또렷하게 마감
   -------------------------------------------------------------------------- */

.footer {
  background: var(--ink);
  color: #ffffff;
  padding: 56px 0 44px;
  margin-top: 40px;
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.footer-credits h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.footer-credits ul {
  list-style: none;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
}

.footer-credits li + li {
  margin-top: 5px;
}

.footer-credits a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-copy {
  margin-top: 28px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
}

/* --------------------------------------------------------------------------
   태블릿 / 모바일 (≤ 1024px)
   - 표지: 글자 키우고 가장자리 여백 축소
   - 게임 리스트: 2×2 기본 + 옆으로 스와이프(가로 스크롤 스냅)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .container {
    padding: 0 16px;
  }

  /* 표지 확대 */
  .hero {
    padding: clamp(60px, 14vw, 100px) 0 clamp(44px, 9vw, 68px);
  }

  .hero-title {
    /* '수업 비었을 때 딴짓은'이 한 줄을 유지하도록 화면폭에 비례해 축소
       (측정: 320px→36px, 360px→41px, 390px→45px 이내여야 한 줄) */
    font-size: clamp(2rem, calc(13vw - 8px), 3.6rem);
  }

  .hero-sub {
    margin-top: 18px;
    font-size: clamp(1.1rem, 3.6vw, 1.35rem);
  }

  /* 2열 세로 그리드 — 좌우 스크롤 대신 아래로 쌓이고, 가운데 정렬 */
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 460px;
    margin: 0 auto;
  }

  .game-grid > li {
    display: flex;
  }

  .game-card {
    flex: 1;
    padding: 26px 14px 20px;
  }

  /* 메모판: 필드 세로 배치 */
  .memo-fields {
    grid-template-columns: 1fr;
  }

  .memo-composer {
    padding: 20px 16px;
  }
}
