/* Base variables and reset */
:root {
    --bg-color: #d4e8f0;
    --text-primary: #2c3e50;
    --text-gold: #b8860b;
    --text-dark: #1e293b;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.75);

    /* 蜴溽･樣｢ｨ 繝ｩ繧､繝医き繝ｩ繝ｼ繝代Ξ繝・ヨ */
    --wish-blue-light: #e8f4fd;
    --wish-blue-mid: #c2dff0;
    --wish-blue-dark: #8ab4cc;
    --wish-gold-light: #f5e6b0;
    --wish-gold-mid: #d4a843;
    --wish-gold-dark: #a07820;
    --wish-teal: #5bbccc;
    --wish-ivory: #faf7f0;

    --rarity-5: #c8841a;
    /* 驥・*/
    --rarity-4: #9b59b6;
    /* 邏ｫ */
    --rarity-3: #2980b9;
    /* 髱・*/
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    font-variant-emoji: text;
}

body {
    font-family: 'Inter', 'Noto Sans JP', 'Segoe UI Symbol', 'Apple Symbols', sans-serif;
    background: linear-gradient(160deg, #daeef8 0%, #c5e0ef 30%, #e8f4f8 60%, #f0e8d8 100%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    /* iOS Safari 蟇ｾ蠢・*/
    width: 100vw;
    -webkit-tap-highlight-color: transparent;
    /* iOS繧ｿ繝・メ繝上う繝ｩ繧､繝磯撼陦ｨ遉ｺ */
}

#app {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Typography & Utils */
.hidden {
    display: none !important;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    color: #1d1d1f;
}

/* Header / Nav */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(to bottom, rgba(190, 225, 245, 0.85) 0%, rgba(200, 230, 248, 0.5) 70%, transparent 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--wish-gold-dark), var(--wish-gold-mid), #e8c96a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 1px 2px rgba(160, 120, 32, 0.3));
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-icon-btn {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    padding: 0;
    flex-shrink: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.header-icon-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.header-icon-btn:active {
    transform: scale(0.95);
}

.header-icon-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.currency {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 9px;
    padding: 2px 10px 2px 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.currency:active {
    transform: scale(0.95);
}

.currency:hover {
    box-shadow: 0 3px 12px rgba(100, 160, 200, 0.3);
}

.currency img {
    height: 24px;
    width: 24px;
    margin-right: 8px;
    object-fit: contain;
}

.currency span {
    font-weight: 700;
    min-width: 40px;
    text-align: right;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    background: #ece5d8;
    color: #333;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(160, 120, 32, 0.4);
    cursor: pointer;
}

/* Main Banner Area */
.banner-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.banner-wrapper {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 60vh;
    border-radius: 9px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(90, 140, 180, 0.35), 0 2px 8px rgba(200, 180, 100, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.banner-text {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 20px 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.87) 0%, rgba(30, 80, 120, 0.3) 60%, transparent 100%);
}

.banner-text h2 {
    font-size: 2rem;
    color: #f5e6b0;
    text-shadow: 0 2px 8px rgba(0, 60, 100, 0.8), 0 0 20px rgba(200, 180, 100, 0.5);
    margin-bottom: 5px;
}

/* Footer / Action Buttons */
.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px;
    padding-bottom: 40px;
    background: linear-gradient(to top, rgba(180, 220, 245, 0.75) 0%, rgba(200, 230, 250, 0.45) 70%, transparent 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.footer-left-btns {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-right-btns {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-sub-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(160, 210, 240, 0.8);
    border-radius: 9px;
    padding: 10px 16px;
    color: #3a5a78;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(100, 160, 200, 0.2);
}

.footer-sub-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(100, 160, 200, 0.35);
}

.footer-sub-btn:active {
    transform: scale(0.95);
}

.footer-btn-icon {
    font-size: 1.4rem;
}

.gacha-btn {
    background: linear-gradient(135deg, #c8e8f8, #a8d0e8);
    border: none;
    border-radius: 9px;
    padding: 3px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 18px rgba(80, 150, 200, 0.4), 0 1px 4px rgba(80, 120, 160, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.gacha-btn.pull-10 {
    background: linear-gradient(135deg, #f5e090, #d4a843, #c8841a);
    box-shadow: 0 4px 18px rgba(200, 160, 50, 0.5), 0 1px 4px rgba(180, 130, 30, 0.4);
}

.gacha-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(80, 150, 200, 0.5);
}

.gacha-btn.pull-10:hover {
    box-shadow: 0 6px 22px rgba(200, 160, 50, 0.65);
}

.gacha-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(80, 150, 200, 0.3);
}

.gacha-btn-inner {
    background: linear-gradient(to bottom, #f0f8ff, #e4f2fc);
    border-radius: 9px;
    padding: 10px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #2c4a65;
}

.gacha-btn.pull-10 .gacha-btn-inner {
    background: linear-gradient(to bottom, #fefae8, #fdf3cc);
    color: #5a3a10;
}

.btn-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.btn-cost {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #6a8aaa;
}

.gacha-btn.pull-10 .btn-cost {
    color: #a07030;
}

.btn-cost img {
    height: 20px;
}

.pity-info {
    position: absolute;
    bottom: 100px;
    left: 20px;
    font-size: 0.9rem;
    color: rgba(40, 80, 120, 0.85);
    background: rgba(255, 255, 255, 0.55);
    padding: 4px 12px;
    border-radius: 9px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(160, 210, 240, 0.6);
    text-shadow: none;
    font-weight: 600;
}

/* Version Badge */
.version-badge {
    position: fixed;
    bottom: 12px;
    right: 16px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(40, 80, 120, 0.7);
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(160, 210, 240, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 3px 10px;
    border-radius: 9px;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.3s;
}

/* Admin: version row */
.admin-version-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-version-prefix {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--admin-text, #e8e8f0);
    white-space: nowrap;
}

.admin-version-input {
    width: 120px;
    flex-shrink: 0;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 9px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 101;
}

.exchange-panel {
    max-width: 400px;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(160, 210, 240, 0.4);
    padding-bottom: 15px;
}

.modal-header h2 {
    color: #1a3a65;
    font-weight: 800;
}

.close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #86868b;
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

/* Shop Tabs (Segmented Control style) */
.shop-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 3px;
    border-radius: 9px;
    margin-bottom: 24px;
    border: none;
    gap: 2px;
    position: relative;
    z-index: 1;
}

.shop-tab {
    flex: 1;
    background: none;
    border: none;
    color: #86868b;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 9px;
    z-index: 1;
}

.shop-tab:hover {
    color: #1d1d1f;
}

.shop-tab.active {
    background: #ffffff;
    color: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.shop-tab.active::after {
    display: none;
}

.shop-tab-indicator {
    position: absolute;
    background: #ffffff;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
    top: 3px;
    bottom: 3px;
    left: 0;
}

.shop-tab-content {
    display: none;
}

.shop-tab-content.active {
    display: block;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding: 10px;
}

.shop-item {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 9px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.shop-item:hover {
    background: #ffffff;
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.stock-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ef4444;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 9px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.shop-cost {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.shop-cost img {
    height: 20px;
    margin: 0;
}

.shop-item img {
    height: 60px;
    margin-bottom: 10px;
}

.item-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.buy-btn,
.confirm-btn,
.cancel-btn {
    background: #f0f0f2;
    color: #0071e3;
    border: none;
    padding: 8px 18px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
    width: auto;
    min-width: 90px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.2px;
    font-size: 0.85rem;
}

.buy-btn:hover,
.confirm-btn:hover {
    background: #0071e3;
    color: #fff;
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.cancel-btn {
    background: linear-gradient(135deg, #b0c8e0, #7890a8);
    box-shadow: 0 2px 8px rgba(100, 140, 180, 0.3);
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #c0d8f0, #8aa0b8);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.exchange-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.5rem;
    margin: 20px 0;
}

.small-icon {
    height: 30px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(240, 250, 255, 0.92);
    color: #2c4a65;
    padding: 10px 24px;
    border-radius: 9px;
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.3s;
    border: 1px solid rgba(160, 210, 240, 0.8);
    box-shadow: 0 4px 16px rgba(80, 140, 200, 0.25);
    font-weight: 600;
    backdrop-filter: blur(8px);
}

/* Animation Screen */
#animation-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    overflow: hidden;
    background: #000;
}

#night-sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 40% 30%, #1a3a6a 0%, #0a1830 60%, #000 100%);
}

#meteor-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#skip-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 5px 15px;
    border-radius: 9px;
    cursor: pointer;
    z-index: 51;
}

/* Result Screen */
#result-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: radial-gradient(ellipse at 50% 30%, rgba(200, 235, 255, 0.92) 0%, rgba(170, 215, 248, 0.88) 40%, rgba(230, 245, 255, 0.95) 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.result-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 900px;
    padding: 20px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes slideUpIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.result-item {
    width: 130px;
    height: 180px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(220, 240, 255, 0.7));
    border: 1.5px solid rgba(200, 230, 255, 0.85);
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    position: relative;
    overflow: hidden;
    animation: slideUpIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    box-shadow: 0 4px 18px rgba(100, 160, 210, 0.3);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-item:hover {
    transform: translateY(-8px) scale(1.05);
    z-index: 10;
}

/* Staggered entry for gacha results */
.result-item:nth-child(1) { animation-delay: 0.05s; }
.result-item:nth-child(2) { animation-delay: 0.1s; }
.result-item:nth-child(3) { animation-delay: 0.15s; }
.result-item:nth-child(4) { animation-delay: 0.2s; }
.result-item:nth-child(5) { animation-delay: 0.25s; }
.result-item:nth-child(6) { animation-delay: 0.3s; }
.result-item:nth-child(7) { animation-delay: 0.35s; }
.result-item:nth-child(8) { animation-delay: 0.4s; }
.result-item:nth-child(9) { animation-delay: 0.45s; }
.result-item:nth-child(10) { animation-delay: 0.5s; }

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
    border-radius: 9px 9px 0 0;
    pointer-events: none;
}

.result-item.star-5 {
    background: linear-gradient(160deg, rgba(255, 245, 200, 0.95), rgba(240, 200, 80, 0.45));
    border-color: #e8c040;
    box-shadow: 0 0 25px rgba(220, 170, 30, 0.5), 0 4px 18px rgba(200, 150, 20, 0.3);
}

.result-item.star-4 {
    background: linear-gradient(160deg, rgba(245, 230, 255, 0.95), rgba(180, 120, 240, 0.35));
    border-color: #c890f0;
    box-shadow: 0 0 20px rgba(160, 100, 230, 0.4), 0 4px 18px rgba(150, 90, 210, 0.3);
}

.result-item.star-3 {
    background: linear-gradient(160deg, rgba(220, 238, 255, 0.95), rgba(80, 150, 220, 0.3));
    border-color: #80c0f0;
    box-shadow: 0 4px 18px rgba(80, 140, 200, 0.25);
}

/* Bag Item Overrides (Apple Style) */
.bag-tab-content .result-item {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04) !important;
    animation: slideUpIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) backwards !important;
    height: auto !important;
    padding: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
    overflow: hidden;
}

/* 5-Star Bag Item Enhancement */
.bag-tab-content .result-item.star-5 {
    background: linear-gradient(135deg, #ffffff 0%, #fffbf0 100%) !important;
    border: 1.5px solid rgba(212, 168, 67, 0.4) !important;
    box-shadow: 0 8px 20px rgba(212, 168, 67, 0.12) !important;
}

.bag-tab-content .result-item.star-5::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    background-size: 200% 100%;
    animation: shimmer 4s infinite linear;
    pointer-events: none;
    border-radius: 9px;
}

/* 4-Star Bag Item Enhancement */
.bag-tab-content .result-item.star-4 {
    background: linear-gradient(135deg, #ffffff 0%, #f9f5ff 100%) !important;
    border: 1.5px solid rgba(155, 89, 182, 0.3) !important;
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.08) !important;
}

.bag-tab-content .result-item:hover {
    transform: translateY(-6px) scale(1.04) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1) !important;
    background: #ffffff !important;
}

.bag-tab-content .result-item.star-5 .item-stars {
    color: #d4a843 !important;
    text-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
}

.bag-tab-content .result-item.star-4 .item-stars {
    color: #9b59b6 !important;
    text-shadow: 0 0 8px rgba(155, 89, 182, 0.3);
}

.bag-tab-content .result-item::before {
    display: none !important;
}

.bag-tab-content .item-img {
    width: 90px !important;
    height: 90px !important;
    border-radius: 6px !important;
    filter: none !important;
}

/* Character Details Weapon Items - Lightweight */
#character-details-modal #cd-inline-weapon-list .result-item {
    animation: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: none !important;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.7), rgba(220, 240, 255, 0.5)) !important;
    border: 1px solid rgba(200, 230, 255, 0.6) !important;
}

#character-details-modal #cd-inline-weapon-list .result-item:hover {
    transform: none !important;
    z-index: auto !important;
}

#character-details-modal #cd-inline-weapon-list .result-item::before {
    display: none !important;
}

#character-details-modal #cd-inline-weapon-list .result-item.star-5 {
    box-shadow: 0 2px 8px rgba(220, 170, 30, 0.2) !important;
}

#character-details-modal #cd-inline-weapon-list .result-item.star-4 {
    box-shadow: 0 2px 8px rgba(160, 100, 230, 0.2) !important;
}

#character-details-modal #cd-inline-weapon-list .result-item.star-3 {
    box-shadow: 0 2px 8px rgba(80, 140, 200, 0.15) !important;
}

/* --- Weapon Split Layout --- */
.bag-split-container {
    display: flex;
    flex-direction: row;
    height: 100%;
    gap: 15px;
}
.bag-split-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}
.bag-split-detail {
    width: 320px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    padding: 15px;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .bag-split-container {
        flex-direction: column;
    }
    .bag-split-detail {
        width: 100%;
        height: 45%;
        flex-shrink: 0;
    }

    /* Character Details: Weapon view (desktop: side-by-side, mobile: top/bottom split) */
    .weapon-view-container {
        display: flex;
        flex-direction: row;
        gap: 15px;
        height: 100%;
    }
    .weapon-list-pane {
        flex: 1 1 auto;
        overflow-y: auto;
        padding: 10px 6px;
        min-height: 0; /* allow flex children to shrink */
    }
    .weapon-detail-pane {
        width: 360px;
        background: rgba(30,41,59,0.9);
        border: 1px solid rgba(255,255,255,0.06);
        border-radius: 9px;
        padding: 12px;
        color: #e6eef8;
        overflow-y: auto;
        flex-shrink: 0;
    }

    @media (max-width: 768px) {
        .weapon-view-container {
            flex-direction: column;
        }
        .weapon-list-pane {
            height: 55%;
        }
        .weapon-detail-pane {
            width: 100%;
            height: 45%;
            border-radius: 12px 12px 0 0;
        }
    }
}
.selected-weapon {
    border: 2px solid #fff !important;
    transform: scale(1.02) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5) !important;
}

.bag-tab-content .item-name {
    color: #1d1d1f !important;
    text-shadow: none !important;
    font-size: 0.8rem !important;
    margin-top: 10px !important;
    font-weight: 600 !important;
}

.bag-tab-content .item-stars {
    font-size: 0.8rem !important;
    margin-bottom: 0 !important;
    text-align: center !important;
}

.item-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 9px;
    margin-bottom: auto;
    filter: drop-shadow(0 3px 6px rgba(60, 100, 160, 0.35));
}

.item-stars {
    color: var(--wish-gold-mid);
    font-size: 1rem;
    margin-bottom: 5px;
}

.item-name {
    font-size: 0.75rem;
    text-align: center;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    width: 100%;
    line-height: 1.2;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

#close-result-btn {
    margin-top: 40px;
    max-width: 200px;
    font-size: 1.1rem;
    padding: 12px 36px;
    background: rgba(20, 20, 35, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    color: #ffffff !important;
    letter-spacing: 1px;
    font-weight: 800;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

#close-result-btn:hover {
    background: rgba(35, 35, 55, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #f3f4f6 !important;
    transform: translateY(-2px) scale(1.03) !important;
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45), 0 0 15px rgba(255, 255, 255, 0.15) !important;
}

#close-result-btn:active {
    transform: translateY(0) scale(0.97) !important;
    background: rgba(15, 15, 25, 0.85) !important;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Allow JS to hide splash image even if other rules set it; toggle `.hidden` on the element */
#cd-splash-img.hidden {
    display: none !important;
}

/* Meteor Animations - 繝ｪ繧｢繝ｫ蛹・*/
.meteor {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    box-shadow: 0 0 20px 5px currentColor, 0 0 40px currentColor;
}

.meteor::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translateY(-50%) rotate(125deg);
    transform-origin: right center;
    width: 400px;
    height: 6px;
    background: linear-gradient(to left, #fff, currentColor, transparent);
    border-radius: 9px;
    filter: blur(2px);
    opacity: 0.9;
}

.meteor.star-5 {
    color: var(--rarity-5);
    animation: fall 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.meteor.star-4 {
    color: var(--rarity-4);
    animation: fall 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.meteor.star-3 {
    color: var(--rarity-3);
    animation: fall 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fall {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0);
    }

    10% {
        opacity: 1;
        transform: translate(15vw, 20vh) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(120vw, 160vh) scale(0.5);
    }
}

/* Splash Screen (遶九■邨ｵ) */
#splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    /* 繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ縺ｨ繝ｪ繧ｶ繝ｫ繝医・髢・*/
    background: linear-gradient(160deg, #c8e4f4 0%, #a8cce4 40%, #d8eef8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.splash-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 80%, rgba(200, 230, 255, 0.6) 0%, rgba(150, 200, 240, 0.2) 60%, transparent 100%);
    opacity: 1;
}

#splash-img {
    height: 80vh;
    max-width: 90vw;
    object-fit: contain;
    z-index: 2;
    animation: slideUpFade 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.splash-info {
    position: absolute;
    bottom: 20%;
    left: 10%;
    z-index: 3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1);
    animation: fadeInRight 0.5s ease forwards 0.3s;
    opacity: 0;
}

#splash-name {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 5px;
    letter-spacing: 2px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8), 0 0 30px rgba(100, 160, 240, 0.5);
}

.click-to-continue {
    position: absolute;
    bottom: 30px;
    right: 30px;
    color: rgba(255, 255, 255, 0.85);
    z-index: 3;
    animation: pulse 1.5s infinite;
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 18px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* Banner Type Tabs (髯仙ｮ・諱貞ｸｸ) */
.banner-type-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    background: linear-gradient(to bottom, rgba(190, 225, 245, 0.6) 0%, transparent 100%);
    border-bottom: 1px solid rgba(160, 210, 240, 0.3);
}

.banner-type-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(50, 80, 120, 0.6);
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    position: relative;
    bottom: -1px;
}

.banner-type-tab:hover {
    color: #2c5a88;
}

.banner-type-tab.active {
    color: #1a4a78;
    border-bottom: 3px solid var(--wish-gold-mid);
}

.banner-type-tab[data-banner="standard"].active {
    color: #1a4a78;
    border-bottom: 3px solid #4ab0cc;
}

.banner-type-icon {
    font-size: 0.85rem;
    opacity: 0.8;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}



/* ==================================
   Loading / Start Screen
==================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: linear-gradient(160deg, #c8e4f4, #a8cce4, #d8eef8);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.loading-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    z-index: 1;
}

.loading-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-shadow: 0 2px 10px rgba(80, 140, 200, 0.4);
}

.loading-progress-container {
    width: 300px;
    height: 6px;
    background: rgba(160, 210, 240, 0.35);
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(100, 160, 200, 0.3);
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(200, 230, 255, 0.5), var(--wish-gold-mid), #f5e090);
    border-radius: 9px;
    box-shadow: 0 0 10px rgba(212, 168, 67, 0.7);
    transition: width 0.1s linear;
}

.start-game-btn {
    font-size: 1.2rem;
    color: #1a3a60;
    padding: 10px 30px;
    cursor: pointer;
    font-weight: bold;
    animation: flashPulse 2s infinite;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 9px;
    border: 1px solid rgba(160, 210, 240, 0.7);
    backdrop-filter: blur(6px);
}

@keyframes flashPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.04);
        box-shadow: 0 0 20px rgba(180, 210, 255, 0.6);
    }
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================================
   Responsive - iPhone / Mobile
==================================== */
@media (max-width: 480px) {

    /* 繝倥ャ繝繝ｼ */
    .top-nav {
        padding: 8px 10px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .header-right {
        gap: 6px;
    }

    .currency {
        padding: 2px 6px 2px 2px;
    }

    .currency img {
        height: 18px;
        width: 18px;
        margin-right: 4px;
    }

    .currency span {
        font-size: 0.8rem;
        min-width: 24px;
    }

    #history-btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* バナー */
    .banner-container {
        padding: 10px;
        align-items: flex-start;
    }

    .banner-wrapper {
        width: 100%;
        height: auto;
        max-height: 45vh;
        aspect-ratio: 16 / 9;
    }

    .banner-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
    }

    .banner-text h2 {
        font-size: 1.2rem;
    }

    .banner-text p {
        font-size: 0.75rem;
    }

    /* 螟ｩ莠戊｡ｨ遉ｺ */
    .pity-info {
        bottom: 90px;
        font-size: 0.8rem;
        left: 10px;
    }

    /* 繝輔ャ繧ｿ繝ｼ */
    .action-buttons {
        padding: 10px;
        padding-bottom: env(safe-area-inset-bottom, 15px);
        gap: 8px;
        flex-wrap: nowrap;
    }

    .footer-left-btns {
        gap: 6px;
    }

    .footer-sub-btn {
        padding: 7px 10px;
        font-size: 0.75rem;
        border-radius: 9px;
    }

    .footer-btn-icon {
        font-size: 1.1rem;
    }

    .footer-right-btns {
        gap: 8px;
    }

    .gacha-btn-inner {
        padding: 8px 16px;
    }

    .btn-title {
        font-size: 0.9rem;
    }

    .btn-cost img {
        height: 16px;
    }

    /* モーダル */
    .modal-content {
        width: 95%;
        max-height: 85vh;
        padding: 15px;
        overflow-y: auto;
    }

    /* バッグ画面を全画面表示 */
    #bag-modal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 12px !important;
        overflow: hidden;
    }
    #bag-modal {
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    #bag-modal .modal-bg {
        display: none;
    }

    .shop-items {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-tab {
        font-size: 0.95rem;
        padding: 8px 10px;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    /* 繝ｪ繧ｶ繝ｫ繝育判髱｢ */
    .result-grid {
        gap: 8px;
        padding: 10px;
        overflow-y: auto;
        max-height: 75vh;
    }

    .result-item {
        width: 90px;
        height: 140px;
    }

    .item-img {
        width: 70px;
        height: 70px;
    }

    .item-stars {
        font-size: 0.75rem;
    }

    .item-name {
        font-size: 0.65rem;
    }

    /* スマホ版の武器一覧を3列に戻し、名前を非表示、縦長カードに */
    #bag-weapon-list.result-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 10px;
    }
    #bag-weapon-list .result-item {
        width: 100% !important;
        height: 125px !important;
        padding: 10px !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        box-sizing: border-box;
    }
    #bag-weapon-list .item-img {
        width: 65px !important;
        height: 65px !important;
        margin-bottom: 8px !important;
    }
    #bag-weapon-list .item-name {
        display: none !important;
    }
    #bag-weapon-list .item-stars {
        margin-top: auto;
        text-align: center !important;
        padding-left: 0 !important;
    }

    #close-result-btn {
        margin-top: 15px;
        font-size: 1rem;
        padding: 10px 20px;
    }

    /* 繧ｹ繝励Λ繝・す繝･逕ｻ髱｢ */
    #splash-img {
        height: 70vh;
    }

    #splash-name {
        font-size: 1.8rem;
    }

    /* 繝ｭ繝ｼ繝臥判髱｢ */
    .loading-progress-container {
        width: 80vw;
    }

    /* 螻･豁ｴ繝｢繝ｼ繝繝ｫ */
    #history-list {
        max-height: 55vh;
    }
}

/* 繝弱ャ繝√↑縺ｩ縺ｮ繧ｻ繝ｼ繝輔お繝ｪ繧｢蟇ｾ蠢・*/
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .action-buttons {
        padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
    }
}

/* ====================================================
   邂｡逅・・ヱ繝阪Ν (Developer Panel - 髱槫・髢区ｩ溯・)
   繧｢繧ｯ繧ｻ繧ｹ: 縲檎･磯｡倥阪Ο繧ｴ繧・蝗樒ｴ譌ｩ縺上ち繝・・
==================================================== */
.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-container {
    background: #0f172a;
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 9px;
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, 0.1),
        0 0 60px rgba(99, 102, 241, 0.25),
        0 30px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

/* 繝倥ャ繝繝ｼ */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e293b 0%, #162032 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 2.5px;
    padding: 3px 9px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

.admin-title {
    color: #e2e8f0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.admin-close-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.admin-close-btn:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.6);
}

/* 繧ｿ繝悶リ繝・*/
.admin-tabs {
    display: flex;
    background: #1e293b;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    flex-shrink: 0;
}

.admin-tab-btn {
    flex: 1;
    padding: 11px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(148, 163, 184, 0.65);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    letter-spacing: 0.3px;
}

.admin-tab-btn:hover {
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.08);
}

.admin-tab-btn.active {
    color: #a5b4fc;
    border-bottom-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

/* 繧ｿ繝悶さ繝ｳ繝・Φ繝・*/
.admin-tab-content {
    display: none;
    overflow-y: auto;
    flex: 1;
    padding: 16px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

.admin-tab-content::-webkit-scrollbar {
    width: 5px;
}

.admin-tab-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 9px;
}

.admin-tab-content.active {
    display: block;
}

/* 繝舌リ繝ｼ險ｭ螳壹ヵ繧ｩ繝ｼ繝 */
.admin-form-section {
    background: #1e293b;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 9px;
    padding: 16px;
    margin-bottom: 14px;
}

.admin-form-section:last-child {
    margin-bottom: 0;
}

.admin-section-title {
    color: #a5b4fc;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.admin-field-group {
    margin-bottom: 12px;
}

.admin-field-group:last-child {
    margin-bottom: 0;
}

.admin-label {
    display: block;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.admin-input-full {
    width: 100%;
    background: #0f172a;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 9px;
    padding: 9px 12px;
    color: #e2e8f0;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    /* 繝・く繧ｹ繝亥・蜉帙・驕ｸ謚槭ｒ險ｱ蜿ｯ */
    user-select: text;
    -webkit-user-select: text;
}

.admin-input-full:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* 繝励・繝ｫ險ｭ螳壹ヲ繝ｳ繝・*/
.admin-hint {
    color: #475569;
    font-size: 0.78rem;
    margin-bottom: 14px;
    line-height: 1.6;
    padding: 8px 12px;
    background: #1e293b;
    border-radius: 9px;
    border-left: 3px solid rgba(99, 102, 241, 0.5);
}

.admin-hint code {
    background: #0f172a;
    padding: 1px 6px;
    border-radius: 9px;
    color: #a5b4fc;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

/* 繝励・繝ｫ繧ｻ繧ｯ繧ｷ繝ｧ繝ｳ */
.admin-pool-section {
    margin-bottom: 14px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 9px;
    overflow: hidden;
}

.admin-pool-section.rarity-5 {
    border-color: rgba(200, 132, 26, 0.4);
}

.admin-pool-section.rarity-4 {
    border-color: rgba(155, 89, 182, 0.4);
}

.admin-pool-section.rarity-3 {
    border-color: rgba(52, 152, 219, 0.35);
}

.admin-pool-section:last-child {
    margin-bottom: 0;
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    background: #1e293b;
}

.admin-section-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
}

.admin-pool-section.rarity-5 .admin-section-label {
    color: #c8841a;
}

.admin-pool-section.rarity-4 .admin-section-label {
    color: #9b59b6;
}

.admin-pool-section.rarity-3 .admin-section-label {
    color: #3498db;
}

.admin-add-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-add-btn:hover {
    background: rgba(99, 102, 241, 0.35);
}

.admin-item-list {
    padding: 8px;
    background: #0a1120;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-item-row {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #1e293b;
    border-radius: 9px;
    padding: 7px 8px;
    border: 1px solid rgba(99, 102, 241, 0.08);
    transition: border-color 0.15s;
}

.admin-item-row:hover {
    border-color: rgba(99, 102, 241, 0.2);
}

.admin-row-num {
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    font-family: monospace;
}

.admin-input {
    background: #0f172a;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 14px;
    padding: 5px 8px;
    color: #e2e8f0;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
    user-select: text;
    -webkit-user-select: text;
}

.admin-input:focus {
    border-color: #6366f1;
}

.admin-name-input {
    flex: 2.5;
    min-width: 0;
}

.admin-splash-input {
    flex: 2.5;
    min-width: 0;
}

.admin-chara-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-chara-label input[type=checkbox] {
    accent-color: #6366f1;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.admin-del-btn {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    border-radius: 14px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.admin-del-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.admin-empty {
    text-align: center;
    color: #334155;
    font-size: 0.8rem;
    padding: 12px;
    font-style: italic;
}

/* 繝輔ャ繧ｿ繝ｼ */
.admin-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    background: #1e293b;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    flex-shrink: 0;
}

.admin-save-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
    padding: 9px 22px;
    border-radius: 9px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    letter-spacing: 0.3px;
}

.admin-save-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.admin-save-btn:active {
    transform: scale(0.97);
}

.admin-cancel-btn {
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.3);
    color: #94a3b8;
    padding: 9px 16px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.2s;
}

.admin-cancel-btn:hover {
    background: rgba(100, 116, 139, 0.3);
}

.admin-reset-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 9px 14px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.2s;
}

.admin-reset-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* 遘伜ｯ・・繝偵Φ繝・*/
.admin-secret-hint {
    text-align: center;
    color: rgba(99, 102, 241, 0.25);
    font-size: 0.68rem;
    padding: 5px;
    background: #0a1120;
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* 繝｢繝舌う繝ｫ蟇ｾ蠢・*/
@media (max-width: 480px) {
    .admin-container {
        max-height: 92vh;
        border-radius: 9px;
    }

    .admin-tab-content {
        padding: 12px;
    }

    .admin-footer {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 7px;
    }

    .admin-save-btn,
    .admin-cancel-btn,
    .admin-reset-btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    .admin-item-row {
        flex-wrap: wrap;
    }

    .admin-name-input,
    .admin-splash-input {
        flex: 1 1 100%;
    }
}

/* ====================================================
   繝舌リ繝ｼ逕ｻ蜒上・繝ｬ繝薙Η繝ｼ (邂｡逅・・ヱ繝阪Ν蜀・
==================================================== */
.admin-image-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-image-row .admin-input-full {
    flex: 1;
}

.admin-banner-preview {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(14, 165, 233, 0.35);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.admin-banner-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}

/* ====================================================
   繧ｨ繧ｯ繧ｹ繝昴・繝医・繧ｿ繝ｳ & 繝｢繝ｼ繝繝ｫ
==================================================== */
.admin-export-btn {
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #38bdf8;
    padding: 9px 14px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.2s;
}

.admin-export-btn:hover {
    background: rgba(14, 165, 233, 0.28);
}

/* 繧ｨ繧ｯ繧ｹ繝昴・繝医Δ繝ｼ繝繝ｫ縺ｮ繧ｪ繝ｼ繝舌・繝ｬ繧､ */
.admin-export-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6000;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: adminFadeIn 0.18s ease;
}

@keyframes adminFadeIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.admin-export-container {
    background: #0f172a;
    border: 1px solid rgba(14, 165, 233, 0.4);
    border-radius: 9px;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 0 1px rgba(14, 165, 233, 0.08),
        0 0 60px rgba(14, 165, 233, 0.2),
        0 30px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

/* 繧ｨ繧ｯ繧ｹ繝昴・繝医・繝・ム繝ｼ */
.admin-export-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e293b, #162032);
    border-bottom: 1px solid rgba(14, 165, 233, 0.25);
    flex-shrink: 0;
}

/* 繧ｨ繧ｯ繧ｹ繝昴・繝医・繝・ぅ */
.admin-export-body {
    overflow-y: auto;
    flex: 1;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, 0.3) transparent;
}

.admin-export-body::-webkit-scrollbar {
    width: 5px;
}

.admin-export-body::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.3);
    border-radius: 9px;
}

/* 菴ｿ縺・婿縺ｮ隱ｬ譏弱ヰ繝ｼ */
.admin-export-notice {
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-left: 4px solid #0ea5e9;
    border-radius: 9px;
    padding: 10px 14px;
    color: #94a3b8;
    font-size: 0.82rem;
    line-height: 1.6;
}

.admin-export-notice strong {
    color: #38bdf8;
}

/* 蜷・ヵ繧｡繧､繝ｫ繧ｻ繧ｯ繧ｷ繝ｧ繝ｳ */
.admin-export-section {
    background: #1e293b;
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-radius: 9px;
    overflow: hidden;
}

.admin-export-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #162032;
    gap: 10px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.15);
    flex-wrap: wrap;
}

.admin-export-file {
    display: block;
    color: #38bdf8;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-bottom: 3px;
}

.admin-export-where {
    display: block;
    color: #475569;
    font-size: 0.73rem;
    font-family: 'Courier New', monospace;
}

/* 繧ｳ繝ｼ繝峨ユ繧ｭ繧ｹ繝医お繝ｪ繧｢ */
.admin-export-code {
    display: block;
    width: 100%;
    min-height: 160px;
    max-height: 280px;
    background: #0a1120;
    color: #a5f3fc;
    border: none;
    padding: 14px 16px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.65;
    resize: vertical;
    outline: none;
    /* 繝・く繧ｹ繝磯∈謚槭ｒ險ｱ蜿ｯ */
    user-select: text;
    -webkit-user-select: text;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, 0.3) transparent;
}

.admin-export-code::-webkit-scrollbar {
    width: 4px;
}

.admin-export-code::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.3);
    border-radius: 9px;
}

/* 繧ｳ繝斐・繝懊ち繝ｳ */
.admin-copy-btn {
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #38bdf8;
    padding: 7px 16px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.admin-copy-btn:hover {
    background: rgba(14, 165, 233, 0.3);
}

.admin-copy-btn.copied {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

/* 繝｢繝舌う繝ｫ蟇ｾ蠢・*/
@media (max-width: 480px) {
    .admin-export-container {
        max-height: 92vh;
        border-radius: 9px;
    }

    .admin-export-body {
        padding: 12px;
    }

    .admin-export-code {
        min-height: 120px;
        font-size: 0.73rem;
    }

    .admin-export-section-header {
        gap: 8px;
    }
}

/* Epitomized Path Styles */
.epitomized-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 9px;
    padding: 10px;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.3);
}

.epitomized-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.epitomized-item.selected {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.2);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.epitomized-img-wrap img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.epitomized-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #f8fafc;
    margin-top: 5px;
}

#cd-constellation-nodes {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

/* Constellation node animation */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(226, 200, 143, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(226, 200, 143, 0); }
    100% { box-shadow: 0 0 0 0 rgba(226, 200, 143, 0); }
}


/* ===== General Mobile Responsiveness ===== */
@media (max-width: 768px) {
    /* Header optimization */
    .top-nav {
        padding: 5px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .header-left {
        width: 100%;
    }

    .logo-text {
        font-size: 1rem;
    }

    .header-right {
        width: 100%;
        overflow-x: auto;
        padding: 5px 0;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
        display: flex;
        align-items: center;
    }

    .header-right::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }

    .header-icon-btn {
        width: 36px !important;
        height: 36px !important;
        flex-shrink: 0;
    }

    .header-icon-btn img {
        width: 20px !important;
        height: 20px !important;
    }

    .currency {
        padding: 2px 8px 2px 2px;
        flex-shrink: 0;
    }

    .currency img {
        height: 18px;
        width: 18px;
        margin-right: 4px;
    }

    .currency span {
        font-size: 0.8rem;
        min-width: 30px;
    }

    /* Banner Tabs */
    .banner-type-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 10px;
        display: flex;
    }

    .banner-type-tabs::-webkit-scrollbar {
        display: none;
    }

    .banner-type-tab {
        padding: 8px 15px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    /* Footer Buttons */
    .action-buttons {
        padding: 10px;
        padding-bottom: 30px;
        gap: 10px;
    }

    .footer-sub-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
        flex-shrink: 0;
    }

    .footer-btn-icon {
        font-size: 1.1rem;
    }

    .footer-right-btns {
        gap: 10px;
    }

    .gacha-btn-inner {
        padding: 6px 15px;
    }

    .btn-title {
        font-size: 0.85rem;
    }

    .btn-cost {
        font-size: 0.75rem;
        gap: 3px;
    }

    .btn-cost img {
        height: 14px;
    }

    /* Pity Info */
    .pity-info {
        bottom: 85px;
        left: 10px;
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    /* Version Badge */
    .version-badge {
        bottom: 5px;
        right: 5px;
        font-size: 0.6rem;
    }

    /* Banner Area */
    .banner-wrapper {
        max-height: 50vh;
    }

    .banner-text h2 {
        font-size: 1.5rem;
    }

    .banner-text p {
        font-size: 0.8rem;
    }
}

/* ===== キャラクター詳細 モバイル対応 ===== */

@media (max-width: 768px) {

    /* ヘッダー: コンパクト化 */
    #character-details-modal .cd-container {
        padding: 10px 10px 0 10px !important;
    }

    #cd-element-icon {
        width: 22px !important;
        height: 22px !important;
    }

    #cd-element-name, #cd-char-name {
        font-size: 0.85rem !important;
    }

    #cd-char-list {
        max-width: 40% !important;
        gap: 5px !important;
    }
    #cd-char-list > div {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0;
    }

    #close-cd-btn {
        width: 26px !important;
        height: 26px !important;
        font-size: 1rem !important;
        flex-shrink: 0;
    }

    /* ボディ: 縦積みに変更 */
    .cd-body {
        flex-direction: column !important;
        overflow: hidden !important;
    }

    /* サイドバー → 上部の横並びタブに変換 */
    .cd-sidebar {
        order: -1 !important;
        width: 100% !important;
        flex-direction: row !important;
        padding: 0 !important;
        gap: 0 !important;
        font-size: 0.85rem !important;
        font-weight: bold !important;
        background: rgba(0, 0, 0, 0.45) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
        flex-shrink: 0 !important;
        z-index: 15 !important;
        text-shadow: none !important;
    }

    .cd-tab {
        flex: 1 !important;
        text-align: center !important;
        padding: 10px 4px !important;
        font-size: 0.8rem !important;
    }

    .cd-tab-indicator {
        left: 15% !important;
        width: 70% !important;
    }

    /* 立ち絵: 中段に静的配置 */
    #cd-splash-img {
        order: 0 !important;
        display: block !important;
        position: static !important;
        transform: none !important;
        width: 100% !important;
        height: 32vh !important;
        max-width: 100% !important;
        object-fit: contain !important;
        object-position: center bottom !important;
        flex-shrink: 0 !important;
        pointer-events: none !important;
        z-index: 0 !important;
    }

    /* メインコンテンツ: 下側でスクロール */
    .cd-main {
        order: 1 !important;
        position: static !important;
        width: 100% !important;
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 10px !important;
        background: rgba(0, 0, 0, 0.35) !important;
        backdrop-filter: blur(6px) !important;
        -webkit-backdrop-filter: blur(6px) !important;
    }

    /* ステータス・武器パネル: absolute解除 */
    #cd-status-view,
    #cd-weapon-view {
        position: static !important;
        width: 100% !important;
        right: auto !important;
        top: auto !important;
    }

    #cd-status-name {
        font-size: 1.3rem !important;
    }

    /* 命ノ星座 */
    #cd-constellation-view {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        min-height: 300px !important;
        overflow-y: visible !important;
    }

    #cd-constellation-bg {
        width: 220px !important;
        height: 220px !important;
        top: 10px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    #cd-constellation-nodes {
        right: auto !important;
        left: 50% !important;
        bottom: 20px !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        flex-direction: row !important;
        gap: 12px !important;
        z-index: 10 !important;
    }

    #cd-constellation-nodes > div {
        width: 36px !important;
        height: 36px !important;
    }

    #cd-constellation-detail {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin-top: 20px !important; /* ノードが下に行ったので間隔調整 */
        margin-bottom: 80px !important; /* ノード用のスペース */
        left: auto !important;
        top: auto !important;
        padding: 12px !important;
    }
}

/* 管理者用リセットボタン */
.admin-danger-btn {
    background: linear-gradient(135deg, #ff4d4d, #cc0000) !important;
    color: white !important;
    border: none;
    padding: 8px 16px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: bold;
    transition: filter 0.2s;
}

.admin-danger-btn:hover {
    filter: brightness(1.2);
}

/* ========================================
   Character Level-Up Panel
   ======================================== */
.cd-levelup-panel {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 9px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 20px rgba(0, 0, 0, 0.15);
}

.cd-levelup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cd-asc-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(226, 200, 143, 0.15);
    color: #e2c88f;
    padding: 3px 10px;
    border-radius: 9px;
    border: 1px solid rgba(226, 200, 143, 0.25);
    letter-spacing: 0.5px;
}

.cd-exp-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* EXP Bar */
.cd-exp-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}

.cd-exp-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c9a84c, #e2c88f, #f5deb3);
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.cd-exp-fill-anim {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(226, 200, 143, 0.5), rgba(245, 222, 179, 0.3));
    border-radius: 6px;
    transition: width 0.3s ease;
    z-index: 1;
}

@keyframes expFlash {
    0% { opacity: 1; filter: brightness(1.8); }
    50% { opacity: 0.8; filter: brightness(1.2); }
    100% { opacity: 1; filter: brightness(1); }
}

.cd-exp-fill.flash {
    animation: expFlash 0.4s ease-out;
}

/* Level-up info row */
.cd-levelup-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 8px;
    color: rgba(226, 200, 143, 0.9);
    font-weight: 500;
}

.cd-cost-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cd-cost-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}

.cd-target-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: #e2c88f;
}

/* Custom Range Slider */
.cd-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    outline: none;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
}

.cd-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5deb3, #e2c88f);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 12px rgba(226, 200, 143, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cd-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 18px rgba(226, 200, 143, 0.5);
}

.cd-slider::-webkit-slider-thumb:active {
    transform: scale(1.25);
}

.cd-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5deb3, #e2c88f);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 12px rgba(226, 200, 143, 0.3);
    cursor: pointer;
}

.cd-slider::-moz-range-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: none;
}

/* Level-up buttons row */
.cd-levelup-btns {
    display: flex;
    gap: 8px;
}

.cd-action-btn {
    border: none;
    font-weight: 700;
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.cd-action-btn:active {
    transform: scale(0.95);
}

.cd-btn-small {
    flex: 1;
    padding: 9px 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
}

.cd-btn-small:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(226, 200, 143, 0.4);
    color: #e2c88f;
}

.cd-btn-confirm {
    flex: 2;
    padding: 9px 16px;
    background: linear-gradient(135deg, #e2c88f, #c9a84c);
    color: #1a1000;
    box-shadow: 0 2px 12px rgba(226, 200, 143, 0.25);
}

.cd-btn-confirm:hover {
    background: linear-gradient(135deg, #f0d8a0, #d4b05c);
    box-shadow: 0 4px 18px rgba(226, 200, 143, 0.4);
    transform: translateY(-1px);
}

.cd-btn-confirm:active {
    transform: scale(0.96);
}

/* Ascend controls */
.cd-ascend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cd-ascend-label {
    font-size: 0.9rem;
    color: #e2c88f;
    font-weight: 600;
}

.cd-ascend-cost {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.cd-btn-ascend {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #e2c88f, #c9a84c);
    color: #1a1000;
    box-shadow: 0 2px 12px rgba(226, 200, 143, 0.25);
    font-size: 0.95rem;
}

.cd-btn-ascend:hover {
    background: linear-gradient(135deg, #f0d8a0, #d4b05c);
    box-shadow: 0 4px 18px rgba(226, 200, 143, 0.4);
    transform: translateY(-1px);
}

/* Level-up animation overlay */
@keyframes levelUpPulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes expCountUp {
    0% { opacity: 0; transform: translateY(8px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

.cd-exp-popup {
    position: absolute;
    top: -20px;
    right: 10px;
    color: #e2c88f;
    font-size: 0.85rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    animation: expCountUp 1.2s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

/* Bag character grid: 3 columns on mobile */
#bag-character-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

#bag-character-list .result-item {
    width: auto;
}

@media (max-width: 480px) {
    #bag-character-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    #bag-character-list .result-item {
        width: auto;
        height: auto;
        min-height: 140px;
    }
}

/* Primogem Exchange Modal: align buttons to the center and style as DarkGlass */
#exchange-modal .modal-actions {
    justify-content: center;
}

#exchange-modal .cancel-btn,
#exchange-modal .confirm-btn {
    background: rgba(25, 25, 35, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 8px 24px !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.05) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
    min-width: 90px;
}

#exchange-modal .cancel-btn:hover {
    background: rgba(45, 45, 60, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

#exchange-modal .confirm-btn {
    border-color: rgba(212, 168, 67, 0.35) !important;
    color: #f5e090 !important; /* Premium gold accent to indicate gacha confirmation */
}

#exchange-modal .confirm-btn:hover {
    background: rgba(35, 35, 50, 0.95) !important;
    border-color: rgba(212, 168, 67, 0.7) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(212, 168, 67, 0.25) !important;
}

#exchange-modal .cancel-btn:active,
#exchange-modal .confirm-btn:active {
    transform: translateY(0) scale(0.97) !important;
}

#cancel-epitomized-btn {
    background: rgba(25, 25, 35, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 8px 24px !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    backdrop-filter: blur(12px) !important;
    transition: all 0.2s ease !important;
}

#cancel-epitomized-btn:hover {
    background: rgba(35, 35, 50, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

#cancel-epitomized-btn:active {
    transform: translateY(0) scale(0.97) !important;
}

/* ========================================
   武器画面レイアウト (weapon view)
   ======================================== */

/* cd-weapon-view 自体: 親(.cd-main)のサイズに合わせて全体を占める */
/* display は .hidden と競合させないため :not(.hidden) で指定 */
.weapon-view-container {
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    flex-direction: row;
    gap: 0;
    overflow: hidden;
    z-index: 10;
}

.weapon-view-container:not(.hidden) {
    display: flex;
}

/* 左ペイン: 武器一覧 — スクロール可能 */
.weapon-list-pane {
    flex: 1 1 0;
    min-width: 0;
    overflow-y: auto;
    padding: 20px 16px 20px 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* 右ペイン: 武器詳細 — スクロールに追随しない (sticky) */
.weapon-detail-pane {
    flex: 0 0 340px;
    width: 340px;
    max-width: 340px;
    overflow-y: auto;
    padding: 20px 20px 20px 16px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.35);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    /* sticky ではなく独自スクロールで固定感を出す */
    position: relative;
}

/* スマホ: 縦積みレイアウトに切り替え */
@media (max-width: 640px) {
    .weapon-view-container {
        position: static !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        flex: 1 !important;
    }

    .weapon-view-container:not(.hidden) {
        display: flex !important;
    }

    .weapon-list-pane {
        flex: 0 0 auto;
        overflow-y: unset;
        padding: 12px;
        max-height: none;
    }

    .weapon-detail-pane {
        flex: 0 0 auto;
        width: 100% !important;
        max-width: 100% !important;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        padding: 12px;
        overflow-y: unset;
    }
}

/* ===============================
   TITLE SCREEN
   =============================== */
.title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #e0f2fe; /* light blue sky fallback */
}

.title-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/bluesky.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.title-logo-container {
    margin-top: 10vh;
    margin-bottom: 8vh;
    animation: slideDownFade 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.title-logo-img {
    width: 280px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.title-btn-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
}

.ts-action-btn {
    position: relative;
    width: 260px;
    height: 50px;
    background: linear-gradient(180deg, #333333 0%, #1a1a1a 100%);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 4px;
    border: none;
    cursor: pointer;
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, filter 0.2s;
    animation: fadeIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ts-action-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #14b8a6 0%, #06b6d4 100%);
    box-shadow: 0 -2px 10px rgba(6, 182, 212, 0.5);
}

.ts-action-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.ts-action-btn:active {
    transform: scale(0.95);
}

.title-footer-icons {
    position: absolute;
    bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    box-sizing: border-box;
}

.tf-icon {
    width: 60px;
    height: 60px;
    background: #6b7280;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset 0 0 10px rgba(20, 184, 166, 0.3);
    transition: transform 0.2s;
}

.tf-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3), inset 0 0 15px rgba(20, 184, 166, 0.5);
}

.tf-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

@keyframes slideDownFade {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
