/* ============================================================
   pepipa — 사이트 공통 스타일
   셸(로그인/로비/메뉴/사진/순위/프로필/설정)에만 사용.
   게임 페이지는 개별 스타일 유지.
   ============================================================ */

:root {
    --bg: #0e1116;
    --bg-soft: #12161d;
    --surface: #151a22;
    --surface-2: #1a202a;
    --border: #242c38;
    --border-strong: #303a49;
    --text: #e8eaed;
    --text-2: #9aa3af;
    --text-3: #5f6975;
    --accent: #4ecca3;
    --accent-dim: rgba(78, 204, 163, 0.14);
    --accent-line: rgba(78, 204, 163, 0.35);
    --danger: #ff6b6b;
    --danger-dim: rgba(255, 107, 107, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, 'Helvetica Neue', 'Malgun Gothic', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-align: left;
}

a { color: var(--accent); text-decoration: none; }

::selection { background: var(--accent-dim); color: var(--accent); }

/* 스크롤바 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3c4757; }

/* ============================================================
   상단 내비게이션
   ============================================================ */

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(14, 17, 22, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-logo {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--text);
    text-transform: lowercase;
}
.nav-logo em {
    font-style: normal;
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    color: var(--text-2);
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link--active { color: var(--accent); background: var(--accent-dim); }

.nav-logout {
    margin-left: 10px;
    padding: 6px 13px;
    background: transparent;
    color: var(--text-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}
.nav-logout:hover { color: var(--danger); border-color: rgba(255, 107, 107, 0.4); }

/* 페이지 기본 컨테이너 (내비게이션 아래) */
.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 92px 20px 48px;
}

.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}
.page-sub {
    color: var(--text-3);
    font-size: 0.82rem;
}

/* ============================================================
   버튼 · 폼
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--accent);
    color: #0b1512;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: filter 0.15s, transform 0.1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.98); }
.btn--ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border-strong);
}
.btn--ghost:hover { color: var(--text); border-color: #3c4757; filter: none; }
.btn--danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.4);
}
.btn--danger:hover { background: var(--danger-dim); filter: none; }
.btn--block { width: 100%; }

.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.field input {
    width: 100%;
    padding: 11px 13px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.field input:focus { border-color: var(--accent); }

.hint { color: var(--text-3); font-size: 0.78rem; }

/* 상태 메시지 */
.note {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 14px;
}
.note--ok {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent-line);
}
.note--err {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.35);
}

/* ============================================================
   카드
   ============================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

/* ============================================================
   로그인 페이지
   ============================================================ */

.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-logo {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: var(--text);
    text-transform: lowercase;
    margin-bottom: 40px;
    user-select: none;
}
.login-logo em { font-style: normal; color: var(--accent); }

.login-box {
    width: 100%;
    max-width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 26px 26px;
}

.login-clock {
    position: fixed;
    top: 14px;
    right: 20px;
    color: var(--text-3);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

/* ============================================================
   로비 — 게임 그리드
   ============================================================ */

.game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    aspect-ratio: 1 / 0.94;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 10px;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.game-card:hover {
    border-color: var(--accent-line);
    background: var(--surface-2);
    transform: translateY(-3px);
}
.game-card:active { transform: scale(0.97); }

.game-card-icon { font-size: 1.9rem; line-height: 1; }

.game-card-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    text-align: center;
    word-break: keep-all;
    line-height: 1.25;
}

.game-card-best {
    font-size: 0.68rem;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    min-height: 1em;
}
.game-card-best b { color: var(--accent); font-weight: 600; }

/* 게임 오버레이 (iframe) */
.game-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(5, 7, 10, 0.92);
    backdrop-filter: blur(4px);
}
.game-overlay.open { display: block; }

.game-overlay-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.game-overlay-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.game-overlay-close {
    padding: 6px 14px;
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}
.game-overlay-close:hover { color: var(--danger); border-color: rgba(255, 107, 107, 0.4); }

.game-overlay iframe {
    display: block;
    width: 100%;
    height: calc(100% - 45px);
    border: none;
    background: var(--bg);
}

/* ============================================================
   순위 페이지
   ============================================================ */

.rank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.rank-table th {
    text-align: left;
    color: var(--text-3);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-strong);
}
.rank-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}
.rank-table tr:last-child td { border-bottom: none; }
.rank-table .win { color: var(--accent); font-weight: 700; }
.rank-table .lose { color: var(--text-3); }
.rank-score { font-weight: 600; }

.rank-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.rank-summary .card {
    flex: 1;
    text-align: center;
    padding: 18px;
}
.rank-summary .rs-value { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.rank-summary .rs-label { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }
.rank-summary .rs-value.mine { color: var(--text); }

/* ============================================================
   프로필
   ============================================================ */

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 auto 14px;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.stat-box {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}
.stat-box .sb-value { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.stat-box .sb-label { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }

/* ============================================================
   사진 갤러리
   ============================================================ */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: inherit;
    appearance: none;
    -webkit-appearance: none;
}
.photo-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s, opacity 0.25s;
    opacity: 0.92;
}
.photo-item:hover img { transform: scale(1.04); opacity: 1; }

.photo-views {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #ddd;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.photo-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.6rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

/* 라이트박스 */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(5, 7, 10, 0.95);
    flex-direction: column;
}
.lightbox.open { display: flex; }

.lightbox-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
}
.lightbox-bar-left {
    color: var(--text-3);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}
.lightbox-bar-right { display: flex; gap: 8px; }

.lightbox-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 16px 16px;
    position: relative;
}
.lightbox-stage img,
.lightbox-stage video {
    max-width: 100%;
    max-height: calc(100vh - 130px);
    object-fit: contain;
    border-radius: 6px;
    outline: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(21, 26, 34, 0.85);
    border: 1px solid var(--border-strong);
    color: var(--text-2);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}
.lightbox-nav:hover { color: var(--accent); border-color: var(--accent-line); }
.lightbox-nav--prev { left: 14px; }
.lightbox-nav--next { right: 14px; }

/* 업로드 패널 */
.photo-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.upload-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #0b1512;
    font-size: 1.6rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(78, 204, 163, 0.25);
    transition: transform 0.15s, filter 0.15s;
    font-family: inherit;
}
.upload-fab:hover { filter: brightness(1.08); transform: translateY(-2px); }

.upload-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border-strong);
    border-radius: 16px 16px 0 0;
    padding: 24px;
    transform: translateY(105%);
    transition: transform 0.25s ease-out;
    z-index: 250;
    max-width: 560px;
    margin: 0 auto;
}
.upload-sheet.open { transform: translateY(0); }

.upload-drop {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    color: var(--text-2);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 14px;
}
.upload-drop:hover, .upload-drop.drag {
    border-color: var(--accent-line);
    background: var(--accent-dim);
}
.upload-drop input { display: none; }

/* 삭제 확인 다이얼로그 */
.dialog {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(5, 7, 10, 0.85);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dialog.open { display: flex; }
.dialog-box {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
}
.dialog-text { color: var(--text-2); font-size: 0.95rem; line-height: 1.6; margin: 0 0 20px; }
.dialog-text b { color: var(--danger); font-weight: 700; cursor: pointer; text-decoration: underline; }
.dialog-actions { display: flex; justify-content: center; gap: 10px; }

/* ============================================================
   도구 허브 (tools.php)
   ============================================================ */

.tool-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}

.tool-search {
    flex: 1;
    min-width: 200px;
    max-width: 340px;
    padding: 10px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.tool-search:focus { border-color: var(--accent); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
    padding: 7px 13px;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-2);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chip:hover { color: var(--text); }
.chip--on {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-dim);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    min-height: 96px;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.tool-card:hover {
    border-color: var(--accent-line);
    background: var(--surface-2);
    transform: translateY(-2px);
}

.tool-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.tool-card-icon { font-size: 1.3rem; line-height: 1; }
.tool-card-name { font-size: 0.88rem; font-weight: 700; }
.tool-card-desc {
    font-size: 0.72rem;
    color: var(--text-3);
    line-height: 1.4;
    word-break: keep-all;
}
.tool-card-fav {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 4px;
    font-family: inherit;
}
.tool-card-fav.on { color: #ffd166; }

/* 도구 실행 패널 */
.tool-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--bg);
    flex-direction: column;
}
.tool-panel.open { display: flex; }

.tool-panel-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.tool-panel-title { font-weight: 700; font-size: 0.95rem; }
.tool-panel-sub { color: var(--text-3); font-size: 0.78rem; margin-right: auto; }

.tool-body {
    flex: 1;
    overflow-y: auto;
    padding: 26px 18px 48px;
}
.tool-body > .tool-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 도구 공통 폼 요소 */
.tin, .tsel {
    padding: 10px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.tin:focus, .tsel:focus { border-color: var(--accent); }

.tool-area {
    width: 100%;
    min-height: 130px;
    padding: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.88rem;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}
.tool-area:focus { border-color: var(--accent); }

.trow {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.trow > * { flex: 1; min-width: 110px; }
.trow > .fix { flex: 0 0 auto; min-width: 0; }

.tlabel {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 5px;
}

.tresult {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-all;
}
.tresult .big {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.tresult pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-2);
}

.tbtn {
    padding: 9px 16px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent-line);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.tbtn:hover { background: rgba(78, 204, 163, 0.24); }
.tbtn--ghost {
    background: transparent;
    color: var(--text-2);
    border-color: var(--border-strong);
}
.tbtn--ghost:hover { color: var(--text); background: var(--surface-2); }

.tcheck {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}
.tcheck input { accent-color: var(--accent); }

.tmsg { font-size: 0.8rem; color: var(--text-3); }
.tmsg--ok { color: var(--accent); }
.tmsg--err { color: var(--danger); }

.marked { background: rgba(78, 204, 163, 0.3); border-radius: 3px; padding: 1px 0; }
.md-preview h1, .md-preview h2, .md-preview h3 { margin: 0.6em 0 0.3em; line-height: 1.3; }
.md-preview h1 { font-size: 1.3rem; }
.md-preview h2 { font-size: 1.15rem; }
.md-preview h3 { font-size: 1rem; }
.md-preview p { margin: 0.4em 0; }
.md-preview code {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.82rem;
}
.md-preview pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    overflow-x: auto;
}
.md-preview blockquote {
    margin: 0.5em 0;
    padding: 4px 12px;
    border-left: 3px solid var(--accent-line);
    color: var(--text-2);
}
.md-preview ul, .md-preview ol { margin: 0.4em 0; padding-left: 1.4em; }

.swatch {
    width: 100%;
    height: 74px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
}

/* 달력 */
.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.cal-title { font-weight: 700; font-size: 1.05rem; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
    background: var(--surface);
}
.cal-cell--dim { color: var(--text-3); opacity: 0.45; }
.cal-cell--sun { color: #ff8a8a; }
.cal-cell--today {
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 800;
    border: 1px solid var(--accent-line);
}
.cal-dow {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-3);
    text-align: center;
    padding: 4px 0;
}

/* ============================================================
   공유 메모 (memo.php)
   ============================================================ */

.memo-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.memo-tab {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.memo-tab--on {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-dim);
}

.memo-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-3);
    margin-bottom: 8px;
    min-height: 1.2em;
}

.memo-area {
    width: 100%;
    min-height: 55vh;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}
.memo-area:focus { border-color: var(--accent-line); }

.memo-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 209, 102, 0.1);
    border: 1px solid rgba(255, 209, 102, 0.35);
    color: #ffd166;
    font-size: 0.82rem;
    margin-bottom: 12px;
}
.memo-banner.show { display: flex; }

/* ============================================================
   반응형
   ============================================================ */

@media (max-width: 860px) {
    .game-grid { grid-template-columns: repeat(4, 1fr); }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
    .tool-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
    .page { padding: 84px 14px 40px; }
    .nav { padding: 0 12px; }
    .nav-link { padding: 7px 9px; font-size: 0.8rem; }
    .nav-logout { padding: 5px 9px; font-size: 0.75rem; margin-left: 4px; }
    .game-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
    .game-card-icon { font-size: 1.5rem; }
    .game-card-name { font-size: 0.7rem; }
    .photo-grid { gap: 6px; }
    .login-logo { font-size: 2.1rem; }
    .lightbox-nav { width: 38px; height: 38px; }
    .tool-grid { grid-template-columns: repeat(2, 1fr); }
    .tool-bar { flex-direction: column; align-items: stretch; }
    .tool-search { max-width: none; }
    .memo-area { min-height: 50vh; }
}
