/* ===== リセット & ベース ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    user-select: none;
    -webkit-user-select: none;
}
#app { height: 100%; display: flex; flex-direction: column; }

/* ===== 共通 ===== */
button {
    touch-action: manipulation;
}
.btn {
    border: none; border-radius: 8px; padding: 10px 16px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: opacity .15s;
}
.btn:active { opacity: .7; }
.btn-primary { background: #4361ee; color: #fff; }
.btn-success { background: #2ec4b6; color: #fff; }
.btn-danger { background: #e63946; color: #fff; }
.btn-ghost { background: transparent; color: #4361ee; border: 1px solid #4361ee; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }

input, select {
    background: #16213e; border: 1px solid #334; color: #e0e0e0;
    border-radius: 8px; padding: 10px 12px; font-size: 14px; width: 100%;
}
input:focus { outline: none; border-color: #4361ee; }

.page { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.page-header {
    display: flex; align-items: center;
    padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
    background: #16213e; border-bottom: 1px solid #334;
    min-height: calc(48px + env(safe-area-inset-top));
}
.page-header h1 { font-size: 16px; flex: 1; text-align: center; }
.page-header .back-btn { font-size: 20px; cursor: pointer; padding: 4px 8px; }
.header-back-btn {
    background: none; border: none; color: #aaa;
    font-size: 22px; line-height: 1;
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; margin-left: -8px;
}
.header-back-spacer { width: 44px; flex-shrink: 0; }
.page-content { flex: 1; padding: 16px; overflow-y: auto; }


/* ===== ホーム画面 ===== */
.home-section { margin-bottom: 20px; }
.home-section h2 { font-size: 14px; color: #888; margin-bottom: 8px; }

/* ===== ハンド履歴 ===== */
.history-row { background: #16213e; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.history-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.history-meta { font-size: 12px; color: #888; }
.history-rate { font-size: 12px; color: #aaa; }
.history-pot { font-size: 12px; color: #2ec4b6; font-weight: 600; }
.history-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; color: #fff; font-weight: 600; flex-shrink: 0; }
.history-summary { display: flex; align-items: center; gap: 6px; }
.history-summary-right { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
.history-participants { font-size: 11px; color: #666; }
.history-chevron { font-size: 9px; color: #556; transition: transform 0.2s; display: inline-block; }
.history-row.expanded .history-chevron { transform: rotate(180deg); }
.history-detail { display: none; margin-top: 10px; border-top: 1px solid #2a2a4a; padding-top: 10px; }
.history-row.expanded .history-detail { display: block; }
.history-street-block { margin-bottom: 8px; }
.history-street-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.history-street-label { font-size: 10px; font-weight: 700; color: #556; letter-spacing: 0.06em; min-width: 44px; }
.history-street-cards { display: flex; gap: 3px; flex-wrap: wrap; }
.history-action-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12px; }
.history-action-name { max-width: 64px; min-width: 28px; font-size: 11px; color: #aaa; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-action-type { font-weight: 700; }
.history-action-amount { color: #ccc; }
.history-action-bb { color: #666; font-size: 10px; }
.history-hands-block { border-top: 1px solid #334; margin-top: 8px; padding-top: 8px; }
.history-hand-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

.session-form { display: flex; flex-direction: column; gap: 10px; }
.session-form .row { display: flex; gap: 8px; align-items: center; }
.session-form label { font-size: 13px; color: #aaa; min-width: 48px; }

.start-btn-large {
    background: #2ec4b6; color: #fff; border: none; border-radius: 12px;
    padding: 16px; font-size: 16px; font-weight: 700; cursor: pointer;
    width: 100%; margin-top: 8px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.start-btn-large:active { opacity: .7; }

/* ===== プレイヤーDB ===== */
.filter-tabs {
    display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px;
    scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-chip {
    padding: 5px 12px; border-radius: 16px; font-size: 12px; font-weight: 600;
    border: 1.5px solid #444; cursor: pointer; white-space: nowrap;
    background: transparent; color: #aaa;
}
.filter-chip.active { border-color: #e0e0e0; color: #e0e0e0; background: rgba(255,255,255,.1); }

.search-box {
    display: flex; align-items: center; gap: 8px;
    background: #16213e; border-radius: 8px; padding: 8px 12px; margin: 8px 0;
}
.search-box input { border: none; padding: 0; background: transparent; }

.player-list { display: flex; flex-direction: column; gap: 6px; }
.player-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: #16213e; border-radius: 8px; cursor: pointer;
}
.player-row:active { background: #1e2a4a; }
.player-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.player-info { flex: 1; min-width: 0; }
.player-name { font-size: 14px; font-weight: 600; }
.player-tags { display: flex; gap: 4px; margin-top: 2px; }
.player-tag {
    font-size: 10px; padding: 1px 6px; border-radius: 4px;
    background: #334; color: #aaa;
}
.mini-calendar { display: flex; gap: 1px; align-items: center; }
.mini-calendar .day { width: 3px; height: 3px; border-radius: 50%; background: #334; }
.mini-calendar .day.active { background: #2ec4b6; }

/* ===== テーブル画面 ===== */
.table-info {
    display: flex; justify-content: space-between; padding: 0 16px 8px;
    font-size: 13px; color: #aaa;
}
.table-info .rate { font-weight: 700; color: #2ec4b6; }

.banner {
    text-align: center; padding: 8px 16px; margin: 0 16px 8px;
    background: #4361ee; border-radius: 8px; font-size: 13px; font-weight: 600;
}

.table-container {
    position: relative; width: 96%; aspect-ratio: 1.7;
    max-height: 46vh; margin: 0 auto;
    background: radial-gradient(ellipse at 50% 60%, #3d2208 0%, #1a1a2e 100%);
    border-radius: 8px;
}
.table-felt {
    position: absolute; top: 52%; left: 50%; transform: translate(-50%, -50%);
    width: 70%; height: 64%; border-radius: 50%;
    background: radial-gradient(ellipse at 50% 38%, #2a7a4a 0%, #1b5232 55%, #0f2e1c 100%);
    border: 2px solid #3a9060;
    box-shadow:
        0 0 0 8px #1a1a1a,
        0 0 0 16px #6b3d12,
        0 0 0 19px #3d2208,
        inset 0 2px 16px rgba(0,0,0,.5),
        0 8px 28px rgba(0,0,0,.8);
}

.seat {
    position: absolute; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    cursor: pointer; z-index: 2;
}
.seat-circle {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
    border: 2px solid transparent; transition: transform .15s;
}
.seat:active .seat-circle { transform: scale(.92); }
.seat-circle.empty { background: #334; border-color: #555; }
.seat-circle.myself { background: #6c63ff; border-color: #9d97ff; }
.seat-label { font-size: 9px; color: #aaa; max-width: 50px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-type { font-size: 8px; color: #888; }

.seat-num {
    position: absolute; top: -5px; right: -5px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #444; color: #ccc;
    font-size: 9px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.seat-circle { position: relative; }

.seat-remove {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
    border-radius: 50%; background: #e63946; color: #fff;
    border: none; font-size: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; z-index: 3;
}

.record-btn-area { padding: 12px 16px; margin-top: auto; }

/* ===== Level colors ===== */
.level-c1  { background: #2ec4b6; }
.level-c2  { background: #4361ee; }
.level-c3  { background: #7c3aed; }
.level-c4  { background: #e91e8c; }
.level-c5  { background: #e63946; }
.level-c6  { background: #e76f51; }
.level-c7  { background: #f4a261; }
.level-c8  { background: #f7c948; }
.level-c9  { background: #7bc67e; }
.level-c10 { background: #2a9d4d; }
.level-c11 { background: #00b4d8; }
.level-c12 { background: #888888; }

/* ===== プレイヤー割当シート ===== */
.sheet-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 100; display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
    background: #1a1a2e; border-radius: 16px 16px 0 0;
    width: 100%; max-height: 85vh; display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}
.sheet-handle { width: 36px; height: 4px; background: #555; border-radius: 2px; margin: 8px auto; }
.sheet-header {
    display: flex; align-items: center; padding: 8px 16px 12px;
    border-bottom: 1px solid #334;
}
.sheet-header h2 { flex: 1; font-size: 16px; text-align: center; }
.sheet-body { flex: 1; overflow-y: auto; padding: 12px 16px; }

/* ===== プレイヤー編集 ===== */
.edit-form { display: flex; flex-direction: column; gap: 16px; }
.edit-section h3 { font-size: 13px; color: #888; margin-bottom: 8px; }
.type-buttons { display: flex; gap: 6px; }
.type-btn {
    flex: 1; padding: 8px 4px; border-radius: 8px; border: 1.5px solid #444;
    background: transparent; color: #aaa; font-size: 12px; font-weight: 700;
    cursor: pointer; text-align: center;
}
.type-btn.active { border-color: #4361ee; color: #4361ee; background: rgba(67,97,238,.15); }
.level-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.level-btn {
    width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid transparent;
    cursor: pointer; padding: 0; flex: none;
}
.level-btn.active { border-color: #fff; }

textarea {
    background: #16213e; border: 1px solid #334; color: #e0e0e0;
    border-radius: 8px; padding: 10px 12px; font-size: 14px; width: 100%;
    min-height: 70px; resize: vertical; font-family: inherit;
}
textarea:focus { outline: none; border-color: #4361ee; }

/* ===== 対戦記録 ===== */
.step-indicator {
    display: flex; gap: 4px; padding: 8px 16px; justify-content: center;
}
.step-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #334;
}
.step-dot.active { background: #4361ee; }
.step-dot.done { background: #2ec4b6; }

.step-title {
    text-align: center; font-size: 14px; color: #ccc; padding: 8px 0 12px;
}

.mini-table-container {
    position: relative; width: 100%; aspect-ratio: 1.8;
    max-height: 200px; margin: 0 auto;
}
.mini-table-felt {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 58%; height: 58%; border-radius: 50%;
    background: radial-gradient(ellipse, #256d45 0%, #1b4332 60%, #112b20 100%);
    border: 2px solid #3a8a60;
    box-shadow: 0 0 0 6px #5c3310, 0 0 0 8px #3d2208, inset 0 0 16px rgba(0,0,0,.4);
}
.mini-seat {
    position: absolute; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    cursor: pointer;
}
.mini-seat-circle {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; color: #fff;
    border: 2px solid transparent;
}
.mini-seat-circle.selected { border-color: #fff; box-shadow: 0 0 8px rgba(67,97,238,.6); }
.mini-seat-label { font-size: 7px; color: #888; }
.mini-seat-pos { font-size: 7px; color: #f4a261; font-weight: 700; }

.pot-display {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 12px; font-weight: 700; color: #2ec4b6;
}

.participant-grid {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    padding: 12px 0;
}
.participant-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer;
}
.participant-item .mini-seat-circle { width: 38px; height: 38px; font-size: 10px; }
.participant-item.active .mini-seat-circle { border-color: #4361ee; background: rgba(67,97,238,.3) !important; }

/* ===== ストリート記録 ===== */
.street-tabs {
    display: flex; background: #16213e; border-bottom: 1px solid #334;
}
.street-tab {
    flex: 1; padding: 8px 4px; text-align: center;
    font-size: 12px; color: #888; cursor: pointer; border: none; background: none;
    border-bottom: 2px solid transparent;
}
.street-tab.active { color: #4361ee; border-bottom-color: #4361ee; font-weight: 700; }

.pot-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; font-size: 13px;
}
.pot-bar .label { color: #888; }
.pot-bar .amount { font-weight: 700; color: #2ec4b6; }
.pot-bar .bb { color: #888; font-size: 11px; }

.board-cards {
    display: flex; gap: 6px; padding: 8px 16px; align-items: center;
}
.board-cards .label { font-size: 12px; color: #888; margin-right: 4px; }

.card-small {
    width: 30px; height: 40px; border-radius: 4px; background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; border: 1px solid #ddd; cursor: pointer;
}
.card-small.empty { background: #334; border-color: #555; color: #666; }
.suit-s { color: #111; }
.suit-h { color: #e63946; }
.suit-d { color: #4361ee; }
.suit-c { color: #2a9d4d; }
/* スペードは暗い背景では白っぽく */
.card-picker-cell .suit-s { color: #ccc; }

.action-list { padding: 4px 16px; display: flex; flex-direction: column; gap: 4px; }
.action-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; background: #16213e; border-radius: 6px; font-size: 12px;
}
.action-row .name { width: 56px; font-weight: 600; }
.action-row .action-type { font-weight: 700; }
.action-row .action-amount { color: #ccc; }
.action-row .action-bb { color: #888; font-size: 10px; }
.action-row .remove { margin-left: auto; color: #888; cursor: pointer; border: none; background: none; font-size: 14px; }

.action-type-fold { color: #888; }
.action-type-check { color: #2ec4b6; }
.action-type-call { color: #4361ee; }
.action-type-bet { color: #f4a261; }
.action-type-raise { color: #e63946; }
.action-type-allin { color: #a855f7; }
.action-type-blind { color: #888; font-style: italic; }
.action-type-straddle { color: #f4c430; font-style: italic; }

.add-action-area { padding: 8px 16px; }
.player-select-row {
    display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px;
    scrollbar-width: none;
}
.player-select-row::-webkit-scrollbar { display: none; }
.player-select-chip {
    padding: 5px 10px; border-radius: 8px; font-size: 11px; font-weight: 600;
    background: #16213e; border: 1px solid #334; color: #aaa; cursor: pointer;
    white-space: nowrap;
}
.player-select-chip.active { border-color: #4361ee; color: #4361ee; background: rgba(67,97,238,.15); }
.player-select-chip.folded { opacity: .3; pointer-events: none; }

.action-buttons { display: flex; gap: 4px; margin: 6px 0; }
.action-btn {
    flex: 1; padding: 8px 2px; border-radius: 6px; border: none;
    font-size: 11px; font-weight: 700; cursor: pointer;
}
.action-btn-fold { background: rgba(136,136,136,.15); color: #888; }
.action-btn-disabled { opacity: 0.2; cursor: not-allowed; pointer-events: none; }
.action-btn-check { background: rgba(46,196,182,.15); color: #2ec4b6; }
.action-btn-call { background: rgba(67,97,238,.15); color: #4361ee; }
.action-btn-bet { background: rgba(244,162,97,.15); color: #f4a261; }
.action-btn-raise { background: rgba(230,57,70,.15); color: #e63946; }
.action-btn-allin { background: rgba(168,85,247,.15); color: #a855f7; }

.amount-row {
    display: flex; gap: 6px; align-items: center;
}
.amount-toggle {
    display: flex; border-radius: 6px; overflow: hidden; border: 1px solid #334;
}
.amount-toggle button {
    padding: 6px 10px; border: none; font-size: 11px; font-weight: 600;
    cursor: pointer; background: #16213e; color: #888;
}
.amount-toggle button.active { background: #4361ee; color: #fff; }
.amount-row input { flex: 1; }

.nav-buttons {
    display: flex; gap: 8px; padding: 12px 16px;
    border-top: 1px solid #334; margin-top: auto;
}
.nav-buttons .btn { flex: 1; }

/* ===== ハンド公開 ===== */
.reveal-list { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.reveal-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: #16213e; border-radius: 8px;
}
.reveal-name { width: 64px; font-size: 13px; font-weight: 600; }
.reveal-cards { display: flex; gap: 4px; flex: 1; }
.reveal-btn { margin-left: auto; }

/* ===== カードピッカー ===== */
.card-picker-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    z-index: 200; display: flex; align-items: flex-end;
}
.card-picker {
    background: #1a1a2e; border-radius: 16px 16px 0 0; width: 100%;
    max-height: 70vh; display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}
.card-picker-header {
    display: flex; align-items: center; padding: 12px 16px;
    border-bottom: 1px solid #334;
}
.card-picker-header h3 { flex: 1; text-align: center; font-size: 15px; }
.card-picker-selected {
    display: flex; gap: 8px; justify-content: center; padding: 12px 0;
}
.card-picker-grid { padding: 8px 6px; overflow-y: auto; }
.card-picker-suit-row { display: flex; gap: 3px; justify-content: center; margin-bottom: 4px; }
.card-picker-cell {
    width: 26px; height: 34px; border-radius: 4px; border: 1.5px solid #444;
    background: #16213e; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; cursor: pointer;
}
.card-picker-cell.selected { border-color: #4361ee; background: rgba(67,97,238,.2); }
.card-picker-cell.used { opacity: .2; pointer-events: none; }
.card-picker-cell .rank { font-size: 10px; }
.card-picker-cell .suit { font-size: 9px; }

/* ===== 日記 ===== */
.diary-graph-section {
    background: #16213e; border-radius: 12px; padding: 12px 12px 8px; margin-bottom: 16px;
}
.diary-period-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.diary-period-tab {
    padding: 4px 14px; border-radius: 12px; font-size: 12px; font-weight: 600;
    border: 1.5px solid #444; background: transparent; color: #aaa; cursor: pointer;
}
.diary-period-tab.active { border-color: #2ec4b6; color: #2ec4b6; background: rgba(46,196,182,.12); }
.diary-chart { width: 100%; height: 160px; display: block; }
.diary-chart-large { height: 240px; }
.diary-graph-entry-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.diary-graph-entry-row { background: #16213e; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.diary-summary {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 8px; border-top: 1px solid #2a2a4a; margin-top: 4px;
}
.diary-summary-label { font-size: 12px; color: #666; }
.diary-summary-value { font-size: 15px; font-weight: 700; }
.diary-summary-value.positive { color: #2ec4b6; }
.diary-summary-value.negative { color: #e63946; }

.diary-list-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.diary-row {
    display: flex; align-items: center; justify-content: space-between;
    background: #16213e; border-radius: 8px; padding: 10px 12px; margin-bottom: 6px;
    cursor: pointer;
}
.diary-row:active { background: #1e2a4a; }
.diary-row-left { flex: 1; min-width: 0; }
.diary-date { font-size: 13px; font-weight: 600; color: #ccc; }
.diary-memo-preview { font-size: 11px; color: #666; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diary-row-right { flex-shrink: 0; margin-left: 12px; }
.diary-pnl { font-size: 15px; font-weight: 700; }
.diary-pnl.positive { color: #2ec4b6; }
.diary-pnl.negative { color: #e63946; }

.diary-session-list { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.diary-session-row {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: 8px; background: #16213e; cursor: pointer; font-size: 13px; color: #aaa;
}
.diary-session-row:active { background: #1e2a4a; }
.diary-session-row.selected { background: rgba(67,97,238,.15); color: #e0e0e0; }
.diary-session-check { width: 16px; color: #4361ee; font-weight: 700; flex-shrink: 0; }

/* 遠征バナー */
.expedition-banner {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(124,58,237,.15); border: 1px solid rgba(124,58,237,.4);
    border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.expedition-banner-info { display: flex; flex-direction: column; gap: 2px; }
.expedition-badge { font-size: 13px; font-weight: 700; color: #a78bfa; }
.expedition-currency { font-size: 12px; color: #888; }
.expedition-start-date { font-size: 11px; color: #666; }
.expedition-start-row { margin-bottom: 12px; }
.expedition-tag-display {
    background: rgba(124,58,237,.15); border: 1px solid rgba(124,58,237,.4);
    border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #a78bfa; font-weight: 600;
}

/* グラフビュータブ */
.diary-view-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.diary-view-tab {
    padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 600;
    border: 1.5px solid #444; background: transparent; color: #aaa; cursor: pointer;
}
.diary-view-tab.active { border-color: #4361ee; color: #4361ee; background: rgba(67,97,238,.12); }
.diary-merge-btn {
    padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
    border: 1.5px solid #7c3aed; background: transparent; color: #7c3aed; cursor: pointer;
}
.diary-merge-btn.active { background: rgba(124,58,237,.2); }

/* 日記一覧の遠征バッジ */
.diary-exp-badge {
    display: inline-block; font-size: 10px; color: #a78bfa; font-weight: 600;
    margin-left: 6px; vertical-align: middle;
}

/* ===== 日記カレンダー ===== */
.diary-cal-section { margin-top: 4px; }
.diary-year-nav {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.diary-graph-year-nav {
    display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px;
}
.diary-year-btn {
    background: none; border: 1px solid #334; color: #aaa;
    width: 32px; height: 32px; border-radius: 8px; font-size: 18px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.diary-year-label { font-size: 15px; font-weight: 700; color: #e0e0e0; }
.diary-month-tabs {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 12px;
}
.diary-month-tab {
    background: #16213e; border: 1px solid #334; border-radius: 8px;
    color: #555; font-size: 11px; font-weight: 600; padding: 6px 2px;
    text-align: center; cursor: pointer; line-height: 1.3;
}
.diary-month-tab.has-entries { color: #aaa; border-color: #446; }
.diary-month-tab.active { background: #4361ee; border-color: #4361ee; color: #fff; }
.diary-month-tab.active .diary-month-count { color: rgba(255,255,255,.8); }
.diary-month-count { font-size: 10px; font-weight: 400; color: #4361ee; }
.diary-calendar {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.diary-cal-header {
    text-align: center; font-size: 10px; color: #666; padding: 4px 0; font-weight: 600;
}
.diary-cal-empty { height: 48px; }
.diary-cal-day {
    height: 48px; border-radius: 8px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px; cursor: pointer;
    background: #16213e;
}
.diary-cal-day:active { opacity: .7; }
.diary-cal-day.today { border: 1px solid #4361ee; }
.diary-cal-day.has-entry { background: #1a2540; }
.diary-cal-num { font-size: 13px; color: #777; line-height: 1; }
.diary-cal-day.has-entry .diary-cal-num { color: #ccc; font-weight: 600; }
.diary-cal-day.today .diary-cal-num { color: #4361ee; }
.diary-cal-dot {
    width: 6px; height: 6px; border-radius: 50%;
}
.diary-cal-dot.positive { background: #2ec4b6; }
.diary-cal-dot.negative { background: #e63946; }
.diary-cal-day.selected { background: #2a3a5e; outline: 2px solid #4361ee; }
.diary-cal-dot.hand-dot {
    background: #4361ee; min-width: 16px; height: 16px; border-radius: 8px;
    font-size: 9px; font-weight: 700; color: #fff;
    display: flex; align-items: center; justify-content: center;
}
