/**
 * 糖糖島 (Sugar Island) 寵物系統樣式
 * @version 1.0.0
 * @date 2026-01-02
 */

/* ==========================================
   基礎容器
   ========================================== */

.sugar-island-container {
    padding: 0.75rem;
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); /* 為底部導航預留空間 */
    min-height: 100vh;
    min-height: 100svh;
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%);
    transition: background 0.5s ease;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* 洞穴排行榜 */
.cave-rankings {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cave-ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #f6f6f6;
    border-radius: 0.6rem;
}

.cave-ranking-item.is-me {
    background: linear-gradient(135deg, rgba(129, 199, 132, 0.18) 0%, rgba(165, 214, 167, 0.18) 100%);
    border: 2px solid #81c784;
}

.cave-rank-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.85rem;
}

.cave-rank-number.top-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
}

.cave-rank-number.top-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: white;
}

.cave-rank-number.top-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: white;
}

.cave-rank-info {
    flex: 1;
    text-align: left;
}

.cave-rank-name {
    font-weight: 600;
    color: #333;
}

.cave-rank-meta {
    font-size: 0.75rem;
    color: #666;
}

/* 合成系統 */
.crafting-content h4 {
    margin: 0 0 0.75rem 0;
    color: #333;
}

.crafting-queue {
    margin-bottom: 1rem;
}

.crafting-queue.empty {
    text-align: center;
    color: #777;
}

.crafting-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f7f7f7;
    border-radius: 0.6rem;
    margin-bottom: 0.5rem;
}

.crafting-queue-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crafting-item-icon {
    font-size: 1.1rem;
}

.crafting-item-name {
    font-weight: 600;
    color: #333;
}

.crafting-queue-status {
    font-size: 0.75rem;
    color: #666;
}

.crafting-claim-btn {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.crafting-recipes {
    margin-top: 1rem;
}

.crafting-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.crafting-category-btn {
    border: 1px solid #d7dbe3;
    background: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    color: #444;
    cursor: pointer;
}

.crafting-category-btn.active {
    background: #ff9800;
    border-color: #ff9800;
    color: #fff;
}

.crafting-recipe {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.crafting-recipe.disabled {
    opacity: 0.6;
}

.crafting-recipe-main {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.crafting-item-info {
    flex: 1;
    text-align: left;
}

.crafting-item-desc {
    font-size: 0.75rem;
    color: #777;
    margin-top: 0.2rem;
}

.crafting-item-time {
    font-size: 0.75rem;
    color: #ff9800;
    margin-top: 0.2rem;
}

.crafting-materials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.crafting-material {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #f1f1f1;
    color: #666;
}

.crafting-material.ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.crafting-material.lack {
    background: #ffebee;
    color: #c62828;
}

.crafting-start-btn {
    margin-top: 0.6rem;
    width: 100%;
    background: linear-gradient(135deg, #ffe082 0%, #ffca28 100%);
    border: none;
    border-radius: 0.6rem;
    padding: 0.45rem 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.crafting-start-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* 確保天氣背景正確覆蓋 - 直接套用到 container */
.sugar-island-container.weather-sunny {
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%) !important;
}

.sugar-island-container.weather-cloudy {
    background: linear-gradient(180deg, #B0C4DE 0%, #A8D5BA 100%) !important;
}

.sugar-island-container.weather-foggy {
    background: linear-gradient(180deg, #9CA3AF 0%, #D1D5DB 100%) !important;
}

.sugar-island-container.weather-storm-low {
    background: linear-gradient(180deg, #4B5563 0%, #1E3A5F 100%) !important;
}

.sugar-island-container.weather-storm-high {
    background: linear-gradient(180deg, #DC2626 0%, #F97316 100%) !important;
}

.sugar-island-container.weather-unknown {
    background: linear-gradient(180deg, #E5E7EB 0%, #D1D5DB 100%) !important;
}

.sugar-island-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.45), rgba(255,255,255,0) 40%),
        radial-gradient(circle at 85% 12%, rgba(255,255,255,0.35), rgba(255,255,255,0) 45%),
        radial-gradient(circle at 60% 30%, rgba(255,255,255,0.25), rgba(255,255,255,0) 40%);
    opacity: 0.8;
    pointer-events: none;
}

.sugar-island-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.35) 100%);
    pointer-events: none;
}

.sugar-island-container > * {
    position: relative;
    z-index: 1;
}

/* ==========================================
   領養區
   ========================================== */

.pet-adopt-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.adopt-welcome {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
}

.adopt-welcome h2 {
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

.adopt-welcome p {
    color: #666;
    margin-bottom: 1.5rem;
}

.pet-type-selection {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pet-type-option {
    width: 80px;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.pet-type-option:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
}

.pet-type-option.selected {
    border-color: #4CAF50;
    background: #E8F5E9;
}

.pet-preview {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.5rem;
    background-size: 800% 100%;
    background-position: 0 0;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    animation: sprite-8-frames-preview 1s steps(8) infinite;
}

@keyframes sprite-8-frames-preview {
    from { background-position: 0 0; }
    to { background-position: -512px 0; }
}

.pet-preview.green-slime {
    background-image: url('/assets/sprites/pets/slime-basic/Green_Slime/Idle.png');
}

.pet-preview.blue-slime {
    background-image: url('/assets/sprites/pets/slime-basic/Blue_Slime/Idle.png');
}

.pet-preview.red-slime {
    background-image: url('/assets/sprites/pets/slime-basic/Red_Slime/Idle.png');
}

.pet-type-option span {
    font-size: 0.85rem;
    color: #333;
}

.adopt-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.adopt-form input {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    text-align: center;
}

.adopt-form input:focus {
    outline: none;
    border-color: #4CAF50;
}

/* ==========================================
   寵物主畫面
   ========================================== */

.pet-main-section {
    width: 100%;
    max-width: none;
}

/* 主資訊列 */
.pet-top-bar {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.pet-top-bar > .weather-status-bar,
.pet-top-bar > .glucose-focus-bar,
.pet-top-bar > .pet-info-bar {
    flex: 1 1 240px;
    margin: 0;
    min-width: 0;
}

.pet-top-bar .weather-status-bar {
    padding: 0.6rem 0.85rem;
}

.pet-top-bar .glucose-focus-bar {
    padding: 0.55rem 0.85rem;
    gap: 0.25rem;
}

.pet-top-bar .pet-info-bar {
    padding: 0.6rem 0.85rem;
}

.pet-top-bar .weather-name {
    font-size: 0.95rem;
}

.pet-top-bar .glucose-display {
    font-size: 0.8rem;
}

.pet-top-bar .focus-text {
    font-size: 0.78rem;
}

.pet-top-bar .focus-metrics {
    font-size: 0.7rem;
}

.pet-top-bar .pet-name {
    font-size: 1rem;
}

.pet-top-bar .pet-level {
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
}

.pet-top-bar .pet-resources {
    flex-wrap: wrap;
}

.pet-top-bar .resource-item {
    font-size: 0.75rem;
}

@media (max-width: 900px) {
    .pet-top-bar {
        flex-direction: column;
    }
}

/* 資訊欄 */
.pet-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: rgba(255,255,255,0.9);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255,255,255,0.65);
    backdrop-filter: blur(10px);
}

.pet-name-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pet-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.pet-level {
    background: #4CAF50;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.pet-resources {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(255,255,255,0.6);
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.7);
}

.resource-item.sugar {
    background: rgba(255, 193, 7, 0.15);
    color: #F57C00;
}

.resource-item.energy-coin {
    background: rgba(156, 39, 176, 0.15);
    color: #7B1FA2;
}

.resource-item.stamina {
    background: rgba(33, 150, 243, 0.15);
    color: #1976D2;
}

/* 寵物展示區 */
.pet-display-area {
    position: relative;
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 65%),
        url('/assets/sprites/backgrounds/home.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 1rem;
    padding: 2rem 1rem;
    margin-bottom: 1rem;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

.pet-display-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 15%, rgba(255,255,255,0.5), rgba(255,255,255,0) 45%),
        linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 45%);
    opacity: 0.6;
    pointer-events: none;
}

.pet-display-area > * {
    position: relative;
    z-index: 1;
}

/* 寵物展示區天氣背景 */
.pet-display-area.weather-sunny {
    filter: brightness(1.05) saturate(1.1);
}

.pet-display-area.weather-cloudy {
    filter: sepia(0.15) saturate(1.1) hue-rotate(-5deg);
}

.pet-display-area.weather-foggy {
    filter: saturate(0.7) hue-rotate(20deg) brightness(0.9);
}

.pet-display-area.weather-storm-low {
    filter: saturate(0.5) hue-rotate(30deg) brightness(0.8);
}

.pet-display-area.weather-storm-high {
    filter: sepia(0.3) saturate(1.4) hue-rotate(-15deg) brightness(0.85);
}

.pet-display-area.weather-unknown {
    filter: grayscale(0.2) brightness(0.95);
}

.pet-sprite-container {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-sprite {
    width: 128px;
    height: 128px;
    background-size: cover;
    background-position: 0 0;
    background-repeat: no-repeat;
    transition: transform 0.3s;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 寵物互動按鈕 */
.pet-action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.75rem 0;
}

.pet-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
    border: 2px solid #ddd;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pet-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #4CAF50;
}

.pet-action-btn:active {
    transform: translateY(0);
}

.pet-action-btn .action-icon {
    font-size: 1.5rem;
}

.pet-action-btn .action-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: #333;
}

.pet-action-btn .action-cost {
    font-size: 0.65rem;
    color: #888;
}

/* ==========================================
   通用場景彈窗框架
   ========================================== */

.scene-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.scene-modal.active {
    display: flex;
}

.scene-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.scene-modal-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: scene-modal-pop 0.25s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes scene-modal-pop {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.scene-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    color: white;
    flex-shrink: 0;
}

.scene-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scene-modal-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.scene-modal-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.scene-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* 各場景主題色 */
.scene-modal.home .scene-modal-header {
    background: linear-gradient(135deg, #8BC34A 0%, #4CAF50 100%);
}

.scene-modal.forest .scene-modal-header {
    background: linear-gradient(135deg, #66BB6A 0%, #2E7D32 100%);
}

.scene-modal.forest .scene-modal-content {
    max-height: 90vh;
    height: 80vh;
}

.scene-modal.forest .scene-modal-body {
    overflow-y: auto;
}

.scene-modal.cave .scene-modal-header {
    background: linear-gradient(135deg, #78909C 0%, #455A64 100%);
}

.scene-modal.market .scene-modal-header {
    background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%);
}

.scene-modal.arena .scene-modal-header {
    background: linear-gradient(135deg, #E57373 0%, #D32F2F 100%);
}

.scene-modal.team .scene-modal-header {
    background: linear-gradient(135deg, #64B5F6 0%, #1976D2 100%);
}

/* 場景動作按鈕 */
.scene-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.scene-action-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.scene-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #adb5bd;
}

.scene-action-card:active {
    transform: translateY(0);
}

.scene-action-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scene-action-card .action-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.scene-action-card .action-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.scene-action-card .action-desc {
    font-size: 0.75rem;
    color: #666;
}

.scene-action-card .action-cost {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
    font-size: 0.7rem;
    color: #888;
}

/* 場景結果/資訊區 */
.scene-result-area {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 0.5rem;
    min-height: 60px;
}

.scene-result-area.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.scene-result-area.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* 食物選擇器彈窗 */
.food-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.food-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.food-selector-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    width: 90%;
    max-width: 350px;
    max-height: 60vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modal-pop 0.2s ease-out;
}

@keyframes modal-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.food-selector-content .food-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
    font-weight: bold;
}

.food-selector-content .food-selector-header .close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
}

.food-selector-content .food-list {
    padding: 0.5rem;
    max-height: 50vh;
    overflow-y: auto;
}

.food-selector-content .food-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.food-selector-content .food-item:hover {
    background: #e8f5e9;
    transform: translateX(5px);
}

.food-selector-content .food-icon {
    font-size: 1.5rem;
}

.food-selector-content .food-icon img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.food-selector-content .food-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.food-selector-content .food-name {
    font-weight: 500;
    color: #333;
}

.food-selector-content .food-effect {
    font-size: 0.75rem;
    color: #4CAF50;
}

.food-selector-content .food-quantity {
    font-size: 0.85rem;
    color: #666;
    background: #eee;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.food-selector-content .no-food-message {
    text-align: center;
    padding: 2rem 1rem;
    color: #888;
}

.food-selector-content .no-food-message button {
    margin-top: 1rem;
}

/* ==========================================
   寵物 Sprite Sheet 動畫
   ========================================== */

/* 階段 1: 基礎史萊姆 (slime-basic) - 1024x128, 8 frames, 128px each */
.pet-slime-green.evolution-1 {
    background-image: url('/assets/sprites/pets/slime-basic/Green_Slime/Idle.png');
    background-size: 800% 100%; /* 8 frames */
    animation: sprite-8-frames 1s steps(8) infinite;
}

.pet-slime-blue.evolution-1 {
    background-image: url('/assets/sprites/pets/slime-basic/Blue_Slime/Idle.png');
    background-size: 800% 100%;
    animation: sprite-8-frames 1s steps(8) infinite;
}

.pet-slime-red.evolution-1 {
    background-image: url('/assets/sprites/pets/slime-basic/Red_Slime/Idle.png');
    background-size: 800% 100%;
    animation: sprite-8-frames 1s steps(8) infinite;
}

/* 階段 2: 元素史萊姆 (slime-elemental) - 384x256, 6 frames, 64px each */
/* 容器 128px，放大 7.5 倍顯示 (128/64 * 6 = 12，但需要放大到 960px) */
/* 對應寵物顏色: green->Slime1, blue->Slime2, red->Slime3 */
.pet-slime-green.evolution-2 {
    background-image: url('/assets/sprites/pets/slime-elemental/Slime1/With_shadow/Slime1_Idle_with_shadow.png');
    background-size: 768px 512px;
    animation: sprite-6-frames-elemental 0.6s steps(6) infinite;
}

.pet-slime-blue.evolution-2 {
    background-image: url('/assets/sprites/pets/slime-elemental/Slime2/With_shadow/Slime2_Idle_with_shadow.png');
    background-size: 768px 512px;
    animation: sprite-6-frames-elemental 0.6s steps(6) infinite;
}

.pet-slime-red.evolution-2 {
    background-image: url('/assets/sprites/pets/slime-elemental/Slime3/With_shadow/Slime3_Idle_with_shadow.png');
    background-size: 768px 512px;
    animation: sprite-6-frames-elemental 0.6s steps(6) infinite;
}

/* 階段 3: Boss 史萊姆 (slime-boss) - 768x512, 6 frames, 128px each */
.pet-slime-green.evolution-3 {
    background-image: url('/assets/sprites/pets/slime-boss/Slime_boss1/With_shadow/Slime_boss1_Idle_with_shadow.png');
    background-size: 768px 512px;
    animation: sprite-6-frames-boss 1.2s steps(6) infinite;
}

.pet-slime-blue.evolution-3 {
    background-image: url('/assets/sprites/pets/slime-boss/Slime_boss2/With_shadow/Slime_boss2_Idle_with_shadow.png');
    background-size: 768px 512px;
    animation: sprite-6-frames-boss 1.2s steps(6) infinite;
}

.pet-slime-red.evolution-3 {
    background-image: url('/assets/sprites/pets/slime-boss/Slime_boss3/With_shadow/Slime_boss3_Idle_with_shadow.png');
    background-size: 768px 512px;
    animation: sprite-6-frames-boss 1.2s steps(6) infinite;
}

/* Sprite 動畫關鍵幀 */
@keyframes sprite-8-frames {
    from { background-position: 0 0; }
    to { background-position: -1024px 0; }
}

@keyframes sprite-6-frames-elemental {
    from { background-position: 0 0; }
    to { background-position: -768px 0; }
}

@keyframes sprite-6-frames-boss {
    from { background-position: 0 0; }
    to { background-position: -768px 0; }
}

/* 後備樣式（無圖片時的純色圓形） */
.pet-slime-green:not([style*="background-image"]):not(.evolution-1):not(.evolution-2):not(.evolution-3) {
    background: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    border-radius: 50% 50% 45% 45%;
}
.pet-slime-blue:not([style*="background-image"]):not(.evolution-1):not(.evolution-2):not(.evolution-3) {
    background: linear-gradient(180deg, #2196F3 0%, #1565C0 100%);
    border-radius: 50% 50% 45% 45%;
}
.pet-slime-red:not([style*="background-image"]):not(.evolution-1):not(.evolution-2):not(.evolution-3) {
    background: linear-gradient(180deg, #F44336 0%, #C62828 100%);
    border-radius: 50% 50% 45% 45%;
}

/* NPC 專用寵物類型 - 元素史萊姆 */
.pet-sprite.slime-fire {
    background: linear-gradient(180deg, #FF5722 0%, #E64A19 100%);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 0 0 15px rgba(255, 87, 34, 0.6);
}
.pet-sprite.slime-water {
    background: linear-gradient(180deg, #03A9F4 0%, #0288D1 100%);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 0 0 15px rgba(3, 169, 244, 0.6);
}
.pet-sprite.slime-grass {
    background: linear-gradient(180deg, #8BC34A 0%, #689F38 100%);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 0 0 15px rgba(139, 195, 74, 0.6);
}
.pet-sprite.slime-electric {
    background: linear-gradient(180deg, #FFEB3B 0%, #FBC02D 100%);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.6);
}

/* NPC 專用寵物類型 - Boss 史萊姆 */
.pet-sprite.king-slime {
    background: linear-gradient(180deg, #9C27B0 0%, #7B1FA2 100%);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.7);
    transform: scale(1.2);
}
.pet-sprite.boss-slime {
    background: linear-gradient(180deg, #E91E63 0%, #C2185B 100%);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 0 0 25px rgba(233, 30, 99, 0.8);
    transform: scale(1.3);
}

/* 進化階段發光效果 */
.evolution-2 {
    filter: drop-shadow(0 0 10px rgba(255,215,0,0.6));
}
.evolution-3 {
    filter: drop-shadow(0 0 15px rgba(255,69,0,0.7));
    animation: sprite-6-frames-boss 1.2s steps(6) infinite, boss-glow 2s ease-in-out infinite;
}

@keyframes boss-glow {
    0%, 100% { box-shadow: 0 0 30px rgba(255,69,0,0.6); }
    50% { box-shadow: 0 0 50px rgba(255,69,0,0.8); }
}

/* 寵物動畫 */
.pet-idle {
    animation: idle-bounce 2s ease-in-out infinite;
}

.pet-happy {
    animation: happy-bounce 0.5s ease-in-out infinite;
}

.pet-sad {
    opacity: 0.7;
    filter: saturate(0.5);
}

.pet-eating {
    animation: eat-animation 0.5s ease-in-out;
}

.pet-jumping {
    animation: jump-animation 0.4s ease-out;
}

@keyframes idle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes happy-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

@keyframes eat-animation {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.1); }
    60% { transform: scale(0.95); }
}

@keyframes jump-animation {
    0% { transform: translateY(0); }
    50% { transform: translateY(-30px) rotate(10deg); }
    100% { transform: translateY(0); }
}

.pet-born-animation {
    animation: born-pop 1.5s ease-out;
}

@keyframes born-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.level-up-glow {
    animation: level-up-pulse 1.5s ease-out;
}

@keyframes level-up-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,215,0,0.7); }
    50% { box-shadow: 0 0 30px 20px rgba(255,215,0,0.3); }
    100% { box-shadow: 0 0 0 0 rgba(255,215,0,0); }
}

/* 食物掉落動畫 */
.food-drop-animation {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    z-index: 30;
    animation: food-drop 0.5s ease-in forwards;
}

.food-drop-sprite {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}

@keyframes food-drop {
    0% {
        top: -60px;
        opacity: 0;
        transform: translateX(-50%) scale(0.5) rotate(-20deg);
    }
    20% {
        opacity: 1;
    }
    70% {
        top: 40%;
        transform: translateX(-50%) scale(1.2) rotate(10deg);
    }
    85% {
        transform: translateX(-50%) scale(0.9) rotate(-5deg);
    }
    100% {
        top: 50%;
        opacity: 0.8;
        transform: translateX(-50%) scale(1) rotate(0deg);
    }
}

/* 效果層 */
.pet-effects-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-particle {
    position: absolute;
    bottom: 30%;
    font-size: 1.5rem;
    animation: float-up 1.5s ease-out forwards;
}

@keyframes float-up {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    30% { opacity: 1; transform: scale(1); }
    100% { transform: translateY(-80px) scale(0.8); opacity: 0; }
}

.gain-effect {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-weight: bold;
    animation: gain-pop 1.2s ease-out forwards;
    z-index: 10;
}

@keyframes gain-pop {
    0% { transform: translateX(-50%) translateY(0) scale(0.5); opacity: 0; }
    20% { transform: translateX(-50%) translateY(-10px) scale(1.1); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(-50%) translateY(-30px) scale(1); opacity: 0; }
}

/* 狀態氣泡 */
.pet-status-bubbles {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    position: relative;
    z-index: 10;
}

.status-bubble {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.status-bubble.status-low {
    background: #FFEBEE;
    color: #C62828;
}

.status-bubble.status-medium {
    background: #FFF3E0;
    color: #E65100;
}

.status-bubble.status-high {
    background: #E8F5E9;
    color: #2E7D32;
}

/* 經驗條 */
.exp-bar-container {
    background: rgba(255,255,255,0.9);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.exp-bar {
    flex: 1;
    height: 12px;
    background: #E0E0E0;
    border-radius: 6px;
    overflow: hidden;
}

.exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

.exp-text {
    font-size: 0.85rem;
    color: #666;
    min-width: 80px;
    text-align: right;
}

/* 互動按鈕 */
.pet-action-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pet-action-btn {
    background: white;
    border: none;
    border-radius: 1rem;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pet-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.pet-action-btn:active {
    transform: translateY(0);
}

.action-icon {
    font-size: 1.5rem;
}

.action-label {
    font-size: 0.75rem;
    color: #666;
}

/* 每日任務 */
.daily-tasks-section {
    background: rgba(255,255,255,0.9);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.daily-tasks-section h4 {
    margin: 0 0 0.75rem 0;
    color: #333;
    font-size: 1rem;
}

.daily-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.daily-task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f5f5f5;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.daily-task-item.completed {
    background: #E8F5E9;
    opacity: 0.8;
}

.task-icon {
    font-size: 1.25rem;
}

.task-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-name {
    font-size: 0.9rem;
    color: #333;
}

.task-reward {
    font-size: 0.75rem;
    color: #888;
}

.task-progress {
    font-size: 0.7rem;
    color: #666;
    font-weight: 500;
}

.task-progress-bar {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.daily-task-item.completed .task-progress-fill {
    background: #4CAF50;
}

.task-status {
    font-size: 1rem;
}

.no-tasks {
    text-align: center;
    color: #888;
    padding: 1rem;
}

/* 進化提示（浮動在寵物頭上） */
.evolution-notice-float {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: evolution-float 2s ease-in-out infinite;
    z-index: 20;
    white-space: nowrap;
    font-size: 0.8rem;
    box-shadow: 0 3px 10px rgba(255, 165, 0, 0.4);
}

@keyframes evolution-float {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        box-shadow: 0 3px 10px rgba(255, 165, 0, 0.4);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
        box-shadow: 0 5px 15px rgba(255, 165, 0, 0.6);
    }
}

.evolution-notice-float span {
    font-weight: bold;
}

.btn-evolve-small {
    background: white;
    color: #FF8C00;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-evolve-small:hover {
    background: #FFF8E1;
    transform: scale(1.05);
}

/* 舊版進化提示（保留相容性） */
.evolution-notice {
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: evolution-pulse 2s infinite;
}

@keyframes evolution-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,215,0,0.5); }
    50% { box-shadow: 0 0 20px rgba(255,215,0,0.8); }
}

.evolution-notice span {
    font-weight: bold;
}

.btn-accent {
    background: white;
    color: #FF8C00;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: bold;
    cursor: pointer;
}

/* ==========================================
   響應式設計
   ========================================== */

@media (max-width: 480px) {
    .sugar-island-container {
        padding: 0.65rem;
        padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    }

    .pet-type-selection {
        gap: 0.5rem;
    }

    .pet-type-option {
        width: 70px;
        padding: 0.5rem;
    }

    .pet-action-buttons {
        gap: 0.5rem;
    }

    .pet-action-btn {
        padding: 0.75rem 0.25rem;
    }

    .action-icon {
        font-size: 1.25rem;
    }

    .action-label {
        font-size: 0.7rem;
    }

    .pet-top-bar {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .pet-top-bar .weather-status-bar,
    .pet-top-bar .glucose-focus-bar,
    .pet-top-bar .pet-info-bar {
        padding: 0.55rem 0.7rem;
    }

    .pet-top-bar .pet-info-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .pet-top-bar .pet-resources {
        width: 100%;
        justify-content: flex-start;
    }

    .pet-display-area {
        min-height: 200px;
        padding: 1.5rem 0.75rem;
        margin-bottom: 0.75rem;
    }
}

/* ==========================================
   天氣系統樣式
   ========================================== */

/* 天氣狀態列 */
.weather-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.95);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
}

.glucose-focus-bar {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: rgba(255,255,255,0.92);
    border-radius: 0.9rem;
    padding: 0.65rem 0.9rem;
    margin-top: -0.5rem;
    margin-bottom: 0.9rem;
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

.glucose-focus-bar .focus-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1f2937;
}

.glucose-focus-bar .focus-badge.safe {
    color: #166534;
}

.glucose-focus-bar .focus-badge.caution {
    color: #92400e;
}

.glucose-focus-bar .focus-badge.danger {
    color: #b91c1c;
}

.glucose-focus-bar .focus-text {
    font-size: 0.85rem;
    color: #374151;
}

.glucose-focus-bar .focus-metrics {
    font-size: 0.75rem;
    color: #6b7280;
    letter-spacing: 0.02em;
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.weather-icon {
    font-size: 2rem;
    line-height: 1;
}

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.weather-name {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
}

.weather-glucose {
    font-size: 0.85rem;
    color: #666;
}

.weather-message {
    flex: 1;
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    max-width: 50%;
}

/* 天氣背景效果 - 晴朗（正常血糖 70-180）*/
.weather-sunny {
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%);
}

.weather-sunny .pet-display-area {
    box-shadow: 0 0 30px rgba(255,215,0,0.3);
    filter: brightness(1.05) saturate(1.1) !important;
}

/* 天氣背景效果 - 多雲（偏高血糖 180-200）*/
.weather-cloudy {
    background: linear-gradient(180deg, #FFE0B2 0%, #FFCC80 100%);
}

.weather-cloudy .pet-display-area {
    filter: sepia(0.15) saturate(1.15) hue-rotate(-8deg) !important;
}

/* 天氣背景效果 - 起霧（高血糖 200-250）*/
.weather-foggy {
    background: linear-gradient(180deg, #FFE0B2 0%, #FFCC80 100%);
}

.weather-foggy .pet-display-area {
    filter: sepia(0.25) saturate(1.3) hue-rotate(-15deg) brightness(0.9) !important;
}

.weather-foggy .pet-display-area::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 150, 50, 0.15);
    pointer-events: none;
}

.weather-foggy .pet-sprite {
    opacity: 0.95;
}

/* 天氣背景效果 - 暴風雪（危險低血糖 <60）*/
.weather-storm-low {
    background: linear-gradient(180deg, #4B5563 0%, #1E3A5F 100%);
    animation: storm-pulse 2s infinite;
}

.weather-storm-low .pet-display-area {
    filter: saturate(0.5) hue-rotate(30deg) brightness(0.75) !important;
    box-shadow: inset 0 0 60px rgba(100,149,237,0.6);
}

.weather-storm-low .pet-sprite {
    animation: shiver 0.3s infinite;
}

@keyframes shiver {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* 天氣背景效果 - 火山（危險高血糖 >250）*/
.weather-storm-high {
    background: linear-gradient(180deg, #DC2626 0%, #F97316 100%);
    animation: volcano-pulse 1.5s infinite;
}

.weather-storm-high .pet-display-area {
    filter: sepia(0.4) saturate(1.6) hue-rotate(-20deg) brightness(0.8) !important;
    box-shadow: inset 0 0 60px rgba(255,69,0,0.6);
}

.weather-storm-high .pet-sprite {
    filter: brightness(1.2) saturate(1.3);
}

@keyframes storm-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(0.9); }
}

@keyframes volcano-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
}

/* 天氣未知 */
.weather-unknown {
    background: linear-gradient(180deg, #E5E7EB 0%, #D1D5DB 100%);
}

/* 血糖趨勢箭頭 */
.glucose-trend {
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
}

.trend-up { color: #EF4444; }
.trend-down { color: #3B82F6; }
.trend-flat { color: #10B981; }

/* 危險警告橫幅 */
.danger-alert {
    background: linear-gradient(90deg, #DC2626 0%, #EF4444 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: danger-flash 1s infinite;
}

.danger-alert.low-glucose,
.danger-alert.danger-low {
    background: linear-gradient(90deg, #1E40AF 0%, #3B82F6 100%);
}

.danger-alert.danger-high {
    background: linear-gradient(90deg, #DC2626 0%, #F97316 100%);
}

@keyframes danger-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.danger-alert-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
}

.danger-alert-icon {
    font-size: 1.25rem;
}

.danger-alert-action {
    background: white;
    color: #DC2626;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: bold;
    cursor: pointer;
}

.danger-alert.low-glucose .danger-alert-action {
    color: #1E40AF;
}

/* CGM 離線警報 */
.cgm-offline-alert {
    background: linear-gradient(90deg, #6B7280 0%, #9CA3AF 100%);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    display: none;
    animation: offline-pulse 2s infinite;
}

.cgm-offline-alert .offline-alert-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}

.cgm-offline-alert .offline-icon {
    font-size: 1.2rem;
}

.cgm-offline-alert .offline-text {
    font-weight: bold;
    font-size: 0.9rem;
}

.cgm-offline-alert .offline-hint {
    font-size: 0.75rem;
    opacity: 0.9;
}

@keyframes offline-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* CGM 離線時的天氣獎勵區域警告樣式 */
.cgm-offline-warning {
    color: #9CA3AF;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 天氣粒子效果容器 */
.weather-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

/* 陽光粒子 */
.sun-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,215,0,0.8);
    border-radius: 50%;
    animation: float-sparkle 3s infinite ease-in-out;
}

@keyframes float-sparkle {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.8; }
    50% { transform: translateY(-20px) scale(1.2); opacity: 1; }
}

/* 雪花粒子 */
.snow-particle {
    position: absolute;
    color: white;
    font-size: 1rem;
    animation: snowfall 4s linear infinite;
}

@keyframes snowfall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(200px) rotate(360deg); opacity: 0; }
}

/* 火焰粒子 */
.fire-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(180deg, #FF6B00 0%, #FF0000 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: fire-rise 2s infinite ease-out;
}

@keyframes fire-rise {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-60px) scale(0.5); opacity: 0; }
}

/* ==========================================
   寵物對話氣泡
   ========================================== */

.pet-dialogue {
    background: white;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: absolute;
    top: 0.75rem;
    left: 50%;
    max-width: 85%;
    opacity: 0;
    transform: translate(-50%, -10px);
    transition: all 0.3s ease-out;
    z-index: 2;
}

.pet-dialogue.dialogue-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.pet-dialogue::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.pet-dialogue span {
    color: #333;
    font-size: 0.9rem;
}

/* 天氣粒子持續動畫 */
.weather-particle {
    animation-iteration-count: infinite !important;
}

/* 天氣狀態列內元素對齊 */
.weather-bonus {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.75rem;
}

.weather-bonus .energy-rate {
    color: #F59E0B;
    font-weight: bold;
}

.weather-bonus .exp-bonus {
    color: #10B981;
}

/* 響應式調整 */
@media (max-width: 380px) {
    .weather-status-bar {
        padding: 0.5rem;
    }

    .weather-icon {
        font-size: 1.25rem;
    }

    .weather-info {
        font-size: 0.85rem;
    }
}

/* ==========================================
   連續晴天系統樣式
   ========================================== */

/* 連續晴天區塊 */
.sunshine-streak-section {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(255,193,7,0.2);
}

.streak-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.streak-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    color: #F57C00;
}

.streak-title-icon {
    font-size: 1.25rem;
}

.streak-days-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #FF9800;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: bold;
}

.streak-days-number {
    font-size: 1.25rem;
}

/* 今日進度 */
.today-progress-section {
    margin-bottom: 1rem;
}

.today-sunny-text {
    font-size: 0.85rem;
    color: #795548;
    margin-bottom: 0.5rem;
}

.today-progress-bar {
    background: rgba(255,255,255,0.6);
    border-radius: 0.5rem;
    height: 12px;
    overflow: hidden;
    position: relative;
}

.today-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFC107 0%, #FF9800 100%);
    border-radius: 0.5rem;
    transition: width 0.5s ease-out;
    position: relative;
}

.today-progress-fill.qualified {
    background: linear-gradient(90deg, #4CAF50 0%, #2E7D32 100%);
    animation: qualified-glow 1.5s ease-in-out infinite;
}

@keyframes qualified-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(76,175,80,0.5); }
    50% { box-shadow: 0 0 15px rgba(76,175,80,0.8); }
}

/* 里程碑區塊 */
.streak-milestones {
    display: flex;
    justify-content: space-around;
    gap: 0.5rem;
}

.milestone-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.5;
    transition: all 0.3s;
}

.milestone-item.achieved {
    opacity: 1;
    transform: scale(1.1);
}

.milestone-icon {
    font-size: 1.5rem;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.milestone-item.achieved .milestone-icon {
    filter: grayscale(0%);
    animation: milestone-bounce 0.5s ease;
}

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

.milestone-progress {
    width: 40px;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.milestone-progress::after {
    content: '';
    display: block;
    width: var(--progress, 0%);
    height: 100%;
    background: #FF9800;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.milestone-item.achieved .milestone-progress::after {
    background: #4CAF50;
}

.milestone-title {
    font-size: 0.7rem;
    color: #795548;
}

/* ==========================================
   慶祝動畫樣式
   ========================================== */

.streak-celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.streak-celebration-modal.fade-out {
    animation: modal-fade-out 0.3s ease forwards;
}

@keyframes modal-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.celebration-content {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFE082 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    max-width: 320px;
    animation: celebration-pop 0.5s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

@keyframes celebration-pop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.celebration-icon {
    font-size: 4rem;
    animation: celebration-bounce 1s ease infinite;
}

@keyframes celebration-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.celebration-content h3 {
    color: #E65100;
    margin: 1rem 0;
    font-size: 1.25rem;
}

.celebration-rewards {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.reward-item {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.celebration-message {
    color: #795548;
    font-size: 0.9rem;
    margin: 1rem 0;
}

.celebration-content button {
    background: linear-gradient(90deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.celebration-content button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255,152,0,0.4);
}

/* 慶祝粒子 */
.celebration-particle {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    z-index: 10001;
    animation: particle-fall 3s ease-out forwards;
}

@keyframes particle-fall {
    0% {
        top: -20px;
        opacity: 1;
        transform: rotate(0deg);
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: rotate(720deg);
    }
}

/* 浮動粒子（天氣效果用） */
.floating-particle {
    position: absolute;
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 5;
    animation: float-up 4s ease-in-out infinite;
}

@keyframes float-up {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 1;
    }
}

/* ==========================================
   場景系統樣式
   ========================================== */

/* 場景區塊 */
.scene-system-section {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(33,150,243,0.2);
}

.scene-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.scene-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    color: #1565C0;
}

.scene-title-icon {
    font-size: 1.25rem;
}

.scene-energy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #1565C0;
}

.energy-icon {
    font-size: 1rem;
}

.energy-bar-mini {
    width: 60px;
    height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
    overflow: hidden;
}

.energy-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFC107 0%, #FF9800 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 場景選擇器 */
.scene-selector {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    scrollbar-width: none;
}

.scene-selector::-webkit-scrollbar {
    display: none;
}

.scene-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 60px;
    position: relative;
}

.scene-tab:hover:not(.locked) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.scene-tab.active {
    background: #1976D2;
    color: white;
}

.scene-tab.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.scene-tab.achievement-tab {
    background: linear-gradient(145deg, #ffd700, #ffb700);
    color: #5a4000;
}

.scene-tab.achievement-tab:hover {
    box-shadow: 0 4px 15px rgba(255, 183, 0, 0.4);
}

.scene-tab.notice-tab {
    background: linear-gradient(145deg, #ffddc1, #ffc28a);
    color: #5a3300;
}

.scene-tab.notice-tab:hover {
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.35);
}

.scene-icon {
    font-size: 1.5rem;
}

.scene-name {
    font-size: 0.7rem;
    font-weight: 500;
}

.lock-icon {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.75rem;
}

/* 場景內容區 */
.scene-content {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

/* 場景背景圖 - 像素風格 */
.scene-content.scene-bg-home {
    background: url('/assets/sprites/backgrounds/home.png') center/cover no-repeat;
}

.scene-content.scene-bg-forest {
    background: url('/assets/sprites/backgrounds/forest.png') center/cover no-repeat;
}

.scene-content.scene-bg-cave {
    background: url('/assets/sprites/backgrounds/cave.png') center/cover no-repeat;
}

.scene-content.scene-bg-market {
    background: url('/assets/sprites/backgrounds/market.png') center/cover no-repeat;
}

.scene-content.scene-bg-arena {
    background: url('/assets/sprites/backgrounds/arena.png') center/cover no-repeat;
}

.scene-content.scene-bg-team {
    background: url('/assets/sprites/backgrounds/team.png') center/cover no-repeat;
}

/* 場景背景遮罩（讓文字更清晰）*/
.scene-content[class*="scene-bg-"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 0;
}

.scene-content[class*="scene-bg-"] > * {
    position: relative;
    z-index: 1;
}

/* 場景通用樣式 */
.scene-home,
.scene-forest,
.scene-cave,
.scene-market,
.scene-arena,
.scene-team {
    text-align: center;
}

/* 森林地圖 */
.forest-map-wrapper {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.forest-map-wrapper.map-modal {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    min-height: 260px;
}

.forest-map-wrapper.map-modal .forest-grid {
    background: #e2e8f0;
    border: 2px dashed #94a3b8;
}

.forest-map-wrapper.map-modal .forest-cell {
    background: #94a3b8 !important;
    border: 1px solid #475569 !important;
    color: #0f172a !important;
    opacity: 1 !important;
}

.forest-map-wrapper.map-modal .forest-cell.revealed {
    background: #fef3c7 !important;
}

.forest-map-wrapper.map-modal .forest-cell.blocked {
    background: #64748b !important;
    color: #f8fafc !important;
}

.forest-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.forest-map-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.map-quality {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
}

.quality-normal { background: #e0e0e0; color: #555; }
.quality-good { background: #c8e6c9; color: #2e7d32; }
.quality-rare { background: #bbdefb; color: #1565c0; }
.quality-legendary { background: #ffe082; color: #e65100; }

.map-affix {
    font-weight: 600;
    color: #6a4f00;
}

.map-affix .affix-icon {
    margin-right: 0.2rem;
}

.affix-default { color: #6a4f00; }
.affix-gold { color: #bf6b00; }
.affix-blue { color: #1565c0; }
.affix-purple { color: #6a1b9a; }
.affix-green { color: #2e7d32; }

.map-affix-desc {
    color: #8d6e63;
}

.forest-reset-btn {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    color: #e65100;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.forest-map-progress {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.map-streak {
    color: #ef6c00;
    font-weight: 600;
}

.forest-grid {
    display: grid;
    gap: 0.3rem;
    margin: 0 auto 0.5rem;
    padding: 0.35rem;
    border-radius: 0.6rem;
    background: #eef2f7;
    border: 1px dashed #cbd5e1;
    min-height: 220px;
    width: 100%;
    box-sizing: border-box;
    align-content: start;
    grid-auto-flow: row;
    place-content: start center;
}

.forest-grid .loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

.forest-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.45rem;
    border: 1px solid #cbd5e1;
    background: #e2e8f0;
    cursor: pointer;
    position: relative;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #334155;
}

.forest-cell.revealed {
    background: #fffdf4;
    cursor: default;
}

.forest-cell.drop-animate {
    animation: forestDropPop 0.5s ease;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.4);
}

@keyframes forestDropPop {
    0% { transform: scale(0.9); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.forest-cell.blocked {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}

.forest-cell .cell-icon {
    font-size: 1rem;
}

.forest-cell .cell-qty {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.6rem;
    color: #333;
}

.forest-map-log {
    min-height: 2.2rem;
    font-size: 0.8rem;
    color: #4a4a4a;
    display: grid;
    gap: 0.2rem;
}

.forest-log-line {
    text-align: left;
}

.scene-home h4,
.scene-forest h4,
.scene-cave h4,
.scene-market h4,
.scene-arena h4,
.scene-team h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #333;
}

.scene-home p,
.scene-forest p,
.scene-cave p,
.scene-market p,
.scene-arena p,
.scene-team p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: #666;
}

/* 家園場景 */
.home-message {
    margin-bottom: 1rem;
}

.home-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.scene-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
}

.scene-action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76,175,80,0.3);
}

.scene-action-btn span:first-child {
    font-size: 1.25rem;
}

.scene-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scene-action-btn .action-cost {
    font-size: 0.65rem;
    color: #888;
    margin-top: 0.1rem;
}

/* 食物選擇器 */
.food-selector-container {
    margin-top: 1rem;
    background: rgba(255,255,255,0.95);
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.food-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;
}

.food-selector-header span {
    font-weight: 600;
    color: #333;
}

.food-selector-header .close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
}

.food-list {
    max-height: 200px;
    overflow-y: auto;
}

.food-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.food-item:hover {
    background: #f0f9f0;
}

.food-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.food-icon img {
    max-width: 100%;
    max-height: 100%;
}

.food-info {
    flex: 1;
    text-align: left;
}

.food-name {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

.food-effect {
    display: block;
    font-size: 0.75rem;
    color: #4CAF50;
}

.food-quantity {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.no-food-message {
    text-align: center;
    padding: 1rem;
    color: #666;
}

.no-food-message p {
    margin-bottom: 0.5rem;
}

/* 森林場景 */
.forest-header {
    margin-bottom: 1rem;
}

.forest-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.energy-cost {
    color: #FF9800;
}

.weather-bonus {
    color: #9E9E9E;
}

.weather-bonus.active {
    color: #FF9800;
    font-weight: bold;
}

.gather-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 auto;
}

.gather-btn:hover:not(.disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(76,175,80,0.4);
}

.gather-btn.disabled {
    background: #BDBDBD;
    cursor: not-allowed;
}

.gather-btn.gathering {
    animation: gather-pulse 0.5s ease infinite;
}

.forest-action-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.gather-btn.explore {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    color: #5d3b00;
}

.gather-btn.explore:hover:not(.disabled) {
    box-shadow: 0 4px 15px rgba(255,152,0,0.35);
}

@keyframes gather-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.95); }
}

.gather-icon {
    font-size: 1.25rem;
}

/* 採集結果 */
.gather-result {
    margin-top: 1rem;
}

.gather-success {
    animation: result-pop 0.3s ease;
}

@keyframes result-pop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.gathered-materials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.gathered-item {
    background: #E8F5E9;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
}

.gather-rewards {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.gather-rewards .bonus {
    color: #FF9800;
    font-weight: bold;
}

.forest-zone {
    margin: 0.35rem 0 0.5rem;
    font-size: 0.85rem;
    color: #4c6a52;
    font-weight: 600;
}

.forest-segment {
    margin: 0.4rem 0 0.75rem;
}

.forest-segment-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 0.35rem;
}

.forest-bonus {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #ff6f00;
    font-weight: 600;
}

.gather-rewards-modal {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.gather-rewards-modal .bonus {
    color: #FF9800;
    font-weight: bold;
}

.cave-rank-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.6rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cave-rank-btn:hover {
    border-color: #9ccc65;
    color: #2e7d32;
}

/* 場景佔位符（開發中） */
.cave-placeholder,
.market-placeholder,
.arena-placeholder,
.team-placeholder {
    padding: 2rem 1rem;
    color: #9E9E9E;
}

.cave-placeholder span,
.market-placeholder span,
.arena-placeholder span,
.team-placeholder span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* 響應式 */
@media (max-width: 380px) {
    .scene-tab {
        min-width: 50px;
        padding: 0.4rem 0.5rem;
    }

    .scene-icon {
        font-size: 1.25rem;
    }

    .scene-name {
        font-size: 0.6rem;
    }

    .scene-action-btn {
        min-width: 60px;
        padding: 0.5rem 0.75rem;
    }
}

/* ==========================================
   商店系統樣式
   ========================================== */

/* 市集頁面標頭 */
.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.market-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.market-coins {
    display: flex;
    gap: 0.75rem;
}

.coin-display {
    background: rgba(255,255,255,0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: bold;
}

/* 市集分頁 */
.market-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.market-tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: white;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.market-tab.active {
    background: #1976D2;
    color: white;
}

.market-tab:hover:not(.active) {
    background: #E3F2FD;
}

/* 市集內容區 */
.market-content {
    min-height: 200px;
}

/* 商品分類按鈕 */
.shop-categories {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.shop-category-btn {
    padding: 0.4rem 0.75rem;
    border: none;
    background: #E0E0E0;
    border-radius: 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.shop-category-btn.active {
    background: #1976D2;
    color: white;
}

.shop-category-btn:hover:not(.active) {
    background: #BDBDBD;
}

/* 商品列表 */
.shop-items-list,
.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

/* 商品項目 */
.shop-item,
.inventory-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.shop-item:hover,
.inventory-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 稀有度邊框 */
.rarity-common { border-left: 3px solid #9E9E9E; }
.rarity-uncommon { border-left: 3px solid #4CAF50; }
.rarity-rare { border-left: 3px solid #2196F3; }
.rarity-epic { border-left: 3px solid #9C27B0; }
.rarity-legendary { border-left: 3px solid #FF9800; }

/* 商品圖示 */
.item-icon {
    font-size: 1.75rem;
    width: 40px;
    height: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 物品像素圖片圖示 */
.item-sprite-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 商品資訊 */
.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.item-price,
.item-quantity {
    font-size: 0.8rem;
    color: #666;
}

.item-owned {
    font-size: 0.8rem;
    color: #9E9E9E;
    min-width: 30px;
    text-align: center;
}

/* 購買按鈕 */
.buy-btn {
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.buy-btn:hover:not(.disabled) {
    transform: scale(1.05);
}

.buy-btn.disabled {
    background: #BDBDBD;
    cursor: not-allowed;
}

/* 背包物品操作按鈕 */
.item-actions {
    display: flex;
    gap: 0.5rem;
}

.use-btn,
.sell-btn {
    padding: 0.35rem 0.6rem;
    border: none;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.use-btn {
    background: #4CAF50;
    color: white;
}

.sell-btn {
    background: #FF9800;
    color: white;
}

.use-btn:hover,
.sell-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* 空背包提示 */
.empty-inventory,
.empty-message {
    text-align: center;
    padding: 2rem 1rem;
    color: #9E9E9E;
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* 載入中動畫 */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* 錯誤訊息 */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #F44336;
}

/* 響應式商店 */
@media (max-width: 380px) {
    .market-coins {
        gap: 0.5rem;
    }

    .coin-display {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }

    .shop-item,
    .inventory-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .item-icon {
        font-size: 1.5rem;
        width: 32px;
    }

    .item-name {
        font-size: 0.85rem;
    }

    .buy-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .use-btn,
    .sell-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }
}

/* ==========================================
   洞穴戰鬥系統
   ========================================== */

.cave-progress {
    background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.cave-floor-info {
    text-align: center;
    margin-bottom: 0.75rem;
}

.floor-label {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.floor-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #a78bfa;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

.cave-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.cave-stat {
    text-align: center;
}

.cave-stat .stat-label {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
}

.cave-stat .stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #d1d5db;
}

.cave-info {
    text-align: center;
    margin-bottom: 1rem;
}

.cave-training-row {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.cave-sub-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 0.65rem;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cave-sub-btn:hover:not(.disabled) {
    border-color: #90caf9;
    color: #1976d2;
}

.cave-sub-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cave-battle-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.cave-battle-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.cave-battle-btn:disabled {
    background: #4b5563;
    cursor: not-allowed;
    opacity: 0.6;
}

.battle-icon {
    font-size: 1.3rem;
}

/* 戰鬥介面 */
.battle-container {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 1rem;
    border: 2px solid rgba(139, 92, 246, 0.4);
    margin-top: 1rem;
}

.battle-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.battle-exit-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.battle-exit-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.floor-badge {
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.battle-mode {
    background: rgba(255, 214, 79, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.5);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.monster-type {
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.monster-type.boss {
    background: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
    color: white;
    animation: bossGlow 2s ease-in-out infinite;
}

.monster-type.elite {
    background: linear-gradient(135deg, #eab308 0%, #f59e0b 100%);
    color: #1a1a2e;
}

@keyframes bossGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(220, 38, 38, 0.5); }
    50% { box-shadow: 0 0 15px rgba(220, 38, 38, 0.8); }
}

.battle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.monster-side,
.pet-side {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.monster-display,
.pet-battle-display {
    margin-bottom: 0.5rem;
}

.monster-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.25rem;
    animation: monsterBounce 1s ease-in-out infinite;
}

@keyframes monsterBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.pet-battle-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.25rem;
}

.monster-name,
.pet-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
}

.battle-vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    flex-shrink: 0;
}

/* HP 血量條 */
.hp-bar {
    height: 20px;
    background: #374151;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.hp-bar .hp-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.monster-hp .hp-fill {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
}

.pet-hp .hp-fill {
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
}

.hp-bar .hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.monster-stats-mini,
.pet-stats-mini {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* 戰鬥記錄 */
.battle-log {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    max-height: 100px;
    overflow-y: auto;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.battle-log .log-entry {
    color: #d1d5db;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.battle-log .log-entry:last-child {
    border-bottom: none;
}

.battle-log .log-entry.new {
    animation: logFadeIn 0.3s ease;
}

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

/* 戰鬥動作按鈕 */
.battle-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.battle-action-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.battle-action-btn.attack {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: white;
}

.battle-action-btn.attack:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.battle-action-btn.flee {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    color: white;
}

.battle-action-btn.flee:hover:not(:disabled) {
    transform: scale(1.02);
}

.battle-action-btn.continue {
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
    color: white;
}

.battle-action-btn.back {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

.battle-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 戰鬥結果 */
.battle-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.battle-result.victory {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(74, 222, 128, 0.2) 100%);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #4ade80;
}

.battle-result.defeat {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(239, 68, 68, 0.2) 100%);
    border: 1px solid rgba(220, 38, 38, 0.5);
    color: #f87171;
}

.battle-result.fled {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.2) 0%, rgba(156, 163, 175, 0.2) 100%);
    border: 1px solid rgba(107, 114, 128, 0.5);
    color: #9ca3af;
}

.result-icon {
    font-size: 1.5rem;
}

/* 響應式調整 */
@media (max-width: 400px) {
    .floor-value {
        font-size: 2rem;
    }

    .monster-icon {
        font-size: 2.5rem;
    }

    .pet-battle-icon {
        font-size: 2rem;
    }

    .battle-vs {
        font-size: 1.2rem;
    }

    .battle-action-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .hp-bar {
        height: 16px;
    }

    .hp-bar .hp-text {
        font-size: 0.6rem;
    }
}

/* ==========================================
   競技場系統
   ========================================== */

/* 競技場場景 */
.scene-arena {
    text-align: center;
}

.arena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.arena-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.arena-daily-info {
    font-size: 0.85rem;
    color: #666;
    background: #f5f5f5;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

.arena-content {
    min-height: 200px;
}

/* 競技場統計 */
.arena-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.arena-tier-display {
    flex: 1;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tier-icon {
    font-size: 1.5rem;
}

.tier-name {
    font-size: 1rem;
}

.tier-progress {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tier-progress-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.tier-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.tier-points {
    font-size: 0.75rem;
    color: #666;
}

.arena-rating {
    text-align: right;
}

.rating-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
}

.rating-value {
    display: block;
    font-size: 1.75rem;
    font-weight: bold;
    color: #333;
}

.rating-rank {
    font-size: 0.85rem;
    color: #666;
}

/* 戰績記錄 */
.arena-record {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.record-item {
    text-align: center;
}

.record-value {
    display: block;
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
}

.record-label {
    font-size: 0.75rem;
    color: #888;
}

/* 賽季資訊 */
.arena-season {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.season-name {
    font-weight: bold;
}

.season-days {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 競技場按鈕 */
.arena-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.arena-btn {
    flex: 1;
    min-width: 90px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
}

.arena-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.arena-btn:disabled {
    background: #9E9E9E;
    cursor: not-allowed;
    opacity: 0.7;
}

.arena-btn.find-opponent {
    background: linear-gradient(135deg, #FF5722 0%, #E64A19 100%);
}

.arena-btn.view-rankings {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
}

.arena-btn.view-history {
    background: linear-gradient(135deg, #607D8B 0%, #455A64 100%);
}

.arena-btn.back {
    background: linear-gradient(135deg, #78909C 0%, #546E7A 100%);
}

.arena-btn.fight {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    font-size: 1rem;
}

/* 對手選擇 */
.opponent-selection h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.opponent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.opponent-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.opponent-card:hover {
    border-color: #FF5722;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.opponent-pet {
    position: relative;
}

.pet-sprite.mini {
    width: 48px;
    height: 48px;
}

.opponent-pet .pet-level {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #333;
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
}

.opponent-info {
    flex: 1;
    text-align: left;
}

.opponent-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.opponent-tier {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.opponent-difficulty {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.opponent-reward {
    font-size: 0.8rem;
    color: #FF9800;
    font-weight: 600;
}

/* 競技場戰鬥 */
.arena-battle {
    text-align: center;
}

.arena-battle .battle-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.fighter {
    flex: 1;
    padding: 0.75rem;
    background: rgba(0,0,0,0.05);
    border-radius: 0.75rem;
}

.player-fighter {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(139, 195, 74, 0.1) 100%);
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.opponent-fighter {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, rgba(255, 87, 34, 0.1) 100%);
    border: 2px solid rgba(244, 67, 54, 0.3);
}

.fighter-pet {
    margin-bottom: 0.5rem;
}

.fighter-pet .pet-sprite {
    width: 64px;
    height: 64px;
    margin: 0 auto;
}

.fighter-info {
    margin-bottom: 0.5rem;
}

.fighter-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.fighter-level {
    font-size: 0.75rem;
    color: #666;
}

.fighter-hp .hp-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.fighter-hp .hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.fighter-hp .hp-fill.opponent {
    background: linear-gradient(90deg, #F44336 0%, #FF5722 100%);
}

.fighter-hp .hp-text {
    font-size: 0.75rem;
    color: #666;
}

.vs-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: #FF5722;
    flex-shrink: 0;
}

/* 競技場戰鬥記錄 */
.arena-battle .battle-log {
    background: #f5f5f5;
    border-radius: 0.5rem;
    padding: 0.5rem;
    max-height: 80px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    text-align: left;
}

.arena-battle .log-entry {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.arena-battle .log-entry.player-attack {
    background: rgba(76, 175, 80, 0.1);
    color: #2E7D32;
}

.arena-battle .log-entry.opponent-attack {
    background: rgba(244, 67, 54, 0.1);
    color: #C62828;
}

/* 競技場結果 */
.arena-result {
    padding: 1.5rem 1rem;
}

.arena-result .result-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: resultBounce 0.5s ease;
}

@keyframes resultBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.arena-result .result-text {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.arena-result.win .result-text { color: #4CAF50; }
.arena-result.lose .result-text { color: #F44336; }
.arena-result.draw .result-text { color: #9E9E9E; }

.result-details {
    background: #f5f5f5;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.rating-change {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.rating-change.positive { color: #4CAF50; }
.rating-change.negative { color: #F44336; }

.new-rating {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.tier-change {
    font-size: 1.1rem;
    font-weight: bold;
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.tier-change.up {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.2) 100%);
    color: #FF8C00;
    animation: tierUpPulse 1s ease infinite;
}

.tier-change.down {
    background: rgba(158, 158, 158, 0.2);
    color: #757575;
}

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

.tier-progress-info {
    font-size: 0.85rem;
    color: #666;
}

.result-rewards {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(139, 195, 74, 0.1) 100%);
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.reward-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.reward-items {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-weight: 600;
}

.win-streak-info {
    font-size: 1.1rem;
    color: #FF5722;
    font-weight: bold;
    margin-bottom: 1rem;
    animation: streakPulse 0.5s ease infinite alternate;
}

@keyframes streakPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

/* 排行榜 */
.arena-rankings h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.rankings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f5f5f5;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.ranking-item.is-me {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(139, 195, 74, 0.15) 100%);
    border: 2px solid #4CAF50;
}

.rank-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.85rem;
}

.rank-number.top-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
}

.rank-number.top-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: white;
}

.rank-number.top-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: white;
}

.rank-pet {
    width: 36px;
    height: 36px;
}

.rank-info {
    flex: 1;
    text-align: left;
}

.rank-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.rank-tier {
    font-size: 0.75rem;
    color: #666;
}

.rank-rating {
    font-weight: bold;
    color: #333;
}

/* 對戰記錄 */
.arena-history h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f5f5f5;
    border-radius: 0.5rem;
    border-left: 3px solid #9E9E9E;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.2rem;
}

.history-direction {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f1f1f1;
    color: #666;
    white-space: nowrap;
}

.history-direction.incoming {
    background: #e3f2fd;
    color: #1976d2;
}

.history-direction.outgoing {
    background: #f1f8e9;
    color: #558b2f;
}

.history-item.win {
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.history-item.lose {
    border-left-color: #F44336;
    background: rgba(244, 67, 54, 0.05);
}

.history-result {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.85rem;
    color: white;
}

.history-result.win {
    background: #4CAF50;
}

.history-result.lose {
    background: #F44336;
}

.history-result.draw {
    background: #9E9E9E;
}

.history-opponent {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.history-opponent .pet-sprite {
    width: 32px;
    height: 32px;
}

.history-rating {
    font-weight: 600;
    font-size: 0.9rem;
}

.history-rating.positive { color: #4CAF50; }
.history-rating.negative { color: #F44336; }

.history-rounds {
    font-size: 0.75rem;
    color: #888;
}

/* 響應式競技場 */
@media (max-width: 380px) {
    .arena-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .arena-rating {
        text-align: center;
    }

    .arena-record {
        padding: 0.5rem;
    }

    .record-value {
        font-size: 1rem;
    }

    .arena-actions {
        gap: 0.35rem;
    }

    .arena-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
        min-width: 80px;
    }

    .opponent-card {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .fighter-pet .pet-sprite {
        width: 48px;
        height: 48px;
    }
}

/* ==========================================
   Toast 動畫
   ========================================== */
@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* ==========================================
   隊伍系統
   ========================================== */

/* 隊伍場景 */
.scene-team {
    text-align: center;
}

.scene-team .team-header {
    margin-bottom: 1rem;
}

.scene-team .team-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.scene-team .team-header p {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: #666;
}

.team-content {
    min-height: 200px;
}

/* 無隊伍狀態 */
.team-no-team {
    padding: 1rem 0;
}

.team-invitations-badge {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.team-invitations-badge:hover {
    transform: scale(1.02);
}

.team-invitations-badge .badge {
    background: white;
    color: #F57C00;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-weight: bold;
    font-size: 0.85rem;
}

.team-welcome {
    padding: 2rem 1rem;
}

.team-welcome .welcome-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.team-welcome h4 {
    margin: 0.5rem 0;
    color: #333;
}

.team-welcome p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* 隊伍操作按鈕網格 */
.team-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0 0.5rem;
}

.team-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.team-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.team-action-btn .btn-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.team-action-btn .btn-text {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.team-action-btn .btn-desc {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

.team-action-btn.create {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.team-action-btn.create .btn-text,
.team-action-btn.create .btn-desc {
    color: white;
}

.team-action-btn.join {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}
.team-action-btn.join .btn-text,
.team-action-btn.join .btn-desc {
    color: white;
}

.team-action-btn.search {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}
.team-action-btn.search .btn-text,
.team-action-btn.search .btn-desc {
    color: white;
}

.team-action-btn.rankings {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

/* 隊伍資訊卡 */
.team-info-card {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.team-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.team-header-info .team-icon {
    font-size: 2.5rem;
}

.team-header-info .team-details {
    flex: 1;
    text-align: left;
}

.team-header-info .team-details h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.team-header-info .team-motto {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.team-code-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f5f5f5;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.team-code-display .code-label {
    font-size: 0.65rem;
    color: #888;
}

.team-code-display .code-value {
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    letter-spacing: 0.1rem;
}

.team-code-display .copy-btn {
    background: none;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.1rem;
}

/* 隊伍統計 */
.team-stats-row {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.75rem;
}

.team-stat {
    text-align: center;
}

.team-stat .stat-icon {
    font-size: 1rem;
}

.team-stat .stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.team-stat .stat-bar {
    width: 60px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.team-stat .stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* 角色標籤 */
.my-role-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.my-role-badge.role-leader {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
}

.my-role-badge.role-co-leader {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
}

.my-role-badge.role-member {
    background: #e0e0e0;
    color: #666;
}

/* 隊伍分頁 */
.team-nav-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    background: #f5f5f5;
    padding: 0.25rem;
    border-radius: 0.75rem;
}

.team-tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.team-tab.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 600;
}

.team-tab-content {
    min-height: 150px;
}

/* 隊伍任務列表 */
.team-quests-empty {
    padding: 2rem;
    text-align: center;
    color: #888;
}

.team-quests-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.team-quest-card {
    background: white;
    border-radius: 0.75rem;
    padding: 0.75rem;
    text-align: left;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-left: 4px solid #9E9E9E;
}

.team-quest-card.difficulty-easy {
    border-left-color: #4CAF50;
}

.team-quest-card.difficulty-normal {
    border-left-color: #2196F3;
}

.team-quest-card.difficulty-hard {
    border-left-color: #FF9800;
}

.team-quest-card.difficulty-epic {
    border-left-color: #9C27B0;
}

.team-quest-card .quest-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.team-quest-card .quest-icon {
    font-size: 1.5rem;
}

.team-quest-card .quest-info {
    flex: 1;
}

.team-quest-card .quest-info h5 {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
}

.team-quest-card .quest-type {
    font-size: 0.75rem;
    color: #888;
}

.team-quest-card .quest-time {
    font-size: 0.75rem;
    color: #FF5722;
    font-weight: 600;
}

.team-quest-card .quest-desc {
    font-size: 0.8rem;
    color: #666;
    margin: 0 0 0.5rem;
}

.team-quest-card .quest-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.team-quest-card .progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.team-quest-card .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.team-quest-card .progress-text {
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
}

.team-quest-card .quest-rewards {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #888;
}

.team-quest-card .quest-rewards .reward {
    color: #FF9800;
    font-weight: 600;
}

/* 隊伍成員列表 */
.team-members-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.team-member-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.75rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.team-member-card.is-me {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(139, 195, 74, 0.1) 100%);
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.team-member-card .member-pet {
    position: relative;
}

.team-member-card .member-pet .pet-sprite {
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.team-member-card .member-pet .pet-level {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #333;
    color: white;
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
    border-radius: 0.25rem;
}

.team-member-card .member-info {
    flex: 1;
    text-align: left;
}

.team-member-card .member-name {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.team-member-card .member-role {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    margin-right: 0.25rem;
}

.team-member-card .member-role.role-leader {
    background: #FFD700;
    color: #333;
}

.team-member-card .member-role.role-co-leader {
    background: #9C27B0;
    color: white;
}

.team-member-card .member-role.role-member {
    background: #e0e0e0;
    color: #666;
}

.team-member-card .member-contribution {
    font-size: 0.7rem;
    color: #888;
}

.team-member-card .member-actions {
    position: relative;
}

.team-member-card .action-btn {
    background: #f0f0f0;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
}

.team-member-card .member-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 100;
    min-width: 120px;
    overflow: hidden;
}

.team-member-card .member-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
}

.team-member-card .member-menu button:hover {
    background: #f5f5f5;
}

.team-member-card .member-menu button.danger {
    color: #F44336;
}

/* 隊伍按鈕 */
.team-btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.team-btn.primary {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
}

.team-btn.secondary {
    background: #e0e0e0;
    color: #333;
}

.team-btn.danger {
    background: linear-gradient(135deg, #F44336 0%, #C62828 100%);
    color: white;
}

.team-btn.disabled {
    background: #9E9E9E;
    color: white;
    cursor: not-allowed;
}

.team-btn:hover:not(.disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 隊伍表單 */
.team-form-card {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.team-form-card h4 {
    margin: 0 0 1rem;
    text-align: center;
}

.team-form-card .form-group {
    margin-bottom: 1rem;
}

.team-form-card label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.team-form-card input[type="text"] {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.team-form-card .toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.team-form-card .form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.team-form-card .form-actions .team-btn {
    flex: 1;
}

/* 圖示選擇器 */
.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.icon-option {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    background: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-option:hover {
    border-color: #4CAF50;
}

.icon-option.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

/* 隊伍搜尋 */
.team-search {
    text-align: left;
}

.team-search .search-header,
.team-rankings .rankings-header,
.team-invitations .invitations-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.team-search .search-header h4,
.team-rankings .rankings-header h4,
.team-invitations .invitations-header h4 {
    margin: 0;
    flex: 1;
}

.back-btn {
    background: #f0f0f0;
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.team-search .search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.team-search .search-bar input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.team-search .search-bar button {
    padding: 0.6rem 1rem;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-results .hint,
.search-results .empty,
.search-results .error {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.search-team-card {
    background: white;
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.search-team-card.full {
    opacity: 0.6;
}

.search-team-card .team-basic {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.search-team-card .team-icon {
    font-size: 2rem;
}

.search-team-card .team-info {
    flex: 1;
}

.search-team-card .team-info h5 {
    margin: 0;
    font-size: 0.95rem;
}

.search-team-card .team-level {
    font-size: 0.75rem;
    color: #888;
}

.search-team-card .team-motto {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin: 0 0 0.5rem;
}

/* 隊伍排行榜 */
.team-rankings .rankings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.team-rankings .ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.team-rankings .ranking-item.is-me {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(139, 195, 74, 0.1) 100%);
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.team-rankings .rank-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0e0e0;
    font-size: 0.8rem;
    font-weight: bold;
}

.team-rankings .rank-num.top-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
}

.team-rankings .rank-num.top-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: white;
}

.team-rankings .rank-num.top-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: white;
}

.team-rankings .team-icon {
    font-size: 1.5rem;
}

.team-rankings .team-info {
    flex: 1;
}

.team-rankings .team-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.team-rankings .team-stats {
    font-size: 0.75rem;
    color: #888;
}

.team-rankings .team-exp {
    font-size: 0.85rem;
    font-weight: bold;
    color: #4CAF50;
}

/* 隊伍邀請 */
.team-invitations .invitations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invitation-card {
    background: white;
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.invitation-card .invitation-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.invitation-card .team-icon {
    font-size: 2rem;
}

.invitation-card .team-info {
    flex: 1;
}

.invitation-card .team-info h5 {
    margin: 0;
    font-size: 0.95rem;
}

.invitation-card .invitation-msg {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin: 0 0 0.5rem;
}

.invitation-card .invitation-actions {
    display: flex;
    gap: 0.5rem;
}

.invitation-card .invitation-actions .team-btn {
    flex: 1;
    padding: 0.5rem;
}

/* 隊伍聊天 */
.team-chat {
    display: flex;
    flex-direction: column;
    height: 300px;
}

.team-chat .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f5f5f5;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.team-chat .chat-empty {
    text-align: center;
    color: #888;
    padding: 2rem;
}

.team-chat .chat-message {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.team-chat .chat-message.system {
    background: rgba(156, 39, 176, 0.1);
    text-align: center;
    font-style: italic;
    color: #9C27B0;
}

.team-chat .chat-message.is-me {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(139, 195, 74, 0.15) 100%);
}

.team-chat .msg-sender {
    display: block;
    font-weight: 600;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.15rem;
}

.team-chat .msg-content {
    display: block;
    color: #333;
}

.team-chat .msg-time {
    display: block;
    font-size: 0.65rem;
    color: #aaa;
    text-align: right;
    margin-top: 0.25rem;
}

.team-chat .chat-input {
    display: flex;
    gap: 0.5rem;
}

.team-chat .chat-input input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.team-chat .chat-input button {
    padding: 0.6rem 1rem;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

/* 隊伍管理 */
.team-manage {
    text-align: left;
}

.team-manage .manage-section {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.team-manage .manage-section h5 {
    margin: 0 0 0.75rem;
    color: #333;
}

.team-manage .manage-section.danger-zone {
    border: 2px solid #F44336;
}

.team-manage .manage-section.danger-zone h5 {
    color: #F44336;
}

.team-manage .manage-form label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
    margin-top: 0.75rem;
}

.team-manage .manage-form label:first-child {
    margin-top: 0;
}

.team-manage .manage-form input[type="text"] {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.team-manage .manage-form .toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.team-manage .manage-form .team-btn {
    margin-top: 1rem;
    width: 100%;
}

.team-manage .danger-zone .team-btn {
    margin-top: 0.5rem;
}

.team-manage .danger-zone .team-btn:first-of-type {
    margin-top: 0;
}

/* 可用任務列表 */
.available-quests .quests-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.available-quests .quests-header h5 {
    margin: 0;
}

.available-quests .quests-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.available-quest-card {
    background: white;
    border-radius: 0.75rem;
    padding: 0.75rem;
    text-align: left;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-left: 4px solid #9E9E9E;
    cursor: pointer;
    transition: all 0.2s ease;
}

.available-quest-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.available-quest-card .quest-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #888;
    margin: 0.5rem 0;
}

.available-quest-card .quest-rewards {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #FF9800;
    font-weight: 600;
}

/* 響應式隊伍系統 */
@media (max-width: 380px) {
    .team-actions-grid {
        gap: 0.5rem;
    }

    .team-action-btn {
        padding: 0.75rem;
    }

    .team-action-btn .btn-icon {
        font-size: 1.25rem;
    }

    .team-action-btn .btn-text {
        font-size: 0.85rem;
    }

    .team-header-info .team-icon {
        font-size: 2rem;
    }

    .team-chat {
        height: 250px;
    }
}

/* ===== 場景彈窗內部樣式 ===== */

/* 場景描述 */
.scene-modal-description {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.scene-modal-description p {
    margin: 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 場景動作按鈕（彈窗內） */
.scene-modal-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border: 2px solid #e0e0e0;
    border-radius: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 100px;
}

.scene-modal-action:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #4CAF50;
}

.scene-modal-action:active:not(.disabled) {
    transform: translateY(0);
}

.scene-modal-action.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0;
}

.scene-modal-action .action-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.scene-modal-action .action-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.scene-modal-action .action-desc {
    font-size: 0.75rem;
    color: #888;
}

/* 採集結果（彈窗版） */
.gather-result-modal {
    text-align: center;
    padding: 0.5rem;
}

.gather-result-modal p {
    margin: 0 0 0.5rem;
    color: #4CAF50;
    font-weight: 600;
}

.gathered-items-modal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.gathered-item-modal {
    background: #e8f5e9;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    color: #2e7d32;
}

/* 洞穴進度（彈窗版） */
.cave-progress-modal {
    background: linear-gradient(135deg, #37474F 0%, #263238 100%);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    color: white;
}

.floor-info {
    text-align: center;
    margin-bottom: 0.75rem;
}

.floor-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.25rem;
}

.floor-number {
    font-size: 1.5rem;
    font-weight: bold;
}

.cave-stats {
    display: flex;
    justify-content: space-around;
}

.cave-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.cave-stats .stat-item span:first-child {
    opacity: 0.8;
}

.cave-stats .stat-item span:last-child {
    font-weight: bold;
}

/* 市集分頁（彈窗版） */
.market-tabs-modal {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.market-tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    background: white;
    color: #333;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.market-tab-btn.active {
    background: #FF9800;
    color: white;
    border-color: #FF9800;
}

.market-tab-btn:hover:not(.active) {
    border-color: #FF9800;
}

/* 商店物品列表（彈窗版） */
.shop-balance-modal {
    background: #fff3e0;
    padding: 0.75rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.shop-items-modal,
.inventory-items-modal {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.inventory-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.inventory-category-btn {
    border: 1px solid #d7dbe3;
    background: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    color: #444;
    cursor: pointer;
}

.inventory-category-btn.active {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
}

.shop-item-modal,
.inventory-item-modal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-item-modal:hover {
    background: #fff3e0;
    transform: translateX(3px);
}

.inventory-item-modal {
    cursor: default;
}

.shop-item-modal .item-icon,
.inventory-item-modal .item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: white;
    border-radius: 0.5rem;
}

.shop-item-modal .item-icon img,
.inventory-item-modal .item-icon img {
    max-width: 100%;
    max-height: 100%;
}

.shop-item-modal .item-info,
.inventory-item-modal .item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.inventory-equipment {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.equipment-slot-card {
    background: #f3f6fb;
    border: 1px solid #e3e7f0;
    border-radius: 0.75rem;
    padding: 0.75rem;
}

.equipment-slot-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #3a3a3a;
}

.equipment-slot-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.equipment-slot-empty {
    color: #888;
    font-size: 0.85rem;
}

.inventory-actions {
    margin-left: auto;
    display: flex;
    gap: 0.4rem;
}

.inventory-action-btn {
    border: none;
    background: #4caf50;
    color: #fff;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.inventory-action-btn:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
}

.inventory-action-btn.danger {
    background: #e53935;
}

.play-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.play-option-card {
    background: #f6f8fb;
    border: 1px solid #e1e6ef;
    border-radius: 0.9rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.play-option-card.disabled {
    opacity: 0.6;
}

.play-option-title {
    font-weight: 600;
    color: #2f3b4b;
}

.play-option-desc {
    font-size: 0.8rem;
    color: #5f6b78;
}

.play-option-btn {
    align-self: flex-start;
    border: none;
    background: #4caf50;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.play-option-btn:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
}

.play-toy-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
}

.play-toy-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem;
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 0.7rem;
}

.play-toy-btn {
    margin-left: auto;
    border: none;
    background: #ff9800;
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.item-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.item-price {
    font-size: 0.8rem;
    color: #FF9800;
}

.item-quantity {
    font-size: 0.8rem;
    color: #666;
}

/* 競技場統計（彈窗版） */
.arena-stats-modal {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.arena-stats-modal .stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: #ffebee;
    border-radius: 0.75rem;
}

.arena-stats-modal .stat-item span:first-child {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.arena-stats-modal .stat-item span:last-child {
    font-size: 1.1rem;
    font-weight: bold;
    color: #D32F2F;
}

/* 隊伍資訊（彈窗版） */
.team-info-modal,
.no-team-modal {
    text-align: center;
    padding: 1rem;
    background: #e3f2fd;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.team-info-modal h4 {
    margin: 0 0 0.5rem;
    color: #1976D2;
}

.no-team-modal p {
    margin: 0;
    color: #666;
}

/* 成功/錯誤文字 */
.success-text {
    color: #4CAF50;
    text-align: center;
}

.error-text {
    color: #f44336;
    text-align: center;
}

.empty-text {
    color: #999;
    text-align: center;
    padding: 2rem;
}

/* ===== 戰鬥彈窗 ===== */
.battle-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem;
}

.battle-modal.active {
    display: flex;
}

.battle-modal-content {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    border-radius: 1rem;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: battle-modal-pop 0.3s ease-out;
}

@keyframes battle-modal-pop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.battle-modal-body {
    padding: 1rem;
}

/* ===== 競技場對手選擇彈窗 ===== */
.opponent-list-modal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.opponent-card-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    border: 2px solid #e0e0e0;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.opponent-card-modal:hover {
    border-color: #D32F2F;
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(211, 47, 47, 0.2);
}

.opponent-card-modal .opponent-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.opponent-card-modal .opponent-name {
    font-weight: 600;
    font-size: 1rem;
}

.opponent-card-modal .opponent-tier {
    font-size: 0.85rem;
    color: #666;
}

.opponent-card-modal .opponent-difficulty {
    font-size: 0.8rem;
    font-weight: 600;
}

.opponent-card-modal .opponent-level {
    font-size: 1.2rem;
    font-weight: bold;
    color: #D32F2F;
}

/* ===== 排行榜彈窗 ===== */
.rankings-list-modal {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ranking-item-modal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.ranking-item-modal.is-me {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border: 2px solid #D32F2F;
}

.ranking-item-modal .rank-number {
    width: 40px;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    color: #666;
}

.ranking-item-modal .rank-number.top-1 {
    color: #FFD700;
    font-size: 1.2rem;
}

.ranking-item-modal .rank-number.top-2 {
    color: #C0C0C0;
    font-size: 1.1rem;
}

.ranking-item-modal .rank-number.top-3 {
    color: #CD7F32;
    font-size: 1.1rem;
}

.ranking-item-modal .rank-info {
    flex: 1;
}

.ranking-item-modal .rank-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.ranking-item-modal .rank-tier {
    font-size: 0.8rem;
    color: #666;
}

.ranking-item-modal .rank-rating {
    font-weight: bold;
    font-size: 1rem;
    color: #D32F2F;
}

/* ===== 隊伍面板彈窗 ===== */
.team-detail-modal {
    padding: 0.5rem;
}

.team-header-modal {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.team-header-modal .team-icon {
    font-size: 2.5rem;
}

.team-header-modal .team-info h4 {
    margin: 0 0 0.25rem;
    color: #1976D2;
}

.team-header-modal .team-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.team-actions-modal {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* ==========================================
   競技場對戰彈窗
   ========================================== */

.arena-battle-modal {
    padding: 1rem;
}

.battle-field-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #fff3e0 100%);
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.fighter-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
}

.fighter-pet-modal {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.fighter-name-modal {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    text-align: center;
}

.fighter-level-modal {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.hp-bar-modal {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.hp-fill-modal {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.hp-fill-modal.opponent {
    background: linear-gradient(90deg, #f44336, #ff7043);
}

.hp-text-modal {
    font-size: 0.75rem;
    color: #666;
}

.vs-text-modal {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff5722;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.battle-log-modal {
    max-height: 150px;
    overflow-y: auto;
    background: rgba(0,0,0,0.05);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.battle-log-modal .log-entry {
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    color: #333;
}

.battle-log-modal .log-entry.player-attack {
    background: rgba(76, 175, 80, 0.2);
    border-left: 3px solid #4caf50;
}

.battle-log-modal .log-entry.opponent-attack {
    background: rgba(244, 67, 54, 0.2);
    border-left: 3px solid #f44336;
}

.battle-actions-modal {
    text-align: center;
}

.battle-result-modal {
    text-align: center;
    padding: 2rem 1rem;
}

.battle-result-modal .result-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.battle-result-modal.win .result-title {
    color: #4caf50;
}

.battle-result-modal.lose .result-title {
    color: #f44336;
}

.battle-result-modal .result-rewards {
    background: rgba(255, 215, 0, 0.2);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.battle-result-modal .reward-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.battle-result-modal .reward-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.battle-result-modal .reward-item {
    font-size: 0.95rem;
    color: #666;
}

.battle-result-modal .result-message {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.battle-result-modal .result-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.battle-result-modal .result-actions .arena-btn {
    flex: 1;
    min-width: 120px;
}

/* ==========================================
   玩家對戰 (PvP) 對手列表
   ========================================== */

.pvp-opponent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
}

.opponent-card-modal.pvp {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
    border-radius: 0.75rem;
    border: 2px solid #ffb74d;
    cursor: pointer;
    transition: all 0.2s;
}

.opponent-card-modal.pvp:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 183, 77, 0.4);
}

.opponent-card-modal .opponent-avatar {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
}

.opponent-card-modal .opponent-info {
    flex: 1;
}

.opponent-card-modal .opponent-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.opponent-card-modal .opponent-owner {
    font-size: 0.8rem;
    color: #666;
}

.opponent-card-modal .opponent-tier {
    font-size: 0.8rem;
    color: #ff9800;
}

.opponent-card-modal .opponent-stats {
    text-align: right;
}

.opponent-card-modal .opponent-level {
    font-weight: 600;
    color: #333;
}

.opponent-card-modal .opponent-rating {
    font-size: 0.8rem;
    color: #666;
}

.pvp-refresh {
    margin-top: 1rem;
    text-align: center;
}

/* ==========================================
   對戰記錄
   ========================================== */

.arena-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    border-left: 4px solid #ddd;
}

.history-item.win {
    border-left-color: #4caf50;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.1) 0%, white 100%);
}

.history-item.lose {
    border-left-color: #f44336;
    background: linear-gradient(90deg, rgba(244, 67, 54, 0.1) 0%, white 100%);
}

.history-result {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.history-result.win {
    background: #4caf50;
    color: white;
}

.history-result.lose {
    background: #f44336;
    color: white;
}

.history-info {
    flex: 1;
}

.history-opponent {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.history-time {
    font-size: 0.75rem;
    color: #999;
}

.history-reward {
    font-weight: 600;
    font-size: 0.9rem;
}

.history-item.win .history-reward {
    color: #4caf50;
}

.history-item.lose .history-reward {
    color: #f44336;
}

/* ==========================================
   進化系統 Modal
   ========================================== */

/* 進化 Modal 容器 */
.evolution-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.evolution-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal 內容 */
.evolution-modal-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 1.5rem;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.evolution-modal.active .evolution-modal-content {
    transform: scale(1);
}

/* Modal 標題 */
.evolution-modal-header {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.2) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.evolution-modal-header h2 {
    color: #FFD700;
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.evolution-modal-header p {
    color: #a0a0c0;
    font-size: 0.9rem;
    margin: 0;
}

.evolution-pet-name {
    color: #4FC3F7;
    font-weight: bold;
}

/* 進化選項列表 */
.evolution-options {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 單個進化選項 */
.evolution-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.evolution-option:hover {
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.evolution-option.selected {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.evolution-option.selected::before {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #FFD700;
    color: #1a1a2e;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* 選項頭部 */
.evolution-option-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.evolution-option-icon {
    font-size: 2.5rem;
    line-height: 1;
    filter: drop-shadow(0 0 10px currentColor);
}

.evolution-option-info {
    flex: 1;
}

.evolution-option-name {
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.evolution-option-desc {
    color: #a0a0c0;
    font-size: 0.8rem;
}

/* 屬性加成 */
.evolution-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.evolution-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
}

.evolution-stat-icon {
    font-size: 0.9rem;
}

.evolution-stat-value {
    color: #4CAF50;
    font-weight: bold;
}

.evolution-stat-label {
    color: #888;
}

/* 固定進化提示 */
.evolution-fixed-notice {
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin: 0 1rem;
    text-align: center;
}

.evolution-fixed-notice p {
    color: #FFB74D;
    font-size: 0.85rem;
    margin: 0;
}

/* Modal 底部按鈕 */
.evolution-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 1rem;
}

.evolution-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.evolution-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #a0a0c0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.evolution-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.evolution-btn-confirm {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.evolution-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
}

.evolution-btn-confirm:disabled {
    background: #555;
    color: #888;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   進化動畫
   ========================================== */

/* 全屏進化動畫遮罩 */
.evolution-animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.evolution-animation-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 進化中文字 */
.evolution-title {
    color: #FFD700;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    margin-bottom: 2rem;
    animation: evolution-title-glow 1s ease-in-out infinite alternate;
}

@keyframes evolution-title-glow {
    from { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    to { text-shadow: 0 0 50px rgba(255, 215, 0, 1), 0 0 80px rgba(255, 165, 0, 0.8); }
}

/* 進化精靈容器 */
.evolution-sprite-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 進化光環 */
.evolution-glow-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    animation: evolution-ring-pulse 1s ease-in-out infinite;
}

.evolution-glow-ring:nth-child(2) {
    animation-delay: 0.33s;
}

.evolution-glow-ring:nth-child(3) {
    animation-delay: 0.66s;
}

@keyframes evolution-ring-pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 進化粒子 */
.evolution-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    animation: evolution-particle-float 2s ease-in-out infinite;
}

@keyframes evolution-particle-float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-30px) scale(0.5);
        opacity: 0;
    }
}

/* 進化精靈閃白 */
.evolution-sprite-flash {
    animation: evolution-flash 0.3s ease-in-out;
}

@keyframes evolution-flash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(3) saturate(0); }
}

/* 進化完成文字 */
.evolution-complete-text {
    color: #fff;
    font-size: 1.2rem;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.evolution-complete-text.show {
    opacity: 1;
    transform: translateY(0);
}

.evolution-new-name {
    color: #FFD700;
    font-weight: bold;
    font-size: 1.5rem;
    display: block;
    margin-top: 0.5rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* 進化確認按鈕 */
.evolution-done-btn {
    margin-top: 2rem;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

.evolution-done-btn.show {
    opacity: 1;
    transform: translateY(0);
}

.evolution-done-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(76, 175, 80, 0.6);
}

/* ==========================================
   進化系統響應式
   ========================================== */

@media (max-width: 480px) {
    .evolution-modal-content {
        max-height: 95vh;
        border-radius: 1rem;
    }

    .evolution-modal-header {
        padding: 1rem;
    }

    .evolution-modal-header h2 {
        font-size: 1.25rem;
    }

    .evolution-option {
        padding: 0.875rem;
    }

    .evolution-option-icon {
        font-size: 2rem;
    }

    .evolution-option-name {
        font-size: 1rem;
    }

    .evolution-stats {
        gap: 0.4rem;
    }

    .evolution-stat {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .evolution-modal-footer {
        padding: 1rem;
        flex-direction: column-reverse;
    }

    .evolution-title {
        font-size: 1.25rem;
    }

    .evolution-sprite-wrapper {
        width: 150px;
        height: 150px;
    }
}
