p:empty{display: none;}  /* 空のpタグ削除 */
br:empty{display: none;}  /* 空のbrタグ削除 */

body {
  background: #18181b;
  color: #fff;
  font-family: '游ゴシック体', 'ヒラギノ角ゴ', sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.article h2 {
  font-size: 20px;
  padding: 10px;
  margin-top: 3em;
}


/* サイドメニューオーバーレイ */
#side-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9;
}


/* メニュー開閉ボタン（常に画面左上で固定） */
#menu-toggle {
    position: fixed;
    top: 36px;
    left: 24px;
    font-size: 24px;
    background: #4169e1;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    z-index: 15;  /* サイドメニューの下に */
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    transition: background 0.15s;
}
#menu-toggle:hover {
    background: #ff0000;
}
@media (max-width: 599px) {
    #menu-toggle {
        top: 24px;
    }
}

/* サイドメニュー */
#side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #252136;
    color: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,2,.6,1);
    padding: 32px 18px 24px 18px;
    z-index: 20;
    box-shadow: 2px 0 18px -6px #0006;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #7d41c9 #252136;
}
#side-menu.open {
    transform: translateX(0);
}
#side-menu.closed {
    transform: translateX(-100%);
}
#side-menu h2 {
    font-size: 19px;
    margin-top: 0;
    margin-bottom: 20px;
    color: #efd7ff;
    letter-spacing: 0.5px;
    font-weight: bold;
    text-align: left;
}

#side-menu form > div {
    margin-bottom: 18px;
}
#side-menu label {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
    color: #e0d8f5;
    font-weight: bold;
    letter-spacing: 0.2px;
}
#side-menu input[type="text"],
#side-menu select {
    width: 100%;
    font-size: 15px;
    padding: 7px 10px;
    margin-bottom: 2px;
    border: 1px solid #7d41c9;
    border-radius: 8px;
    background: #181622;
    color: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border 0.18s, box-shadow 0.18s;
}
#side-menu input[type="text"]:focus,
#side-menu select:focus {
    border: 1.5px solid #efd7ff;
    box-shadow: 0 0 4px #bb86fc;
}
.exclude-tag-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
#exclude-tag-search,
label[for="exclude-tag-search"] {
    margin-bottom: 0;
}
#side-menu button[type="submit"] {
    width: 100%;
    padding: 8px 0;
    margin-top: 8px;
    background: linear-gradient(90deg, #9c58e1 30%, #7d41c9 100%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 10px #0002;
    letter-spacing: 1px;
}
#side-menu button[type="submit"]:hover {
    background: linear-gradient(90deg, #bb86fc 30%, #7d41c9 100%);
    box-shadow: 0 4px 16px #7d41c977;
}

#side-menu #show-favorite-emotes-btn,
#side-menu #show-all-emotes-btn {
    width: 100%;
    padding: 8px 0;
    margin-top: 8px;
    background: #fff3;
    color: #fbd74e;
    font-size: 15px;
    font-weight: bold;
    border: 1.5px solid #fbd74e;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border 0.18s;
    letter-spacing: 0.5px;
}
#side-menu #show-favorite-emotes-btn:hover,
#side-menu #show-all-emotes-btn:hover {
    background: #fff6;
    color: #fff;
    border: 1.5px solid #ffd700;
}

#menu-close {
    position: absolute;
    top: 35px;
    right: 16px;
    font-size: 24px;
    background: #4169e1;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    z-index: 25;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: background 0.15s;
}
#menu-close:hover {
    background: #ff0000;
}

#side-menu input[type="text"]::placeholder {
    color: #b9b4c9;
    opacity: 1;
}

#side-menu select option {
    background: #252136;
    color: #fff;
}

#side-menu::-webkit-scrollbar {
    width: 8px;
}
#side-menu::-webkit-scrollbar-thumb {
    background: #7d41c9;
    border-radius: 4px;
}
#side-menu::-webkit-scrollbar-track {
    background: #252136;
}

/* サイドメニュー・スマホレスポンシブ */
@media (max-width: 599px) {
    #side-menu {
        width: 100vw;
        min-width: 0;
        max-width: none;
        padding: 18px 10px 22px 10px;
        font-size: 16px;
        box-shadow: none;
    }
    #side-menu h2 {
        font-size: 17px;
        margin-bottom: 12px;
    }
    #menu-close {
        top: 20px;
        right: 10px;
        width: 34px;
        height: 34px;
        font-size: 21px;
    }
}


/* その他レイアウト */
.sort-row {
    display: flex;
    white-space: nowrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    justify-content: flex-end;
    width: 100%;
    font-size: 16px;
}
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #9c58e1;
    background: #2d2a3d;
    color: #fff;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.theme-toggle-btn:hover {
    background: #9c58e1;
    border-color: #bb86fc;
    transform: translateY(-1px);
}
.sort-row label {
    margin-left: 10px;
    margin-bottom: 0;
    display: inline-block;
    vertical-align: middle;
}
.sort-row select {
    width: auto;
    border-radius: 8px;
    padding: 4px 12px;
    border: 1px solid #888;
    font-size: 16px;
    background: #2d2a3d;
    color: #fff;
}
#limit-select {
    margin-right: 0; /* 最後のselectは右余白なし */
}
@media (max-width: 599px) {
    .sort-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        justify-content: flex-start;
    }
    .sort-row label, .sort-row select {
        margin-right: 0;
        margin-bottom: 2px;
        width: 100%;
        font-size: 14px;
        display: block;
        text-align: left;
    }
    .theme-toggle-btn {
        align-self: flex-start;
        width: 36px;
        height: 36px;
    }
    .sort-row select {
        margin-bottom: 10px;
    }
}


/* エモートカード */
#emotes-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.streamer-group {
    border: 1px solid #3a3650;
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
}
.streamer-group-header {
    margin-bottom: 10px;
    border-bottom: 1px solid #2b2937;
    padding-bottom: 8px;
}
.streamer-group-main {
    display: flex;
    align-items: center;
    gap: 8px;
}
.streamer-group-meta {
    min-width: 0;
}
.streamer-group-name-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.streamer-group-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}
.streamer-followers {
    margin-top: 2px;
    font-size: 12px;
    color: #cec8e0;
}
.streamer-group-emotes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 8px;
}
.emote-card {
    font-size: 13px;
    border-radius: 12px;
    border: 1px solid #2f2a42;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    background: rgba(64, 64, 64, 0.85);
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
    transition: transform 0.15s;
    content-visibility: auto;
    contain-intrinsic-size: 132px 150px;
}
.emote-img-group {
    display: flex;
    align-items: center;
    justify-content: center;
}
.emote-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    display: block;
}
.streamer-img {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    object-fit: cover;
    border: 2px solid #9c58e1;
}
.lazy-media {
    transition: opacity 0.2s ease;
}
.filter-streamer-link {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    color: #9c58e1;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.filter-streamer-link:hover {
    text-decoration: underline wavy;
    color: #bb86fc;
}
.twitch-link {
    display: inline-flex;
    align-items: center;
}
.streamer-channel_link {
    width:16px;
    vertical-align:middle;
    transition: filter 0.15s, transform 0.15s;
    cursor: pointer;
}
.streamer-channel_link:hover {
    filter: brightness(1.3) drop-shadow(0 0 6px #9c58e1);
    transform: scale(1.18) rotate(-7deg);
    cursor: pointer;
}


/* お気に入り */
.emote-alt {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    max-width: 120px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emote-name-fav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0;
}
.zoom-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.zoom-btn-img {
    width: 20px;
    height: 20px;
    display: block;
}
.zoom-btn:hover {
    filter: brightness(1.25) drop-shadow(0 0 6px #9c58e1);
    transform: scale(1.1);
}
.tag-btn {
    width:20px;
    vertical-align:middle;
    transition: filter 0.15s, transform 0.15s;
    cursor: pointer;
}
.tag-btn-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
}
.tag-btn:hover {
    filter: brightness(1.3) drop-shadow(0 0 6px #9c58e1);
    transform: scale(1.18) rotate(-7deg);
    cursor: pointer;
}
.favorite-btn {
    position: static;
    margin-left: 0;
    font-size: 18px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    vertical-align: middle;
    padding: 0;
}
.favorite-btn:hover {
    color: #ffa500;
    filter: brightness(1.2) drop-shadow(0 0 6px #ffa500);
    transform: scale(1.18) rotate(-10deg);
    cursor: pointer;
}
.favorite-btn.fav {
    color: #ffd700;     /* お気に入り時の色 */
    transition: color 0.2s, filter 0.2s, transform 0.2s;
}
.favorite-btn.fav:hover {
    color: #222; 
    filter: brightness(1.2) drop-shadow(0 0 6px #222);
    transform: scale(1.18) rotate(-10deg);
}
@media (max-width: 599px) {
    .streamer-group-emotes {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    }
    .emote-card {
        padding: 8px 4px;
    }
}


/* タグモーダルウィンドウ */
.emote-tag-modal {
  position: fixed; left:0; top:0; width:100vw; height:100vh;
  background: rgba(0,0,0,0.45); z-index:2000; display:flex;
  justify-content: center; align-items: center;
}
.emote-tag-modal-inner {
  background: #222; border-radius:16px; min-width:320px;
  max-width:94vw; padding:24px; text-align:center; position:relative;
  box-shadow:0 6px 30px #0008;
}
.modal-close {
  position:absolute; right:12px; top:8px; font-size:32px; color:#ccc; cursor:pointer;
  background:none; border:none; padding:0; line-height:1;
}
.tag-modal-imgbox {
  margin-bottom:12px;
}
.modal-emote-img {
  width:90px; height:90px; object-fit:contain; border-radius:10px; background:#fff;
}
.tag-list {
  margin:14px 0 12px 0; display:flex; flex-wrap:wrap; gap:10px; justify-content:center;
}
.tag-chip {
  display:inline-flex; align-items:center; background:#38304e; color:#fff;
  border-radius:12px; padding:3px 10px; font-size:15px; position:relative;
}
.tag-chip .delete-tag-btn {
  margin-left:5px; background:none; border:none; color:#ff8686;
  font-size:15px; cursor:pointer; font-weight:bold;
}
.tag-modal-form {
  margin-top:10px; display:flex; gap:6px; justify-content:center;
}
#tag-modal-input {
  font-size:16px; border-radius:8px; border:1px solid #888; padding:3px 8px;
  width:140px; background:#191633; color:#fff;
}
#tag-modal-add-btn {
  background:#6c47b7; color:#fff; border:none; border-radius:8px;
  font-size:15px; padding:5px 14px; cursor:pointer;
}
#tag-modal-add-btn:hover { background:#835be7;}

.emote-zoom-modal {
  position: fixed; left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.58); z-index: 2100; display: flex;
  justify-content: center; align-items: center;
}
.emote-zoom-modal-inner {
  background: #1f1b2a; border-radius: 16px; width: min(480px, 92vw);
  max-height: 90vh; padding: 18px 18px 12px; text-align: center; position: relative;
  box-shadow: 0 10px 36px #0009;
}
.emote-zoom-modal-img {
  width: min(280px, 70vw); max-height: 70vh; object-fit: contain;
  background: #fff; border-radius: 10px; padding: 8px;
}
.emote-zoom-modal-name {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #f0ebff;
}


/* ページネーションのスタイル */
.pagination,
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 24px 0;
    flex-wrap: wrap;
}
.pagination .page-btn,
#pagination .page-btn {
    background: #2d2a3d;
    color: #fff;
    border: 1px solid #9c58e1;
    border-radius: 6px;
    padding: 4px 14px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.pagination .page-btn.active,
.pagination .page-btn:hover,
#pagination .page-btn.active,
#pagination .page-btn:hover {
    background: #9c58e1;
    color: #fff;
    border-color: #7d41c9;
}
.pagination .page-ellipsis,
#pagination .page-ellipsis {
    color: #aaa;
    padding: 0 8px;
    font-size: 16px;
    user-select: none;
}


/* ローディング画面のスタイル */
.loading-screen {
    display: none; /* 初期状態では非表示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.loading-screen.is-visible {
    display: flex;
}
/* スピナーのアニメーション */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body.theme-light {
    background: #f4f7fc;
    color: #1f2430;
}

body.theme-dark #container,
body.theme-dark #content,
body.theme-dark #content-in,
body.theme-dark #main,
body.theme-dark .entry-content {
    background: #18181b !important;
    color: #fff;
}

/*
body.theme-light #emotes-title,
body.theme-light .article h2 {
    color: #1f2430;
}
*/

body.theme-light #container,
body.theme-light #content,
body.theme-light #content-in,
body.theme-light #main,
body.theme-light .entry-content {
    background: #f4f7fc !important;
    color: #1f2430;
}

body.theme-light #side-menu {
    background: #f9fbff;
    color: #1f2430;
    box-shadow: 2px 0 18px -6px #0003;
    scrollbar-color: #9fb4e7 #f9fbff;
}
body.theme-light #side-menu h2,
body.theme-light #side-menu label {
    color: #1f2430;
}
body.theme-light #side-menu input[type="text"],
body.theme-light #side-menu select {
    background: #fff;
    color: #1f2430;
    border-color: #9fb4e7;
}
body.theme-light #side-menu select option {
    background: #fff;
    color: #1f2430;
}
body.theme-light #side-menu input[type="text"]::placeholder {
    color: #6f7685;
}
body.theme-light #side-menu button[type="submit"] {
    background: linear-gradient(90deg, #5f8cf4 30%, #4169e1 100%);
}
body.theme-light #side-menu #show-favorite-emotes-btn,
body.theme-light #side-menu #show-all-emotes-btn {
    background: #fff;
    color: #805700;
    border-color: #e0b428;
}

body.theme-light #menu-toggle,
body.theme-light #menu-close {
    background: #4169e1;
}

body.theme-light .sort-row label {
    color: #1f2430;
}
body.theme-light .sort-row select {
    background: #fff;
    color: #1f2430;
    border-color: #aab3c4;
}
body.theme-light .theme-toggle-btn {
    background: #fff;
    color: #1f2430;
    border-color: #aab3c4;
}
body.theme-light .theme-toggle-btn:hover {
    background: #e9eefb;
    border-color: #7d92c9;
}

body.theme-light .streamer-group {
    border-color: #d3dceb;
    background: #fff;
}
body.theme-light .streamer-group-header {
    border-bottom-color: #dfe6f2;
}
body.theme-light .streamer-followers {
    color: #4f607d;
}
body.theme-light .emote-card {
    background: #f8faff;
    border-color: #d6deee;
    box-shadow: 0 1px 2px rgba(24, 34, 60, 0.08);
}
body.theme-light .emote-alt {
    color: #1f2430;
}
body.theme-light .filter-streamer-link {
    color: #325cc4;
}
body.theme-light .filter-streamer-link:hover {
    color: #2048a8;
}

body.theme-light .emote-tag-modal,
body.theme-light .emote-zoom-modal {
    background: rgba(30, 38, 54, 0.35);
}
body.theme-light .emote-tag-modal-inner,
body.theme-light .emote-zoom-modal-inner {
    background: #ffffff;
    color: #1f2430;
    box-shadow: 0 10px 30px rgba(23, 33, 56, 0.2);
}
body.theme-light .modal-close {
    color: #5a6476;
}
body.theme-light .tag-chip {
    background: #e8edf9;
    color: #1f2430;
}
body.theme-light #tag-modal-input {
    background: #fff;
    color: #1f2430;
    border-color: #aab3c4;
}
body.theme-light #tag-modal-add-btn {
    background: #4169e1;
}
body.theme-light .emote-zoom-modal-name {
    color: #1f2430;
}

body.theme-light .pagination .page-btn,
body.theme-light #pagination .page-btn {
    background: #fff;
    color: #1f2430;
    border-color: #aab3c4;
}
body.theme-light .pagination .page-btn.active,
body.theme-light .pagination .page-btn:hover,
body.theme-light #pagination .page-btn.active,
body.theme-light #pagination .page-btn:hover {
    background: #4169e1;
    color: #fff;
    border-color: #3559bf;
}
body.theme-light .pagination .page-ellipsis,
body.theme-light #pagination .page-ellipsis {
    color: #5a6476;
}

body.theme-light .loading-screen {
    background: rgba(244, 247, 252, 0.85);
}
