body {
    height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    background-color: #b9b9b9;
}

/* ヘッダーの調整 (2枚目優先) */
.header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    top: 0;
    width: 100%;
    background-color: #090909;
    position: relative;
    box-sizing: border-box;
    z-index: 500;
}

.header-top {
    position: fixed; /* 1枚目の後半を採用、stickyは上書き */
    display: flex;
    justify-content: center; /* 2枚目 */
    align-items: center;
    background-color: #090909;
    width: 100%;
    z-index: 500;
    top: 0;
}

.header h2 {
    margin: 0; /* 2枚目 */
    z-index: 1000;
    line-height: 41px; /* 2枚目 */
}

.header p {
    margin: 20px 0 0 0; /* 1枚目 */
    padding: 40px 0 10px 0; /* 1枚目 */
    color: #ff0;
    font-size: 12px;
}

h2 {
    color: #ff0;
}

h2 + p {
    color: #ff0;
    font-size: 12px;
}

/* その他のスタイル */
.highlight { color: red; }
.highlightbite { color: yellow; }
.highlightzero { color: blue; }
.red { color: red; }
.big { font-size: 1.2em; }
#oni-mode-trigger {
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-shadow: inherit;
    cursor: pointer;
    transform-origin: center;
    animation: star-spin 10s ease-in-out infinite;
}

.header .logo {
    font-family: 'Yuji Syuku', 'Yu Mincho', serif;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

@keyframes star-spin {
    0%, 90% { transform: perspective(160px) rotateY(0deg); }
    100% { transform: perspective(160px) rotateY(360deg); }
}

.logo-flip {
    position: relative;
    display: inline-block;
    transform-style: preserve-3d;
    animation: star-spin 10s ease-in-out -5s infinite;
}

.logo-flip-front,
.logo-flip-back {
    display: inline-block;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.logo-flip-back {
    position: absolute;
    inset: 0;
    text-align: center;
    transform: rotateY(180deg);
}

@media (prefers-reduced-motion: reduce) {
    #oni-mode-trigger,
    .logo-flip { animation: none; }
}

#oni-mode-trigger:focus-visible {
    outline: 2px solid #ff0;
    outline-offset: 2px;
}

.smoke {
    position: relative;
    animation: slideShadow 1.5s linear forwards;
}

@keyframes slideShadow {
    0% { text-shadow: 0px 0 0 rgba(232, 232, 232, 0.5); }
    100% { text-shadow: 0px 1px 3px #e8e8e8e8; }
}

ul {
    margin: 0;
    padding: 0;
    max-width: auto;
    display: flex;
    text-align: center;
}

ul li {
    flex-direction: row;
    margin: 0;
    padding: auto;
    display: inline-block;
    list-style: none;
    flex-wrap: wrap;
    height: 30px;
    width: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #888;
    line-height: 2;
    font-size: 15px;
    font-weight: bold;
    background: #afafaf;
}

li:hover {
    color: rgb(255, 255, 0);
    display: block;
    text-decoration: none;
}

li a {
    color: rgb(0, 0, 0);
    display: block;
    text-decoration: none;
}

li a:hover {
    color: rgb(255, 255, 0);
    display: block;
    text-decoration: none;
}

nav {
    position: sticky;
    top: 41px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

#restart-btn{
    position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#reloadButton{
  z-index: 500;
}

.game-actions {
    max-width: 520px;
    padding: 10px 12px 4px;
    box-sizing: border-box;
}

.game-actions ul {
    gap: 10px;
}

.game-actions li {
    display: block;
    flex: 1;
    min-width: 0;
    height: auto;
    overflow: visible;
    border: 0;
    background: none;
}

.game-actions .action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    box-sizing: border-box;
    border: 1px solid;
    border-radius: 10px;
    font: 700 14px Arial, sans-serif;
    letter-spacing: 0.03em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 1px 0 #ffffff30, 0 3px 0 #062b20, 0 5px 10px #001b2440;
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.game-actions .action-share {
    color: #fff;
    border-color: #51bd78;
    background: linear-gradient(165deg, #199a50, #086738);
}

.game-actions .action-new {
    color: #32220b;
    border-color: #f0d397;
    background: linear-gradient(165deg, #ffe6ad, #c79a48);
}

.action-btn i {
    font-size: 23px;
    line-height: 1;
}

.game-actions .action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.game-actions .action-btn:active {
    transform: translateY(2px);
    box-shadow: inset 0 1px 4px #0003;
}

.game-actions .action-btn:focus-visible {
    outline: 2px solid #fff3c6;
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .game-actions .action-btn { transition: none; }
}


.container {
    height: 100%;
}

.main-area {
    /* ラシャの細かな毛羽と織り目に、照明の柔らかな明暗を重ねる。 */
    background-color: #207a50;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='felt'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cpath fill='%23fff' opacity='.12' filter='url(%23felt)' d='M0 0h180v180H0z'/%3E%3C/svg%3E"),
        repeating-linear-gradient(35deg, rgba(207, 240, 202, 0.025) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(125deg, rgba(0, 26, 18, 0.045) 0 1px, transparent 1px 4px),
        radial-gradient(ellipse at 45% 20%, rgba(116, 193, 127, 0.32), transparent 70%),
        linear-gradient(110deg, #15563b, #288b59 48%, #1b6745);
    background-size: 180px 180px, auto, auto, auto, auto;
    box-shadow: inset 0 0 65px rgba(0, 24, 17, 0.25);
    flex: 1;
    margin: 0 auto;
    max-width: 100%;
    height: 100%;
    text-align: center;
}


.board-back {
    position: relative;
    isolation: isolate;
    background-color: #650f25;
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 222, 194, 0.035) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(26, 0, 9, 0.09) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse at 45% 15%, rgba(226, 105, 113, 0.28), transparent 65%),
        radial-gradient(ellipse at center, transparent 30%, rgba(29, 0, 12, 0.65) 100%),
        linear-gradient(115deg, #4c0a20, #921f3c 45%, #620f28);
    box-shadow:
        inset 0 1px 0 #e0bd78,
        inset 0 -1px 0 #b58a4b,
        inset 0 8px 18px rgba(29, 0, 10, 0.45),
        inset 0 -8px 18px rgba(29, 0, 10, 0.45),
        0 5px 12px rgba(32, 0, 10, 0.3);
    grid-template-columns: repeat(6, 1fr);
}

/* 金糸の縁取り。カード操作を妨げない装飾レイヤー。 */
.board-back::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(225, 186, 112, 0.65);
    outline: 1px solid rgba(225, 186, 112, 0.2);
    outline-offset: 2px;
    pointer-events: none;
    z-index: -1;
}

.board-back .card-inner {
    box-shadow: 0 3px 5px rgba(25, 0, 8, 0.38);
}

/* カード全体 */
.card {
    cursor: default; /* 初期状態では通常のカーソル */
    border-radius: 8px;
    width: 48px;
    max-width: 100%;
    height: 62px;
    max-height: 100%;
    perspective: 100px;
    /* 3D空間の奥行き */
    display: inline-block;
    margin: 5px;
}

/* クリック可能なカード */
.card:not(.flipped):not(.matched) {
    cursor: pointer; /* クリック可能なカードはポインター */
}

/* カードの中身 */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    /* 3D空間内で子要素を保持 */
    transition: transform 0.6s;
    /* アニメーション */
    transform: rotateY(180deg);
    /* 初期状態で裏面を表示 */
}

/* カードの表面・裏面の共通設定 */
.card-front,
.card-back {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    /* 裏面が見えないようにする */
    display: flex;
    border: solid 1px #999;
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
}

/* 表面 */
.card-front {
    background-color: #f0f0f0;
    color: #000;
    transform: rotateY(0deg);
    /* 表面はそのまま */
}

.card-front.matched {
    background-color: #ffed48; /* 例: 黄色っぽい色 */
    font-weight: normal;
}

/* 裏面 */
.card-back {
    background-image: linear-gradient(135deg, #ffc107 25%, transparent 25%), linear-gradient(225deg, #ffc107 25%, transparent 25%), linear-gradient(45deg, #ffc107 25%, transparent 25%), linear-gradient(315deg, #ffc107 25%, #ffe9a7 25%);
    background-position: 0px 0, 0px 0, 0 0, 0 0;
    background-size: 12px 14px;
    background-repeat: repeat;
    transform: rotateY(180deg);
    /* 裏面は180度回転している */
}

/* クリック時に裏返す */
.card.flipped .card-inner {
    transform: rotateY(0deg);
    /* 表面を表示 */
}


/* フリップ時に色を変更する */
.card.flipped {
    background-color: #2a2a2a45;
}

.card.matched {
    pointer-events: none;
}

#restart-btn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#restart-btn:hover {
    font-weight: bold;
    background-color: #2ecc71;
}

.info-window{
    margin: 0 auto;
    width: 300px;
    border: 2px solid #f5f5f5;
    border-radius: 4px;
}

.turn-and-time {
    font-size: 15px;
    line-height: 2;
    color: #ff0;
    font-weight: bold;
    text-align: center;
    height: 30px;

    background-color: #191919;
    margin: 0 auto;
}

#message-box {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    height: 30px;
    background-color: #191919;
    margin: 0 auto;
}

.correct {
    color: red;
}

.incorrect {
    color: rgb(0, 230, 251);
}


footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #000;
    text-align: center;
    z-index: 0;
}

footer p {
    color: #fff;
    font-size: 10px;
    font-weight: bold;
}

/* 広告欄のスタイル */
.ad-section {
    border-top: 1px solid #ffffff;
    padding: 10px;
    text-align: center;
    background: #000000;
}

.ad-section p {
    margin: 0;
    font-size: 12px;
    font-weight: bold;
    color: hsl(0, 0%, 19%);
}

/* 難易度選択ボタン */
.difficulty-select {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 5px 0;
}

.diff-btn {
    padding: 8px 16px;
    font-size: 15px;
    font-weight: bold;
    background-color: #333;
    color: #ff0;
    border: 2px solid #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.diff-btn:hover {
    background-color: #555;
}

.diff-btn.active {
    background-color: #ff0;
    color: #000;
    border-color: #ff0;
}

/* プルダウン版 難易度選択 */
.diff-select {
    padding: 10px 16px;
    font-size: 15px;
    font-weight: bold;
    background-color: #333;
    color: #ff0;
    border: 2px solid #666;
    border-radius: 6px;
    cursor: pointer;
    width: 280px;                    /* ボタン3つ分の横幅に近いサイズ */
    appearance: none;                /* デフォルト矢印を消す */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ff0' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.diff-select:hover {
    background-color: #555;
    border-color: #ff0;
}

.diff-select:focus {
    outline: none;
    border-color: #ff0;
    box-shadow: 0 0 0 3px rgba(255, 255, 0, 0.3);
}

/* optionのスタイル（一部ブラウザで効く） */
.diff-select option {
    background-color: #222;
    color: #ff0;
    padding: 10px;
}

/* メニュー本体 */
.extra-content {
    position: absolute;
    top: 40px;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    display: none;
    z-index: 1000;
    display: flex;
    flex-direction: column; /* ←一旦そのまま */
    align-items: stretch;
}

.extra-content button {
    white-space: nowrap;   /* 改行させない */
    padding: 8px 12px;
}

/* チェックONで表示 */

.extra-menu {
    position: absolute;
    top: 10px;
    right: 0;
    margin: 6px 12px 0 0;
    z-index: 2000;
}

.extra-content button {
    flex: 1;
    padding: 8px;
}


/* =============== ゲームボード =============== */


#game-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
}


#game-board {
    text-align: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
    margin: 0 auto;
    width: fit-content;
    max-width: 100%;
}

/* =============== カード本体 =============== */
#game-board.oni-mode {
    grid-template-columns: repeat(26, minmax(0, 1fr)) !important;
    gap: clamp(3px, 1vw, 8px) 0 !important;
    width: min(728px, calc(100% - 24px));
    padding-bottom: 60px !important;
}

#game-board.oni-mode .card {
    justify-self: center;
    width: 86% !important;
    height: auto !important;
    aspect-ratio: 48 / 62;
    min-width: 0;
}

#game-board.oni-mode .card-front,
#game-board.oni-mode .card-back {
    font-size: clamp(8px, 1.6vw, 12px);
    line-height: 1.1;
    overflow-wrap: anywhere;
    border-radius: clamp(3px, 1vw, 8px);
}

.sub-tabs {
    flex-wrap: wrap;
}

.card {
    width: 48px !important;          /* 統一サイズ */
    height: 62px !important;         /* 縦横比を少し調整（見やすく） */
    margin: 0 !important;
    box-sizing: border-box;
    perspective: 100px;
}

/* カード内要素 */
.card-inner,
.card-front,
.card-back {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* ==================== ランキングモーダル ==================== */
.ranking-modal {
    max-width: 420px;
    margin: 5% auto;
    padding: 20px;
    background: #1e1e1e;
    color: #fff;
    border-radius: 12px;
    position: relative;
}

.main-tabs {
    display: flex;
    margin-bottom: 12px;
    border-bottom: 2px solid #444;
}

.main-tab {
    flex: 1;
    padding: 12px;
    background: #2a2a2a;
    color: #ccc;
    border: none;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.main-tab.active {
    background: #ff0;
    color: #000;
}

.sub-tabs {
    display: flex;
    gap: 6px;
    margin: 15px 0;
}

.sub-tab {
    flex: 1;
    padding: 10px;
    background: #333;
    color: #ff0;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.sub-tab.active {
    background: #ff0;
    color: #000;
    border-color: #ff0;
}

.ranking-area {
    min-height: 320px;
    max-height: 420px;
    overflow-y: auto;
    background: #111;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.ranking-table th {
    background: #222;
    color: #ff0;
}

.ranking-table tr:hover {
    background: #222;
}

.name-change-area {
    margin-top: 15px;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 8px;
    text-align: center;
}

.name-change-area input {
    width: 70%;
    padding: 10px;
    margin: 10px 0;
    background: #333;
    color: #fff;
    border: 1px solid #666;
    border-radius: 6px;
}

.close-bottom-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #555;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
}

/* ==================== 名前変更専用モーダル ==================== */
.name-modal {
    max-width: 380px;
    width: 90%;
    padding: 30px 25px;
    background: linear-gradient(#2a2a2a, #1e1e1e);
    color: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.name-modal h2 {
    text-align: center;
    margin: 0 0 25px 0;
    color: #ff0;
    font-size: 24px;
}

.name-modal p {
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #ddd;
}

#name-modal-input {
    width: 100% !important;         /* はみ出し防止 */
    max-width: 100%;
    padding: 16px 14px;
    font-size: 18px;
    background: #333;
    color: #fff;
    border: 2px solid #ff0;
    border-radius: 10px;
    margin: 15px 0 25px 0;
    box-sizing: border-box;
}

#name-modal-input:focus {
    outline: none;
    border-color: #ffff00;
    box-shadow: 0 0 0 4px rgba(255, 255, 0, 0.2);
}

.name-modal-buttons {
    display: flex;
    gap: 12px;
}

.name-modal-buttons button {
    flex: 1;
    padding: 14px;
    font-size: 17px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
}

.name-modal-buttons button:first-child {
    background: #ff0;
    color: #000;
}

.cancel-btn {
    background: #555;
    color: #fff;
}

/* 広告エリアも綺麗に */
.ad-space {
    margin-top: 25px;
    padding: 20px;
    background: #111;
    border: 1px dashed #444;
    border-radius: 10px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
}

/* ==================== ハンバーガーメニュー 最終調整版 ==================== */

/* ==================== メニュー本体（右スライドイン） ==================== */
.extra-content {
    position: absolute;
    top: 54px;
    right: -16px;
    width: 180px;
    background: #1a1a1a;
    border-radius: 10px 0 0 10px;
    padding: 8px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    
    /* スライドイン設定 */
    opacity: 0;
    transform: translateX(30px);
    pointer-events: none;
}

.extra-menu.open .extra-content {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* ==================== ハンバーガーメニュー（線を元の細いグレーに戻す） ==================== */



.extra-checkbox {
    display: none;
}

.extra-icon {
    display: block;
    width: 36px;
    height: 36px;
    cursor: pointer;
    position: relative;
    border-radius: 4px;
    border: 2px solid #808080;
    background: rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
}

.extra-icon span {
    position: absolute;
    height: 2px;           /* 元の細さ */
    width: 22px;
    background: #808080;   /* 元のグレー */
    transition: all 0.3s ease;
    left: 50%;
    transform: translateX(-50%);
}

.extra-icon span:nth-child(1) { top: 8px; }
.extra-icon span:nth-child(2) { top: 16px; }
.extra-icon span:nth-child(3) { top: 24px; }

/* 開いたときのアニメーション */
.extra-menu.open .extra-icon span:nth-child(1) {
    transform: translate(-50%, 8px) rotate(45deg);
}
.extra-menu.open .extra-icon span:nth-child(2) {
    opacity: 0;
}
.extra-menu.open .extra-icon span:nth-child(3) {
    transform: translate(-50%, -8px) rotate(-45deg);
}


/* メニュー項目 */

.extra-content button {
    width: 100%;
    padding: 13px 18px;
    background: transparent;
    color: #fff;
    text-align: left;
    font-size: 15px;
    border: none;
    cursor: pointer;
}

.extra-content button:hover {
    background: #333;
}

/* ==================== Game Clear オーバーレイ（カードの上に表示） ==================== */
.clear-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;           /* 非常に高いZ-index */
}

.clear-overlay.show {
    display: flex;
}

.clear-panel {
    background: linear-gradient(180deg, #1f1f1f, #0f0f0f);
    padding: 35px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.9);
    border: 4px solid #ff0;
    max-width: 85%;
    min-width: 320px;
}

.clear-message {
    color: #f11;
    font-size: 26px;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 25px;
    min-height: 90px;
}

.clear-message .best {
    color: #ff0;
    font-size: 32px;
}

.restart-btn-overlay {
    padding: 16px 50px;
    font-size: 18px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 6px 15px rgba(0,0,0,0.5);
}

.restart-btn-overlay:hover {
    background: #2ecc71;
    transform: scale(1.02);
}


.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    z-index: 1050;
  }

  
  #modalContent {
    width: 100%;
  }
  
  .closeBtn{
    margin: 60px auto 30px;
    text-align: center;
  }

.modal-content {
    position: absolute;
    top: 88px;                    /* ← 上から88px固定 */
    left: 50%;
    transform: translateX(-50%);  /* 水平中央のみ */
    max-width: 460px;
    width: 92%;
    max-height: calc(100vh - 120px);   /* 下に余白を確保 */
    overflow-y: auto;
    margin: 0;
    border-radius: 16px;
}

/* ランキングモーダル用 */
.ranking-modal {
    max-width: 460px;
    width: 92%;
}

/* 名前変更モーダル用 */
.name-modal {
    max-width: 380px;
    width: 90%;
}

/* Xシェアボタン */
.share-x-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 320px;
    margin: 15px auto 10px;
    padding: 14px 20px;
    background: #000;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.share-x-btn:hover {
    background: #1d9bf0;
    border-color: #1d9bf0;
    transform: scale(1.05);
}

.share-x-btn span {
    font-size: 20px;
}

/* ==================== 更新バッジの位置修正 ==================== */
#update-badge {
    position: absolute;
    top: 15px;
    right: 30px;
    background: #ff0000;
    color: white;
    font-size: 13px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ping 2s infinite;
    box-shadow: 0 0 0 3px rgba(255,0,0,0.5);
    z-index: 3100;           /* ハンバーガーメニューより前面 */
    pointer-events: none;
}

/* .hidden 単体より #update-badge の詳細度が高いため、非表示は別ルールで上書きする */
#update-badge.hidden {
    display: none;
}

@keyframes ping {
    75%, 100% { transform: scale(2.2); opacity: 0; }
}

/* ランキングモーダルを開いているときも位置が崩れないように */
#update-menu-btn {
    position: relative;
}
