/* 交渉画面専用スタイル */

#negotiation-screen {
    background-color: rgba(52, 73, 94, 0.95);
    padding: 1rem;
    overflow-y: auto;
    z-index: 100;
}

#negotiation-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

#negotiation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

#partner-name {
    font-size: 1.5rem;
    color: #3498db;
}

#trust-level {
    font-size: 1rem;
}

#trust-stars {
    color: #f39c12;
    font-size: 1.5rem;
}

#partner-demands {
    background-color: rgba(44, 62, 80, 0.8);
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

#partner-demands h3 {
    color: #3498db;
    margin-bottom: 1rem;
}

#demands-list {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.demand-item {
    background-color: rgba(52, 152, 219, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 2px solid rgba(52, 152, 219, 0.5);
}

.demand-stars {
    color: #f39c12;
    margin-left: 0.5rem;
}

/* 交渉パネル */
#trade-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.trade-panel {
    background-color: rgba(44, 62, 80, 0.8);
    padding: 0.8rem;
    border-radius: 8px;
}

.trade-panel h3 {
    color: #3498db;
    margin-bottom: 1rem;
}

.trade-item {
    background: linear-gradient(135deg, rgba(52, 109, 164, 0.9) 0%, rgba(44, 82, 130, 0.9) 100%);
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.trade-item:hover {
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.trade-item.selected {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.5) 0%, rgba(41, 128, 185, 0.5) 100%);
    border-color: #3498db;
}

.trade-item.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* スピナーコントロール */
.quantity-spinner {
    display: flex;
    align-items: center;
    background-color: #1e3a52;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.spinner-button {
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
}

.spinner-button:hover:not(:disabled) {
    background-color: rgba(52, 152, 219, 0.2);
    color: #5dade2;
}

.spinner-button:active:not(:disabled) {
    background-color: rgba(52, 152, 219, 0.4);
}

.spinner-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.spinner-value {
    width: 36px;
    height: 32px;
    text-align: center;
    background-color: #1e3a52;
    color: #fff;
    border: none;
    outline: none;
    font-size: 1rem;
    font-weight: bold;
    padding: 0 2px;
    cursor: pointer;
}

.spinner-value:focus {
    background-color: #2c5282;
    color: #3498db;
}

.spinner-value:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.trade-item-name {
    min-width: 80px;
    font-weight: bold;
    color: #ecf0f1;
    white-space: nowrap;
    /* 絵文字に太い黒縁を追加（複数のtext-shadowで太さを出す） */
    text-shadow:
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000;
}

.trade-item-max {
    color: #95a5a6;
    font-size: 1rem;
    white-space: nowrap;
}

.trade-item-progress {
    flex: 1;
    height: 24px;
    background-color: rgba(127, 140, 141, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
    transition: width 0.3s ease;
    border-radius: 12px;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.5);
}

/* 興味度メーター */
#interest-meter {
    position: relative;
}

#interest-meter h3 {
    color: #3498db;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.meter-bar {
    width: 100%;
    height: 32px;
    background-color: rgba(127, 140, 141, 0.3);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #f39c12 30%, #f1c40f 50%, #2ecc71 100%);
    transition: width 0.5s ease;
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.meter-fill.low {
    background: linear-gradient(90deg, #e74c3c 0%, #e74c3c 100%);
}

.meter-fill.medium {
    background: linear-gradient(90deg, #f39c12 0%, #f1c40f 100%);
}

.meter-fill.high {
    background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
}

#interest-percentage {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 1rem;
    font-weight: bold;
    color: #2ecc71;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* 相手の反応と興味度メーター（横並び） */
#partner-reaction-container {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    background-color: rgba(44, 62, 80, 0.8);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

#partner-reaction {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#partner-expression {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: bounce 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#partner-dialogue {
    font-size: 0.9rem;
    font-style: italic;
    color: #ecf0f1;
    padding: 0.5rem 0.8rem;
    background-color: rgba(52, 73, 94, 0.6);
    border-radius: 8px;
    border-left: 4px solid #3498db;
    text-align: center;
    max-width: 200px;
}

/* 交渉アクション */
#negotiation-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

#negotiation-actions button {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

/* 戻るボタンと取り消しボタンを非表示 */
#btn-back-from-negotiation,
#btn-reset-proposal {
    display: none;
}

/* ステップ0での相手アイテムの明滅枠 */
.trade-item.highlight-request {
    animation: borderBlink 1.5s ease-in-out infinite;
}

@keyframes borderBlink {
    0%, 100% {
        border-color: rgba(46, 204, 113, 0.8);
        box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    }
    50% {
        border-color: rgba(46, 204, 113, 0.3);
        box-shadow: 0 0 5px rgba(46, 204, 113, 0.2);
    }
}

/* アイテムツールチップ */
.item-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
    pointer-events: none;
    min-width: 250px;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(52, 152, 219, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.item-tooltip.visible {
    opacity: 1;
}

.tooltip-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(52, 152, 219, 0.3);
    padding-bottom: 0.3rem;
}

.tooltip-description {
    margin-bottom: 0.8rem;
    line-height: 1.4;
    color: #ecf0f1;
}

.tooltip-value {
    font-size: 0.85rem;
    color: #f39c12;
    margin-bottom: 0.5rem;
}

.tooltip-effects {
    font-size: 0.85rem;
}

.tooltip-effect {
    display: flex;
    align-items: center;
    margin-top: 0.3rem;
    color: #2ecc71;
}

.tooltip-effect-icon {
    margin-right: 0.5rem;
}
