/* === Character (Look + Skin System) Styles === */

/* ===== Look Selection Panel ===== */
.look-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.look-card {
    background: #fff;
    border: 3px solid #e0d8f0;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.look-card:hover {
    border-color: #9B59B6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.2);
}

.look-card-preview {
    width: 96px;
    height: 144px;
    border-radius: 8px;
    background: #f5f0ff;
    border: 1px solid #e0d8f0;
    margin: 0 auto 8px;
    display: block;
}

.look-card-name {
    font-size: 14px;
    font-weight: bold;
    color: #4a3a5a;
}

/* ===== Skin Shop Panel ===== */
.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-width: 560px;
    margin: 0 auto;
}

.skin-card {
    background: #fff;
    border: 2px solid #e0d8f0;
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.skin-card:hover {
    border-color: #9B59B6;
}
.skin-card.equipped {
    border-color: #FFD700;
    background: #fff8e0;
}
.skin-card.owned {
    border-color: #a0d8a0;
}

.skin-card-preview {
    width: 72px;
    height: 108px;
    border-radius: 6px;
    background: #f5f0ff;
    border: 1px solid #e0d8f0;
    margin: 0 auto 6px;
    display: block;
}

.skin-card-preview.pet {
    width: 60px;
    height: 60px;
}

.skin-card-name {
    font-size: 12px;
    font-weight: bold;
    color: #4a3a5a;
    margin-bottom: 2px;
}

.skin-card-price {
    font-size: 11px;
    color: #888;
}
.skin-card-price.status-equipped {
    color: #FFD700;
    font-weight: bold;
}
.skin-card-price.status-owned {
    color: #4a9a4a;
}

/* ===== Preserved Styles ===== */

/* Character standing in room */
.character-sprite {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.character-sprite.enter-right {
    animation: charSlideIn 0.6s ease forwards;
}

@keyframes charSlideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Dialogue box */
.dialogue-box {
    position: absolute;
    bottom: 64px; left: 5%;
    width: 90%; height: 120px;
    background: rgba(20, 15, 30, 0.92);
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.15);
    padding: 16px 20px;
    z-index: 60;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: dialogueSlideUp 0.3s ease;
}

@keyframes dialogueSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.dialogue-speaker {
    font-size: 13px;
    font-weight: bold;
    color: #FF69B4;
    margin-bottom: 6px;
}

.dialogue-text {
    font-size: 15px;
    color: #fff;
    line-height: 1.6;
    min-height: 48px;
}

.dialogue-text .cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: #fff;
    animation: blink 0.6s infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.dialogue-choices {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

.dialogue-choice {
    padding: 8px 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.dialogue-choice:hover {
    background: rgba(255,255,255,0.2);
    border-color: #FF69B4;
}

/* Click-to-advance indicator */
.dialogue-advance {
    position: absolute;
    bottom: 8px; right: 16px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Wardrobe layout (reused by skin shop) */
.wardrobe-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.wardrobe-preview {
    width: 160px;
    flex-shrink: 0;
}

.wardrobe-preview canvas {
    width: 160px;
    height: 280px;
    border-radius: 12px;
    background: #f5f0ff;
    border: 2px solid #e0d8f0;
}

.wardrobe-items {
    flex: 1;
}

/* Legacy costume grid (kept for reference, used by skin-grid now) */
.costume-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.costume-card {
    background: #fff;
    border: 2px solid #e0d8f0;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.costume-card:hover { border-color: #9B59B6; }
.costume-card.equipped { border-color: #FFD700; background: #fff8e0; }
.costume-card.locked { opacity: 0.6; }
.costume-card .costume-color {
    width: 36px; height: 36px;
    border-radius: 8px;
    margin: 0 auto 6px;
}
.costume-card .costume-name { font-size: 13px; font-weight: bold; color: #4a3a5a; }
.costume-card .costume-price { font-size: 11px; color: #888; }

/* ===== AI Free Talk Mode ===== */

/* Mode toggle button (pill shape) */
.ai-mode-toggle {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 55;
    display: flex;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.15);
    font-size: 11px;
    font-family: inherit;
}

.ai-mode-toggle button {
    padding: 5px 12px;
    border: none;
    background: rgba(20, 15, 30, 0.7);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    font-size: 11px;
}

.ai-mode-toggle button.active {
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
    color: #fff;
    font-weight: bold;
}

.ai-mode-toggle button:hover:not(.active) {
    background: rgba(155, 89, 182, 0.3);
    color: rgba(255,255,255,0.8);
}

/* AI dialogue box — compact to show more character art */
.dialogue-box.ai-mode {
    height: auto;
    min-height: 100px;
    max-height: 240px;
    display: flex;
    flex-direction: column;
}

.dialogue-box.ai-mode .dialogue-text {
    flex: 1;
    overflow-y: auto;
    max-height: 160px;
    scrollbar-width: thin;
    scrollbar-color: rgba(155,89,182,0.3) transparent;
}

/* AI chat message list */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    max-height: 160px;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(155,89,182,0.3) transparent;
}

.ai-chat-msg {
    margin-bottom: 8px;
    line-height: 1.5;
}

.ai-chat-msg .ai-msg-speaker {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 2px;
}

.ai-chat-msg .ai-msg-speaker.char {
    color: #FF69B4;
}

.ai-chat-msg .ai-msg-speaker.player {
    color: #69B4FF;
}

.ai-chat-msg .ai-msg-text {
    font-size: 14px;
    color: #fff;
}

/* Input area at the bottom of AI dialogue */
.ai-input-area {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.ai-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.ai-input:focus {
    border-color: rgba(155, 89, 182, 0.6);
}

.ai-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.ai-send-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    opacity: 0.85;
}

.ai-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* AI Chat close button */
.ai-chat-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
    flex-shrink: 0;
}
.ai-chat-close-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* Thinking / loading animation */
.ai-thinking {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
}

.ai-thinking .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9B59B6;
    animation: aiThinkBounce 1.2s infinite;
}

.ai-thinking .dot:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiThinkBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}
