body {
  font-family: 'JetBrains Mono', monospace;
  background-color: #0a0f0a;
  color: #0bda79;
  margin: 0;
  overflow-x: hidden;
  position: relative;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 240px;
  /* 배경 제거됨 */ background: #0d140d;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 9999;
  padding: 20px;
}
.sidebar.show {
  transform: translateX(0);
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  /* 배경 제거됨 */ background: rgba(0,0,0,0.5);
  display: none;
  z-index: 9998;
}
.sidebar-overlay.show {
  display: block;
}
.menu {
  list-style: none;
  padding: 0;
  margin-top: 40px;
}
.menu li {
  margin-bottom: 3px;
}
.menu a {
  position: relative;
  overflow: hidden;
  color: #0bda79;
  text-decoration: none;
  display: block;
  padding: 10px;
  border-radius: 4px;
}
.menu a:hover {
  background-color: #162516;
  color: #0bda79;
}

.mobile-header {
  display: flex;
  align-items: center;
  /* 배경 제거됨 */ background: #0d140d;
  padding: 10px 16px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
}
.hamburger {
  font-size: 24px;
  color: #0bda79;
  cursor: pointer;
  margin-right: 12px;
}
.logo img {
  height: 36px;
  filter: drop-shadow(0 0 4px #229966);
}

.top-nav {
  margin-top: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
  background-color: #101810;
  border-bottom: 1px solid #224422;
}
.remote-link {
  margin: 0 auto;
  color: #0bda79;
  font-size: 22px;
  letter-spacing: 0.6em;
  text-shadow: 0 0 4px #55ccaa;
  #eaffff-space: nowrap;
}
.remote-link.loading {
  color: #ffcc33;
  animation: blink 0.5s step-end infinite;
}
.remote-link.connected {
  color: #00e5ff;
}
@keyframes blink {
  50% { opacity: 0; }
}

.content {
  padding: 20px;
}
.ascii-header {
  font-size: 20px;
  color: #0bda79;
  border-bottom: 1px solid #339966;
  margin-bottom: 10px;
}

.board {
  width: 100%;
  border-collapse: collapse;
}
.board th, .board td {
  border: 1px solid #335544;
  padding: 10px;
  text-align: left;
}
.board tr:hover {
  background-color: #1a2a1a;
  cursor: pointer;
}
#post-view h3 {
  border-bottom: 1px dashed #448866;
  margin-bottom: 8px;
  color: #0bda79;
}


@media (max-width: 768px) {
  
  gap: 10px;
  margin-top: 10px;
}
.download-button {
  display: block;
  text-align: center;
  /* 배경 제거됨 */ background: #112211;
  border: 1px solid #2a553a;
  box-shadow: 0 0 4px #00330033;
  padding: 10px;
  border-radius: 4px;
  color: #0bda79;
  text-decoration: none;
}
.download-button:hover {
  background-color: #1b2f1b;
  color: #ffffff;
}


.centered-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}


/* 데스크탑 사이드바 구조 */
@media (min-width: 769px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    /* 배경 제거됨 */ background: #0d140d;
    padding: 20px;
    transform: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .mobile-header {
    display: none !important;
  }

  .main {
    margin-left: 250px;
  }

  .logo-area-sidebar {
    display: block;
  }
}

/* 모바일 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 9999;
    transition: transform 0.3s ease-in-out;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .logo-area-sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    /* 배경 제거됨 */ background: #0d140d;
    padding: 10px 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
  }

  .hamburger {
    font-size: 24px;
    color: #0bda79;
    cursor: pointer;
    margin-right: 12px;
  }

  .mobile-header .logo img {
    height: 36px;
    filter: drop-shadow(0 0 4px #229966);
  }

  .main {
    margin-top: 60px;
  }
}

.header-center {
  padding: 40px 20px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-align: center;
  padding: 40px 20px 20px;
}

.logo-center img {
  height: 60px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 6px #229966);
}


/* 사이드바 로고: 원격제어 위 로고 스타일 적용 */
.logo-area-sidebar img {
  height: 60px;
  filter: drop-shadow(0 0 6px #229966);
  transition: filter 0.3s;
}
.logo-area-sidebar img:hover {
  filter: brightness(1.2) contrast(1.3) drop-shadow(0 0 8px #44cc77);
}

/* 모바일: 로고 중앙 정렬 */
@media (max-width: 768px) {
  .mobile-header {
    justify-content: center;
    gap: 10px;
  }

  .hamburger {
    position: absolute;
    left: 16px;
  }

  .mobile-header .logo {
    display: flex;
    justify-content: center;
  }
}


@media (min-width: 769px) {
  .content {
    padding-left: 40px;
    padding-right: 40px;
  }
}

@media (max-width: 768px) {
  .mobile-header {
    justify-content: center;
    position: relative;
  }

  .mobile-header .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}


@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* 배경 제거됨 */ background: #0d140d;
    z-index: 10000;
  }

  .hamburger {
    position: absolute;
    left: 16px;
    font-size: 24px;
    color: #0bda79;
    cursor: pointer;
  }

  .mobile-header .logo {
    margin: 0 auto;
  }

  .mobile-header .logo img {
    height: 36px;
    filter: drop-shadow(0 0 4px #229966);
  }

  .main {
    margin-top: 60px;
  }
}


@media (max-width: 768px) {
  .sidebar {
    margin-top: 60px; /* 모바일 헤더 높이만큼 공간 확보 */
  }
}


.remote-link {
  margin: 0 auto;
  display: inline-block;
  padding: 12px 24px;
  background-color: #101b10;
  border: 1px solid #2a553a;
  box-shadow: 0 0 4px #00330033;
  border-radius: 6px;
  font-size: 20px;
  font-weight: bold;
  color: #0bda79;
  text-decoration: none;
  letter-spacing: 0.4em;
  text-shadow: 0 0 4px #55ccaa;
  transition: all 0.2s ease-in-out;
  text-align: center;
}

.remote-link:hover {
  background-color: #1b2f1b;
  color: #ffffff;
  text-shadow:
    0 0 6px #66ffcc,
    0 0 12px #33ff99,
    0 0 18px #22dd88;
  transform: scale(1.05);
}

.remote-link.loading {
  background-color: #332200;
  color: #ffcc33;
  text-shadow: 0 0 3px #bb8833;
  animation: blink 0.5s step-end infinite;
  transform: none;
}

.remote-link.connected {
  background-color: #003322;
  color: #00e5ff;
  text-shadow: 0 0 4px #229988;
}

.header-center {
  padding: 40px 20px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-align: center;
  padding: 40px 20px 20px;
}

@media (max-width: 768px) {
  .remote-link {
  margin: 0 auto;
    font-size: 16px;
    padding: 10px 18px;
    letter-spacing: 0.3em;
  }
}


.header-center {
  padding: 40px 20px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.remote-link {
  margin: 0 auto;
  min-width: 240px;
  padding: 16px 32px;
  font-size: 22px;
  margin-top: 12px;
  text-align: center;
}

@media (max-width: 768px) {
  .remote-link {
  margin: 0 auto;
    font-size: 18px;
    padding: 14px 28px;
    min-width: 220px;
  }
}


.menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10px;
  width: calc(100% - 20px);
  height: 1px;
  /* 배경 제거됨 */ background: linear-gradient(to right, #33ff99, #003300);
  opacity: 0.3;
}


.modal {
  position: fixed;
  z-index: 11000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  /* 배경 제거됨 */ background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  padding: 30px 20px;
  width: 90%;
  max-width: 400px;
  margin: 0 auto;

  background: #111811;
  border: 1px solid #224422;
  border-radius: 10px;
  box-shadow: 0 0 10px #003300;
}

.modal-content h3 {
  margin-bottom: 16px;
  font-size: 22px;
  color: #0bda79;
}

.modal-content input[type="password"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  font-size: 16px;
  border-radius: 4px;
  background-color: #0d140d;
  color: #0bda79;
  border: 1px solid #335544;
  box-sizing: border-box;
}

.modal-content button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background-color: #224422;
  color: #eaffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.modal-content button:hover {
  background-color: #336633;
}
.modal-content input {
  width: 100%;
  padding: 8px;
  margin: 10px 0;
  /* 배경 제거됨 */ background: #0d140d;
  color: #0bda79;
  border: 1px solid #335544;
}
.modal-content button {
  width: 100%;
  padding: 10px;
  /* 배경 제거됨 */ background: #224422;
  color: #ffffff;
  border: none;
  cursor: pointer;
}
.modal-content button:hover {
  /* 배경 제거됨 */ background: #336633;
}

.footer {
  text-align: center;
  color: #0bda79;
  font-size: 14px;
  padding: 20px;
  border-top: 1px solid #224422;
  /* 배경 제거됨 */ background: #0d140d;
  margin-top: 40px;
}

.typing::after {
  content: "|";
  animation: blink 1s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.main {
  flex: 1;
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  padding: 30px 20px;
  width: 90%;
  max-width: 400px;
  margin: 0 auto;

  background: #111811;
  border: 1px solid #224422;
  border-radius: 10px;
  box-shadow: 0 0 10px #003300;
}

.modal-content h3 {
  margin-bottom: 16px;
  font-size: 22px;
  color: #0bda79;
}

.modal-content input[type="password"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  font-size: 16px;
  border-radius: 4px;
  background-color: #0d140d;
  color: #0bda79;
  border: 1px solid #335544;
  box-sizing: border-box;
}

.modal-content button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background-color: #224422;
  color: #eaffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.modal-content button:hover {
  background-color: #336633;
}


.system-log {
  background-color: #000;
  color: #33ff99;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  padding: 14px 20px;
  margin: 20px auto;
  max-width: 600px;
  border: 1px dashed #33ff99;
  border-radius: 5px;
  box-shadow: inset 0 0 8px #003300;
  #eaffff-space: pre-wrap;
  text-align: left;
}


/* 사이드바 내 로고 중앙 정렬 */
@media (min-width: 769px) {
  .logo-area-sidebar {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
  }
}


@media (min-width: 769px) {
  .sidebar {
    display: block !important;
    transform: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .mobile-header {
    display: none !important;
  }

  .main {
    margin-left: 270px; /* 사이드바보다 약간 더 오른쪽 */
    max-width: calc(100% - 270px);
    padding-right: 30px;
  }

  .content {
    margin-left: 10px;  /* 전체 카드 오른쪽으로 이동 */
    padding-right: 20px;
  }

  
}


.notice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: nowrap;
  gap: 10px;
}

.new-post-button {
  font-size: 14px;
  padding: 6px 14px;
  background-color: #121a12;
  border: 1px solid #2a553a;
  color: #0bda79;
  border-radius: 4px;
  box-shadow: 0 0 4px #00330033;
  #eaffff-space: nowrap;
  line-height: 1.2;
  width: auto;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}
.new-post-button:hover {
  background-color: #1b2f1b;
  color: #ffffff;
  box-shadow: 0 0 6px #33ff99;
  transform: scale(1.05);
}


.new-post-button {
  font-size: 14px;
  padding: 6px 14px;
  background-color: #121a12;
  border: 1px solid #2a553a;
  color: #0bda79;
  border-radius: 4px;
  box-shadow: 0 0 4px #00330033;
  #eaffff-space: nowrap;
  line-height: 1.2;
  min-width: 0;
  width: auto;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  margin-left: auto;
}
.new-post-button:hover {
  background-color: #1b2f1b;
  color: #ffffff;
  box-shadow: 0 0 6px #33ff99;
  transform: scale(1.05);
}


/* Custom textarea style matching input */
.custom-textarea {
  width: 100%;
  padding: 8px;
  margin: 10px 0;
  background: #0d140d;
  color: #0bda79;
  border: 1px solid #335544;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  box-sizing: border-box;
}
.remote-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  #eaffff-space: normal;
  word-break: keep-all;
  max-width: 90%;
  line-height: 1.6;
  text-align: center;
  padding: 14px 20px;
}

.remote-link .highlight {
  font-size: 22px;
  font-weight: bold;
  color: #ffcc66;
  margin-bottom: 6px;
}

.remote-link .subtext {
  font-size: 16px;
  color: #0bda79;
}


.card {
  background: #121a12;
  border: 1px solid #2a553a;
  padding: 20px;
  border-radius: 6px;
  margin-top: 20px;
  width: 100%;
  box-sizing: border-box;
  min-height: 150px;
}


/* --- Mobile hamburger fix --- */
.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 10001; /* above overlay */
}
@media (min-width: 769px) {
  .hamburger { display: none; }
}
/* Ensure overlay doesn't block header when hidden */
.sidebar-overlay { pointer-events: none; }
.sidebar-overlay.show { pointer-events: auto; }


/* Link Hub inside notice width */
#notice-table, #notice-body, .board { width: 100%; }
.linkhub { margin: 8px 0; }
.link-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
@media (max-width: 980px) {
  .link-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .link-row { grid-template-columns: 1fr; }
}
.link-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px;
  border: 1px solid #2a553a;
  border-radius: 8px;
  background-color: #0d140d;
  color: #0bda79;
  text-decoration: none;
  transition: transform .05s ease, border-color .15s ease, background-color .15s ease;
}
.link-card i {
  font-size: 18px; opacity: .9;
}
.link-card .title { font-weight: 700; }
.link-card .desc { opacity: .85; font-size: .92rem; }
.link-card:hover {
  background-color: #111a11;
  border-color: #3a7a53;
  transform: translateY(-1px);
}

/* Active state for filter buttons */
.filter-buttons-wrapper .btn-active,
.filters .btn-active{
  outline: 2px solid #3a7a53;
  background-color: #111a11;
}


/* === FORCE filter text color to toned-down color === */
:root { --text-color: #0bda79; }
.filter-buttons-wrapper .hacker-btn,
.filter-buttons-wrapper button,
.filters .hacker-btn,
.filters button {
  color: var(--text-color) !important;
}
body { color: var(--text-color); }


/* === LinkHub Actions (scoped) === */
.notice-header { gap: 10px; }
.linkhub-actions{
  display:flex;
  gap:8px;
  margin-left:auto; /* keep other widths unchanged */
  align-items:center;
  flex-wrap:nowrap;
}
.lh-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 10px;
  font-size:12px;
  line-height:1;
  color:#0bda79;
  background:#0c120c;
  border:1px solid #2a553a;
  border-radius:4px;
  text-decoration:none;
  box-shadow:0 0 4px #00330033;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space:nowrap;
}
.lh-btn:hover{
  background:#1b2f1b;
  color:#ffffff;
  box-shadow:0 0 6px #33ff99;
  transform:translateY(-1px);
}
@media (max-width: 640px){
  .linkhub-actions{ gap:6px; }
  .lh-btn{ padding:4px 8px; font-size:11px; }
}

/* LinkHub filter buttons (scoped) */
.linkhub-actions{display:flex;gap:8px;margin-left:auto;align-items:center;flex-wrap:nowrap}
.lh-btn{display:inline-flex;align-items:center;justify-content:center;padding:4px 10px;font-size:12px;line-height:1;
  color:#0bda79;background:#0c120c;border:1px solid #2a553a;border-radius:4px;text-decoration:none;
  box-shadow:0 0 4px #00330033;transition:transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;white-space:nowrap}
.lh-btn:hover{background:#1b2f1b;color:#ffffff;box-shadow:0 0 6px #33ff99;transform:translateY(-1px)}
.lh-btn.is-active{background:#1f3b1f;color:#fff;border-color:#33ff99;box-shadow:0 0 8px #33ff99}
@media (max-width:640px){.lh-btn{padding:4px 8px;font-size:11px}}




/* === Tablet-ish width: filter bar arranged into exactly two rows (no horizontal scroll) === */
@media (min-width: 900px) and (max-width: 1280px) {
  /* will be overridden by two-row grid below */
  .filter-buttons-wrapper {
    display: grid !important;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, 36px);
    grid-auto-columns: max-content;
    align-items: center;
    align-content: center;
    justify-content: start;
    gap: 8px 10px;
    width: 100%;
  }
  .filter-buttons-wrapper .hacker-btn {
    height: 36px;
    line-height: 34px;
    padding: 0 14px;
    white-space: nowrap;
    flex: initial;
  }
  /* Place the search at the far right, spanning both rows */
  .filter-buttons-wrapper input[type="search"] {
    grid-row: 1 / span 2;
    justify-self: end;
    min-width: 200px;
    width: 220px;
    height: 36px;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}


/* === Tablet-width two-row layout for filter & search (no horizontal scroll) === */
@media (min-width: 900px) and (max-width: 1280px) {
  .filter-buttons-wrapper {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    grid-template-rows: repeat(2, 36px);
    align-items: center;
    justify-content: start;
    gap: 8px 10px;
    width: 100%;
  }
  .filter-buttons-wrapper .hacker-btn {
    height: 36px;
    padding: 0 12px;
    line-height: 36px;
    white-space: nowrap;
    flex: 0 0 auto;
  }
  #downloadSearch {
    height: 36px;
    grid-row: 1 / span 2; /* span both rows */
    justify-self: end;
    width: 220px !important;
    min-width: 200px;
    margin: 0 !important;
  }
}


/* === Downloads grid: max 6 columns per row === */
.download-list { display:grid; gap:10px; list-style:none; padding:0; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }







/* === Download card text wrapping === */
.download-list > li > a.download-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 10px;
}
.download-list .file-name {
  white-space: normal;
  overflow-wrap: anywhere; /* break long tokens (IP, underscores) */
  word-break: break-word;
  line-height: 1.25;
}


.download-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.download-button small {
    display: block;
}


/* === grid: 1 item full width, 2 items half/half, responsive === */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}


/* 그리드 내 카드가 가로로 꽉 차도록 폭 제한 해제 */
.download-grid > .download-button { width: 100%; max-width: none; }


/* 그리드: 항목 수에 따라 자동 분할(1개=전폭, 2개=반반) */
.download-list > li { width:100%; }


/* ===== Apply LinkHub active styles to Download filters ===== */
.filter-buttons-wrapper .hacker-btn.active, .download-filters .filter.active, .download-filters button.active, .download-tabs .tab.active, .download-filter button.active {
  background-color:#0f1a12; border:1px solid rgba(11,218,121,0.7); color:#caffdd; box-shadow:0 0 12px rgba(11,218,121,   0.40), inset 0 0 10px rgba(11,218,121,0.1);
  transition: all .2s ease;
color: #ffffff !important;}
.filter-buttons-wrapper .hacker-btn:hover, .download-filters .filter:hover, .download-filters button:hover, .download-tabs .tab:hover, .download-filter button:hover {
  transition: all .2s ease;
color: #ffffff !important;}
.filter-buttons-wrapper .hacker-btn:focus-visible, .download-filters .filter:focus-visible, .download-filters button:focus-visible, .download-tabs .tab:focus-visible, .download-filter button:focus-visible {
  outline: none; transition: all .2s ease;
}

/* ===== Download card filename emphasis ===== */
.download-button .file-name,
.download-button .filename,
.download-button .title,
.download-button .name { font-weight: 800 !important; letter-spacing: .1px; }

.download-button .meta,
.download-button .file-size,
.download-button .size,
.download-button .date,
.download-button time { font-weight: 400 !important; opacity: .85; }



/* === 모바일 카드 중앙 정렬 (가로 폭 균형) ===================== */
@media (max-width: 767px) {
  .download-grid, .download-list, .downloads {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: start;
    margin-left: auto;
    margin-right: auto;
  }
  .download-grid.flex, .download-list.flex, .downloads.flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }
  .download-grid > .download-button,
  .download-list > .download-button,
  .downloads > .download-button,
  .download-grid > .download-card,
  .download-list > .download-card,
  .downloads > .download-card {
    width: 100%;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
}



/* Force-hide any central remote popups */
#remote-modal-inline,
.modal-overlay,
.modal,
.remote-modal { display:none !important; visibility:hidden !important; opacity:0 !important; pointer-events:none !important; }



/* === (2025-08-16) MOBILE FILTER: exactly 2 rows; '기타' fills the entire 2nd row === */
@media (max-width: 768px) {
  .filter-buttons-wrapper,
  .download-filters,
  .download-filter,
  .download-tabs {
    display: grid !important;
    /* Create EXACTLY 2 rows; columns expand as needed */
    grid-template-rows: repeat(2, minmax(44px, auto)) !important;
    grid-auto-flow: column !important;           /* fill by columns, not rows */
    grid-auto-columns: minmax(0, 1fr) !important;/* each new column is flexible */
    gap: 8px !important;
    align-items: stretch;
  }
  /* Buttons/anchors fill each cell neatly */
  .filter-buttons-wrapper .hacker-btn,
  .download-filters button,
  .download-tabs .tab,
  .download-filter button,
  .filter-buttons-wrapper a,
  .download-filters a,
  .download-tabs a,
  .download-filter a {
    width: 100% !important;
    margin: 0 !important;
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }
  /* '기타' → full-width second row */
  .filter-buttons-wrapper .is-etc,
  .download-filters .is-etc,
  .download-tabs .is-etc,
  .download-filter .is-etc {
    grid-row: 2 !important;
    grid-column: 1 / -1 !important; /* span all columns */
  }
}



/* === Touch accuracy improvements === */
/* Ensure larger touch targets and spacing between filter buttons */
.filter-buttons-wrapper .hacker-btn,
.filter-buttons-wrapper button,
.download-filters .hacker-btn,
.download-filters button,
.download-tabs button,
.download-filter button {
  min-height: 44px;              /* Apple HIG minimum */
  padding: 12px 16px;            /* Comfortable finger padding */
  margin: 6px 0;                 /* Vertical spacing to avoid overlap */
  -webkit-tap-highlight-color: rgba(0,0,0,0); /* Remove iOS tap flash */
  touch-action: manipulation;    /* Prevent double-tap zoom ghost clicks */
}

/* Remove hover-only visuals on touch devices to avoid sticky 'hover' */
@media (hover: none) and (pointer: coarse) {
  .filter-buttons-wrapper .hacker-btn:hover,
  .filter-buttons-wrapper button:hover,
  .download-filters .hacker-btn:hover,
  .download-filters button:hover,
  .download-tabs button:hover,
  .download-filter button:hover {
    background: inherit !important;
    box-shadow: inherit !important;
    filter: none !important;
  }
}


/* 스크롤 중에는 버튼 클릭 자체를 막아 유령 클릭/네비게이션 시도 방지 */
.is-scrolling .filter-buttons-wrapper button,
.is-scrolling .download-filters button,
.is-scrolling .download-tabs button,
.is-scrolling .download-filter button {
  pointer-events: none !important;
}
.is-scrolling .filter-buttons-wrapper .hacker-btn:active,
.is-scrolling .download-filters .hacker-btn:active,
.is-scrolling .download-tabs button:active,
.is-scrolling .download-filter button:active {
  transform: none !important;
  box-shadow: none !important;
}


/* === Mobile (<=768px): 파일 다운로드 필터 2열 그리드 === */
@media (max-width: 768px){
  .filter-buttons-wrapper{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(44px, auto);
    gap: 12px;
    width: 100%;
  }
  .filter-buttons-wrapper .hacker-btn,
  .filter-buttons-wrapper button{
    width: 100% !important;
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }
}


/* === Desktop filter button improvements === */
.filter-buttons-wrapper{
  display:flex;
  flex-wrap:wrap;
  gap:12px 16px;   /* spacing between buttons */
  margin-bottom:12px;
}
.filter-buttons-wrapper .hacker-btn,
.filter-buttons-wrapper button{
  cursor:pointer;
  padding:10px 18px;
  border-radius:6px;
  border:1px solid rgba(11,218,121,0.35);
  background:rgba(0,0,0,0.2);
  transition:all .2s ease;
}
.filter-buttons-wrapper .hacker-btn:hover,
.filter-buttons-wrapper button:hover{
  background:rgba(11,218,121,0.1);
  box-shadow:0 0 6px rgba(11,218,121,0.4);
}



  .filter-buttons-wrapper .hacker-btn,
  .filter-buttons-wrapper button{
    padding: 10px 16px;
    min-height: 40px;
  }
}


/* === Desktop spacing for download filter buttons (wider) === */
@media (min-width: 769px){
  .filter-buttons-wrapper{
    display: flex;
    flex-wrap: wrap;
    gap: 18px 20px;           /* row-gap, column-gap wider */
    align-items: center;
    margin-bottom: 10px;
  }
  .filter-buttons-wrapper .hacker-btn,
  .filter-buttons-wrapper button{
    padding: 12px 20px;
    min-height: 44px;
  }
}





/* === Custom Filter Spacing === */
@media (min-width: 1280px){
  .filter-buttons-wrapper{
    display: flex;
    flex-wrap: wrap;
    column-gap: 20px !important;
    row-gap: 16px !important;
    justify-content: flex-start;
  }
}

@media (min-width: 769px) and (max-width: 1279px){
  .filter-buttons-wrapper{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    justify-content: center;
  }
}

@media (max-width: 768px){
  .filter-buttons-wrapper{
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .filter-buttons-wrapper .hacker-btn,
  .filter-buttons-wrapper button{
    width: 100%;
  }
}


/* === Custom Filter Margin === */
.filter-buttons-wrapper {
  margin-bottom: 24px !important; /* space between filter buttons and file cards */
}


/* === FIX 1: Prevent overflow of file-download filters across breakpoints === */
.filter-buttons-wrapper{
  width: 100%;
  box-sizing: border-box;
}

/* Tablet/Desktop ranges sometimes forced grid and caused overflow.
   Use wrapping flex so buttons stay inside the card. */
@media (min-width: 900px){
  .filter-buttons-wrapper{
    display: flex !important;
    flex-wrap: wrap !important;
    /* keep existing spacing from your file; do not alter */
    overflow-x: visible !important;
  }
}

/* Mobile: allow wrapping; keep buttons within width */
@media (max-width: 899px){
  .filter-buttons-wrapper{
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-x: hidden;
  }
  .filter-buttons-wrapper .hacker-btn,
  .filter-buttons-wrapper button{
    max-width: 100%;
  }
}

/* === FIX 2: Center text inside filter buttons (no size change) === */
.filter-buttons-wrapper .hacker-btn,
.filter-buttons-wrapper button{
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}


/* === Mobile: prevent filter buttons from escaping on click === */
@media (max-width: 768px){
  .filter-buttons-wrapper{
    overflow-x: hidden;  /* avoid sideways bleed */
  }
  .filter-buttons-wrapper .hacker-btn,
  .filter-buttons-wrapper button{
    max-width: 100%;
    white-space: nowrap;
  }
  /* Neutralize scale/transform on tap to prevent visual overflow */
  .filter-buttons-wrapper .hacker-btn:hover,
  .filter-buttons-wrapper .hacker-btn:active,
  .filter-buttons-wrapper .hacker-btn:focus,
  .filter-buttons-wrapper button:hover,
  .filter-buttons-wrapper button:active,
  .filter-buttons-wrapper button:focus{
    transform: none !important;
    box-shadow: inherit !important;
  }
}


/* === Desktop: add a bit of space between filter buttons and file list === */
@media (min-width: 1024px){
  .filter-buttons-wrapper{
    margin-bottom: 24px !important;
  }
}

/* --- Mobile-only fix: keep neon effect on filter buttons during tap/active (no strength change) --- */
@media (max-width: 768px){
  .filter-buttons-wrapper .hacker-btn:hover,
  .filter-buttons-wrapper .hacker-btn:active,
  .filter-buttons-wrapper .hacker-btn:focus,
  .filter-buttons-wrapper button:hover,
  .filter-buttons-wrapper button:active,
  .filter-buttons-wrapper button:focus{
    /* preserve the neon box-shadow used for active buttons */
    box-shadow: 0 0 10px rgba(11,218,121,0.40), inset 0 0 10px rgba(11,218,121,0.10) !important;
    /* preserve any glow */
    filter: drop-shadow(0 0 6px rgba(0,255,170,.55)) !important;
  }
}
