/* ===========================================================
   基本スタイル
=========================================================== */
body {
    font-family: "Yu Gothic", sans-serif;
    background: #f5f7fa;
    margin: 0;
    padding: 0;
    text-align: center;
    color: #222;
}

/* ===========================================================
   タブメニュー
=========================================================== */
.tab-container {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    gap: 8px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 25px;
    cursor: pointer;
    background: #e2e8f0;
    border-radius: 6px 6px 0 0;
    font-weight: bold;
    border: 1px solid #cbd5e1;
}
.tab.active {
    background: #ffffff;
    border-bottom: none;
}

/* ===========================================================
   タブ内容
=========================================================== */
.tab-content {
    display: none;
    background: #ffffff;
    width: 80%;
    margin: 0 auto;
    border: 1px solid #cbd5e1;
    border-radius: 0 0 10px 10px;
    padding: 25px 0 40px 0;
    margin-bottom: 40px;
}
.tab-content.active {
    display: block;
}

/* ===========================================================
   カード（テーマ表示）
=========================================================== */
#card {
    display: inline-block;
    background: #b7e4f9;
    padding: 25px 50px;
    border-radius: 12px;
    font-size: 32px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.6s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    word-break: break-word;
}

#generateBtn {
    padding: 12px 25px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    background: #2d8fd0;
    color: white;
    border: none;
}

/* ===========================================================
   編集画面（形容詞・名詞・ルール）
=========================================================== */
.edit-section {
    margin-top: 20px;
}

.list-box {
    background: #f1f5f9;
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
    width: 40%;
    vertical-align: top;
    margin: 10px;
}

.list-box.wide {
    width: 85%;
}

.list-box h3 {
    margin: 0;
    font-size: 18px;
    border-bottom: 2px solid #2d8fd0;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.add-form {
    margin-top: 20px;
}

.add-form input {
    padding: 6px;
    font-size: 14px;
    margin-right: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.add-btn {
    padding: 7px 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.add-btn.warning {
    background: #f97316;
}
.add-btn.primary {
    background: #3b82f6;
}

.button-area {
    margin-top: 40px;
}

/* ===========================================================
   ルール表示（生成タブ側）
=========================================================== */
.rule-display {
    width: 75%;
    margin: 60px auto 0 auto;
    text-align: left;
    background: white;
    border-radius: 12px;
    padding: 25px 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    line-height: 1.8;
}

.rule-display h3 {
    margin-top: 0;
    font-size: 20px;
    border-bottom: 2px solid #2d8fd0;
    padding-bottom: 6px;
    margin-bottom: 15px;
}

/* ===========================================================
   タイマー（PC表示がベース）
=========================================================== */
.timer {
    position: fixed;
    top: 85px;
    right: 20px;
    background: #ffffff;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 999;
    width: 180px;
    text-align: center;
    font-size: 13px;
}

.timer-mini {
    display: none;
    align-items: center;
    gap: 6px;
}
.timer-mini button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.timer-panel {
    margin-top: 4px;
}

.timer-title {
    font-weight: bold;
}

.timer-display {
    font-size: 22px;
    font-weight: bold;
    margin-top: 8px;
}

.timer-buttons {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    justify-content: center;
}

.timer-start {
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
}

.timer-stop {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
}

.timer-close {
    background: #6b7280;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
}

/* ===========================================================
   ダークモード
=========================================================== */
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 20px;
    font-size: 26px;
    cursor: pointer;
    user-select: none;
    z-index: 1000;
}

body.dark-mode {
    background: #1e1e1e;
    color: #e5e5e5;
}

body.dark-mode .tab {
    background: #3a3a3a;
    color: #e5e5e5;
    border-color: #555;
}
body.dark-mode .tab.active {
    background: #1e1e1e;
    border-bottom: none;
}

body.dark-mode #card {
    background: #4a6fa5;
    color: #ffffff;
}

body.dark-mode .list-box {
    background: #2d2d2d;
    color: #e5e5e5;
    border: 1px solid #444;
}

body.dark-mode .rule-display {
    background: #2d2d2d !important;
    color: #e5e5e5;
}

/* ===========================================================
   スマホ対応
=========================================================== */
@media (max-width: 480px) {

    .tab-content {
        width: 95%;
        padding: 20px 5px 35px 5px;
    }

    #card {
        font-size: 24px;
        padding: 18px 25px;
        width: 80%;
    }

    .list-box {
        width: 90%;
        margin: 10px auto;
        display: block;
    }

    /* タイマー最小化 */
    #timerFloating {
        top: 10px;
        left: 10px;
        right: auto;
        width: auto;
        padding: 6px 8px;
        font-size: 12px;
    }

    .timer-mini {
        display: flex;
    }

    .timer-panel {
        display: none;
        position: absolute;
        top: 36px;
        left: 0;
        background: #ffffff;
        border-radius: 10px;
        padding: 8px 10px;
        width: 180px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    }

    #timerFloating.open .timer-panel {
        display: block;
    }
}
