1단계 뼈대: joke-app에서 로그인(디스코드·게스트)·세션·권한·관리자·DB를 가져와 음악퀴즈용으로 정리, 새 디자인·아이콘, WS 연결·시계 맞추기, 테스트·e2e

- apps/server: Hono API(auth/me/config/admin), Bun WebSocket(welcome·ping/pong, 압축 끔), SQLite 마이그레이션
- 사이트 설정: 채팅 도배 방지 기본 꺼짐(관리자가 켬, 초당·순간 횟수)
- apps/web: 첫 화면·로그인·관리자(대시보드·사이트·사용자·관리자·기록), 라이트/다크, 휴대폰, noindex
- packages/shared: 닉네임 규칙, 프로토콜(zod), 시계 차이 계산
- 테스트 20개 + 브라우저 e2e 6단계 통과

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-18 19:44:47 +09:00
parent 7ae34c49c1
commit 391bbe69e5
61 changed files with 3569 additions and 3 deletions

View File

@@ -0,0 +1,242 @@
/* 음악퀴즈 — "동네 레코드 가게" (docs/03-ui-design.md). Hand-written CSS variables, no framework (same approach as joke-app). */
:root {
--bg: #f5efe3;
--surface: #fffdf8;
--surface-2: #efe6d3;
--surface-3: #e6dac2;
--ink: #1e1b18;
--text: #1e1b18;
--text-sub: #6b6157;
--line: #ddd2be;
--primary: #1f6f78;
--primary-press: #185960;
--primary-soft: #d7eae8;
--on-primary: #fff;
--mustard: #f2b544;
--coral: #e4573d;
--correct: #2f8f4e;
--correct-soft: #ddf0e2;
--danger: #b3261e;
--danger-soft: #f8dcd6;
--warning-soft: #fdebc7;
--discord: #5865f2;
--star-1: #f2b544;
--star-2: #ef8a3a;
--star-3: #dc4b3e;
--star-4: #6b3fb5;
--radius: 14px;
--radius-sm: 10px;
--shadow-key: 0 3px 0 var(--ink);
--font: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
color-scheme: light;
}
:root[data-theme='dark'] {
--bg: #17150f;
--surface: #221f1a;
--surface-2: #2c2821;
--surface-3: #39342b;
--ink: #e9dfc9;
--text: #efe7d6;
--text-sub: #b3a891;
--line: #3f392f;
--primary: #4fa9b2;
--primary-press: #3e8f97;
--primary-soft: #1d3a3d;
--on-primary: #10221f;
--correct: #5cc07c;
--correct-soft: #1c3324;
--danger: #ff8a7a;
--danger-soft: #3d1f1a;
--warning-soft: #3d311a;
color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
:root[data-theme='auto'] {
--bg: #17150f;
--surface: #221f1a;
--surface-2: #2c2821;
--surface-3: #39342b;
--ink: #e9dfc9;
--text: #efe7d6;
--text-sub: #b3a891;
--line: #3f392f;
--primary: #4fa9b2;
--primary-press: #3e8f97;
--primary-soft: #1d3a3d;
--on-primary: #10221f;
--correct: #5cc07c;
--correct-soft: #1c3324;
--danger: #ff8a7a;
--danger-soft: #3d1f1a;
--warning-soft: #3d311a;
color-scheme: dark;
}
}
:root[data-font-scale='large'] { font-size: 17px; }
:root[data-font-scale='xlarge'] { font-size: 19px; }
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }
body {
margin: 0;
background: var(--bg);
/* very subtle paper grain */
background-image: radial-gradient(color-mix(in srgb, var(--ink) 4%, transparent) 1px, transparent 1px);
background-size: 5px 5px;
color: var(--text);
font-family: var(--font);
font-weight: 500;
letter-spacing: -0.01em;
word-break: keep-all;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; font-weight: 800; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
p { margin: 0; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }
.muted { color: var(--text-sub); }
.small { font-size: 0.87rem; }
.mono { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* ---------------------------------------------------------------- buttons (keycap: 2px ink + 3px solid shadow) */
.btn {
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
min-height: 44px; padding: 0 18px;
border-radius: 12px; border: 2px solid var(--ink);
background: var(--surface); color: var(--ink);
font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap;
box-shadow: var(--shadow-key); cursor: pointer;
transition: transform 0.05s, box-shadow 0.05s;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-mustard { background: var(--mustard); color: #1e1b18; }
.btn-discord { background: var(--discord); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--text-sub); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.87rem; border-radius: 9px; box-shadow: 0 2px 0 var(--ink); }
.btn-lg { min-height: 52px; font-size: 1.07rem; }
.btn-block { width: 100%; }
/* ---------------------------------------------------------------- form */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.87rem; font-weight: 700; color: var(--text-sub); }
.input, textarea.input, select.input {
min-height: 48px; width: 100%;
border: 2px solid var(--ink); border-radius: 12px; padding: 0 14px;
background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 1rem;
}
textarea.input { padding: 10px 14px; min-height: 90px; resize: vertical; }
.field-error { color: var(--danger); font-weight: 700; font-size: 0.9rem; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
/* ---------------------------------------------------------------- cards, badges, chips */
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.ink { border: 2px solid var(--ink); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 0.8rem; font-weight: 750; background: var(--surface-2); color: var(--text-sub); }
.badge.teal { background: var(--primary-soft); color: var(--primary); }
.badge.live { background: var(--coral); color: #fff; }
.badge.ok { background: var(--correct-soft); color: var(--correct); }
.badge.warn { background: var(--warning-soft); color: #8a5a00; }
:root[data-theme='dark'] .badge.warn { color: var(--mustard); }
.chip { min-height: 30px; padding: 0 11px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font: inherit; font-weight: 650; font-size: 0.87rem; display: inline-flex; align-items: center; gap: 5px; color: var(--text); cursor: pointer; }
.chip[aria-pressed='true'] { border: 2px solid var(--ink); background: var(--primary); color: var(--on-primary); }
/* ---------------------------------------------------------------- site header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 2px solid var(--ink); }
.site-header-inner { height: 64px; max-width: 1440px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 18px; }
.site-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.04em; color: var(--ink); text-decoration: none; }
.site-logo img { width: 36px; height: 36px; }
.site-nav { display: flex; gap: 16px; }
.site-nav a { color: var(--text-sub); text-decoration: none; font-weight: 700; padding: 6px 2px; }
.site-nav a.active { color: var(--ink); box-shadow: inset 0 -3px 0 var(--mustard); }
.header-user { display: flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; color: var(--ink); background: none; border: 0; cursor: pointer; padding: 4px; text-decoration: none; }
.theme-toggle { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--ink); background: var(--surface); cursor: pointer; font-size: 18px; }
.account-menu { position: relative; }
.account-menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: var(--surface); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); padding: 6px; display: flex; flex-direction: column; z-index: 30; }
.account-menu-list button { text-align: left; font: inherit; font-weight: 700; padding: 10px 12px; border-radius: 8px; border: 0; background: none; color: var(--text); cursor: pointer; }
.account-menu-list button:hover, .account-menu-list button:focus-visible { background: var(--surface-2); }
.avatar { border-radius: 50%; border: 2px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.announcement { background: var(--primary-soft); padding: 8px 16px; text-align: center; font-weight: 700; border-bottom: 1.5px solid var(--line); }
.announcement.maintenance { background: var(--warning-soft); }
/* ---------------------------------------------------------------- pages */
.page { max-width: 1440px; margin: 0 auto; padding: 28px 40px; }
.page.narrow { max-width: 520px; }
/* home */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: stretch; }
.welcome { background: #1f6f78; color: #fff; border: 2px solid var(--ink); border-radius: 20px; padding: 30px 34px; position: relative; overflow: hidden; box-shadow: 6px 6px 0 var(--ink); min-height: 280px; }
.welcome h1 { font-size: 2.25rem; font-weight: 850; letter-spacing: -0.045em; line-height: 1.22; position: relative; }
.welcome p { opacity: 0.9; margin-top: 10px; font-size: 1.03rem; line-height: 1.6; max-width: 420px; position: relative; }
.welcome .acts { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; position: relative; }
.welcome .acts .btn { color: #1e1b18; border-color: #1e1b18; box-shadow: 0 3px 0 #1e1b18; }
.welcome .acts .btn:not(.btn-mustard) { background: #fffdf8; }
.welcome .bigLP { position: absolute; right: -70px; bottom: -90px; width: 300px; height: 300px; border-radius: 50%; background: repeating-radial-gradient(circle, #1c1a1f 0 6px, #2a2830 6px 8px); }
.welcome .bigLP::after { content: ''; position: absolute; inset: 105px; border-radius: 50%; background: var(--mustard); }
.welcome .note { position: relative; margin-top: 18px; font-size: 0.85rem; font-weight: 700; opacity: 0.85; }
.login-card { background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; padding: 26px 28px; display: flex; flex-direction: column; gap: 12px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--text-sub); font-size: 0.83rem; font-weight: 700; }
.or::before, .or::after { content: ''; flex: 1; height: 1.5px; background: var(--line); }
.guest-warning { background: var(--warning-soft); border-radius: 10px; padding: 8px 12px; }
.rooms-head { display: flex; align-items: center; gap: 12px; margin: 30px 0 12px; flex-wrap: wrap; }
.empty { border: 2px dashed var(--line); border-radius: 16px; padding: 28px; text-align: center; color: var(--text-sub); font-weight: 650; }
/* ---------------------------------------------------------------- admin (docs/02: side menu + content, .data-table) */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 66px); }
.admin-side { background: var(--surface-2); border-right: 2px solid var(--ink); padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; }
.admin-side a { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; font-weight: 700; color: var(--text-sub); text-decoration: none; }
.admin-side a.active { background: var(--ink); color: var(--surface); }
.admin-side a.soon { opacity: 0.55; }
.admin-side .sep { font-size: 0.77rem; font-weight: 800; color: var(--text-sub); padding: 12px 12px 4px; letter-spacing: 0.04em; }
.admin-main { padding: 22px 26px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.4rem; font-weight: 850; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.8rem; color: var(--text-sub); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; font-size: 0.9rem; }
.data-table th { background: var(--surface-2); text-align: left; font-size: 0.8rem; color: var(--text-sub); font-weight: 800; padding: 9px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.data-table td { padding: 8px 10px; border-bottom: 1.5px solid var(--line); font-weight: 600; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-weight: 700; box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 50%, transparent); }
.toast.error { background: var(--danger); color: #fff; }
/* ---------------------------------------------------------------- sheet (confirm dialog) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 18, 14, 0.45); display: flex; align-items: center; justify-content: center; z-index: 90; padding: 16px; }
.sheet { background: var(--surface); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink); padding: 22px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.sheet:focus { outline: none; }
/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
.hero { grid-template-columns: 1fr; }
.page { padding: 20px 16px; }
.admin-layout { grid-template-columns: 1fr; }
.admin-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 2px solid var(--ink); padding: 8px; }
.admin-side .sep { display: none; }
.admin-side a { white-space: nowrap; }
.admin-main { padding: 16px; }
}
@media (max-width: 600px) {
.site-header-inner { padding: 0 12px; gap: 10px; }
.site-logo span { display: none; }
.welcome { padding: 24px; }
.welcome .bigLP { width: 170px; height: 170px; right: -60px; bottom: -70px; }
.welcome .bigLP::after { inset: 60px; }
.welcome .acts { margin-bottom: 60px; }
.welcome h1 { font-size: 1.75rem; }
.header-user-name { display: none; }
}