@import url('https://fonts.googleapis.com/css2?family=Nanum+Pen+Script&display=swap');

img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

/* Prefer wrapping at spaces instead of splitting Korean/English words. */
body,
button,
input,
textarea,
select {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ABOUT copy uses the full available width while remaining left-aligned. */
.about-lead {
  max-width: none;
  text-align: left;
}

.about-card p {
  text-align: left;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

.sidebar a:focus-visible,
.sidebar button:focus-visible,
.mobile-header a:focus-visible,
.mobile-header button:focus-visible,
.lightbox button:focus-visible {
  outline-color: #fff;
}

.game-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 24%,transparent);
}

.screenshot-item:focus-visible,
.screenshot-carousel-nav:focus-visible,
.related-project-nav:focus-visible,
.detail-link:focus-visible {
  outline-color: var(--accent,var(--navy));
}

.synopsis-content .handwriting,
.synopsis-content .synopsis-handwriting {
  font-family: 'Nanum Pen Script', 'Segoe Print', cursive;
}

.filter-row[hidden] {
  display: none !important;
}

.filter-buttons .filter-toggle-button {
  margin-left: auto;
  border-style: dashed;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
}

.filter-buttons .filter-toggle-button:hover,
.filter-buttons .filter-toggle-button:focus-visible {
  border-color: var(--navy);
  background: color-mix(in srgb,var(--navy) 5%,white);
  color: var(--navy);
}

@media (max-width: 780px) {
  :root { --sidebar-width: 0px; }
  .site-shell { display: block; }
  .sidebar { display: none; }
  .content { padding: 92px 20px 60px; }

  .mobile-header {
    display: block;
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    right: 0;
    background: var(--sidebar);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }

  .mobile-header-inner { padding: 14px 18px; }
  .mobile-brand-row {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .mobile-brand { font-size: .92rem; font-weight: 750; }
  .mobile-menu-toggle { border: 0; background: transparent; color: #fff; cursor: pointer; font-size: .76rem; }

  /* Open mobile navigation occupies the entire viewport. */
  .mobile-menu-panel:not([hidden]) {
    position: fixed;
    z-index: 1;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    padding: 68px 18px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--sidebar);
  }

  .mobile-rule { height: 1px; background: rgba(255,255,255,.14); margin-bottom: 14px; }
  .mobile-rule-spaced { margin-top: 14px; }

  .mobile-profile { display: flex; gap: 12px; align-items: center; }
  .mobile-profile-avatar { width: 54px; height: 54px; overflow: hidden; border-radius: 50%; flex: 0 0 auto; }
  .mobile-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .mobile-profile-name { font-size: .82rem; font-weight: 700; }
  .mobile-profile-name span { color: rgba(255,255,255,.58); font-size: .72rem; }
  .mobile-profile-tagline { margin-top: 4px; color: rgba(255,255,255,.62); font-size: .72rem; }

  .mobile-group-label { margin-bottom: 6px; color: rgba(255,255,255,.38); font-size: .66rem; font-weight: 700; letter-spacing: .1em; }
  .mobile-links { display: grid; grid-template-columns: 1fr; gap: 2px; }
  .mobile-link,
  .mobile-email {
    display: block;
    width: 100%;
    padding: 6px 0;
    color: rgba(255,255,255,.72);
    font-size: .78rem;
    line-height: 1.45;
  }
  .mobile-link.is-active { color: #fff; font-weight: 700; }

  .mobile-language { display: flex; flex-wrap: wrap; gap: 8px; }
  .mobile-footer,
  .mobile-copyright {
    display: block;
    margin-top: 12px;
    color: rgba(255,255,255,.58);
    font-size: .68rem;
    line-height: 1.5;
  }

  .filter-buttons .filter-toggle-button { margin-left: 0; }

  /* Keep the navigation glyph optically centered inside its white button. */
  .screenshot-carousel-nav,
  .mobile-gallery-carousel-wrap .screenshot-carousel-nav {
    display: grid;
    place-items: center;
    padding: 0;
    line-height: 1;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
  }
}

@media (max-width: 480px) {
  .result-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .sort-select,
  .reset-button,
  .filter-buttons button,
  .mobile-menu-toggle {
    min-height: 40px;
  }

  .filter-buttons {
    gap: 8px;
  }

  .detail-links .detail-link {
    min-height: 40px;
  }
}
