/* ============================================
   css/ui/mypage-daily.css - デイリーリザルト専用スタイル
   ============================================ */

/* フィルターバー */
.dr-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(0, 188, 212, 0.2);
    flex-wrap: wrap;
    gap: 10px;
}

.dr-filter-left,
.dr-filter-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dr-filter-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #546e7a;
}

.dr-filter-group {
    display: flex;
    background: #eceff1;
    border-radius: 16px;
    padding: 3px;
}

.dr-filter-btn {
    background: transparent;
    border: none;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #78909c;
    cursor: pointer;
    transition: all 0.2s;
}

.dr-filter-btn.active {
    background: white;
    color: #00838f;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dr-filter-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 3カラムメインレイアウト */
.dr-main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr 1.6fr;
    gap: 20px;
    align-items: stretch;
}

.dr-panel {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    height: 580px;
    display: flex;
    flex-direction: column;
}

.dr-panel-title {
    font-family: 'Orbitron', sans-serif;
    color: #00838f;
    margin: 0 0 15px 0;
    font-size: 1rem;
    flex-shrink: 0;
}

/* My Moves (左) */
.dr-moves-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.dr-move-box {
    flex: 1;
    border: 1px solid #cfd8dc;
    border-radius: 12px;
    padding: 10px;
    text-align: left;
    border-bottom-width: 4px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dr-move-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #eceff1;
    padding-bottom: 5px;
}

.dr-step-label {
    font-size: 0.6rem;
    color: #90a4ae;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dr-piece-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #37474f;
}

/* ピースの詳細ビジュアル (ミニグリッド：上部小アイコン用) */
.dr-piece-visual {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
}

.dr-mini-grid {
    display: grid;
    gap: 1px;
    background: rgba(0, 0, 0, 0.05);
    padding: 1px;
    border-radius: 2px;
}

.dr-mini-cell {
    width: 14px;
    height: 14px;
    background: transparent;
    border-radius: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
}

.dr-mini-cell.filled {
    background: #cfd8dc;
    box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.3);
}

.dr-mini-cell.filled.active.yellow {
    background: #fbc02d;
}

.dr-mini-cell.filled.active.red {
    background: #ff5252;
}

.dr-mini-cell.filled.active.green {
    background: #69f0ae;
}

/* ボード表示領域 (下部大ボード：高精度グリッド) */
.dr-board-container {
    background: #f1f5f7;
    border-radius: 12px;
    padding: 20px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dr-pseudo-grid {
    width: 320px;
    height: 320px;
    border: 2px solid #00acc1;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 229, 255, 0.1);
    background: #fff;
    display: grid;
    overflow: hidden;
    /* 外周 28px、盤面 1fr の 11x11 定義 */
    grid-template-columns: 28px repeat(9, 1fr) 28px;
    grid-template-rows: 28px repeat(9, 1fr) 28px;
}

/* 外周ヒント数字 */
.dr-edge-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 900;
    color: #00acc1;
    /* Cyan */
    text-shadow: 0 0 4px rgba(0, 172, 193, 0.3);
    pointer-events: none;
    user-select: none;
    background: rgba(0, 0, 0, 0.02);
}

/* 四隅のスペース */
.dr-edge-empty {
    background: transparent;
}

/* 本物のグリッドセル (大ボード用) */
.dr-board-cell {
    width: 100%;
    height: 100%;
    background: #fff;
    border: 0.5px solid #eceff1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #37474f;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* ピースの背景色 (数字を隠さないよう調整) */
.dr-board-cell.filled {
    background: #eceff1;
    color: #37474f;
}

.dr-board-cell.filled.yellow {
    background: #fbc02d;
}

/* 少し明るくしてコントラスト確保 */
.dr-board-cell.filled.red {
    background: #ff5252;
}

.dr-board-cell.filled.green {
    background: #69f0ae;
}

.dr-board-cell.filled.muted {
    background: #f5f7f8;
    color: #90a4ae;
    opacity: 1;
}

.dr-board-cell.hint {
    background: #fff !important;
    color: #37474f !important;
}

.dr-board-cell.hint::after {
    content: "";
    width: 6px;
    height: 6px;
    background: #37474f;
    border-radius: 50%;
    opacity: 0.3;
    position: absolute;
}

/* 大ボード用ピース境界線 (外周のヒントと同じシアン色に変更) */
.dr-board-cell.border-t {
    border-top: 1px solid #00acc1;
}

.dr-board-cell.border-b {
    border-bottom: 1px solid #00acc1;
}

.dr-board-cell.border-l {
    border-left: 1px solid #00acc1;
}

.dr-board-cell.border-r {
    border-right: 1px solid #00acc1;
}

/* ピース一覧 (中央) */
.dr-pieces-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.dr-piece-item {
    padding: 8px 12px;
    border: 1px solid #eceff1;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.dr-piece-item.active {
    border-color: #00bcd4;
    background: rgba(0, 188, 212, 0.05);
}

.dr-piece-item.active .dr-piece-id {
    color: #00838f;
}

.dr-piece-id {
    font-size: 0.8rem;
    font-weight: 700;
    color: #546e7a;
}

.dr-piece-id small {
    color: #00bcd4;
    font-size: 0.55rem;
    display: block;
}

.dr-piece-swatch {
    width: 24px;
    height: 24px;
    background: #cfd8dc;
    border-radius: 4px;
}

.dr-piece-swatch.yellow {
    background: #fbc02d;
}

/* Community Choices (右) */
.dr-tabs {
    display: flex;
    background: #eceff1;
    padding: 3px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.dr-tab {
    flex: 1;
    border: none;
    padding: 4px 0;
    background: transparent;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #78909c;
    cursor: pointer;
}

.dr-tab.active {
    background: white;
    color: #00838f;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dr-community-section {
    margin-bottom: 15px;
}

.dr-community-section:last-child {
    margin-bottom: 0;
}

.dr-section-title {
    font-size: 0.65rem;
    color: #90a4ae;
    letter-spacing: 0.05em;
    margin: 0 0 6px;
}

/* 右パネル内のスクロールエリア */
.dr-right-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 5px;
}

/* スクロールバーのカスタマイズ（細く） */
.dr-right-scroll-area::-webkit-scrollbar {
    width: 4px;
}

.dr-right-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.dr-right-scroll-area::-webkit-scrollbar-thumb {
    background: #cfd8dc;
    border-radius: 2px;
}

/* 軌跡のスタック */
.dr-prev-stack {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.dr-prev-box {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    gap: 10px;
}

.dr-prev-thumb {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

.dr-prev-thumb.yellow {
    background: #fbc02d;
}

.dr-prev-info {
    flex: 1;
}

.dr-prev-name {
    font-weight: 700;
    font-size: 0.75rem;
    color: #37474f;
}

.dr-badge {
    background: rgba(0, 188, 212, 0.1);
    color: #00bcd4;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 6px;
    white-space: nowrap;
}

.dr-selection-rate {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #00838f;
    text-align: right;
}

/* 次の手ランキング */
.dr-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dr-step-badge {
    font-size: 0.6rem;
    background: #eceff1;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 700;
    color: #546e7a;
}

.dr-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dr-ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid #eceff1;
    border-radius: 8px;
    transition: all 0.2s;
}

.dr-ranking-item.interactive {
    cursor: pointer;
}

.dr-ranking-item.interactive:hover {
    background: #f1f8e9; /* 薄い緑で選択できることをアピール */
    border-color: #8bc34a;
}

.dr-ranking-thumb {
    width: 16px;
    height: 16px;
    background: #cfd8dc;
    border-radius: 2px;
}

.dr-ranking-name {
    width: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #37474f;
}

.dr-progress-bar {
    flex: 1;
    height: 5px;
    background: #eceff1;
    border-radius: 3px;
    overflow: hidden;
}

.dr-progress-fill {
    height: 100%;
    background: #00bcd4;
    border-radius: 3px;
}

.dr-ranking-pct {
    min-width: 80px;
    text-align: right;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    color: #00838f;
}

.dr-ranking-pct small {
    font-size: 0.65rem;
    color: #90a4ae;
    margin-left: 4px;
    font-weight: 400;
}

/* プレイデータ統計テーブル (右パネル下部) */
.dr-stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
    background: #fafafa;
    border: 1px solid #eceff1;
    border-radius: 10px;
    overflow: hidden;
}

.dr-stats-table th {
    background: #f1f5f7;
    color: #78909c;
    font-weight: 700;
    padding: 6px 10px;
    text-align: left;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #eceff1;
}

.dr-stats-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eceff1;
    color: #455a64;
}

.dr-stats-table tr:last-child td {
    border-bottom: none;
}

.dr-stats-table td:first-child {
    font-weight: 700;
    color: #546e7a;
    width: 45%;
}

.dr-stats-table .val-mine {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #00838f;
    text-align: right;
    width: 27%;
}

.dr-stats-table .val-global {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #90a4ae;
    text-align: right;
    width: 28%;
}

.dr-stats-table tr:hover {
    background: #fff;
}

@media (max-width: 900px) {
    .dr-main-layout {
        grid-template-columns: 1fr;
    }

    .dr-panel.center-panel {
        display: none;
    }

    .dr-panel {
        height: auto;
        min-height: 400px;
    }
}