/* ショップ画面の調整 */
.shop-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ショップ画面スタイル */
.shop-balance {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 10px;
}

/* カテゴリボタン */
.shop-categories {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.category-btn {
    padding: 6px 12px;
    border: 1px solid #00ffff;
    background: rgba(0,255,255,0.1);
    color: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    min-width: 50px;
    text-align: center;
}

.category-btn.active {
    background: #00ffff;
    color: black;
    font-weight: bold;
}
/* グリッドレイアウト */
.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

/* アイテムカードスタイル */
.shop-item-card {
    background: linear-gradient(135deg, #1a2a4a, #0d1b2f);
    border: 2px solid #3a5a8a;
    border-radius: 10px;
    padding: 12px 15px;
    transition: all 0.3s ease;
    min-height: 180px; /* 最小高さを設定 */
    display: flex;
    flex-direction: column;
}

.shop-item-card:hover {
    transform: translateY(-3px);
    border-color: #00ffff;
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.2);
}

/* アイテムヘッダー */
.item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    min-height: 40px;
}

.item-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.item-info {
    flex: 1;
    min-width: 0; /* テキストオーバーフロー防止 */
}

.item-name {
    margin: 0 0 4px 0;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-rarity {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    display: inline-block;
}

.item-rarity-common {
    background: #666666;
    color: white;
}

.item-rarity-rare {
    background: #4a8fff;
    color: white;
}

.item-rarity-epic {
    background: #ff6bff;
    color: white;
}

/* アイテム説明 */
.item-description {
    color: #cccccc;
    margin-bottom: 12px;
    line-height: 1.3;
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 2行に制限 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-height: 2.6em; /* 2行分の高さを確保 */
}

/* 価格表示 */
.item-price {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.price-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.1);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* 所持数表示 */
.item-owned {
    color: #00ff88;
    font-size: 0.75rem;
    margin-bottom: 10px;
    min-height: 1em;
}

/* 購入ボタン */
.shop-buy-btn {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #00aaff, #0088ff);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    min-height: 36px;
    flex-shrink: 0;
}

.shop-buy-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #00ffff, #00aaff);
    transform: translateY(-1px);
}

.shop-buy-btn.disabled {
    background: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

.shop-buy-btn.maxed {
    background: #ff4444;
    cursor: not-allowed;
}

.shop-buy-btn.owned {
    background: linear-gradient(135deg, #00ff88, #00cc66);
}

/* ショップ画面全体のスクロールを無効化 */
#shopScreen .screen-container {
    max-height: 90vh;
    overflow-y: visible;
    overflow-x: hidden;
}

/* アイテムなし表示 */
.no-items {
    text-align: center;
    color: #888;
    padding: 40px;
    font-style: italic;
}

/* スクロールインジケーター */
.scroll-hint {
    position: sticky;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(0, 255, 255, 0.7);
    font-size: 0.8rem;
    animation: fadeInOut 2s infinite;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 15px;
    width: fit-content;
    margin: 0 auto;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

