/* ============================================================
   TSUMTSUM RANKMATCH - MIDNIGHT ARENA v3.0.1
   Design Base: v1 (Original) / Features: v3.0 (Event & Rewards)
   ============================================================ */

:root {
    --tsumrm-bg-dark: #1a1e24;
    --tsumrm-bg-gradient: linear-gradient(135deg, #0f1215 0%, #1f2b38 100%);
    --tsumrm-panel-bg: rgba(30, 35, 45, 0.9);
    --tsumrm-panel-border: 1px solid rgba(255, 255, 255, 0.15);
    --tsumrm-accent-blue: #00d2ff;
    --tsumrm-accent-red: #ff4757;
    --tsumrm-accent-green: #2ecc71;
    --tsumrm-accent-gold: #ffd700;
    --tsumrm-text-main: #ffffff;
    --tsumrm-text-sub: #b0c0d0;
    --tsumrm-font-stack: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    --tsumrm-font-mono: 'Courier New', Courier, monospace;
}

/* ------------------------------------------------------------
   1. Base Layout & Wrappers (v1)
   ------------------------------------------------------------ */
.tsumrm-entry-wrapper, .tsumrm-room-wrapper { 
    background: var(--tsumrm-bg-gradient); 
    color: var(--tsumrm-text-main); 
    font-family: var(--tsumrm-font-stack); 
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    border: var(--tsumrm-panel-border); 
    padding: 10px; 
    max-width: 800px; 
    margin: 20px auto; 
    line-height: 1.4; 
    font-size: 13px; 
    position: relative; 
    overflow: hidden; 
    box-sizing: border-box; 
}
.tsumrm-entry-wrapper *, .tsumrm-room-wrapper * { box-sizing: border-box; }
.tsumrm-entry-wrapper a, .tsumrm-room-wrapper a { color: var(--tsumrm-accent-blue); text-decoration: none; }

.tsumrm-room-card, .stat-box, .tsumrm-lb-mycard, .calendar-day, .tsumrm-tab-content, .castle-text-block { 
    background: var(--tsumrm-panel-bg); 
    border: var(--tsumrm-panel-border); 
    border-radius: 8px; 
    margin-bottom: 10px; 
    padding: 10px; 
    color: var(--tsumrm-text-main); 
}

h2, h3, .card-title { 
    font-weight: 700; 
    border-left: 4px solid var(--tsumrm-accent-blue); 
    padding-left: 10px; 
    margin: 0 0 10px 0; 
    color: var(--tsumrm-accent-blue); 
    font-size: 1rem; 
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.1) 0%, transparent 100%); 
    line-height: 1.5; 
}
.tsumrm-centered-text { text-align: center; color: #aaa; padding: 20px; }

/* ------------------------------------------------------------
   2. Buttons (v1)
   ------------------------------------------------------------ */
.tsumrm-button { 
    display: block; width: 100%; 
    background: linear-gradient(to bottom, #00d2ff, #0078ff); 
    border: none; border-radius: 6px; 
    color: #fff !important; font-weight: 800; 
    padding: 12px; margin-top: 5px; 
    box-shadow: 0 4px 0 #005bb5; 
    cursor: pointer; text-align: center; font-size: 0.95rem; 
}
.tsumrm-button:active { transform: translateY(4px); box-shadow: none; }
.tsumrm-button:disabled { background: #555; color: #aaa !important; box-shadow: none; cursor: not-allowed; }

.tsumrm-button-cancel { 
    background: linear-gradient(to bottom, #ff6b6b, #ee5253); 
    box-shadow: 0 3px 0 #b33939; 
    font-size: 0.75rem; padding: 6px 12px; 
    border-radius: 4px; border:none; 
    color: #fff; cursor: pointer; text-align: center; 
    white-space: nowrap; display: inline-block; 
}

.tsumrm-btn-small { 
    padding: 4px 10px; 
    background: #333; border: 1px solid #555; 
    color: #fff; border-radius: 4px; 
    cursor: pointer; font-size: 0.75rem; 
    white-space: nowrap; transition: 0.2s; 
}
.tsumrm-btn-small.active { 
    background: var(--tsumrm-accent-blue); 
    color: #000; border-color: var(--tsumrm-accent-blue); font-weight: bold; 
}

/* ------------------------------------------------------------
   3. Entry Screen (v1)
   ------------------------------------------------------------ */
.tsumrm-countdown-box { 
    text-align: center; 
    border: 1px solid var(--tsumrm-accent-blue); 
    background: rgba(0, 210, 255, 0.05); 
    padding: 15px; margin-bottom: 15px; 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
}
#tsumrm-countdown-timer { 
    font-family: var(--tsumrm-font-mono); 
    font-size: 1.5rem; font-weight: bold; 
    color: var(--tsumrm-accent-blue); 
    line-height: 1.3; 
    text-shadow: 0 0 10px var(--tsumrm-accent-blue); 
    white-space: pre-line; 
}

.tsumrm-tsum-cards { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-bottom: 15px; 
}
.tsum-card { 
    background: rgba(0,0,0,0.5); border: 1px solid #444; border-radius: 6px; 
    padding: 5px; text-align: center; cursor: pointer; transition: 0.2s; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
}
.tsum-card img { width: 50px; height: 50px; border-radius: 50%; margin-bottom: 3px; object-fit: cover; }
.tsum-card span { display: block; font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.tsum-card.selected { border-color: var(--tsumrm-accent-blue); background: rgba(0, 210, 255, 0.15); }

.entry-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
@media (max-width: 480px) { .entry-status-grid { grid-template-columns: 1fr; } }

.entry-list-item { 
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; 
    background: rgba(255,255,255,0.05); padding: 8px 10px; 
    border-radius: 6px; margin-bottom: 5px; 
    border-left: 4px solid var(--tsumrm-text-sub); 
    font-size: 0.85rem; 
}
.entry-list-item.matched { border-left-color: var(--tsumrm-accent-green); background: rgba(46, 204, 113, 0.1); }
.entry-info { display: flex; align-items: center; gap: 5px; overflow: hidden; }
.entry-name { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Calendar */
.tsumrm-schedule-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.calendar-header { font-size: 0.7rem; color: #888; padding: 2px; }
.calendar-day { 
    height: 65px; padding: 2px; border-radius: 4px; margin: 0; 
    font-size: 0.7rem; display: flex; flex-direction: column; align-items: center; 
    overflow: hidden; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); 
    cursor: pointer; transition: 0.2s; 
}
.calendar-day.empty { background: transparent; border: none; cursor: default; }
.calendar-day:hover:not(.empty) { background: rgba(255,255,255,0.1); border-color: var(--tsumrm-accent-blue); }
.calendar-day.today { border: 1px solid var(--tsumrm-accent-blue); background: rgba(0, 210, 255, 0.1); }
.calendar-date { font-weight: bold; margin-bottom: 2px; }
.calendar-tsums { 
    display: flex; flex-wrap: nowrap; overflow-x: auto; justify-content: center; gap: 2px; width: 100%; 
    padding-bottom: 2px; scrollbar-width: none; 
}
.calendar-tsums::-webkit-scrollbar { display: none; }
.calendar-tsums img { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }

/* Modal */
#tsumrm-calendar-modal { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.85); z-index: 999999; 
    display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); 
}
.tsumrm-modal-content { 
    background: #1a1e24; border: 1px solid var(--tsumrm-accent-blue); 
    padding: 20px; border-radius: 12px; width: 90%; max-width: 400px; 
    position: relative; box-shadow: 0 0 30px rgba(0, 210, 255, 0.4); 
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.modal-tsum-row { 
    display: flex; align-items: center; gap: 15px; 
    background: rgba(255,255,255,0.05); padding: 12px; 
    border-radius: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); 
}
.modal-tsum-row img { width: 50px; height: 50px; border-radius: 50%; border: 1px solid #444; }
.modal-tsum-row span { font-size: 1.1rem; font-weight: bold; color: #fff; }

/* ------------------------------------------------------------
   4. Room Screen (v1)
   ------------------------------------------------------------ */
.tsum-compact-display { 
    display: flex; align-items: center; gap: 10px; 
    background: #111; padding: 10px; border-radius: 8px; 
    margin-bottom: 15px; border-left: 4px solid var(--tsumrm-accent-green); 
}
.tsum-compact-display img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.tsum-band-badge { font-size: 0.8rem; background: #333; padding: 2px 6px; border-radius: 4px; color: #aaa; }

.vs-screen { 
    display: flex; flex-direction: row; justify-content: space-between; align-items: center; 
    background: rgba(0,0,0,0.3); padding: 10px; border-radius: 12px; 
    margin-bottom: 15px; border: 1px solid rgba(255,255,255,0.05); 
}
.player-card { 
    flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; 
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 8px; padding: 10px 5px; 
}
.player-card.self { border-color: var(--tsumrm-accent-blue); } 
.player-card.rival { border-color: var(--tsumrm-accent-red); }
.player-name { font-size: 0.9rem; font-weight: bold; margin-bottom: 5px; line-height: 1.2; word-break: break-all; } 
.player-rate { font-size: 0.85rem; color: var(--tsumrm-accent-gold); font-family: var(--tsumrm-font-mono); margin-bottom: 5px; } 
.player-sl { font-size: 0.75rem; color: #aaa; border: 1px solid #555; padding: 1px 4px; border-radius: 3px; margin-bottom: 5px; }
.player-status { font-size: 0.75rem; color: #888; border: 1px solid #555; padding: 2px 6px; border-radius: 4px; } 
.player-status.ready { color: #000; background: var(--tsumrm-accent-green); border-color: var(--tsumrm-accent-green); font-weight: bold; }
.vs-logo { font-family: 'Impact', sans-serif; font-size: 2rem; font-style: italic; margin: 0 10px; color: #fff; text-shadow: 0 0 15px rgba(255, 0, 0, 0.8); }

.rules-accordion { margin-bottom: 20px; }
.rules-header { 
    background: rgba(255,255,255,0.05); padding: 10px 15px; border-radius: 6px; cursor: pointer; 
    display: flex; justify-content: space-between; align-items: center; 
    border: 1px solid rgba(255,255,255,0.1); transition: background 0.2s; 
}
.rules-header:hover { background: rgba(255,255,255,0.1); }
.rules-content { 
    background: rgba(0,0,0,0.3); padding: 15px; 
    border: 1px solid rgba(255,255,255,0.1); border-top: none; 
    border-radius: 0 0 6px 6px; font-size: 0.85rem; line-height: 1.6; 
    color: #ddd; white-space: pre-wrap; display: none; 
}

/* Room Timer */
#room-countdown-timer-box { 
    text-align: center; margin-bottom: 25px; padding: 20px 10px; 
    border-radius: 8px; width: 100%; border: 1px solid transparent; transition: 0.3s; 
}
#room-countdown-timer { 
    font-family: var(--tsumrm-font-mono); font-size: 4rem; 
    font-weight: 800; line-height: 1; margin-top: 5px; letter-spacing: 2px; 
}
.timer-label { font-size: 1.2rem; font-weight: bold; letter-spacing: 2px; }
.phase-1 { background: linear-gradient(90deg, rgba(0, 50, 50, 0.8), rgba(0, 80, 80, 0.9)); border-color: var(--tsumrm-accent-blue) !important; }
.phase-1 #room-countdown-timer { color: var(--tsumrm-accent-blue); text-shadow: 0 0 20px var(--tsumrm-accent-blue); }
.phase-1 .timer-label { color: #a0e0ff; }
.phase-2 { background: linear-gradient(90deg, rgba(60, 30, 0, 0.8), rgba(80, 40, 0, 0.9)); border-color: #e67e22 !important; }
.phase-2 #room-countdown-timer { color: #e67e22; text-shadow: 0 0 20px #e67e22; }
.phase-2 .timer-label { color: #ffcc99; }
.phase-warn { background: linear-gradient(90deg, rgba(60, 10, 10, 0.8), rgba(80, 10, 10, 0.9)); border-color: #e74c3c !important; animation: pulseWarn 2s infinite; }
.phase-warn #room-countdown-timer { color: #e74c3c; font-size:2rem; white-space:normal; }
.phase-warn .timer-label { color: #ff9999; }

/* Chat */
.chat-area { 
    background: rgba(0,0,0,0.3); padding: 10px; border-radius: 8px; 
    border: 1px solid rgba(255,255,255,0.1); max-width: 100%; overflow: hidden; 
}
.line-chat-log { height: 300px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-wrapper { display: flex; flex-direction: column; max-width: 80%; margin-bottom: 10px; }
.chat-wrapper.self { align-self: flex-end; align-items: flex-end; }
.chat-wrapper.rival { align-self: flex-start; align-items: flex-start; }
.chat-meta { font-size: 0.7rem; color: rgba(255,255,255,0.6); margin-bottom: 2px; padding: 0 5px; }
.chat-msg { padding: 8px 12px; border-radius: 6px; line-height: 1.4; word-wrap: break-word; font-size: 0.9rem; max-width: 100%; }
.chat-msg.self { background: rgba(0, 210, 255, 0.1); border: 1px solid var(--tsumrm-accent-blue); color: #fff; box-shadow: 0 0 5px rgba(0,210,255,0.2); }
.chat-msg.rival { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); color: #ddd; }
.chat-msg.system { align-self: center; background: rgba(255,255,255,0.1); color: #aaa; font-size: 0.75rem; padding: 4px 10px; border-radius: 12px; max-width: 90%; border:none; }
.chat-sticker { width: 100px; height: auto; object-fit: contain; display: block; }
.chat-msg:has(.chat-sticker) { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0; }
.chat-controls-tabs { display: flex; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.chat-tab-btn { flex: 1; padding: 8px; background: transparent; border: none; cursor: pointer; color: #888; font-weight: bold; transition:0.2s; }
.chat-tab-btn.active { color: var(--tsumrm-accent-blue); border-bottom: 2px solid var(--tsumrm-accent-blue); }
.chat-panel { display: none; padding-top: 5px; }
.chat-panel.active { display: block; }
#sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
#sticker-grid img { width:100%; aspect-ratio:1/1; object-fit:contain; cursor:pointer; padding:5px; border-radius:4px; background:rgba(255,255,255,0.05); }
#sticker-grid img:hover { background:rgba(255,255,255,0.1); border:1px solid var(--tsumrm-accent-blue); }
#chat-categories, #sticker-categories { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 5px; margin-bottom: 5px; }
#chat-categories button, #sticker-categories button { background: #333; border: 1px solid #555; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; white-space: nowrap; color:#ccc; }
#chat-categories button.active, #sticker-categories button.active { background: var(--tsumrm-accent-blue); color:#000; border-color:var(--tsumrm-accent-blue); font-weight:bold; }
#chat-messages { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 5px; width: 100%; }
#chat-messages button { width:100%; text-align:left; padding:8px; margin-bottom:5px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); border-radius:4px; cursor:pointer; color:#fff; }
#chat-messages button:hover { background:rgba(255,255,255,0.1); }

.memo-area textarea { width: 100%; background: #000; border: 1px solid #444; color: #ddd; padding: 10px; border-radius: 4px; font-size: 16px; resize: vertical; min-height: 100px; }
.result-input-group { display: flex; gap: 10px; margin-bottom: 10px; } .result-input-item { flex: 1; min-width: 0; } .result-input-item label { font-size: 0.8rem; color: #aaa; display: block; margin-bottom: 5px; } .result-input-item input { width: 100%; font-size: 1.2rem; text-align: center; padding: 8px; background: #000; border: 1px solid #555; color: #fff; border-radius: 4px; }
.tsumrm-message { padding: 10px; border-radius: 6px; margin-top: 10px; font-weight: bold; text-align: center; font-size: 0.9rem; }
.tsumrm-message.success { background: rgba(46, 204, 113, 0.2); border: 1px solid #2ecc71; color: #2ecc71; }
.tsumrm-message.error { background: rgba(231, 76, 60, 0.2); border: 1px solid #e74c3c; color: #e74c3c; }

/* Match Result Overlay */
#tsumrm-result-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99999; background: rgba(0, 0, 0, 0.95); backdrop-filter: blur(15px); display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
#tsumrm-result-overlay.active { opacity: 1; pointer-events: auto; }
.result-title { font-size: 3.5rem; font-weight: 900; font-style: italic; text-transform: uppercase; margin-bottom: 30px; letter-spacing: 3px; }
.tsumrm-result-win .result-title { color: #ffd700; text-shadow: 0 0 30px #ffd700; } .tsumrm-result-lose .result-title { color: #3498db; text-shadow: 0 0 30px #3498db; } .tsumrm-result-draw .result-title { color: #fff; text-shadow: 0 0 20px #fff; }
.result-rate-box { background: rgba(255,255,255,0.1); padding: 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2); text-align: center; min-width: 280px; }
.rate-nums { font-size: 1.5rem; font-family: var(--tsumrm-font-mono); margin: 15px 0; color: #fff; }
.rate-change { font-size: 2.5rem; font-weight: bold; display: block; margin-top: 10px; }
.rate-up { color: #2ecc71; text-shadow: 0 0 20px #2ecc71; } .rate-down { color: #e74c3c; text-shadow: 0 0 20px #e74c3c; }

/* ------------------------------------------------------------
   5. Stats & Team (v1)
   ------------------------------------------------------------ */
.stats-grid-top { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 5px; }
.stats-grid-bottom { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; margin-bottom: 10px; }
.stats-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 15px; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
.stats-carousel::-webkit-scrollbar { display: none; }
.stat-slide { flex: 0 0 100%; scroll-snap-align: center; }
.stat-card-inner { background: rgba(30, 35, 45, 0.9); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px; padding: 20px; }
.stat-title { font-size: 0.8rem; color: #aaa; margin-bottom: 10px; letter-spacing: 1px; }
.stat-row { display: flex; justify-content: space-around; }
.stat-col { text-align: center; }
.stat-val { display: block; font-size: 2rem; font-weight: bold; line-height: 1; margin-bottom: 5px; font-family: sans-serif; }
.stat-lbl { font-size: 0.7rem; color: #666; font-weight: bold; }
.chart-wrapper { height: 300px; width: 100%; position: relative; }
table.stats-tsum-table, table.tsumrm-history-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; white-space: nowrap; }
table.stats-tsum-table th, table.stats-tsum-table td, table.tsumrm-history-table th, table.tsumrm-history-table td { padding: 6px 8px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.tsum-cell { display: flex; align-items: center; gap: 5px; text-align: left; }
.tsum-cell img { width: 24px; height: 24px; border-radius: 50%; }
.table-scroll-wrapper { overflow-x: auto; margin-bottom: 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); }
.tsumrm-tabs { display: flex; background: rgba(0,0,0,0.3); border-radius: 8px; padding: 2px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); }
.tsumrm-tab-btn { flex: 1; text-align: center; padding: 10px 5px; cursor: pointer; font-weight: bold; color: var(--tsumrm-text-sub); border-radius: 6px; transition: 0.2s; font-size: 0.85rem; }
.tsumrm-tab-btn.active { background: var(--tsumrm-accent-blue); color: #000; box-shadow: 0 0 10px var(--tsumrm-accent-blue); }
.tsumrm-tab-content { display: none; border: none; background: transparent; box-shadow: none; padding: 0; }
.tsumrm-tab-content.active { display: block; animation: fadeIn 0.3s; }
.tsumrm-stats-subtabs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #555 transparent; }
.tsumrm-stats-subtabs::-webkit-scrollbar { height: 4px; }
.tsumrm-stats-subtabs::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

/* Leaderboard */
.tsumrm-accordion { width: 100%; }
.tsumrm-accordion-header { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: rgba(255, 255, 255, 0.05); border-radius: 6px; transition: background 0.2s; }
.tsumrm-accordion-header:hover { background: rgba(255, 255, 255, 0.1); }
.tsumrm-accordion-header::-webkit-details-marker { display: none; }
.tsumrm-accordion-content { padding-top: 10px; animation: fadeIn 0.3s; }
.tsumrm-accordion[open] .accordion-icon { transform: rotate(180deg); }
.accordion-icon { transition: transform 0.3s; font-size: 0.7rem; color:#aaa; }
.segmented-tabs { display: flex; width: 100%; background: rgba(0,0,0,0.3); border-radius: 6px; padding: 2px; border: 1px solid rgba(255,255,255,0.1); }
.segmented-tabs .tsumrm-tab-btn { flex: 1; text-align: center; padding: 8px 0; cursor: pointer; font-weight: bold; color: #888; border-radius: 4px; transition: 0.2s; font-size: 0.8rem; }
.segmented-tabs .tsumrm-tab-btn.active { background: var(--tsumrm-accent-blue); color: #000; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.compact-bar { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.compact-bar::-webkit-scrollbar { display: none; }
.ranking-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ranking-table th { color:#888; font-weight:normal; padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.ranking-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.03); vertical-align: middle; white-space: nowrap; }
.ranking-table tr:last-child td { border-bottom: none; }
.rank-top { color: var(--tsumrm-accent-gold); font-weight: bold; font-style: italic; }
.rank-1 { font-size: 1.1rem; text-shadow: 0 0 5px rgba(255,215,0,0.5); }
.compact-date { background: #222; border: 1px solid #444; color: #fff; padding: 2px 5px; border-radius: 4px; font-size: 0.8rem; font-family: sans-serif; }
.tsumrm-metric-row { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.tsumrm-pill { display: inline-block; padding: 6px 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); color: #ccc; border-radius: 20px; font-size: 0.8rem; cursor: pointer; transition: 0.2s; }
.tsumrm-pill:hover { background: rgba(255,255,255,0.1); }
.tsumrm-pill.active { background: rgba(0, 210, 255, 0.2); border-color: #00d2ff; color: #00d2ff; font-weight: bold; }
.lb-princess-icon { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 1px solid #555; display: block; margin: 0 auto; }
#princess-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.princess-card { position: relative; width: 100%; aspect-ratio: 16/9; border: 2px solid #444; border-radius: 8px; overflow: hidden; background: #000; display: block; }
.princess-card img { width: 100%; height: 100%; object-fit: cover; }
.princess-card-name { position: absolute; bottom: 0; width: 100%; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); color: #fff; padding: 5px; text-align: center; font-family: serif; font-size: 0.9rem; }

/* ------------------------------------------------------------
   ★ 追加: Match Found Overlay
   ------------------------------------------------------------ */
#tsumrm-match-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 999999;
    background: rgba(0,0,0,0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
#tsumrm-match-overlay.active { display: flex; animation: flashRed 0.5s ease-out; }
@keyframes flashRed { 0% { background: rgba(150,0,0,0.8); } 100% { background: rgba(0,0,0,0.95); } }

.match-text-main {
    font-family: var(--tsumrm-font-mono);
    font-size: 3rem; font-weight: 900; font-style: italic;
    color: #ffd700; text-shadow: 0 0 20px #ff4757, 0 0 40px #ff4757;
    margin-bottom: 20px;
    opacity: 0; transform: scale(3);
    animation: slamIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: 0.2s;
    text-align: center;
}
@keyframes slamIn { to { opacity: 1; transform: scale(1); } }

.match-text-sub {
    font-size: 1.2rem; color: #fff; letter-spacing: 3px;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: 1.0s;
}
@keyframes fadeIn { to { opacity: 1; } }

/* ------------------------------------------------------------
   Utility & Badges
   ------------------------------------------------------------ */
#my-team-members li, #pending-list li, #kick-list li, #team-search-results li { list-style: none !important; list-style-type: none !important; }
.member-item { padding: 10px 5px; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; }
.member-name { font-weight: bold; font-size: 0.95rem; }
.member-rate { font-size: 0.75rem; color: #aaa; background: #222; padding: 2px 6px; border-radius: 4px; margin-left: 8px; }
.leader-badge { font-size: 0.7rem; color: gold; border: 1px solid gold; padding: 1px 4px; border-radius: 3px; margin-left: 5px; }

/* Stage Badges */
.tsumrm-stage-badge { display: inline-block; padding: 5px 15px; border-radius: 4px; font-weight: bold; font-family: var(--tsumrm-font-mono); color: #fff; font-size: 1.2rem; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.tsumrm-stage-badge-small { display: inline-block; padding: 1px 6px; border-radius: 3px; font-weight: bold; font-family: var(--tsumrm-font-mono); color: #fff; font-size: 0.75rem; margin-left: 5px; vertical-align: middle; }

/* Stage Colors */
.stage-S { background: linear-gradient(135deg, #ffd700, #fdb931); border: 1px solid #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
.stage-A { background: linear-gradient(135deg, #ff4757, #ff6b81); border: 1px solid #ff4757; }
.stage-B { background: linear-gradient(135deg, #2e86de, #54a0ff); border: 1px solid #2e86de; }
.stage-C { background: linear-gradient(135deg, #10ac84, #1dd1a1); border: 1px solid #10ac84; }
.stage-D { background: linear-gradient(135deg, #576574, #8395a7); border: 1px solid #576574; }

/* Monitor Table (Admin) */
.wp-list-table th, .wp-list-table td { vertical-align: middle; }
.wp-list-table small { color: #888; }

/* ============================================================
   NEW FEATURES (v3.0.0): Events, Rewards, Notifications
   ============================================================ */

/* 1. Notification Popup */
#tsumrm-notification-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); z-index: 999999;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(2px);
}
.tsumrm-popup-content {
    background: #fff; width: 90%; max-width: 400px;
    border-radius: 12px; overflow: hidden; text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    animation: tsumPopIn 0.3s ease-out;
    color: #333;
}
@keyframes tsumPopIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tsumrm-popup-header {
    background: linear-gradient(135deg, #00d2ff 0%, #0078ff 100%);
    padding: 15px; color: #fff; font-weight: bold; font-size: 1.1rem;
    display: flex; justify-content: center; align-items: center; gap: 5px;
}
.tsumrm-popup-body { padding: 20px; }
.tsumrm-popup-image-wrapper img {
    max-width: 100%; height: auto; border-radius: 8px; margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.tsumrm-popup-btn {
    display: inline-block; background: #ff4757; color: #fff; text-decoration: none;
    padding: 10px 20px; border-radius: 50px; font-weight: bold; margin-bottom: 15px;
    box-shadow: 0 3px 0 #b33939; transition: transform 0.1s;
}
.tsumrm-popup-btn:active { transform: translateY(2px); box-shadow: none; }
.tsumrm-dont-show {
    display: flex; justify-content: center; align-items: center; gap: 5px;
    font-size: 0.85rem; color: #666; cursor: pointer; margin-top: 10px;
}
.tsumrm-popup-close-area {
    background: #f5f5f5; padding: 15px; border-top: 1px solid #ddd;
}
.tsumrm-popup-close-btn {
    background: #ffd700; color: #333; border: 1px solid #e1b700;
    padding: 10px 40px; border-radius: 50px; font-weight: bold; font-size: 1rem;
    cursor: pointer; box-shadow: 0 3px 0 #cfa900;
}
.tsumrm-popup-close-btn:active { transform: translateY(2px); box-shadow: none; }

/* 2. Event Mode Switcher & Labels */
.tsumrm-mode-switcher {
    display: flex; margin-bottom: 15px;
    background: rgba(0,0,0,0.5); border: 1px solid var(--tsumrm-accent-gold);
    border-radius: 8px; padding: 4px;
}
.mode-tab {
    flex: 1; text-align: center; padding: 8px; cursor: pointer;
    border-radius: 6px; font-weight: bold; color: #aaa; transition: 0.2s;
}
.mode-tab.active {
    background: var(--tsumrm-accent-gold); color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}
.event-label { color: #ffd700; font-weight: bold; letter-spacing: 1px; font-size: 0.8rem; }

/* 3. Rewards Grid (Treasury/Museum) */
.tsumrm-reward-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 15px;
    padding: 10px;
}
.reward-item {
    cursor: pointer;
    text-align: center;
    position: relative;
    transition: transform 0.2s;
}
.reward-item:hover { transform: scale(1.05); }

.reward-img-wrapper {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255,215,0,0.3);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 15px rgba(255,215,0,0.1);
    margin-bottom: 5px;
}
.reward-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}
.reward-name {
    font-size: 0.75rem; color: #ddd;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-weight: bold;
}
.new-badge {
    position: absolute; top: -5px; right: -5px;
    background: #ff4757; color: white;
    font-size: 0.6rem; padding: 2px 6px; border-radius: 10px;
    font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 2;
}

/* 4. Reward Detail Overlay */
.reward-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.reward-popup {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    width: 85%; max-width: 320px;
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
    transform: scale(0.8); opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #333;
}
.reward-popup.pop-in { transform: scale(1); opacity: 1; }
.reward-shine {
    position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.2) 0%, transparent 70%);
    animation: rotateShine 10s linear infinite;
    z-index: 0; pointer-events: none;
}
@keyframes rotateShine { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.reward-popup-img {
    width: 120px; height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
    position: relative; z-index: 1;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}
.reward-popup-title {
    font-size: 1.4rem; font-weight: 800; color: #333;
    margin: 0 0 5px 0; position: relative; z-index: 1; border: none; background: none; padding: 0;
}
.reward-popup-event {
    font-size: 0.9rem; color: #d4af37; font-weight: bold;
    margin: 0 0 20px 0; position: relative; z-index: 1; text-transform: uppercase; letter-spacing: 1px;
}
.reward-popup-date {
    font-size: 0.8rem; color: #999;
    margin: 0 0 25px 0; position: relative; z-index: 1;
}
.reward-close-btn {
    background: #333; color: #fff; border: none;
    padding: 12px 40px; border-radius: 50px;
    cursor: pointer; font-weight: bold;
    position: relative; z-index: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.reward-close-btn:active { transform: scale(0.95); }