@charset "UTF-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #606060;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    padding-top: 4.5vw;
}

/* ーーーーーーーーーーーーーーーーーー グローバルナビ (Fixed) ーーーーーーーーーーーーーーーーーー */
header.main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4vw;
    background-color: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(0.5vw);
    border-bottom: 0.25vw solid #00ccff;
    display: flex;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 0.5vw 1vw rgba(0, 0, 0, 0.5);
}

.nav-main {
    display: flex;
    list-style-type: none;
    margin-left: 1vw;
    gap: 0.5vw;
}

.nav-main li a {
    display: block;
    width: 9vw;
    height: 2.8vw;
    text-decoration: none;
    text-align: center;
    line-height: 2.8vw;
    font-size: 0.95vw;
    font-weight: bold;
    color: #ffffff;
    background-color: rgba(40, 40, 40, 0.8);
    border: 0.1vw solid rgba(255, 255, 255, 0.4);
    border-radius: 0.3vw;
    transition: all 0.2s ease;
}

.nav-main li a:hover {
    background-color: #00ccff;
    color: #000000;
    border-color: #ffffff;
    box-shadow: 0 0 0.8vw rgba(0, 204, 255, 0.8);
    transform: translateY(-0.1vw);
}

.gold-now {
    width: 11vw;
    height: 2.8vw;
    margin-right: 1.5vw;
    margin-left: auto;
    background-color: rgba(10, 10, 10, 0.9);
    border: 0.15vw solid #ffd700;
    border-radius: 0.3vw;
    color: #ffd700;
    font-weight: bold;
    font-size: 0.95vw;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 0.3vw rgba(255, 215, 0, 0.5);
}

/* ==========================================
 * 共通：戻るボタンの統一デザイン
 * ========================================== */
.btn-back-to-select, .btn-close-equip {
    background: linear-gradient(135deg, #444 0%, #222 100%);
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid #777;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-back-to-select:hover, .btn-close-equip:hover {
    background: linear-gradient(135deg, #555 0%, #333 100%);
    border-color: #00ccff;
    color: #00ccff;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 204, 255, 0.3);
}

/* ==========================================
 * 拠点・ステージセレクト画面のスタイル
 * ========================================== */
.stage-select-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #1a1a1a;
    color: #fff;
    height: 100vh;
    box-sizing: border-box;
}

.stage-select-screen h2 {
    margin-bottom: 20px;
    font-size: 22px;
    letter-spacing: 2px;
}

.select-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 500px;
}

.select-menu-grid button {
    padding: 12px;
    font-size: 15px;
    font-weight: bold;
    background-color: #333;
    color: #fff;
    border: 2px solid #555;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-menu-grid button:hover {
    background-color: #ff9800;
    border-color: #ffa726;
    color: #000;
}

/* ==========================================
 * スキル編成画面
 * ========================================== */
.skill-organize-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 10px 30px;
    background-image: url('../images/background/skill.png');
    background-size: cover;
    background-position: center;
    color: #fff;
    width: 100vw;
    height: calc(100vh - 4.5vw);
    overflow: hidden;
    box-sizing: border-box;
    position: fixed;
    top: 4.5vw;
    left: 0;
    z-index: 200;
}

.skill-organize-screen .top-nav-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 1200px;
    flex-shrink: 0;
}

.organize-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 1200px;
    flex: 1;
    min-height: 0;
    margin-bottom: 6px;
}

.skill-section-box {
    display: flex;
    gap: 12px;
    background-color: rgba(22, 22, 22, 0.94);
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #555;
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
}

.special-box { border-color: #ffb74d; }
.basic-box { border-color: #00ccff; }

.skill-section-box h3 {
    margin: 0 0 3px 0;
    font-size: 13px;
    border-bottom: 1.5px solid #444;
    padding-bottom: 2px;
    letter-spacing: 0.5px;
}

.special-box h3 { color: #ffb74d; }
.basic-box h3 { color: #00ccff; }

.skill-section-box .equipped-skills-panel {
    flex: 0.8;
    background: rgba(12, 12, 12, 0.6);
    padding: 5px;
    border-radius: 6px;
    border: 1px solid #444;
    display: flex;
    flex-direction: column;
}

.skill-section-box .owned-skills-panel {
    flex: 1.3;
    background: rgba(12, 12, 12, 0.6);
    padding: 5px;
    border-radius: 6px;
    border: 1px solid #444;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

.skill-use-count {
    font-size: 11px;
    color: #ffcc00;
    font-weight: normal;
}

.slot-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto; /* 追加：行の高さを中身のサイズに合わせる */
    align-content: start;          /* 追加：縦方向に引き伸ばさず上詰めに配置する */
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.slot-grid-2x2 .skill-item-card {
    background: linear-gradient(to bottom, #333, #222);
    border: 1px solid #666;
    border-radius: 4px;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    box-sizing: border-box;
    min-width: 0; /* カードが枠からはみ出るのを防ぐ */
}

.slot-grid-2x2 .skill-item-card .skill-info {
    flex: 1;               /* 追加：余白を自動で埋める */
    min-width: 0;          /* 追加：はみ出し防止 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-grid-2x2 .skill-item-card .skill-info h4 {
    font-size: 12px;
    margin: 0;
    color: #fff;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-grid-2x2 .skill-item-card button {
    flex-shrink: 0;
    margin-left: 6px;
    padding: 4px 10px;
    font-size: 11px;
}

.slot-grid-2x2 .empty-slot-card {
    background-color: #1a1a1a;
    border: 1px dashed #555;
    border-radius: 4px;
    padding: 4px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #777;
    font-size: 10px;
}

.owned-special-skill-list,
.owned-basic-skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.owned-special-skill-list .skill-item-card,
.owned-basic-skill-list .skill-item-card {
    background: linear-gradient(to bottom, #2c2c2c, #222);
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.owned-special-skill-list .skill-info h4,
.owned-basic-skill-list .skill-info h4 {
    font-size: 11px;
    margin: 0;
    color: #ffb74d;
}

.owned-basic-skill-list .skill-info h4 { color: #00ccff; }

.owned-special-skill-list .skill-info p,
.owned-basic-skill-list .skill-info p {
    font-size: 10px;
    color: #ccc;
    margin: 0;
    line-height: 1.2;
}

.skill-organize-screen button {
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.skill-organize-screen button:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.slot-grid-2x2 button,
.skill-item-card button.equipped {
    background: linear-gradient(to bottom, #e53935, #c62828);
    color: #fff;
    border: 1px solid #ff5252;
}

.owned-special-skill-list button,
.owned-basic-skill-list button {
    background: linear-gradient(to bottom, #43a047, #2e7d32);
    color: #fff;
    border: 1px solid #66bb6a;
}

/* ==========================================
 * 能力育成画面
 * ========================================== */
.ability-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    background-image: url(../images/background/status.png);
    background-size: cover;
    color: #ffffff;
    width: 100vw;
    height: calc(100vh - 4.5vw);
    padding: 10px 25px;
    box-sizing: border-box;
    position: fixed;
    top: 4.5vw;
    left: 0;
    z-index: 200;
    overflow-y: auto;
}

.ability-screen .top-nav-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 800px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.ability-tab-bar {
    display: flex;
    gap: 6px;
    width: 100%;
    max-width: 800px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.ability-tab-btn {
    flex: 1;
    padding: 5px;
    font-weight: bold;
    cursor: pointer;
    background-color: #333;
    color: #bbb;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.ability-tab-btn.active {
    background-color: #00ccff;
    color: #000;
    border-color: #fff;
}

.ability-tab-panel {
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

.ability-container {
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    background-color: #2b2b2b;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
}

.ability-header-info {
    position: fixed;
    background-color: #1a1a1a;
    margin-left: 23vw;
    margin-bottom: 4px;
    line-height: 2vw;
    width: fit-content;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #ffcc00;
    z-index: 10;
}

.status-row {
    margin-top: 15px;
    margin-bottom: 3px;
    border-bottom: 1px solid #444;
    padding-bottom: 6px;
}

.status-row-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 2px;
}

.gauge-wrapper {
    position: relative;
    width: 100%;
    height: 8px;
    background-color: #111;
    border-radius: 4px;
    overflow: hidden;
}

.gauge-bar {
    height: 100%;
    background-color: #00ccff;
    width: 0%;
    transition: width 0.2s ease;
}

.level-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ffcc00;
    z-index: 2;
}

.marker-lv4 { left: 40%; }
.marker-lv7 { left: 70%; }
.marker-lv10 { left: 100%; }

.status-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.status-controls button {
    padding: 2px 6px;
    font-size: 11px;
    background-color: #444;
    color: white;
    border: 1px solid #777;
    border-radius: 3px;
    cursor: pointer;
}

.status-controls button:hover {
    background-color: #00ccff;
    color: black;
}

.status-bonus-desc {
    font-size: 10px;
    color: #aaa;
}

.ability-tab-panel#panel-skills,
.ability-tab-panel#panel-traits {
    max-height: 60vh;
    overflow-y: auto;
    background-color: #2b2b2b;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 12px;
    box-sizing: border-box;
    color: #fff;
}

.ability-tab-panel#panel-skills h3,
.ability-tab-panel#panel-traits h3 {
    margin-top: 0;
    color: #ffb74d;
    border-bottom: 2px solid #555;
    padding-bottom: 4px;
    font-size: 14px;
}

#ability-owned-skills-list,
#ability-owned-traits-list {
    list-style: none;
    padding: 0;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ability-status-log {
    width: 100%;
    max-width: 800px;
    background-color: #111;
    border: 1px solid #00ccff;
    border-radius: 5px;
    padding: 5px;
    margin-top: 5px;
    font-size: 11px;
    color: #fff;
    min-height: 25px;
    max-height: 45px;
    overflow-y: auto;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

.ability-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    width: 100%;
    max-width: 800px;
    flex-shrink: 0;
}

.ability-skill-card {
    background-color: #333;
    padding: 3px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
}

.ability-skill-title {
    color: #ffb74d;
}

.ability-skill-desc {
    color: #ccc;
    font-size: 11px;
}

.ability-skill-btn {
    padding: 6px 14px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    border: none;
    border-radius: 4px;
    white-space: nowrap;
}

.ability-skill-btn.is-equipped {
    background-color: #d32f2f;
}

.ability-skill-btn.is-unequipped {
    background-color: #388e3c;
}

.respec-btn {
    background-color: #cc3333;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
}

.respec-btn:hover {
    background-color: #ff4444;
}

.btn-ability-apply {
    padding: 5px 14px;
    background-color: #00ccff;
    color: black;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
}

.btn-ability-apply:hover {
    opacity: 0.8;
}
/* ==========================================
 * ライブラリ（図鑑）画面
 * ========================================== */
.library-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    background-color: #1e1e1e;
    background-image: url('../images/background/library.png');
    background-size: cover;
    background-position: center;
    padding: 10px 15px;
    color: #fff;
    width: 88vw;
    max-width: 800px;
    height: 78vh;                  /* 縦の高さを少しゆとりを持たせる */
    position: fixed;
    top: 11vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    box-sizing: border-box;
    border: 2px solid #00ccff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    overflow: hidden;
}

.library-inner-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.lib-header-bar {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.lib-header-bar .btn-back-to-select {
    position: absolute;
    left: 0;
    padding: 4px 12px;
    font-size: 12px;
}

.lib-header-bar h2 {
    width: 100%;
    text-align: center;
    font-size: 17px;
    margin: 0;
    color: #fff;
}

.lib-tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.lib-tab-btn {
    flex: 1;
    padding: 6px;
    background: linear-gradient(135deg, #333 0%, #222 100%);
    color: #bbb;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.lib-tab-btn.active {
    background: linear-gradient(135deg, #00ccff 0%, #0088aa 100%);
    color: #000;
    border-color: #fff;
}

.library-container {
    display: flex;
    flex-direction: row-reverse; /* 右：リスト、左：詳細 */
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 5px;
}

.library-list-area {
    flex: 1.2;
    background-color: rgba(30, 30, 30, 0.95);
    border: 1px solid #555;
    border-radius: 6px;
    padding: 8px;
    overflow-y: auto;
    min-height: 0;
}

.library-enemy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.library-enemy-list li {
    padding: 8px 10px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}

.library-enemy-list li:hover {
    background-color: #444;
}

.library-enemy-list li.active {
    background-color: #ff9800;
    color: #000;
    border-color: #fff;
}

.library-detail-area {
    flex: 1.3;
    background-color: rgba(30, 30, 30, 0.95);
    border: 1px solid #00ccff;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    min-height: 0;
    box-sizing: border-box;
}

/* ▼ 画像表示枠を大きく拡大 (幅150px × 高さ150px) ▼ */
.lib-img-box {
    width: 150px;
    height: 150px;
    background-color: #111;
    border: 2px solid #555;
    border-radius: 8px;
    margin-bottom: 8px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.lib-locked-img {
    filter: brightness(0) invert(0.3);
}

#lib-item-name {
    font-size: 15px;
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 0 0 4px #00ccff;
    border-bottom: 2px solid #00ccff;
    padding-bottom: 3px;
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

.lib-info-text {
    width: 100%;
    font-size: 12px;
    line-height: 1.4;
    color: #ddd;
    overflow-y: auto;
}

.lib-info-text p {
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px dashed #444;
}

.type-badge {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.type-atk { background-color: #ff4444; color: #fff; }
.type-def { background-color: #2196F3; color: #fff; }
.type-hp { background-color: #4CAF50; color: #fff; }
.type-balance { background-color: #ff9800; color: #000; }
.type-special { background-color: #9c27b0; color: #fff; }

@media screen and (max-width: 768px) {
    .library-screen {
        top: 100px; /* SP時のメニュー高さに合わせて調整 */
        height: calc(100vh - 100px);
    }
    .library-container {
        flex-direction: column;
    }
    .lib-img-box {
        width: 150px;
        height: 150px;
    }
    .player-status-confirm-area {
        width: 45vw;
        max-height: 25vw;
        font-size: 2.5vw;
    }
    /* ▼▼▼ スマホ対応の中に追加 ▼▼▼ */
    .player-rogue-status-area {
        width: 45vw;
        max-height: 25vw;
        font-size: 2.2vw;
    }
    /* ▲▲▲ 追加ここまで ▲▲▲ */
}
/* ==========================================
 * ショップ画面
 * ========================================== */
.shop-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    background-image: url(../images/background/shop.png);
    background-position: center;
    padding: 8px 20px 15px 20px;
    color: #fff;
    width: 100vw;
    height: calc(100vh - 4.5vw);
    top: 4.5vw;
    left: 0;
    overflow: hidden;
    box-sizing: border-box;
    position: fixed;
    z-index: 900;
}

.shop-screen .top-nav-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 900px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.shop-inner-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
    height: calc(100vh - 70px);
}

.shop-tab-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.shop-tab-bar .tab-btn {
    flex: 1;
    padding: 5px;
    font-size: 11px;
    font-weight: bold;
    background-color: rgba(50, 50, 50, 0.9);
    color: #ccc;
    border: 1px solid #666;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-tab-bar .tab-btn.active {
    background-color: #ff9800;
    color: #000;
    border-color: #ffa726;
}

.shop-container {
    background-color: rgba(34, 34, 34, 0.9);
    border: 2px solid #555;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    box-sizing: border-box;
    min-height: 0;
}

#shop-category-title {
    color: #ffb74d;
    border-bottom: 2px solid #555;
    padding-bottom: 3px;
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 13px;
    flex-shrink: 0;
}

.shop-item-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    flex: 1;
}

.shop-card {
    background: linear-gradient(to bottom, #2c2c2c, #222);
    border: 1px solid #555;
    border-radius: 5px;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.shop-card .item-info h4 {
    font-size: 12px;
    margin: 0;
    color: #fff;
}

.shop-card .item-info p {
    font-size: 10px;
    color: #ccc;
    margin: 1px 0;
    line-height: 1.2;
}

.shop-card button {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    background: linear-gradient(to bottom, #43a047, #2e7d32);
    color: #fff;
    border: 1px solid #66bb6a;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.shop-card button:hover {
    filter: brightness(1.2);
}

.shop-card button:disabled {
    background: #444;
    border-color: #555;
    color: #888;
    cursor: not-allowed;
    filter: none;
}

.shop-card .shop-item-price {
    color: #ffd700;
    font-size: 13px;
}

.shop-card .shop-item-stats {
    color: #00ccff;  /* ← #ffcc00 から #00ccff（水色系の青）に変更 */
    font-weight: bold;
}
/* ==========================================================================
   ガチャ＆交換所画面 ＋ 演出アニメーション
   ========================================================================== */
.gacha-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    background-image: url('../images/background/gatya.png');
    background-size: 130%;
    background-position: center;
    padding: 8px 20px 15px 20px;
    color: #fff;
    width: 100vw;
    height: calc(100vh - 4.5vw);
    top: 4.5vw;
    left: 0;
    overflow: hidden;
    box-sizing: border-box;
    position: fixed;
    z-index: 900;
}

.gacha-screen .top-nav-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1000px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.gacha-container {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 1000px;
    height: 68vh;
    background-color: rgba(30, 30, 30, 0.9);
    border: 2px solid #555;
    border-radius: 8px;
    padding: 12px;
    box-sizing: border-box;
}

.gacha-action-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.gacha-header {
    display: flex;
    justify-content: space-between;
    background-color: #111;
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #ffcc00;
    color: #ffcc00;
    font-weight: bold;
    font-size: 12px;
}

.gacha-banners {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gacha-banner {
    padding: 8px 10px;
    border-radius: 6px;
    text-align: center;
    border: 2px solid #666;
}

.normal-gacha { background: linear-gradient(135deg, #2a4b7c, #1a2a40); border-color: #4a90e2; }
.premium-gacha { background: linear-gradient(135deg, #7c2a35, #401a20); border-color: #e24a58; }

.gacha-banner h3 { font-size: 14px; margin-bottom: 2px; color: #fff; }
.gacha-desc { font-size: 10px; color: #ccc; margin-bottom: 4px; }

.gacha-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.btn-gacha-roll {
    padding: 5px 12px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    background-color: #444;
    color: #fff;
    border: 1px solid #888;
    transition: 0.2s;
    font-size: 11px;
}
.btn-gacha-roll:hover { filter: brightness(1.2); transform: scale(1.05); }

.gacha-exchange-area {
    margin-top: 4px;
    background-color: rgba(0,0,0,0.5);
    padding: 6px;
    border-radius: 5px;
}

.exchange-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 100px;
    overflow-y: auto;
}

.exchange-item {
    display: flex;
    justify-content: space-between;
    background-color: #333;
    padding: 5px 8px;
    border-radius: 4px;
    align-items: center;
    font-size: 11px;
}
.exchange-item button {
    padding: 2px 6px;
    background-color: #00ccff;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
    font-size: 10px;
}

.gacha-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gacha-effect-area {
    height: 100px;
    background-color: #000;
    border: 2px solid #555;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gacha-result-log {
    flex: 1;
    background-color: #111;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 6px;
    font-family: monospace;
    font-size: 11px;
    overflow-y: auto; 
    white-space: pre-wrap; 
}

/* ガチャアニメーション定義 */
.effect-normal {
    color: #fff;
    animation: fadeIn 0.5s ease-out forwards;
}
.effect-rare {
    color: #4a90e2;
    text-shadow: 0 0 10px #4a90e2;
    animation: popAndGlow 0.6s ease-out forwards;
}
.effect-epic {
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700;
    border-color: #ffd700 !important;
    animation: epicGlow 0.8s ease-out forwards;
}
.effect-legend {
    color: #ff5555;
    text-shadow: 0 0 20px #ff0000, 0 0 40px #ff00ff;
    border-color: #ff5555 !important;
    animation: legendBurst 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes popAndGlow {
    0% { opacity: 0; transform: scale(0.5); }
    50% { transform: scale(1.1); text-shadow: 0 0 20px #4a90e2; }
    100% { opacity: 1; transform: scale(1); text-shadow: 0 0 10px #4a90e2; }
}
@keyframes epicGlow {
    0% { opacity: 0; transform: translateY(20px); }
    50% { transform: translateY(-5px); box-shadow: inset 0 0 30px #ffd700; }
    100% { opacity: 1; transform: translateY(0); box-shadow: inset 0 0 10px #ffd700; }
}
@keyframes legendBurst {
    0% { opacity: 0; transform: scale(0.1) rotate(-10deg); }
    40% { transform: scale(1.2) rotate(5deg); box-shadow: inset 0 0 50px #ff0000; }
    60% { transform: scale(0.9) rotate(-2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); box-shadow: inset 0 0 20px #ff5555; }
}

/* ==========================================================================
   カジノ・スロット画面
   ========================================================================== */
.slot-screen {
    flex-direction: column;
    align-items: center;
    background-color: #1a1a1a;
    background-image: url(../images/background/slot.png);
    background-size: 130%;
    background-position: center;
    color: #fff;
    width: 100vw;
    height: calc(100vh - 4.5vw);
    top: 4.5vw;
    left: 0;
    overflow-y: auto;
    box-sizing: border-box;
    position: fixed;
    z-index: 900;
    padding: 10px 20px;
}

.slot-screen .top-nav-bar {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 10px;
}

.slot-container {
    background: rgba(20, 20, 20, 0.9);
    border: 3px solid #ffcc00;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 10px 30px rgba(255, 204, 0, 0.2);
}

.slot-title {
    color: #ffcc00;
    margin: 0;
    font-size: 22px;
    text-shadow: 0 2px 10px rgba(255, 204, 0, 0.5);
}

.slot-stats {
    font-size: 13px;
    color: #ccc;
    background: #000;
    padding: 3px 10px;
    border-radius: 15px;
    border: 1px solid #444;
}
#slot-total-earned {
    color: #ffd700;
    font-weight: bold;
    font-size: 15px;
}

.chance-time-indicator {
    height: 18px;
    font-size: 13px;
    font-weight: bold;
    color: transparent;
    transition: 0.3s;
}
.chance-time-indicator.active {
    color: #ff5555;
    text-shadow: 0 0 10px #ff5555;
    animation: flashText 1s infinite alternate;
}

.slot-machine-frame {
    background: #444;
    padding: 10px;
    border-radius: 6px;
    border: 3px solid #222;
    box-shadow: inset 0 8px 15px rgba(0,0,0,0.8);
}

.slot-machine {
    display: flex;
    gap: 10px;
    background: #111;
    padding: 6px;
    border-radius: 4px;
}

.reel {
    width: 90px;
    height: 80px;
    background: linear-gradient(to bottom, #ddd, #fff, #ddd);
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 38px;
    border-radius: 4px;
    border: 2px solid #666;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5);
    overflow: hidden;
}

.reel.spinning {
    animation: slotSpin 0.1s linear infinite;
    filter: blur(2px);
}
.reel.reel-stop {
    animation: slotStop 0.3s ease-out forwards;
}

@keyframes slotSpin {
    0% { transform: translateY(-20px); }
    100% { transform: translateY(20px); }
}
@keyframes slotStop {
    0% { transform: translateY(-30px); }
    50% { transform: translateY(10px); }
    100% { transform: translateY(0); }
}
@keyframes flashText {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.slot-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.bet-selector {
    display: flex;
    gap: 6px;
    background: #222;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid #444;
}

.bet-btn {
    background: #333;
    color: #bbb;
    border: none;
    padding: 5px 14px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    font-size: 12px;
}
.bet-btn:hover { background: #555; color: #fff; }
.bet-btn.active {
    background: #00ccff;
    color: #000;
    box-shadow: 0 0 8px #00ccff;
}

.btn-spin {
    background: linear-gradient(to bottom, #ff5252, #c62828);
    color: #fff;
    border: 2px solid #ff1744;
    border-radius: 40px;
    padding: 8px 35px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: 0.1s;
}
.btn-spin:active {
    transform: translateY(3px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.slot-result-msg {
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 2px 0;
}

.slot-result-msg.win-big span {
    color: #ff3333;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 0 10px #ff0000;
    animation: slotFlashBig 0.5s infinite alternate;
}

.slot-result-msg.win-small span {
    color: #00ccff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 10px #00ccff;
    animation: slotFlashSmall 0.8s infinite alternate;
}

@keyframes slotFlashBig {
    0% { transform: scale(1); opacity: 0.8; text-shadow: 0 0 10px #ff0000; }
    100% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 20px #ff0000, 0 0 40px #ffff00; }
}

@keyframes slotFlashSmall {
    0% { opacity: 0.7; }
    100% { opacity: 1; text-shadow: 0 0 20px #00ccff; }
}

/* ==========================================
 * ステータス・持ち物画面
 * ========================================== */
.status-screen, .item-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    background-color: #1e1e1e;
    color: #ffffff;
    width: 100vw;
    height: calc(100vh - 4.5vw);
    padding: 12px 25px;
    box-sizing: border-box;
    position: fixed;
    top: 4.5vw;
    left: 0;
    z-index: 200;
    overflow-y: auto;
}

.status-screen .top-nav-bar, .item-screen .top-nav-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 800px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.status-container, .item-container {
    width: 100%;
    max-width: 800px;
    background-color: #2b2b2b;
    border: 2px solid #555;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 75vh;
    overflow-y: auto;
}

.status-section h3 {
    color: #ffb74d;
    border-bottom: 2px solid #555;
    padding-bottom: 5px;
    margin-top: 0;
    font-size: 15px;
}

.status-section p, 
.status-section ul {
    font-size: 13px;
    line-height: 1.4;
    margin: 3px 0;
}

.status-section ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#global-inventory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==========================================
 * 装備画面
 * ========================================== */
.equipment-screen {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-color: #1e1e1e;
    padding: 8px 15px;            /* 上下のパディングを少し詰める */
    color: #fff;
    width: 100vw;
    height: calc(100vh - 4vw); 
    top: 4vw;                  
    left: 0;
    overflow: hidden;
    box-sizing: border-box;
    position: fixed;
    z-index: 900;
}

.equipment-screen button {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.equip-close-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1100px;
    margin-bottom: 4px;           /* 下マージンを詰める */
    flex-shrink: 0;
}

.equip-close-bar h2 {
    font-size: 15px;
}

.equip-inner-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    height: calc(100vh - 180px);
    gap: 6px;                     /* 要素間の隙間を狭くする */
}

.equipment-screen .organize-container {
    display: flex;
    flex-direction: row; 
    gap: 12px;
    flex: 1;
    min-height: 0;
    justify-content: center;
    align-items: stretch;
}

.equipment-screen .equipped-skills-panel,
.equipment-screen .owned-skills-panel {
    flex: 1;
    background-color: rgba(34, 34, 34, 0.9);
    border: 2px solid #555;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;             /* ★ 変更：ここをスクロール可能に指定 */
    min-height: 0;
    box-sizing: border-box;
}

.equipment-screen .equip-tab-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.equipment-screen .equip-tab-bar .tab-btn {
    flex: 1;
    background: linear-gradient(135deg, #333 0%, #222 100%);
    color: #bbb;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 5px;
    font-size: 11px;
    font-weight: bold;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.equipment-screen .equip-tab-bar .tab-btn:hover {
    background: linear-gradient(135deg, #444 0%, #333 100%);
    color: #fff;
    border-color: #888;
}

.equipment-screen .equip-tab-bar .tab-btn.active {
    background: linear-gradient(135deg, #ff9800 0%, #e65100 100%) !important;
    color: #ffffff !important;
    border-color: #ffd700 !important;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.player-status-summary {
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 1px;
    margin-bottom: 3px;           /* 下マージンを詰める */
    font-size: 11px;
    line-height: 1.2;
    flex-shrink: 0;
}

#summary-effects {
    color: #ffb74d;
}

.slot-subtitle {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.equipment-screen .equip-current-list,
.equipment-screen .equip-owned-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 追加：リスト項目を上詰めに配置 */
    gap: 6px;                    /* 余白の調整 */
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
    min-height: 0;
}

.equipment-screen .equip-owned-list {
    flex: 0 1 auto; /* 画面の空きスペースに合わせて自動で引き伸ばさない */
}

.equipment-screen .equip-owned-list .skill-item-card {
    flex: 0 0 auto; /* 各カードが必要以上の高さに勝手に伸びるのを防ぐ */
    height: auto;
}

.equipment-screen .equip-current-list .skill-item-card,
.equipment-screen .equip-owned-list .skill-item-card {
    background: linear-gradient(to bottom, #333, #222);
    border: 1px solid #555;
    border-radius: 5px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    gap: 8px;
    box-sizing: border-box;
    flex: 0 0 auto;              /* 追加：カードが縦に伸びるのを防ぐ */
}

.equipment-screen .skill-item-card .skill-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.equipment-screen .skill-item-card .skill-info h4 {
    font-size: 12px;
    margin: 0;
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equipment-screen .skill-item-card .skill-info p {
    font-size: 10px;
    color: #ccc;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equipment-screen .skill-item-card button {
    background: linear-gradient(135deg, #00acc1 0%, #00695c 100%);
    color: #ffffff;
    font-weight: bold;
    border: 1px solid #26a69a;
    border-radius: 4px;
    padding: 4px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 10px;
}

.equipment-screen .skill-item-card button:hover {
    background: linear-gradient(135deg, #00bcd4 0%, #00897b 100%);
    border-color: #80deea;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 188, 212, 0.4);
}

.equipment-screen .skill-item-card button.equipped {
    background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%) !important;
    border: 1px solid #ff5252 !important;
    color: #ffffff !important;
}

.equipment-screen .skill-item-card button.equipped:hover {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%) !important;
    border-color: #ff8a80 !important;
    box-shadow: 0 0 8px rgba(229, 57, 53, 0.6) !important;
}

.right-shop-tab-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.right-shop-tab-btn {
    flex: 1;
    background: linear-gradient(135deg, #333 0%, #222 100%);
    color: #bbb;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 5px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.right-shop-tab-btn:hover {
    background: linear-gradient(135deg, #444 0%, #333 100%);
    color: #fff;
    border-color: #888;
}

.right-shop-tab-btn.active {
    background: linear-gradient(135deg, #ff9800 0%, #e65100 100%) !important;
    color: #ffffff !important;
    border-color: #ffd700 !important;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}



.guide-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    background-color: #1e1e1e;
    padding: 10px 15px;
    color: #fff;
    width: 85vw;
    max-width: 750px;
    height: 72vh;
    position: fixed;
    top: 14vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    box-sizing: border-box;
    border: 2px solid #00ccff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    overflow: hidden;
}
.guide-inner-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.guide-tab-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.guide-tab-btn {
    flex: 1;
    padding: 6px 4px;
    background: linear-gradient(135deg, #333 0%, #222 100%);
    color: #bbb;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}
.guide-tab-btn.active {
    background: linear-gradient(135deg, #00ccff 0%, #0088aa 100%);
    color: #000;
    border-color: #fff;
}
.guide-content-area {
    background-color: rgba(30, 30, 30, 0.95);
    border: 1px solid #555;
    border-radius: 6px;
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.5;
}
.guide-content-area h3 {
    color: #ffcc00;
    margin-top: 0;
    font-size: 14px;
    border-bottom: 1px solid #444;
    padding-bottom: 4px;
}
.guide-page p {
    margin: 6px 0;
}

/* ーーーーーーーーーーーーーーーーーー バトル画面全体レイアウト ーーーーーーーーーーーーーーーーーー */
#battle-screen {
    display: block;
    width: 100vw;
    min-height: calc(100vh - 4vw);
    padding: 0.8vw 0 0 0;
    position: relative;
}

.enemy {
    width: 70vw;
    height: 24vw;
    margin-left: auto;
    margin-right: auto;
    padding-top: 0.8vw;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border: 0.3vw solid white;
    position: relative;
}

.enemy-name {
    width: 20vw;
    height: 2.3vw;
    font-size: 1.1vw;
    margin-left: auto;
    margin-right: auto;
    border: 0.2vw solid white;
    color: white;
    background-color: #1a1a1a;
    text-align: center;
    line-height: 1.9vw;
}

#enemy-hp {
    display: block;
    accent-color: #ff4444;
    width: 20vw;
    height: 1.3vw;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.3vw;
}

.enemy-status-area {
    text-align: center;
    font-size: 0.9vw;
    color: #ff6b6b;
    margin-top: 0.2vw;
    font-weight: bold;
}

.enemy-img {
    width: 25vw;
    height: 13vw;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.3vw;
    background-position: center;
    background-size: contain; 
    background-repeat: no-repeat;
    position: relative;
}

.enemy-janken-area {
    width: 7vw;
    height: 7vw;
    right: 2vw;
    bottom: 2vw;
    position: absolute;
    border: 0.3vw solid white;
    background-color: #404040;
    font-size: 4vw;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.text-area {
    position: absolute;
    bottom: 15vw;
    left: 30%;
    width: 40%;
    height: 8vw;
    font-size: 1.1vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5vw;
    color: white;
    border: 0.3vw solid white;
    background-color: rgba(10, 10, 10, 0.95);
    z-index: 50;
    text-align: center;
    overflow-y: auto;
    max-height: 150px;
}

.player-escape-menu {
    display: none;
    justify-content: center;
    gap: 2vw;
    margin-top: 0.3vw;
    width: 100%;
}

.btn-escape-yes, .btn-escape-no {
    width: 7vw;
    height: 1.6vw;
    font-size: 0.9vw;
    font-weight: bold;
    cursor: pointer;
    background-color: #202020;
    color: white;
    border: 0.15vw solid #ffd700;
    border-radius: 0.3vw;
    transition: all 0.2s ease;
}

.btn-escape-yes:hover, .btn-escape-no:hover {
    background-color: #ffd700;
    color: black;
}

.player {
    width: 70vw;
    height: 14vw;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1vw;
    background-color: #404040;
    border: 0.3vw solid white;
    padding-top: 0.4vw;
    position: relative;
}

.player-hp-area {
    display: flex;
    align-items: center;
    padding-left: 1.2vw;
    width: 50vw;
    height: 1.6vw;
}

#player-hp {
    display: block;
    accent-color: #3b82f6;
    width: 36vw;
    height: 1.2vw;
}

#player-hp-text {
    width: 12vw;
    color: white;
    font-size: 0.85vw;
    font-weight: bold;
    text-shadow: 0.1vw 0.1vw 0.2vw black;
    margin-left: 1.2vw;
}

.player-ultimate-gauge-area {
    display: flex;
    align-items: center;
    padding-left: 1.2vw;
    font-size: 0.8vw;
    color: #ffd700;
    font-weight: bold;
    height: 1.4vw;
}

#ultimate-gauge {
    width: 36vw;
    height: 0.7vw;
    margin-left: 1.2vw;
    margin-right: 1.2vw;
    accent-color: #ff9800;
}

.player-menu-area {
    display: flex;
    align-items: flex-start;
    margin-top: 0.4vw;
}

.player-menu {
    list-style-type: none;
    margin-left: 1.2vw;
}

.player-menu li button {
    width: 15vw;
    height: 1.45vw;
    font-size: 0.8vw;
    margin-bottom: 0.15vw;
    cursor: pointer;
    font-weight: bold;
    background-color: #2b2b2b;
    color: white;
    border: 0.1vw solid #888;
    border-radius: 0.2vw;
}

.player-menu li button:hover {
    background-color: #00ccff;
    color: black;
    border-color: #fff;
}

.player-janken-menu,
.player-ultimate-menu,
.player-special-skill-menu,
.player-basic-skill-menu {
    list-style-type: none;
    display: none;
    margin-left: 1.2vw;
    max-height: 9vw;
    overflow-y: auto;
}

.player-janken-menu li button,
.player-ultimate-menu li button,
.player-special-skill-menu li button,
.player-basic-skill-menu li button {
    width: 15vw;
    height: 1.45vw;
    font-size: 0.8vw;
    margin-bottom: 0.15vw;
    cursor: pointer;
    font-weight: bold;
    background-color: #2b2b2b;
    color: white;
    border: 0.1vw solid #888;
    border-radius: 0.2vw;
}

.player-janken-menu li button:hover,
.player-ultimate-menu li button:hover,
.player-special-skill-menu li button:hover,
.player-basic-skill-menu li button:hover {
    background-color: #00ccff;
    color: black;
}

.player-item-menu {
    list-style-type: none;
    display: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.2vw;
    width: 17.5vw;
    max-height: 9.5vw;
    overflow-y: auto;
    margin-left: 1.2vw;
    padding-right: 0.3vw;
}

.player-item-menu li {
    list-style: none;
    width: 17.5vw;
}

.player-item-menu li button {
    width: 100%;
    height: 1.45vw;
    font-size: 0.75vw;
    cursor: pointer;
    background-color: #2b2b2b;
    color: white;
    border: 0.1vw solid #888;
}

.player-item-menu li button:hover {
    background-color: #00ccff;
    color: black;
}

.player-status-confirm-area {
    width: 20vw;
    max-height: 6.5vw;
    overflow-y: auto;
    background-color: rgba(20, 20, 20, 0.9);
    border: 0.15vw solid #00ccff;
    padding: 0.25vw;
    margin-left: 1.2vw;
    font-size: 0.7vw;
}

.player-status-confirm-area .status-title {
    color: #00ccff;
    font-weight: bold;
    margin-bottom: 0.15vw;
    text-align: center;
}

.player-concession {
    list-style: none;
}

.player-concession li button {
    width: 100%;
    font-size: 0.65vw;
    background: #333;
    color: #fff;
    border: 0.1vw solid #666;
    margin-bottom: 0.15vw;
    text-align: left;
    padding-left: 0.2vw;
    pointer-events: none;
}

.player-janken-area {
    margin-left: auto;
    margin-right: 2.5vw;
    width: 7vw;
    height: 6.5vw;
    border: 0.3vw solid white;
    background-color: #404040;
    font-size: 3.5vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media screen and (max-width: 768px) {
    header.main-menu {
        height: auto;
        padding: 5px;
        flex-direction: column;
    }
    .nav-main {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        margin-left: 0;
        gap: 5px;
    }
    .nav-main li a {
        width: auto;
        padding: 0 10px;
        height: 30px;
        line-height: 30px;
        font-size: 12px;
    }
    .gold-now {
        width: auto;
        margin: 5px auto;
        padding: 0 20px;
        height: 30px;
        font-size: 14px;
    }
    body {
        padding-top: 100px; 
    }

    .select-menu-grid {
        grid-template-columns: 1fr;
    }

    .skill-organize-screen,
    .equipment-screen,
    .shop-screen,
    .ability-screen,
    .item-screen,
    .status-screen,
    .gacha-screen,
    .slot-screen {
        overflow-y: auto !important; 
        height: 100vh !important;
        padding-top: 100px !important;
        padding-bottom: 30px !important;
        display: block !important; 
    }

    .organize-container,
    .equip-inner-wrapper,
    .shop-inner-wrapper,
    .gacha-container {
        display: block !important; 
        height: auto !important;
        max-height: none !important;
    }

    .equipment-screen .equipped-skills-panel,
    .equipment-screen .owned-skills-panel,
    .skill-section-box {
        max-height: none !important;
        height: auto !important;
        margin-bottom: 20px;
        display: block; 
    }


    #battle-screen {
        overflow-y: auto; 
        padding-bottom: 50px;
    }

    .enemy {
        width: 95vw;
        height: 50vw; 
    }
    .enemy-name { font-size: 3.5vw; height: 6vw; width: 50vw; line-height: 5vw; }
    #enemy-hp { height: 3vw; width: 50vw; }
    .enemy-status-area { font-size: 2.5vw; }
    .enemy-img { height: 25vw; width: 50vw; }
    .enemy-janken-area { width: 12vw; height: 12vw; font-size: 7vw; }

    .text-area {
        position: relative !important;
        width: 90%;
        left: 5%;
        bottom: auto;
        margin: 5vw 0; 
        height: auto;
        min-height: 20vw;
        padding: 3vw;
        font-size: 3.5vw; 
        overflow-y: auto;
        max-height: 150px;
    }

    .player {
        width: 95vw;
        height: auto !important; 
        padding-bottom: 5vw;
    }
    .player-janken-area { width: 12vw; height: 12vw; font-size: 7vw; }

    .player-hp-area, .player-ultimate-gauge-area {
        height: auto;
        margin-bottom: 2vw;
    }
    #player-hp, #ultimate-gauge { height: 3vw; }
    #player-hp-text { font-size: 3vw; width: 20vw; }
    .player-ultimate-gauge-area label { font-size: 3vw; width: 25vw; }
    #ultimate-gauge-text { font-size: 3vw; width: 15vw; }

    .player-menu-area {
        flex-wrap: wrap; 
        gap: 3vw;
    }

    .player-menu li button,
    .player-janken-menu li button,
    .player-ultimate-menu li button,
    .player-special-skill-menu li button,
    .player-basic-skill-menu li button {
        width: 42vw; 
        height: 8vw;
        font-size: 3vw;
        margin-bottom: 2vw;
    }

    .player-status-confirm-area {
        width: 45vw;
        max-height: 25vw;
        font-size: 2.5vw;
    }
    .player-concession li button { font-size: 2vw; padding: 1vw; }

    .player-item-menu {
        width: 100%;
        max-height: none;
    }
    .player-item-menu li { width: 45vw; }
    .player-item-menu li button { height: 8vw; font-size: 2.5vw; margin-bottom: 2vw;}

    .btn-escape-yes, .btn-escape-no {
        width: 20vw;
        height: 6vw;
        font-size: 3vw;
    }
}

.status-flex-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.status-chart-area {
    flex: 1;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 0 10px rgba(0,204,255,0.2);
}

.status-text-area {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media screen and (max-width: 768px) {
    .status-flex-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .status-chart-area {
        width: 100%;
        max-width: 300px; 
    }
    .status-text-area {
        width: 100%;
    }
}

.slot-machine-frame.chance-mode {
    border-color: #ff00ff;
    box-shadow: 0 0 20px #ff00ff, inset 0 0 20px #ff00ff;
    animation: neonGlow 0.5s infinite alternate;
}

@keyframes neonGlow {
    0% { border-color: #ff0000; box-shadow: 0 0 20px #ff0000, inset 0 0 20px #ff0000; }
    33% { border-color: #00ff00; box-shadow: 0 0 20px #00ff00, inset 0 0 20px #00ff00; }
    66% { border-color: #0000ff; box-shadow: 0 0 20px #0000ff, inset 0 0 20px #0000ff; }
    100% { border-color: #ff00ff; box-shadow: 0 0 20px #ff00ff, inset 0 0 20px #ff00ff; }
}

.chance-trigger-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    animation: chanceTriggerFlash 1.5s ease-out forwards;
    z-index: 999;
}

@keyframes chanceTriggerFlash {
    0% { background-color: rgba(255, 255, 255, 0.9); }
    10% { background-color: rgba(255, 0, 0, 0.5); }
    20% { background-color: rgba(255, 255, 0, 0.5); }
    100% { background-color: transparent; }
}

.chance-cutin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 80px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px #ff00ff, 0 0 40px #ff0000, 0 0 60px #ffff00;
    z-index: 1000;
    pointer-events: none;
    text-align: center;
    line-height: 1.2;
    width: 100%;
    animation: cutinPop 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cutinPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2) rotate(-5deg); opacity: 1; }
    40% { transform: translate(-50%, -50%) scale(1) rotate(5deg); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

@media screen and (max-width: 768px) {
    .chance-cutin { font-size: 50px; }
}

.stage-cat-btn {
    background-color: #333;
    color: #bbb;
    border: 1px solid #555;
    border-radius: 6px;
    transition: all 0.2s;
}
.stage-cat-btn.active {
    background-color: #ff9800;
    color: #000;
    border-color: #ffd700;
}

.stage-accordion {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}
.stage-accordion[open] {
    border-color: #ffcc00;
}
.stage-accordion summary {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: bold;
    color: #ffcc00;
    cursor: pointer;
    background-color: #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.stage-accordion summary:hover {
    background-color: #333;
}
.stage-accordion-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #1a1a1a;
}
.stage-card {
    background-color: #2c2c2c;
    border: 1px solid #666;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stage-card:hover {
    transform: translateY(-2px);
    border-color: #00ccff;
    box-shadow: 0 6px 12px rgba(0, 204, 255, 0.3);
}

.stage-card.cleared {
    border-left: 5px solid #4caf50;
}

.stage-card .btn-start-stage {
    min-width: 75px;
    height: 38px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

@keyframes logFlash {
    0% { border-color: #555; box-shadow: 0 0 0px rgba(255, 68, 68, 0); background-color: rgba(10, 10, 10, 0.95); }
    30% { border-color: #ff4444; box-shadow: 0 0 15px rgba(255, 68, 68, 0.9); background-color: rgba(80, 0, 0, 0.8); }
    100% { border-color: #555; box-shadow: 0 0 0px rgba(255, 68, 68, 0); background-color: rgba(10, 10, 10, 0.95); }
}
.log-flash {
    animation: logFlash 0.4s ease;
}

@keyframes logFlashYellow {
    0% { border-color: #555; box-shadow: 0 0 0px rgba(255, 204, 0, 0); background-color: rgba(10, 10, 10, 0.95); }
    30% { border-color: #ffcc00; box-shadow: 0 0 15px rgba(255, 204, 0, 0.9); background-color: rgba(80, 80, 0, 0.8); }
    100% { border-color: #555; box-shadow: 0 0 0px rgba(255, 204, 0, 0); background-color: rgba(10, 10, 10, 0.95); }
}
.log-flash-yellow {
    animation: logFlashYellow 0.4s ease;
}

@keyframes enemyDamage {
    0% { filter: brightness(1); transform: translate(0, 0); }
    20% { filter: brightness(2.5) saturate(3) hue-rotate(-40deg); transform: translate(-8px, 4px); }
    40% { filter: brightness(2) saturate(2); transform: translate(8px, -4px); }
    60% { filter: brightness(1.5); transform: translate(-4px, 2px); }
    100% { filter: brightness(1); transform: translate(0, 0); }
}
.enemy-damaged-flash {
    animation: enemyDamage 0.4s ease;
}

@keyframes enemyDrawShake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-3px, 0); }
    50% { transform: translate(3px, 0); }
    75% { transform: translate(-2px, 0); }
    100% { transform: translate(0, 0); }
}
.enemy-draw-shake {
    animation: enemyDrawShake 0.3s ease;
}

@keyframes critFlash {
    0% { filter: brightness(1); transform: scale(1); }
    30% { filter: brightness(3.5) saturate(5) drop-shadow(0 0 20px gold); transform: scale(1.2); }
    100% { filter: brightness(1); transform: scale(1); }
}
.enemy-crit-flash {
    animation: critFlash 0.5s ease;
}

.boss-cutin-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background-color: rgba(150, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: bossFlash 0.5s ease-in-out infinite alternate;
}

.boss-cutin-text {
    font-size: 36px;
    font-weight: bold;
    color: #ff3333;
    text-align: center;
    text-shadow: 0 0 20px #000, 0 0 10px #ff0000;
    animation: bossScale 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bossFlash {
    0% { background-color: rgba(150, 0, 0, 0.5); }
    100% { background-color: rgba(200, 0, 0, 0.85); }
}

@keyframes bossScale {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes logFlashGreen {
    0% { background-color: #2e7d32; } /* 鮮やかな不透明の緑 */
    100% { background-color: #1a1a1a; } /* ゲームの元の背景色（例：暗い色）に合わせる */
}
.log-flash-green {
    animation: logFlashGreen 0.4s ease;
}

/* 敵のHP数値表示 */
#enemy-hp-text {
    width: 100%;
    margin: 0 auto 4px auto;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 1px 2px #000;
}

/* ==========================================
 * 鍛冶屋画面
 * ========================================== */
.equipment-screen.smithy-screen {
    background-image: url('../images/background/smithy.png'); /* 背景画像があれば設定 */
    display: none; /* 初期非表示 */
}

.smithy-gold-display {
    margin-left: auto;
    width: auto;
    padding: 0 15px;
    font-size: 14px;
}

.smithy-panel-title {
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    margin-top: 0;
    font-size: 14px;
}

.smithy-panel-title.title-blue { color: #00ccff; }
.smithy-panel-title.title-orange { color: #ff9800; }

.smithy-tab-bar {
    margin-bottom: 10px;
    margin-top: 5px;
}

.smithy-right-panel {
    display: flex;
    flex-direction: column;
}

.smithy-stone-list {
    flex: 1;
}

.smithy-action-area {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #555;
    text-align: center;
    flex-shrink: 0;
}

.smithy-cost-text {
    color: #ffcc00;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 14px;
}

.btn-smithy-execute {
    padding: 10px 30px;
    font-size: 14px;
    font-weight: bold;
    background: linear-gradient(to bottom, #43a047, #2e7d32);
    color: #fff;
    border: 1px solid #66bb6a;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    display: none; /* JSで表示を切り替え */
}

.btn-smithy-execute:hover { filter: brightness(1.2); }

.btn-smithy-reset {
    padding: 10px 30px;
    font-size: 14px;
    font-weight: bold;
    background: linear-gradient(to bottom, #e53935, #c62828);
    color: #fff;
    border: 1px solid #ff5252;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    display: none; /* JSで表示を切り替え */
}

.btn-smithy-reset:hover { filter: brightness(1.2); }

/* ローグライク専用ステータス枠 */
.player-rogue-status-area {
    width: 18vw;
    max-height: 6.5vw;
    overflow-y: auto;
    background-color: rgba(20, 20, 20, 0.9);
    border: 0.15vw solid #9c27b0; /* ローグライク風の紫色 */
    padding: 0.25vw;
    margin-left: 1.2vw;
    font-size: 0.65vw;
}
.player-rogue-status-area .status-title {
    color: #ff55ff;
    font-weight: bold;
    margin-bottom: 0.15vw;
    text-align: center;
}