/* Combo Simulator UI - Premium Styles */
:root {
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(0, 242, 255, 0.2);
    --accent-cyan: #00f2ff;
    --accent-purple: #bc13fe;
    --mp-color: #00d2ff;
    --dmg-color: #ff4d4d;
    --save-color: #00ff88;
}

/* Base Layout */
.combo-builder {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem 0;
}

/* Skill Selection Grid (Ultra Compact) */
.skill-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.skill-item {
    background: transparent !important;
    border: none !important;
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.skill-item:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.skill-item.disabled {
    filter: grayscale(100%);
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

.mp-icon-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    font-size: 0.6rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: inset 0 2px 5px rgba(255,255,255,0.3), 0 4px 10px rgba(0,0,0,0.3);
    flex-shrink: 0;
    position: relative; /* 必須：擬似要素の基準点 */
}

.mp-icon-badge span {
    font-size: 1.1rem; /* 数値を大きく */
    line-height: 1;
    letter-spacing: -1px; /* 4桁対応のために文字間を詰める */
}

/* 4桁（1000など）の場合はさらに調整 */
.mp-icon-badge span.large-num {
    font-size: 0.9rem;
}

.mp-icon-badge.no-symbol {
    flex-direction: row; /* 中央に配置 */
}

.mp-icon-badge.no-symbol span {
    font-size: 1.4rem; /* シンボルがない場合はさらに巨大化 */
}

.mp-icon-badge::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 15%;
    width: 70%;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
    border-radius: 50%;
}

.mp-icon-symbol {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.mp-low { background: radial-gradient(circle at 30% 30%, #4facfe 0%, #00f2fe 100%); }
.mp-mid { background: radial-gradient(circle at 30% 30%, #f9d423 0%, #ff4e50 100%); color: #fff !important; }
.mp-high { background: radial-gradient(circle at 30% 30%, #b8cbb8 0%, #b8cbb8 0%, #b465da 0%, #cf6cc9 33%, #ee609c 66%, #ee609c 100%); }

.skill-name {
    font-size: 0.6rem;
    font-weight: 400;
    color: #cbd5e1;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Combo String (Horizontal Scroll Timeline) */
.combo-string {
    display: flex;
    flex-wrap: nowrap; /* 折り返しを禁止 */
    gap: 1.2rem;
    padding: 2rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    min-height: 180px;
    align-items: flex-start; /* 上揃え */
    justify-content: flex-start; /* 左から並べる */
    overflow-x: auto; /* 横スクロールを許可 */
    -webkit-overflow-scrolling: touch; /* iOSでの滑らかなスクロール */
    position: relative;
    scrollbar-width: thin; /* Firefox用 */
    scrollbar-color: var(--accent-cyan) rgba(255, 255, 255, 0.05);
}

.combo-string::-webkit-scrollbar {
    height: 8px;
}

.combo-string::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.combo-string::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

.combo-card {
    flex: 0 0 180px; /* 幅を固定してスクロールに対応 */
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1rem;
    position: relative;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.combo-card .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff4d4d;
    border-radius: 50%;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(255, 77, 77, 0.3);
}

/* Tag Selection - Grid Style */
.tag-selector {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.tag-btn {
    padding: 6px 4px;
    font-size: 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.tag-btn.active {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
    font-weight: 900;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

/* Tag Specific Colors */
.tag-btn.active.consecutive { background: #00d2ff; }
.tag-btn.active.smite { background: #ff4d4d; color: #fff; }
.tag-btn.active.save { background: #00ff88; }
.tag-btn.active.swift { background: #bc13fe; color: #fff; }
.tag-btn.active.mind_eye { background: #ffd700; color: #000; }
.tag-btn.active.tenacity { background: #ff7f50; color: #fff; }
.tag-btn.active.invincible { background: #1e90ff; color: #fff; }
.tag-btn.active.bloodthirst { background: #ff1493; color: #fff; }
.tag-btn.active.toughness { background: #32cd32; color: #fff; }

/* Visualization Gauges inside card */
.card-stats {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.stat-label { color: #abb2bf; }
.stat-value { font-weight: 800; }

.mini-gauge {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.gauge-fill-mp { height: 100%; background: var(--mp-color); transition: width 0.3s; }
.gauge-fill-dmg { height: 100%; background: var(--dmg-color); transition: width 0.3s; }

/* Summary Panel */
.summary-panel {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.summary-item {
    text-align: left;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--nav-text-muted);
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
}

/* Bubble (Tutorial) System */
.bubble-alert {
    position: absolute;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid var(--accent-cyan);
    color: #fff;
    padding: 12px 20px;
    border-radius: 16px;
    font-size: 0.85rem;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    max-width: 200px;
    text-align: left;
}

.bubble-alert.active {
    opacity: 1;
    transform: translateY(0);
}

.bubble-alert::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--accent-cyan);
}

/* 320px support */
@media (max-width: 320px) {
    .combo-string { padding: 1rem; }
    .combo-card { width: 140px; padding: 0.8rem; }
    .summary-panel { grid-template-columns: 1fr; gap: 1rem; padding: 1.2rem; }
    .summary-value { font-size: 1.5rem; }
}
