/**
 * カスタムデータベースツール フロントエンド用スタイル
 */

/* テーブルスタイル */
.cdt-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cdt-table th,
.cdt-table td {
    padding: 8px;
    border: 1px solid #ddd;
}

.cdt-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    text-align: left;
}

.cdt-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* リスト表示 */
.cdt-list {
    margin: 0 0 20px 0;
    padding: 0;
    list-style: none;
}

.cdt-list-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.cdt-list-item:last-child {
    border-bottom: none;
}

/* グリッド表示 */
.cdt-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 20px;
}

.cdt-grid-item {
    flex: 0 0 calc(33.333% - 20px);
    margin: 0 10px 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #eee;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .cdt-grid-item {
        flex: 0 0 calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .cdt-grid-item {
        flex: 0 0 calc(100% - 20px);
    }
}

/* カード表示 */
.cdt-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05);
}

.cdt-card-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.cdt-card-content {
    margin-bottom: 0;
}

/* 画像表示 */
.cdt-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

/* レスポンシブ対応テーブル */
@media (max-width: 767px) {
    .cdt-responsive-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
.cdt-game-tip {
    position: relative;
    border-bottom: 1px dotted currentColor;
    cursor: help;
}

.cdt-game-tip::after {
    position: absolute;
    z-index: 1000;
    left: 50%;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: min(280px, 80vw);
    padding: 8px 10px;
    border-radius: 4px;
    background: #222;
    color: #fff;
    content: attr(data-tip);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity .15s ease, transform .15s ease;
}

.cdt-game-tip:hover::after,
.cdt-game-tip:focus::after {
    opacity: 1;
    transform: translate(-50%, 0);
}
