/* 全体設定 */
:root {
    --primary-color: #4a69bd;
    --accent-color: #6c5ce7;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-sub: #636e72;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
}

.my-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.subtitle {
    margin-top: 10px;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 導入文 */
.intro {
    background: #fff3cd;
    border-left: 5px solid #ffca28;
    padding: 15px;
    margin: 20px 0 30px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #856404;
}

/* アプリグリッドレイアウト */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* カードのデザイン */
.app-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* リンク付きカード全体の基本設定 */
.app-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 20px;
}

.app-card h3 {
    margin: 0 0 10px;
    color: var(--primary-color);
    font-size: 1.1rem;
    border-bottom: 2px solid #f1f2f6;
    padding-bottom: 8px;
}

.app-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-sub);
}

/* 特定のカードへのアクセント（Discordボットなど） */
.app-card.accent {
    border-top: 4px solid #00d2d3;
}

.app-card.old-site {
    background: #f1f2f6;
    opacity: 0.8;
}

/* カメラテストセクション */
.test-section {
    text-align: center;
    margin-top: 40px;
    padding: 30px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.video-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

#video {
    width: 100%;
    height: auto;
    display: block;
}

.A_btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-block;
}

.A_btn:hover {
    background-color: var(--accent-color);
}

/* フッター */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-sub);
    font-size: 0.8rem;
}

/* スマホ対応 */
@media (max-width: 600px) {
    .app-grid {
        grid-template-columns: 1fr;
    }

    header {
        padding: 30px 15px;
    }
}

/* 停止時の赤色 */
.A_btn.btn-active {
    background-color: #dc3545 !important;
}

/* --------------------------------------------------
   追加：因数分解カードなどの「複数ボタン」対応
   -------------------------------------------------- */

/* カード内の余白をボタン用に調整 */
.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* ボタンを並べるエリア */
.card-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* 独立した小さなボタンのデザイン */
.sub-btn {
    flex: 1;
    text-align: center;
    padding: 10px 5px !important;
    /* カード全体のリンクと干渉しないよう上書き */
    font-size: 0.85rem !important;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    background-color: #f1f2f6;
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color);
    transition: all 0.2s;
}

/* ゲーム版（右側のボタン）は色を変えて目立たせる */
.sub-btn.game {
    background-color: var(--primary-color);
    color: white !important;
}

.sub-btn:hover {
    opacity: 0.8;
    transform: scale(1.02);
}