:root {
  --bg: #0a0c10;
  --surface: #11141a;
  --surface-2: #171b22;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f5;
  --muted: #8a93a0;
  --faint: #5b6470;
  --accent: #7aa2ff;
  --game: #4ade80;
  --tool: #fbbf24;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(122, 162, 255, 0.07), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 "Pretendard", system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

.top { border-bottom: 1px solid var(--line); }
.top .wrap { padding-top: 40px; padding-bottom: 32px; }
.logo {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--text); text-decoration: none;
  font-size: 24px; font-weight: 700; letter-spacing: -0.03em;
}
.logo-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background:
    linear-gradient(var(--accent) 0 0) 4px 4px / 8px 8px no-repeat,
    linear-gradient(var(--accent) 0 0) 14px 14px / 8px 8px no-repeat,
    linear-gradient(rgba(255,255,255,.16) 0 0) 14px 4px / 8px 8px no-repeat,
    linear-gradient(rgba(255,255,255,.16) 0 0) 4px 14px / 8px 8px no-repeat,
    var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.lead { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 32px 0 20px;
}
.filters {
  display: inline-flex; padding: 4px; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.filters button {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--muted);
  background: none; border: 0; border-radius: 7px;
  padding: 6px 16px; cursor: pointer;
  transition: color .15s, background-color .15s;
}
.filters button:hover { color: var(--text); }
.filters button[aria-selected="true"] {
  background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 1px 2px rgba(0,0,0,.4);
}
.filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.grid {
  list-style: none; margin: 0 0 64px; padding: 0;
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  position: relative;
  display: flex; flex-direction: column; height: 100%;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -12px rgba(0,0,0,.6);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px -16px rgba(0,0,0,.8);
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.cover {
  position: relative; aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a1f28, #0e1116);
  overflow: hidden;
}
.cover::before {
  content: attr(data-initial);
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 44px; font-weight: 800; letter-spacing: -0.02em; color: rgba(255,255,255,.08);
}
.cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 -1px 0 var(--line);
}
.cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.card:hover .cover img { transform: scale(1.035); }

.body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; flex: 1; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.name { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.type {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.type::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.type-game::before { background: var(--game); box-shadow: 0 0 8px rgba(74,222,128,.6); }
.type-tool::before { background: var(--tool); box-shadow: 0 0 8px rgba(251,191,36,.6); }
.desc { margin: 0; color: var(--muted); }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-size: 12px; color: #aeb6c2;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
}

.foot {
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.path { font: 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--faint); }
.open {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text);
  padding: 6px 12px 6px 14px; border-radius: 8px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line-strong);
  transition: background-color .2s, color .2s, border-color .2s;
}
.open::after { content: "→"; transition: transform .2s; }
.card:hover .open { background: var(--text); border-color: var(--text); color: var(--bg); }
.card:hover .open::after { transform: translateX(2px); }

.empty { color: var(--muted); text-align: center; padding: 64px 0; }

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .top .wrap { padding-top: 24px; padding-bottom: 20px; }
  .toolbar { margin: 20px 0 14px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .cover img, .open, .open::after { transition: none; }
  .card:hover, .card:hover .cover img { transform: none; }
}

.notice {
  margin: 24px 0 0; padding: 12px 16px;
  background: rgba(122, 162, 255, 0.08); border: 1px solid rgba(122, 162, 255, 0.25);
  border-radius: var(--radius); color: var(--text);
}
.notice::before { content: "📢 "; }

.admin-link { position: fixed; right: 10px; bottom: 8px; font-size: 11px; opacity: .35; color: inherit; text-decoration: none; }
.admin-link:hover { opacity: .8; }

.top .wrap { position: relative; }
.account {
  position: absolute; top: 40px; right: 28px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.account button, .account .btn {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--line-strong);
  transition: background-color .15s;
}
.account button:hover, .account .btn:hover { background: rgba(255,255,255,.1); }
.account .primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.account .primary:hover { background: #fff; }
.account input {
  font: inherit; font-size: 13px; color: var(--text); width: 140px;
  padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong);
}
.account input:focus-visible, .account button:focus-visible, .account .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.account .who { color: var(--muted); font-size: 13px; }
.account .who b { color: var(--text); font-weight: 600; }
.account .err { flex-basis: 100%; text-align: right; color: #f87171; font-size: 12px; min-height: 1em; }
@media (max-width: 600px) {
  .account { position: static; margin-top: 16px; justify-content: flex-start; }
  .account .err { text-align: left; }
}

.live { margin-left: auto; margin-right: 8px; font-size: 12px; color: #16a34a; white-space: nowrap; }
.live::before { content: "●"; margin-right: 4px; font-size: 9px; vertical-align: 1px; }
.live.off { color: var(--faint); }
