/* =====================================
   FlashCard App：全体デザイン
===================================== */
#flashcard-app {
    max-width: 480px;
    margin: 30px auto;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0px 4px 16px rgba(0,0,0,0.1);
    font-family: "Segoe UI", "Roboto", sans-serif;
    box-sizing: border-box;
    min-height: 700px;
}

#flashcard-app > * {
    box-sizing: border-box;
}



/* =====================================
   入力フォーム
===================================== */
#flashcard-app input:not(.ql-editor),
#flashcard-app textarea {
    /*width: 100%;*/
    padding: 12px 14px;
    margin: 10px 0;
    border: 1px solid #ccc;
    font-size: 15px;
    transition: 0.2s;
}

#flashcard-app input:focus,
#flashcard-app textarea:focus {
    border-color: #0078ff;
    box-shadow: 0 0 0 3px rgba(0,120,255,0.2);
    outline: none;
}

/* =====================================
   ボタン（アプリ専用）
===================================== */
#flashcard-app button:not(.ql-toolbar button) {
    /*width: 100%;*/
    padding: 8px;
    margin: 12px 0;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    background: linear-gradient(135deg, #007bff, #0056d2);
    color: white;
    cursor: pointer;
    transition: 0.2s;
}


#flashcard-app button:not(.ql-toolbar button):hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#flashcard-app button:not(.ql-toolbar button):active {
    transform: translateY(1px);
}

/* 種類別ボタン */
#flashcard-app .learnBtn[data-type="good"] {
    background: #2ecc71;
}

#flashcard-app .learnBtn[data-type="normal"] {
    background: #f1c40f;
    color: #333;
}

#flashcard-app .learnBtn[data-type="bad"] {
    background: #e74c3c;
}

/* Hints ボタン専用デザイン */
.hint-btn {
    background: #444 !important;   /* 黒っぽい色 */
    color: #fff !important;         /* 文字は白 */
    border-radius: 8px;             /* 角丸 */
    padding: 12px 0;                /* 高さ揃え */
    font-size: 15px;
    border: none;
    width: 100%;                    /* 他のボタンと揃える */
    cursor: pointer;
    transition: 0.2s;
}

/* Hover 時の色 */
.hint-btn:hover {
    background: #333 !important;
}

/* Active(押した瞬間) */
.hint-btn:active {
    background: #000 !important;
}


/* =====================================
   ヘッダー
===================================== */
#flashcard-app h2 {
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 22px;
    color: #333;
    font-weight: 600;
}

/* =====================================
   モード切り替え
===================================== */
#flashcard-app .mode-buttons button:not(.ql-toolbar button) {
    background: #444;
}
.mode-buttons {
  display: none;
}
/* 学習画面関連 */
#screenRegister,
#screenList,
#screenLearn,
#learnStartScreen {
  display: none;
}

/* =====================================
   カード一覧
===================================== */
#flashcard-app ul {
    list-style: none;
    padding: 0;
}

#flashcard-app ul li {
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #dedede;
    margin: 16px 0;
}

/* ▼ Q/A/Hint ブロック */
#flashcard-app .card-block {
    margin-bottom: 14px;
}

#flashcard-app .card-block .label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#flashcard-app .card-block .value {
    background: #f8f9fb;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
}

#flashcard-app .card-block .hint-value {
    background: #fff8e6;
}

.value p{
	margin-bottom:10px !important;
}



/* 一覧全体 */
.card-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

/* 1行 */
#flashcard-app ul.card-list > li.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px 4px;
  margin: 0;
  border: none;
  border-bottom: 1px solid #e5e5e5;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
}

/* カード一覧の行 */
#flashcard-app ul.card-list > li.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px 4px;
  border-bottom: 1px solid #e5e5e5;
  background: transparent;
}

/* カード一覧：行の上下間隔を詰める */
#flashcard-app ul.card-list > li.card-row {
  padding-top: 6px;
  padding-bottom: 6px;
  margin: 0;
}

/* li に当たっている共通スタイルを無効化 */
#flashcard-app ul.card-list > li.card-row {
  border-radius: 0;
  background: transparent;
}

/* 区切り線だけ残す */
#flashcard-app ul.card-list > li.card-row:not(:last-child) {
  border-bottom: 1px solid #e5e5e5;
}

#flashcard-app ul.card-list > li.card-row {
  padding: 4px 2px;
  font-size: 14px;
}


/* 右側アクション */
#flashcard-app ul.card-list .card-actions {
  display: flex;
  gap: 16px;
}

/* ★ 編集・削除ボタンを「通常ボタン」から完全に切り離す */
#flashcard-app ul.card-list .card-actions button {
  width: auto;
  padding: 0;
  margin: 0;

  background: none;
  border: none;
  border-radius: 0;

  font-size: 14px;
  font-weight: normal;
  color: #555;

  cursor: pointer;
  box-shadow: none;
}

/* hover はテキストリンク風 */
#flashcard-app ul.card-list .card-actions button:hover {
  text-decoration: underline;
}

/* 削除だけ少し薄く or 赤く */
#flashcard-app ul.card-list .card-actions .deleteBtn {
  color: #999;
}



/* 問題文 */
.card-question {
  flex: 1;
  color: #333;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右側アクション */
.card-actions {
  display: flex;
  gap: 16px;
}

/* 編集・削除（テキストリンク風） */
.card-actions button {
  background: none;
  border: none;
  padding: 0;

  font-size: 14px;
  cursor: pointer;
}

/* 編集 */
.card-actions .editBtn {
  color: #555;
}

/* 削除 */
.card-actions .deleteBtn {
  color: #999;
}

/* hover */
.card-actions button:hover {
  text-decoration: underline;
}





/* ▼ 編集 / 削除ボタン */
#flashcard-app .card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#flashcard-app .card-actions button {
    width: auto !important;
    padding: 0px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    background: none !important;
    color: #333 !important;
    border: 1px solid #ccc;
}

#flashcard-app .card-actions button:hover {
    background: #d5d5d5 !important;
}

#flashcard-app .card-actions .deleteBtn {
    background: none !important;
    border-color: #f5c2c7 !important;
    color: #a33 !important;
}

#flashcard-app .card-actions .deleteBtn:hover {
    background: #f1bfc4 !important;
}

/* =====================================
   学習モード
===================================== */
#flashcard-app .learn-question {
    /*background: #f0f7ff;
    padding: 16px;
    border-radius: 12px;
    font-size: 20px;
    margin: 20px 0;
    border-left: 4px solid #0078ff;*/
}

#flashcard-app .learn-answer {
    /*background: #eafaf1;
    padding: 16px;
    border-radius: 12px;
    font-size: 18px;
    margin: 20px 0;
    border-left: 4px solid #2ecc71;
    display: none;*/
    margin-bottom: 30px;
    margin-top: 10px;
}

#flashcard-app .hint-toggle {
    margin: 10px 0;
}

#flashcard-app .learn-hint {
    background: #fff8e6;
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #f1c40f;
    margin: 15px 0;
    font-size: 16px;
}

/* 発音記号のデザイン */
#flashcard-app .learn-phonetic {
    text-align: center;
    margin-top: 8px;
    font-size: 18px;
    color: #555;
    cursor: pointer;
    user-select: none;
    opacity: 0.8;
    transition: 0.2s;
}

#flashcard-app .learn-phonetic:hover {
    opacity: 1;
    color: #000;
}

.sound-icon {
  cursor: pointer;
}
.sound-icon:hover {
  opacity: 0.7;
}

.learn-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.learn-edit-btn {
    font-size: 14px !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    border: none !important;
    background: none !important;
    cursor: pointer !important;
    width: 100px !important;
    color: #4b4a4a !important;
}
.learn-edit-btn:hover {
  background: none !important;
  box-shadow: none !important;
}

/* 学習モード：カウントダウン */
.learn-timer {
  position: absolute;
  /*top: 12px;*/
  right: 8px;

  width: 32px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  /*font-weight: bold;*/
  color: #888;

  background: #fff;
  border-radius: 50%;
}

.learn-panel {
  position: relative;
}

/* learnCard を基準にする */
#learnCard {
  position: relative;
}

/* ヒントボタン */
#hintBtn {
    position: absolute;
    right: 48px;
    z-index: 2;
    width: 70px !important;
    height: 32px !important;
    border-radius: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* Answer 初期状態 */
#learnAnswer {
  cursor: pointer;
  position: relative;
}

/* プレースホルダ */
.answer-placeholder {
  color: #999;
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

/* 回答本文（初期は非表示） */
.answer-content {
  display: none;
  white-space: pre-wrap;
}

/* 表示後 */
#learnAnswer.is-visible .answer-placeholder {
  display: none;
}

#learnAnswer.is-visible .answer-content {
  display: block;
}


/* Answer パネル共通 */
#learnAnswer {
  /*min-height: 130px;*/          /* 高さを確保（重要） */
  box-sizing: border-box;
}
#learnAnswer {
  transition: opacity .2s ease;
}

#learnAnswer.is-hidden {
  display: none;
  opacity: 0;
}

#learnAnswer.is-visible {
  display: block;
  opacity: 1;
}


/* プレースホルダ表示中：上下中央 */
#learnAnswer.is-hidden {
  display: none !important;              /* ★ flex にする */
  align-items: center;        /* 上下中央 */
  justify-content: center;    /* 左右中央 */
  color: #bfbfbf;           /* 灰色 */
  /*cursor: pointer;*/
  text-align: center;
}

/* 回答表示後：通常レイアウト */
#learnAnswer.is-visible {
  display: flex !important;              /* ★ flex にする */
  align-items: center;        /* 上下中央 */
  justify-content: center;    /* 左右中央 */
  /*display: block; */            /* ★ flex を解除 */
  color: #000;
  cursor: default;
}

/* 評価ボタン無効時 */
.learnBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.2);
}


/* 学習画面の旧 Hint 表示エリアは完全に非表示にする */
#learnHint {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    visibility: hidden !important;
}


/* スライドアニメーション */
#flashcard-app .slide {
    overflow: hidden;
    height: 0;
    transition: height 0.25s ease;
}

.learn-panel {
    background: #fbf76638;
    padding: 20px;
    padding-top: 5px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    min-height: 300px;
}
.learn-panel2 {
    background: #fff;
    padding: 20px;
    padding-top: 5px;
    margin-bottom: 30px;
    min-height: 230px;
}

#quest {
	 background:#e4ed5c42;
}

.panel-title {
    font-size:14px;
    color:#666;
    margin-bottom:25px;
}

.panel-body {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
}

.panel-phonetic {
    font-size: 18px;
    margin-top: 5px;
    color: #333;
    cursor: pointer;
}

.phonetic-wrap {
    text-align: center;
}

.learn-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.learn-buttons.show { opacity: 1; }
.learn-buttons { opacity: 1; transition: .3s; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display:flex;
    align-items:center;
    justify-content:center;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-close {
    position:absolute;
    right:20px;
    top:10px;
    cursor:pointer;
    font-size: 26px;
}


/* ---------------------------------------------
   学習モード：Q（問題）のカード（シンプル上品版）
--------------------------------------------- */
#flashcard-app .learn-question {
    /*background: #ffffff;*/
    /*padding: 24px 22px;
    border-radius: 14px;*/
    font-size: 32px;
    font-weight: bold;
    /*margin: 25px 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    line-height: 1.7;
    border: 1px solid #e5e5e5;
    transition: 0.2s ease;*/
    text-align: center;
    line-height: 38px;
}

#flashcard-app .learn-question:hover {
    /*transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);*/
}

/* ---------------------------------------------
   学習モード：A（答え）のカード（シンプル上品版）
--------------------------------------------- */
#flashcard-app .learn-answer {
    /*background: #ffffff;*/
    /*padding: 24px 22px;
    border-radius: 14px;*/
    font-size: 20px;
    /*margin: 25px 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);*/
    line-height: 1.7;
    /*border: 1px solid #e5e5e5;
    display: none;*/
    transition: 0.2s ease;
    text-align: center;
    font-weight: 500;
}

#flashcard-app .learn-answer:hover {
    /*transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);*/
}




/* ============================================================
   学習モード：評価ボタン（横並びで綺麗に）
============================================================ */
#flashcard-app #learnButtons {
    /*display: none;*/ /* ← 初期は非表示 */
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 20px;
}

/* =========================================
   解答表示ボタン：無効状態
========================================= */
#revealAnswerBtn:disabled {
  opacity: 0.2;
  filter: grayscale(1);
  cursor: default;        /* ← pointer を出さない */
  pointer-events: none;   /* ← hover / click 全無効 */
}

/* hover エフェクト完全無効 */
#revealAnswerBtn:disabled:hover {
  background: inherit;
  color: inherit;
  box-shadow: none;
  transform: none;
}





#flashcard-app #learnButtons.show {
    display: grid !important; /* ← 表示するときだけ grid */
}

#flashcard-app #learnButtons .learnBtn {
    width: 100% !important;
    padding: 8px 0 !important;
    font-size: 14px !important;
    border-radius: 25px !important;
    border: none !important;
    cursor: pointer;
}

/* 色 */
#flashcard-app .learnBtn[data-type="good"]   { background:#2ecc71 !important; }
#flashcard-app .learnBtn[data-type="normal"] { background:#f1c40f !important; color:#333 !important; }
#flashcard-app .learnBtn[data-type="bad"]    { background:#e74c3c !important; }


/* ボタン横並び */
#flashcard-app .learn-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: 20px 0;
}

/* 各ボタンのサイズ統一 */
#flashcard-app .learn-buttons button {
    flex: 1;
    border-radius: 8px;
    padding: 12px 0;
}

/* Hints ボタン */
#flashcard-app .hintBtn {
    background: #555 !important;
    color: white !important;
}


/* Hints タイトルにアイコン追加 */
#hintModal .modal-header h3::before {
    content: "💡";        /* ← 好きなアイコンに変更可能 */
    /*margin-right: 8px;*/
    font-size: 20px;
    /*vertical-align: middle;*/
}

/* Hints モーダル全体 */
#hintModal .modal-content {
    padding: 24px 28px;
    font-size: 14px;          /* ← 全体文字サイズを小さめに */
    min-height: 350px;
}

/* タイトル */
#hintModal .modal-header h3 {
    font-size: 18px;          /* ← 見出しも少し控えめに */
    font-weight: 600;
}

/* 本文 */
#hintModal .modal-body {
    font-size: 14px;          /* ← 本文も大きすぎず、見やすく */
    line-height: 1.6;
}

/* 閉じる × アイコン */
#hintModal .modal-close {
    font-size: 20px;          /* ← 小さめ */
    cursor: pointer;
}

#hintModalContent p {
    margin-bottom: 10px;
}

.learn-hint.is-hidden {
  display: none;
}

.learn-hint.is-visible {
  display: block;
}

/* =====================================
   学習開始
===================================== */
.learn-start-screen {
  text-align: center;
  padding: 40px 20px;
}

.start-learn-btn {
  margin-top: 20px;
  padding: 14px 24px;
  font-size: 16px;
  border-radius: 10px;
  background: #444;
  color: #fff;
  border: none;
  cursor: pointer;
}

.start-learn-btn:hover {
  opacity: 0.9;
}


/* =====================================
   Quill エディタ
===================================== */

/* 新規登録用エディタ */
#flashcard-app #hintEditor {
    height: 200px;
    background: #fff;
    margin-bottom: 10px;
    border: 1px solid #ccc !important;
    border-radius: 10px;
    overflow: hidden;
}

/* 編集モーダル内エディタ */
#editHintEditor {
    height: 180px;
    background: #fff;
    border: 1px solid #ccc !important;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.ql-toolbar.ql-snow,
.ql-container.ql-snow {
    border: none !important;
}

.ql-editor p{
	margin-bottom:10px !important;
}



/* =====================================
   ▼▼ モーダル（完全版） ▼▼
===================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 20px;
    width: 90%;
    max-width: 480px;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    font-size: 26px;
    cursor: pointer;
    color: #666;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer .primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
}

.modal-footer .secondary {
    background: #aaa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    display: none;
}

/* モーダル専用ボタン（更新・キャンセル） */
#editModal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#editModal .modal-footer button {
    width: auto !important;
    padding: 8px 16px !important;
    margin: 0 !important;
    font-size: 13px !important;
    border-radius: 25px !important;
}

/* 更新（primary） */
#editModal .modal-footer .primary {
    background: #007bff !important;
    color: white !important;
}

/* キャンセル（secondary） */
#editModal .modal-footer .secondary {
    background: #e0e0e0 !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
}


/* =====================================================
   カード登録／カード編集 共通で input/textarea を統一
===================================================== */
#flashcard-app #screenRegister input,
#flashcard-app #screenRegister textarea,
#editModal input,
#editModal textarea {
    /*width: 100% !important;*/
    /*padding: 12px 14px !important;*/
    margin: 5px 0 !important;
    border: 1px solid #ccc !important;
    /*border-radius: 10px !important;*/
    font-size: 15px !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    color: #333 !important;
    box-sizing: border-box !important;
    transition: 0.2s !important;
    background: #fff !important;
}

/* フォーカス時の統一 */
#flashcard-app #screenRegister input:focus,
#flashcard-app #screenRegister textarea:focus,
#editModal input:focus,
#editModal textarea:focus {
    border-color: #0078ff !important;
    box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.2) !important;
    outline: none !important;
}


.answer-group {
  margin-top: 12px;
}

.answer-item input[type="text"] {
  flex: 1;
}

.answer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;              /* ★ 親をフル幅に */
}

.answer-item .answerInput {
  flex: 1 1 auto;           /* ★ 伸びる */
  width: 100%;              /* ★ 強制フル幅 */
  min-width: 0;             /* ★ flex で縮まないために必須 */
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14px;
  box-sizing: border-box;
}

#editModal .modal-body {
  display: flex;
  flex-direction: column; /* ★ 縦並びに固定 */
  gap: 12px;
}

.answer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.answer-item .answerInput {
  flex: 1;
  min-width: 0;
}


/* カード登録画面 */
#screenRegister #q,
#screenRegister #p {
  width: 100%;
}

/* 編集モーダル */
#editModal #editQ,
#editModal #editP {
  width: 100%;
  padding: 12px 14px;
  margin: 0 !important;
}

.answer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.answer-item input[type="radio"] {
  flex: 0 0 auto;
}

.answer-item .answerInput {
  flex: 1;
  min-width: 0;
}

/* ===============================
   解答入力だけスリムにする
================================ */
#flashcard-app .answer-item .answerInput {
  padding: 6px 10px !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
}

/* ===============================
   DL-store
================================ */
.deck button.installed {
  background: #aaa;
  cursor: default;
}


/* ===============================
   study 問題集
================================ */


/* ===== Deck list layout (force) ===== */
#flashcard-app #deck-list .deck-item{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  height: 40px;
}

/* 左側（名前＋件数）を1ブロックとして扱う */
#flashcard-app #deck-list .deck-name{
  display:inline-block !important;
  font-weight:600 !important;
  font-size:16px !important;
  white-space:nowrap !important;
}
#flashcard-app #deck-list .deck-meta{
  display:inline-block !important;
  margin-left:10px !important;
  font-size:16px !important;
  /*color:#666 !important;*/
  white-space:nowrap !important;
  font-weight:600 !important;
}

/* ボタンを小さく＆右寄せ（WPのbutton幅指定を打ち消す） */
#flashcard-app #deck-list .btn-study,
#flashcard-app #deck-list .btn-delete{
  /*width:auto !important;*/
  min-width:0 !important;
  padding:6px 10px !important;
  font-size:13px !important;
  line-height:1.2 !important;
  /*border-radius:8px !important;*/
  white-space:nowrap !important;
}

/* ボタンを右側に寄せる */
#flashcard-app #deck-list .btn-study{
  /*margin-left:auto !important;*/
}


span#learnStartTitle {
    font-weight: 600;
    font-size: 24px;
}


.learn-buttons {
  display: flex;         /* 常に表示 */
  opacity: 1;
  transition: opacity .2s;
}

.learn-buttons.disabled {
  opacity: 0.4;
  pointer-events: none;
}


.btn-back {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: #eee;
  color: #333;
  font-size: 14px;
  cursor: pointer;
}

.btn-back:hover {
  background: #ddd;
}


.btn-study {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #007bff, #0056d2);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-study:hover {
  opacity: 0.9;
}

.btn-study .deck-title {
  /*font-weight: bold;*/
}

.btn-study .deck-count {
  background: rgba(255,255,255,0.2);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

button#startLearnBtn {
    width: 100%;
}
button#btnRegister {
    width: 100%;
}
button#btnList {
    width: 100%;
}
button#btnLearn {
    width: 100%;
}
button#backToDeckListBtn {
    max-width: 170px;
}
button#revealAnswerBtn {
    width: 100%;
}

button.btn-delete {
    background: none !important;
    color: black !important;
}

/*
button#openSettingsBtn {
    background: none !important;
    color: black !important;
}
*/
.modal.hidden { display: none; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  min-width: 300px;
}

.setting-item {
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.is-hidden {
  /*visibility: hidden;*/
  display: none !important;
}

.is-removed {
  display: none !important;
}

/* deckListScreen を基準にする */
#deckListScreen {
  position: relative;
}

/* 設定ボタンを右上に固定 */
/*
#openSettingsBtn {
  position: absolute;
  top: -50px;
  right: -6px;
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 6px 10px;
  font-size: 13px;
  border-radius: 20px;

  background: #f5f5f5;
  border: 1px solid #ddd;
  cursor: pointer;
}
*/

/* 設定モーダル全体 */
#settingsModal .modal-content {
  background: #ffffff;
  padding: 24px 28px;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  font-size: 14px;
}

/* タイトル */
#settingsModal h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}

/* 設定項目の1行 */
#settingsModal label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 14px;
}

/* select */
#settingsModal select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  min-width: 100px;
}

/* checkbox */
#settingsModal input[type="checkbox"] {
  transform: scale(1.1);
  cursor: pointer;
}

#settingsModal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* 保存ボタン */
#settingsModal .btn-save {
  background: #1e88e5;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 25px;
  cursor: pointer;
}

#settingsModal .btn-save:hover {
  background: #1565c0;
}

#settingsModal .btn-cancel:hover {
  background: #1565c0;
}

/* 閉じるボタン */
#settingsModal .btn-cancel {
  background: #1e88e5;
  border: 1px solid #fff;
  padding: 8px 16px;
  border-radius: 25px;
  cursor: pointer;
}

#settingsModal .btn-save,
#settingsModal .btn-cancel {
  font-size: 12px !important;
}


.learn-progress {
  font-size: 12px;
  color: #666;
}

#learnProgress {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);

  font-size: 12px;
  color: #666;
  background: rgba(255,255,255,0.6);
  padding: 2px 6px;
  border-radius: 6px;
}

.register-actions {
  display: flex;
  justify-content: flex-end; /* 右寄せ */
  margin-top: 16px;
}



.deck {
    margin-bottom: 5px;
}
.deck-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  border: none;
  background: #2b78e4;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
}

.deck-btn:hover:not(:disabled) {
  background: #1f5fc4;
}

/* インストール済み状態 */
.deck-btn.installed,
.deck-btn:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

/* 通常ボタン */
button[data-deck] {
  background: #2d7df4;
  color: white;
  cursor: pointer;
  max-width: 300px;
}

/* インストール中 */
button[data-deck].installing {
  background: #aaa;
  color: #fff;
  cursor: wait;
}

/* インストール済み */
button[data-deck].installed {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.8;
}


.learn-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 6px;
  background: #f5f7fa;
  font-size: 12px;
  color: #333;
}

.learn-stats div {
  white-space: nowrap;
}


/* 学習が始まっているデッキ */
.deck-count.started {
  background: rgba(255, 200, 0, 0.9);   /* 黄色系 */
  color: #333;
}

p.deckListNote {
    font-size: 14px;
}


/* 除外されたカードの見た目 */
.card-row.excluded-card {
  background: #e5e5e5 !important;
  opacity: 0.6;
}

/* 除外カードは編集・削除不可 */
.card-row.excluded-card .card-actions {
  display: none;
}

/*
.card-row.excluded-card .card-actions {
  display: none !important;
}
*/
.card-row.excluded-card {
  background: #e5e5e5;
  opacity: 0.7;
}

.restoreBtn {
  background: #ffffff;
  border: 1px solid #888;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}

.restoreBtn:hover {
  background: #f0f0f0;
}



.hint-speak-btn {
  background: transparent;
  border: none;
  padding: 0;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #555;
}
.hint-speak-btn:hover {
  color: #2d6cdf;
}
.hint-speak-btn:active {
  color: #1f57b8;
}
.hint-speak-btn.speaking {
  color: #ff8c00;
}
.hint-speak-btn:focus {
  outline: none;
}


.ce-input {
  border: 1px solid #ccc;
  padding: 8px;
  min-height: 36px;
  /*border-radius: 4px;*/
  outline: none;
  background: #fff;
  font-size: 14px;
  line-height: 1.4;
}

.ce-input:empty:before {
  content: attr(data-placeholder);
  color: var(--placeholder-color);
  pointer-events: none;
}

div#q {
    margin: 5px 0px;
    padding: 12px 14px;
    border-radius: 0px;
}

:root {
  --placeholder-color: #aaa;
}

input::placeholder {
  color: var(--placeholder-color);
  opacity: 1;
}

.ce-input .hl {
  color: #d33;
  font-weight: bold;
}

.learn-question {
  background: none;
  color: #333;
  font-family: inherit;
  font-size: 32px;
  font-weight: bold;
  text-align: center;
}
.learn-question.clickable {
  cursor: pointer;
}

.hl {
  color: #f25c2a;
  font-weight: bold;
  background: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/*
#btnHighlightQ,
#btnHighlightEditQ {
    display: block;
    width: 100%;
    padding: 8px 16px;
    margin: 12px 0;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #007bff, #0056d2);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.05s ease;
    transform: scale(0.98);
}

#btnHighlightQ:hover,
#btnHighlightEditQ:hover {
    transform: translateY(-1px);
}

#btnHighlightQ:active,
#btnHighlightEditQ:active {
    transform: translateY(1px);
}
*/

div#editQ_ce {
    margin: 5px 0px;
    padding: 12px 14px;
    border-radius: 0px;
}

#btnHighlightQ.highlight-btn,
#btnHighlightEditQ.highlight-btn {
  width: 44px;
  /*height: 0px;*/
  padding: 0 !important;
  margin: 0 !important;
  
  border-radius: 50%;
  font-size: 14px !important;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.98);
  background:none !important;
  box-shadow: none;
}
#btnHighlightQ.highlight-btn{
  margin-bottom:10px !important;
}
#btnHighlightEditQ.highlight-btn {
  margin-bottom:0px !important;
  margin-top:-12px !important;
}
/*
#flashcard-app .highlight-btn:hover {
  transform: translateY(-1px);
}

#flashcard-app .highlight-btn:active {
  transform: translateY(1px);
}
*/

.click-hint {
  color: #aaa;
  font-size: 0.7em;
  cursor: pointer;
}

#learnQuestion {
  min-height: 76px; /* もともとの line-height と同じ値 */
}

input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


.learn-start-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;   /* ← 追加 */
  align-items: center;      /* 中央寄せ */
  gap: 12px;
}


.learn-start-actions button {
  width: 160px;
}

/* 学習設定ボタン */
#openSettingsBtn {
  background: #444 !important;            /* 黒っぽい */
  color: #fff;                 /* 文字は白 */
  border: none;
  border-radius: 25px;
  padding: 10px 20px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease;
}

/* ホバー時 */
#openSettingsBtn:hover {
  background: #000;            /* さらに濃く */
}

/* 歯車アイコン（emoji img）を白っぽく */
#openSettingsBtn img.emoji {
  filter: brightness(0) invert(1);
}

/* 学習除外ボタンのエリアを中央寄せ */
.learn-extra-buttons {
  display: flex;
  justify-content: center;
  margin-top: 60px;
}
button#btnExclude {
    min-width: 110px;
    background: #444 !important;
}

select#settingTtsVoice {
    max-width: 250px;
}


.force-speak-btn {
  position: absolute;
  right: 12px;
  bottom: 0px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #333;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 10;
  background: #fffef4 !important;
}

.force-speak-btn:hover {
  background: #000;
}

.force-speak-btn img {
  position: relative;
  top: 1px;   /* 数値を調整して好みの位置に */
}


.learn-start-version {
  margin-top: -6px;
  font-size: 14px;
  color: #666;
}

/* ================================
   Deck Info Modal
================================ */
.deck-info-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);   /* 画面を暗くする */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.deck-info-modal.is-hidden {
  display: none;
}

.deck-info-content {
  position: relative;
  background: #fff;
  padding: 20px 24px;
  border-radius: 12px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  text-align: left;
}

/* 中のテキスト装飾 */
#deckInfoTitle {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: bold;
}

#deckInfoVersion {
  margin: 0 0 6px;
  font-size: 13px;
  color: #666;
}

#deckInfoDesc {
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: #666;
}



/* ×ボタン */
.deck-info-close {
  position: absolute;
  top: 0px;
  right: 0px;
  border: none;
  background: transparent;
  font-size: 22px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  line-height: 1;
}

.deck-info-close:hover {
  color: #ddd;
  background: none;
  box-shadow: none;
}


button.deck-info-btn {
    background: none;
    box-shadow: none;
    padding: 0px;
}

button.deck-info-btn:hover {
    opacity: 0.33;
}


#deckInfoCount {
  font-size: 13px;
  margin-bottom: 6px;
  color: #444;
}

.deck-info-revisions {
  margin-top: 12px;
  font-size: 13px;
  border-top: 1px solid #eee;
  padding-top: 8px;
}
.deck-info-revisions h4{
  font-size: 14px;
}

.deck-info-revisions ul {
  padding-left: 18px;
  margin: 6px 0 0;
}

.deck-info-revisions li {
  margin-bottom: 6px;
}

.no-revision {
  color: #777;
  font-size: 12px;
}



#startLearnBtn.start-learn-btn {
  /* オレンジ系 */
  background: linear-gradient(135deg, #ff8c00, #ff4500) !important;
}


#backToDeckListBtn.btn-back {
  background: linear-gradient(135deg, #9b9ea1, #949da9) !important;
}








@media screen and (max-width: 480px) {
	/* 480px以下に適用されるCSS（スマホ用） */
	
#flashcard-app .deck-title {
  display: block;
  max-width: 100%;
  white-space: nowrap;       /* 改行しない */
  overflow: hidden;          /* はみ出しを隠す */
  text-overflow: ellipsis;   /* … を表示 */
}
#flashcard-app .btn-study {
  display: flex;
  align-items: center;
  gap: 8px;
}

#flashcard-app .deck-title {
  /*flex: 1;*/
  min-width: 0;              /* これが重要（ellipsis を効かせる） */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*
#flashcard-app .btn-study {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
}

#flashcard-app .btn-study .deck-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  font-size: 14px;
  white-space: normal;
}

#flashcard-app .btn-study .deck-count {
  align-self: flex-end;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.25);
}

#flashcard-app #deck-list .btn-study {
    height: 75px;
    border-radius: 20px !important;
}

#flashcard-app #deck-list .deck-item {
    height: 80px;
}
.deck-count.started {
    background: rgba(255, 200, 0, 0.9) !important;
    color: #333;
}
*/
}