:root {
  --bg: #05080b;
  --panel: #121920;
  --panel2: #0c1218;
  --line: #1e2a36;
  --text: #e8eef4;
  --muted: #a9b4bf;
  --mint: #12b886;
  --mint2: #63e6be;
  --heart: #ff6b6b;
  --bar: 50px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* 상단 바 */
.bar {
  position: sticky; top: 0; z-index: 5;
  height: var(--bar);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
}
.logo { font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.logo span { color: var(--mint); }
.bar .btn { margin-left: auto; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 13.5px; }
.btn.ghost { border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--mint); color: var(--mint2); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); animation: pulse 1.8s infinite; }
.live.off i { background: var(--muted); box-shadow: none; animation: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* 벽 */
.wall-main { max-width: 1320px; margin: 0 auto; padding: 36px 24px 90px; }
.wall-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.wall-head h1 { margin: 0 0 4px; font-size: 34px; font-weight: 900; letter-spacing: -.03em; line-height: 1.15; }
.wall-head p { margin: 0; color: var(--muted); }
.count { font-size: 13.5px; color: var(--muted); padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.count b { color: var(--mint2); font-size: 15px; margin-right: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.empty { text-align: center; color: var(--muted); padding: 80px 0; margin: 0; }
.empty[hidden] { display: none; }

.card {
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  animation: pop .5s ease both;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--mint); box-shadow: 0 18px 44px rgba(0, 0, 0, .45); }
.card.mine { border-color: rgba(18, 184, 134, .55); }
@keyframes pop { from { opacity: 0; transform: translateY(14px); } }

.shot { display: block; }
.chrome { display: flex; align-items: center; gap: 5px; padding: 8px 12px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.chrome i { width: 8px; height: 8px; border-radius: 50%; background: #2c3a48; }
.chrome span { margin-left: 6px; font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; }
.frame iframe {
  position: absolute; top: 0; left: 0;
  width: 1200px; height: 750px; border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.info { padding: 14px 16px 13px; display: grid; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #fff;
  background: hsl(var(--h, 160) 55% 42%);
}
.who-text { min-width: 0; line-height: 1.3; }
.who-text b { font-size: 14.5px; }
.who-text time, .who-text .title { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-style: normal; font-weight: 700; color: #042; background: var(--mint); vertical-align: 2px; }
.msg { margin: 0; font-size: 14px; color: #c9d3dd; line-height: 1.5; overflow-wrap: anywhere; }
.msg::before { content: "“"; color: var(--muted); } .msg::after { content: "”"; color: var(--muted); }
.like {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 600;
  transition: transform .15s, color .15s, border-color .15s;
}
.like:hover { color: var(--heart); border-color: var(--heart); }
.like.on { color: var(--heart); border-color: var(--heart); background: rgba(255, 107, 107, .1); }
.like.bump { transform: scale(1.2); }

/* 작품 하나 */
body.item { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.item .bar { gap: 16px; }
.back { color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.back:hover { color: var(--mint2); }
.item .who { flex: 1; }
.item .avatar { width: 32px; height: 32px; font-size: 14px; }
.item .who-text .sub { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .who-text .title { display: inline; }
.item .who-text .msg { display: inline; font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.tools { display: flex; align-items: center; gap: 8px; }
.tools .like { margin-left: 0; }
.tool { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: none; color: var(--text); font-size: 13px; font-weight: 600; }
.tool:hover { border-color: var(--muted); }
.tool.on { border-color: var(--mint); color: var(--mint2); }
.item-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
.item-main.code { grid-template-columns: 1fr 46%; }
#site { width: 100%; height: 100%; border: 0; background: #fff; }
.code-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: #212121; }
.code-panel[hidden] { display: none; }
.code-panel .tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: var(--panel2); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.code-panel .tab {
  background: none; border: 1px solid transparent; border-bottom: 0; color: #c2ccd6;
  padding: 6px 12px; border-radius: 7px 7px 0 0; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; white-space: nowrap;
}
.code-panel .tab.on { background: #212121; color: var(--text); border-color: var(--line); }
.code-panel pre { flex: 1; margin: 0; padding: 14px 16px; overflow: auto; font-size: 13px; line-height: 1.55; }
.code-panel code { font-family: ui-monospace, "JetBrains Mono", Consolas, "D2Coding", monospace; white-space: pre; color: #eeffff; }
.cm-jinja { color: #ffcb6b; }
.cm-jinja-tag { color: #c792ea; }

@media (max-width: 720px) {
  .wall-main { padding: 24px 16px 60px; }
  .wall-head h1 { font-size: 28px; }
  .grid { grid-template-columns: 1fr; }
  .item .who-text .sub, .live { display: none; }
  .item-main.code { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .code-panel { border-left: 0; border-top: 1px solid var(--line); }
}
