@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --stardew-brown: #5c4033;
    --stardew-tan: #e8d4b8;
    --stardew-cream: #fff8dc;
    --stardew-dark: #3d2817;
    --stardew-gold: #ffd700;
    --stardew-green: #228b22;
    --stardew-blue: #4a90b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

body {
    /* 简洁的星露谷风格背景 - 与游戏融合 */
    background: linear-gradient(180deg,
        #2d1b0e 0%,
        #3d2817 100%
    );
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'VT323', monospace;
    overflow: hidden;
    position: relative;
}

/* 顶部导航栏 */
#top-nav {
    width: 100%;
    min-height: 40px;
    background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
    border-bottom: 2px solid #333;
    display: flex;
    align-items: center;
    padding: 8px 20px;
    flex-shrink: 0;
    gap: 20px;
    flex-wrap: wrap;
}

/* 标题横幅区域 */
#title-banner {
    width: 100%;
    padding: 15px 0;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border-bottom: 2px solid #333;
    text-align: center;
    flex-shrink: 0;
}

.game-title {
    font-size: 64px;
    font-weight: bold;
    margin: 0;
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(3px 3px 0 #5c4033) drop-shadow(-1px -1px 0 #3d2817);
    letter-spacing: 16px;
    font-family: 'VT323', monospace;
}

.game-intro {
    flex: 1;
    color: #aaa;
    font-size: 14px;
    line-height: 1.5;
}

.game-intro .ca-text {
    color: #4fc3f7;
    font-family: monospace;
    font-size: 12px;
    background: rgba(79, 195, 247, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-all;
}

.game-intro .highlight {
    color: #ffd700;
    font-weight: bold;
}

.game-intro .warning {
    color: #ff6b6b;
    font-weight: bold;
}

/* 主内容区域 */
body > .side-panel,
body > #game-wrapper {
    flex-shrink: 0;
}

/* 内容容器 */
body::after {
    content: none;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* 左右说明面板 */
.side-panel {
    width: 200px;
    height: 90vh;
    max-height: 800px;
    background: rgba(45, 27, 14, 0.95);
    border: 4px solid var(--stardew-brown);
    border-radius: 8px;
    box-shadow: 
        inset 0 0 0 2px #8b6914,
        0 4px 20px rgba(0,0,0,0.5);
    padding: 15px;
    color: var(--stardew-cream);
    font-size: 16px;
    overflow-y: auto;
}

.side-panel .panel-title {
    font-size: 22px;
    color: var(--stardew-gold);
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--stardew-brown);
    text-shadow: 2px 2px 0 #000;
}

.side-panel .panel-section {
    margin-bottom: 18px;
}

.side-panel .section-title {
    font-size: 18px;
    color: #f4a460;
    margin-bottom: 8px;
    padding-left: 5px;
    border-left: 3px solid var(--stardew-gold);
}

.side-panel ul {
    list-style: none;
    padding-left: 5px;
}

.side-panel li {
    margin-bottom: 6px;
    line-height: 1.4;
    font-size: 15px;
}

.side-panel .key {
    background: var(--stardew-brown);
    color: var(--stardew-cream);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid #8b6914;
}

.side-panel .rod-name {
    color: #87ceeb;
    font-weight: bold;
}

.side-panel .item-name {
    color: #98fb98;
}

.side-panel .item-price {
    color: #ffd700;
    font-size: 13px;
    float: right;
}

/* 高亮色彩 */
.side-panel .highlight-orange {
    background: linear-gradient(180deg, #FF9800 0%, #E65100 100%);
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.side-panel .highlight-green {
    color: #4CAF50;
    font-weight: bold;
}

.side-panel .warn {
    color: #ff6b6b;
    font-weight: bold;
}

/* 鱼类行为类型 */
.side-panel .fish-type {
    color: #64b5f6;
    font-weight: bold;
}

/* 天气图标 */
.side-panel .weather-icon {
    font-size: 16px;
}

/* 装备列表 */
.side-panel .equipment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-panel .equip-item {
    background: rgba(92, 64, 51, 0.5);
    border: 2px solid #8b6914;
    border-radius: 4px;
    padding: 6px 8px;
}

.side-panel .equip-name {
    font-weight: bold;
}

.side-panel .equip-price {
    float: right;
    color: #ffd700;
    font-size: 13px;
}

.side-panel .equip-desc {
    font-size: 12px;
    color: #c0a080;
    margin-top: 2px;
}

.side-panel .equip-detail {
    font-size: 11px;
    color: #a0a0a0;
    margin-top: 4px;
    line-height: 1.3;
}

.side-panel .equip-note {
    font-size: 12px;
    color: #ff9800;
    margin-bottom: 6px;
    padding: 3px 6px;
    background: rgba(255, 152, 0, 0.15);
    border-radius: 3px;
}

/* 难度标签 */
.side-panel .diff {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 4px;
}

.side-panel .diff-1 {
    background: #4CAF50;
    color: white;
}

.side-panel .diff-2 {
    background: #8BC34A;
    color: white;
}

.side-panel .diff-3 {
    background: #FFC107;
    color: #333;
}

.side-panel .diff-4 {
    background: #FF9800;
    color: white;
}

.side-panel .diff-5 {
    background: linear-gradient(90deg, #9C27B0, #E91E63);
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* 响应式隐藏 */
@media (max-width: 1400px) {
    .side-panel {
        display: none;
    }
}

/* 木纹装饰边框效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(90deg,
            transparent 0px,
            transparent 60px,
            rgba(139, 105, 20, 0.1) 60px,
            rgba(139, 105, 20, 0.1) 62px
        ),
        repeating-linear-gradient(0deg,
            transparent 0px,
            transparent 60px,
            rgba(139, 105, 20, 0.1) 60px,
            rgba(139, 105, 20, 0.1) 62px
        );
    pointer-events: none;
    z-index: -1;
}

/* 四角装饰 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 0% 0%, rgba(139, 105, 20, 0.3) 0%, transparent 15%),
        radial-gradient(circle at 100% 0%, rgba(139, 105, 20, 0.3) 0%, transparent 15%),
        radial-gradient(circle at 0% 100%, rgba(139, 105, 20, 0.3) 0%, transparent 15%),
        radial-gradient(circle at 100% 100%, rgba(139, 105, 20, 0.3) 0%, transparent 15%);
    pointer-events: none;
    z-index: -1;
}

#game-wrapper {
    position: relative;
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    background: #2d1b0e;
    border: 8px solid var(--stardew-brown);
    border-radius: 8px;
    box-shadow: 
        inset 0 0 0 4px #8b6914,
        0 0 0 4px var(--stardew-dark),
        0 10px 60px rgba(0,0,0,0.8);
}

#game-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 100px);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 星露谷风格盒子 */
.stardew-box {
    background: linear-gradient(180deg, 
        #d4a574 0%, 
        #c49464 30%,
        #b48454 70%,
        #a47444 100%);
    border: 4px solid var(--stardew-brown);
    box-shadow: 
        inset 2px 2px 0 rgba(255,255,255,0.3),
        inset -2px -2px 0 rgba(0,0,0,0.2),
        3px 3px 0 rgba(0,0,0,0.3);
    padding: 8px 16px;
    color: var(--stardew-dark);
    font-size: 20px;
    font-weight: bold;
}

/* 顶部HUD */
#hud-top {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

.hud-item {
    background: linear-gradient(180deg, #d4a574 0%, #b48454 100%);
    border: 4px solid #5c4033;
    box-shadow: 
        inset 2px 2px 0 rgba(255,255,255,0.3),
        inset -2px -2px 0 rgba(0,0,0,0.2),
        3px 3px 0 rgba(0,0,0,0.3);
    padding: 8px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    color: #3d2817;
}

/* 游戏模式指示器 */
.mode-indicator {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    border: 3px solid;
    box-shadow: 
        inset 2px 2px 0 rgba(255,255,255,0.2),
        2px 2px 0 rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.mode-indicator.trial {
    background: linear-gradient(180deg, #FF9800 0%, #E65100 100%);
    border-color: #BF360C;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    animation: trial-pulse 2s ease-in-out infinite;
}

.mode-indicator.official {
    background: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    border-color: #1B5E20;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

@keyframes trial-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.gold-icon {
    font-size: 20px;
}

#money {
    color: #8b6914;
    font-weight: bold;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.divider {
    color: #8b7355;
    margin: 0 4px;
}

#game-season {
    color: #2d6b2d;
    font-weight: bold;
}

#game-time {
    color: #3d2817;
}

/* 工具栏 */
#toolbar-container {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.stardew-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(180deg, #6b4c2d 0%, #5c3d1e 100%);
    padding: 8px 12px;
    border: 4px solid var(--stardew-brown);
    border-radius: 4px;
    box-shadow: 
        inset 0 2px 0 rgba(255,255,255,0.15),
        inset 0 -2px 0 rgba(0,0,0,0.2),
        0 4px 8px rgba(0,0,0,0.4);
}

.toolbar-slot {
    width: 56px;
    height: 56px;
    background: linear-gradient(180deg, var(--stardew-tan) 0%, #d8c4a8 100%);
    border: 3px solid #8b7355;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.1s;
}

.toolbar-slot:hover {
    border-color: var(--stardew-gold);
    transform: translateY(-2px);
}

.toolbar-slot.selected {
    border-color: var(--stardew-gold) !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6) !important;
    background: linear-gradient(180deg, #fff8dc 0%, #f0e0c0 100%) !important;
}

/* 钓具槽位选中状态 */
.toolbar-slot.tackle-slot.selected {
    border-color: var(--stardew-gold) !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.8) !important;
    background: linear-gradient(180deg, #fffacd 0%, #f5e6a0 100%) !important;
}

.toolbar-slot.locked {
    background: #888;
    cursor: not-allowed;
}

.toolbar-slot.locked:hover {
    transform: none;
    border-color: #666;
}

.toolbar-slot img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.toolbar-slot .locked-img {
    filter: brightness(0.3);
}

.toolbar-divider {
    width: 4px;
    height: 48px;
    background: #4a3020;
    margin: 0 8px;
    border-radius: 2px;
}

/* 鱼饵和钓具槽容器 */
#bait-slots {
    display: flex;
    gap: 4px;
}

#tackle-slots {
    display: flex;
    gap: 4px;
}

/* 空槽位样式 */
.toolbar-slot.empty {
    background: linear-gradient(180deg, #9a8a7a 0%, #8a7a6a 100%);
    border-color: #6a5a4a;
}

.toolbar-slot.empty img {
    opacity: 0.3;
}

/* 禁用状态 (鱼竿不支持) */
.toolbar-slot.disabled {
    opacity: 0.6;
}

.toolbar-slot.disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(100, 100, 100, 0.3);
    pointer-events: none;
}

.item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    background: var(--stardew-dark);
    color: white;
    font-size: 14px;
    padding: 0 4px;
    border-radius: 2px;
    min-width: 18px;
    text-align: center;
}

/* 侧边菜单 */
#side-menu {
    position: absolute;
    right: 8px;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.menu-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(180deg, #d4a574 0%, #b48454 100%);
    border: 3px solid var(--stardew-brown);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.menu-btn:hover {
    transform: scale(1.1);
    border-color: var(--stardew-gold);
}

.menu-btn img {
    width: 32px;
    height: 32px;
}

/* 操作提示 */
#action-hint {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: float 2s ease-in-out infinite;
}

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

#action-hint.alert {
    background: linear-gradient(180deg, #ff6b6b 0%, #cc4444 100%);
    border-color: #aa2222;
    animation: shake 0.1s ease-in-out infinite;
}

#action-hint.alert #hint-text {
    color: #fff;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) rotate(0); }
    25% { transform: translateX(-50%) rotate(-2deg); }
    75% { transform: translateX(-50%) rotate(2deg); }
}

/* 面板通用样式 */
.stardew-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--stardew-cream);
    border: 6px solid var(--stardew-brown);
    box-shadow: 
        inset 0 0 0 4px #c49464,
        0 8px 32px rgba(0,0,0,0.6);
    min-width: 600px;
    max-width: 800px;
    max-height: 500px;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.stardew-panel.hidden {
    display: none;
}

.panel-header {
    background: linear-gradient(180deg, #8b6914 0%, #6b4c10 100%);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 4px solid var(--stardew-brown);
}

.panel-icon {
    width: 32px;
    height: 32px;
}

.panel-header h2 {
    flex: 1;
    color: var(--stardew-cream);
    font-size: 28px;
    text-shadow: 2px 2px 0 var(--stardew-dark);
    margin: 0;
}

.close-btn {
    width: 36px;
    height: 36px;
    background: #cc4444;
    border: 3px solid #aa2222;
    border-radius: 4px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.close-btn:hover {
    background: #ee5555;
    transform: scale(1.1);
}

.panel-stats {
    background: rgba(139, 105, 20, 0.2);
    padding: 8px 16px;
    text-align: center;
    font-size: 18px;
    color: var(--stardew-brown);
    border-bottom: 2px solid #d4c4a4;
}

.panel-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* 鱼类图鉴 */
.fish-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.fish-card {
    background: linear-gradient(180deg, #e8d8c8 0%, #d8c8b8 100%);
    border: 3px solid #a08060;
    border-radius: 4px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.fish-card:hover {
    transform: translateY(-4px);
    border-color: var(--stardew-gold);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.fish-card.locked {
    background: #666;
    border-color: #444;
}

.fish-card img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.fish-card.locked img {
    filter: brightness(0);
}

.fish-card-name {
    font-size: 16px;
    color: var(--stardew-dark);
    font-weight: bold;
}

.fish-card-price {
    font-size: 14px;
    color: #8b6914;
    margin-top: 4px;
}

.fish-card.locked .fish-card-name,
.fish-card.locked .fish-card-price {
    color: #888;
}

.fish-card-rod {
    font-size: 11px;
    color: #5a6a4a;
    margin-top: 4px;
    padding: 2px 6px;
    background: rgba(90, 120, 70, 0.15);
    border-radius: 3px;
    display: inline-block;
}

.fish-card.locked .fish-card-rod {
    color: #aaa;
    background: rgba(100, 100, 100, 0.2);
}

/* 商店 */
.shop-section {
    margin-bottom: 20px;
}

.shop-section h3 {
    color: var(--stardew-brown);
    font-size: 20px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px dashed #c4956a;
}

.shop-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.shop-item {
    background: linear-gradient(180deg, #e8d8c8 0%, #d8c8b8 100%);
    border: 3px solid #a08060;
    border-radius: 4px;
    padding: 12px;
    width: 130px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.shop-item:hover {
    border-color: var(--stardew-gold);
    transform: translateY(-2px);
}

.shop-item.owned {
    border-color: var(--stardew-green);
    background: linear-gradient(180deg, #d8e8d8 0%, #c8d8c8 100%);
}

.shop-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-item img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.shop-item-name {
    font-size: 14px;
    color: var(--stardew-dark);
    font-weight: bold;
    margin-bottom: 4px;
}

.shop-item-price {
    font-size: 16px;
    color: #daa520;
}

.shop-item-desc {
    font-size: 12px;
    color: #6b5540;
    margin-top: 4px;
}

/* 背包 */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.inventory-slot {
    width: 56px;
    height: 56px;
    background: linear-gradient(180deg, #d4c4a4 0%, #c4b494 100%);
    border: 3px solid #a08060;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.inventory-slot:hover {
    border-color: var(--stardew-gold);
}

.inventory-slot.selected {
    border-color: #4CAF50;
    background: linear-gradient(180deg, #c4e4b4 0%, #a4d494 100%);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.inventory-slot img {
    width: 40px;
    height: 40px;
}

.inventory-slot .count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    background: var(--stardew-dark);
    color: white;
    font-size: 12px;
    padding: 0 4px;
    border-radius: 2px;
}

/* 钓鱼小游戏 */
#fishing-minigame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

#fishing-minigame.hidden {
    display: none;
}

/* 横版小游戏容器 */
.minigame-container-horizontal {
    background: linear-gradient(180deg, #6b4c2d 0%, #5c3d1e 100%);
    border: 6px solid #8b6914;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 
        inset 0 0 0 4px #c49464,
        0 8px 32px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 左侧鱼信息 */
.minigame-fish-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.minigame-fish-info img {
    width: 64px;
    height: 64px;
}

#minigame-fish-name {
    color: var(--stardew-cream);
    font-size: 20px;
    text-shadow: 2px 2px 0 var(--stardew-dark);
    text-align: center;
}

/* 主区域 */
.minigame-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 横向钓鱼条 */
.minigame-bar-horizontal {
    width: 500px;
    height: 80px;
    background: var(--stardew-dark);
    border: 4px solid var(--stardew-brown);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.minigame-water-horizontal {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        #5ab4e8 0%, 
        #3a9ad8 20%,
        #2a7ab8 50%,
        #1a5a98 80%,
        #0a3a78 100%);
    position: relative;
}

/* 横向绿条 (控制区域) */
.minigame-catch-zone-horizontal {
    position: absolute;
    height: 100%;
    width: 100px;
    background: linear-gradient(90deg, 
        rgba(124, 252, 0, 0.8) 0%,
        rgba(50, 205, 50, 0.8) 50%,
        rgba(34, 139, 34, 0.8) 100%);
    border-radius: 4px;
    top: 0;
    box-shadow: 
        inset 2px 0 0 rgba(255,255,255,0.4),
        inset -2px 0 0 rgba(0,0,0,0.2);
    transition: left 0.05s linear;
}

/* 横向鱼图标 */
.minigame-fish-horizontal {
    position: absolute;
    width: 48px;
    height: 48px;
    top: 50%;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: left 0.08s linear;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.5));
}

/* 鱼挣扎动画 */
.minigame-fish-horizontal.struggling {
    animation: fishStruggle 0.15s ease-in-out infinite;
}

@keyframes fishStruggle {
    0%, 100% { transform: translateY(-50%) rotate(0deg) scale(1); }
    25% { transform: translateY(-55%) rotate(-8deg) scale(1.05); }
    75% { transform: translateY(-45%) rotate(8deg) scale(1.05); }
}

/* 鱼被捕获时 */
.minigame-fish-horizontal.caught {
    animation: fishCaught 0.3s ease-out;
}

@keyframes fishCaught {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.3); filter: brightness(1.5) drop-shadow(0 0 10px gold); }
    100% { transform: translateY(-50%) scale(1); }
}

/* 绿条脉冲效果 */
.minigame-catch-zone-horizontal.catching {
    animation: barPulse 0.5s ease-in-out infinite;
}

@keyframes barPulse {
    0%, 100% { 
        box-shadow: inset 2px 0 0 rgba(255,255,255,0.4), inset -2px 0 0 rgba(0,0,0,0.2);
    }
    50% { 
        box-shadow: inset 2px 0 0 rgba(255,255,255,0.4), inset -2px 0 0 rgba(0,0,0,0.2),
                    0 0 15px rgba(46, 204, 113, 0.8), 0 0 30px rgba(46, 204, 113, 0.4);
    }
}

/* 水面波动效果 */
.minigame-water-horizontal {
    position: relative;
    overflow: hidden;
}

.minigame-water-horizontal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 300%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255,255,255,0.1) 25%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.1) 75%,
        transparent 100%);
    animation: waterShimmer 3s linear infinite;
}

@keyframes waterShimmer {
    0% { transform: translateX(0); }
    100% { transform: translateX(33.33%); }
}

/* 紧张时屏幕抖动 */
.minigame-container-horizontal.tense {
    animation: screenShake 0.1s ease-in-out;
}

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

/* 进度条危险状态 */
.minigame-progress-bar.danger {
    animation: dangerPulse 0.3s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { border-color: var(--stardew-brown); }
    50% { border-color: #E74C3C; box-shadow: 0 0 10px rgba(231, 76, 60, 0.5); }
}

/* 进度条接近成功 */
.minigame-progress-bar.success {
    animation: successGlow 0.5s ease-in-out infinite;
}

@keyframes successGlow {
    0%, 100% { border-color: var(--stardew-brown); }
    50% { border-color: #2ECC71; box-shadow: 0 0 15px rgba(46, 204, 113, 0.6); }
}

/* 顶部横向进度条 */
.minigame-progress-bar {
    width: 100%;
    height: 28px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 4px solid var(--stardew-brown);
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.5),
        0 2px 4px rgba(0,0,0,0.3);
    position: relative;
}

.minigame-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.progress-fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    transition: width 0.1s ease-out, background 0.3s;
    box-shadow: 
        inset 0 2px 0 rgba(255,255,255,0.4),
        inset 0 -2px 0 rgba(0,0,0,0.2),
        2px 0 8px rgba(255,200,0,0.5);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
}

.minigame-hint {
    text-align: center;
    color: #c49464;
    font-size: 16px;
    margin-top: 12px;
}

/* 消息弹窗 */
.stardew-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
}

.stardew-popup.hidden {
    display: none;
}

.popup-content {
    background: var(--stardew-cream);
    border: 6px solid var(--stardew-brown);
    box-shadow: 
        inset 0 0 0 4px #c49464,
        0 8px 32px rgba(0,0,0,0.6);
    padding: 24px 48px;
    text-align: center;
    min-width: 300px;
}

.popup-content img {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
}

#popup-text {
    font-size: 24px;
    color: var(--stardew-dark);
}

#popup-text .highlight {
    color: var(--stardew-gold);
}

#popup-text .price {
    color: #daa520;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: #d4c4a4;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #8b6914;
    border-radius: 4px;
    border: 2px solid #d4c4a4;
}

::-webkit-scrollbar-thumb:hover {
    background: #a07818;
}

/* ==================== Web3 样式 ==================== */

/* 钱包栏 */
#wallet-bar {
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    height: 44px;
    background: linear-gradient(180deg, #4a3020 0%, #3d2817 100%);
    border-bottom: 3px solid #8b6914;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 16px;
    gap: 12px;
    z-index: 100;
}

.twitter-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
    border: 2px solid #333;
    border-radius: 4px;
    color: white;
    font-family: 'VT323', monospace;
    font-size: 15px;
    padding: 5px 12px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.twitter-link:hover {
    background: linear-gradient(180deg, #333 0%, #1a1a1a 100%);
    border-color: #555;
    transform: translateY(-1px);
}

.twitter-icon {
    font-size: 16px;
    font-weight: bold;
}

.twitter-text {
    font-size: 14px;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: auto;
}

#wallet-address {
    color: #c49464;
    font-size: 16px;
}

#wallet-balance {
    color: var(--stardew-gold);
    font-size: 16px;
    font-weight: bold;
}

.wallet-btn {
    background: linear-gradient(180deg, #5c8a3a 0%, #4a7030 100%);
    border: 3px solid #3a5020;
    border-radius: 4px;
    color: white;
    font-family: 'VT323', monospace;
    font-size: 16px;
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.wallet-btn:hover {
    background: linear-gradient(180deg, #6c9a4a 0%, #5a8040 100%);
    transform: translateY(-1px);
}

.mint-btn {
    background: linear-gradient(180deg, #d4a030 0%, #b48820 100%);
    border: 3px solid #8a6010;
    border-radius: 4px;
    color: white;
    font-family: 'VT323', monospace;
    font-size: 16px;
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.mint-btn:hover:not(.disabled) {
    background: linear-gradient(180deg, #e4b040 0%, #c49830 100%);
    transform: translateY(-1px);
}

.mint-btn.disabled {
    background: #666;
    border-color: #444;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Web3 消息提示 */
.web3-message {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 18px;
    z-index: 200;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

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

.web3-message.info {
    background: linear-gradient(180deg, #4a90b8 0%, #3a70a0 100%);
    border: 3px solid #2a5080;
    color: white;
}

.web3-message.success {
    background: linear-gradient(180deg, #5c8a3a 0%, #4a7030 100%);
    border: 3px solid #3a5020;
    color: white;
}

.web3-message.error {
    background: linear-gradient(180deg, #c44 0%, #a33 100%);
    border: 3px solid #822;
    color: white;
}

.web3-message.hidden {
    display: none;
}

/* 游戏遮罩 */
#game-overlay {
    position: absolute;
    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: 90;
}

#game-overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--stardew-cream);
    border: 6px solid var(--stardew-brown);
    box-shadow: 
        inset 0 0 0 4px #c49464,
        0 8px 32px rgba(0,0,0,0.6);
    padding: 32px 48px;
    text-align: center;
    max-width: 500px;
}

.overlay-content h2 {
    color: var(--stardew-brown);
    font-size: 36px;
    margin-bottom: 16px;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.5);
}

.overlay-content p {
    color: var(--stardew-dark);
    font-size: 20px;
    margin-bottom: 20px;
}

.overlay-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
}

.overlay-steps .step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #e8d8c8 0%, #d8c8b8 100%);
    border: 3px solid #a08060;
    border-radius: 4px;
    font-size: 18px;
    color: var(--stardew-dark);
}

.overlay-steps .step.completed {
    background: linear-gradient(180deg, #b8e8b8 0%, #98d898 100%);
    border-color: #5a8a5a;
}

.overlay-steps .step.completed .step-num {
    background: #5c8a3a;
}

.step-num {
    width: 28px;
    height: 28px;
    background: var(--stardew-brown);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.overlay-hint {
    color: #8b6914;
    font-size: 16px;
    margin-top: 16px;
}

.overlay-hint strong {
    color: var(--stardew-gold);
}

/* 分隔线 */
.overlay-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.overlay-divider::before,
.overlay-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #a08060, transparent);
}

.overlay-divider span {
    padding: 0 16px;
    color: #8b7355;
    font-size: 16px;
}

/* 试玩模式按钮 */
.trial-btn {
    background: linear-gradient(180deg, #FF9800 0%, #E65100 100%);
    border: 4px solid #BF360C;
    border-radius: 6px;
    color: white;
    font-family: 'VT323', monospace;
    font-size: 22px;
    padding: 12px 32px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 
        inset 2px 2px 0 rgba(255,255,255,0.3),
        3px 3px 0 rgba(0,0,0,0.3);
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.trial-btn:hover {
    background: linear-gradient(180deg, #FFA726 0%, #FB8C00 100%);
    transform: translateY(-2px);
    box-shadow: 
        inset 2px 2px 0 rgba(255,255,255,0.3),
        4px 4px 0 rgba(0,0,0,0.3);
}

.trial-btn:active {
    transform: translateY(0);
    box-shadow: 
        inset 2px 2px 0 rgba(255,255,255,0.3),
        2px 2px 0 rgba(0,0,0,0.3);
}

.trial-hint {
    color: #a08060;
    font-size: 14px;
    margin-top: 12px;
}

/* 成就按钮 */
.achievement-btn {
    background: linear-gradient(180deg, #9b59b6 0%, #8e44ad 100%);
    border: 3px solid #6c3483;
    border-radius: 4px;
    color: white;
    font-family: 'VT323', monospace;
    font-size: 16px;
    padding: 8px 16px;
    cursor: pointer;
    margin-left: 16px;
    transition: all 0.2s;
    animation: achievementPulse 2s ease-in-out infinite;
}

.achievement-btn:hover {
    background: linear-gradient(180deg, #ab69c6 0%, #9e54bd 100%);
    transform: scale(1.05);
}

.achievement-btn.hidden {
    display: none;
}

.achievement-btn:disabled {
    background: #666;
    border-color: #444;
    cursor: not-allowed;
    animation: none;
}

@keyframes achievementPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(155, 89, 182, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(155, 89, 182, 0.6);
    }
}

/* 调整游戏包装器以容纳钱包栏 */
#game-wrapper {
    margin-top: 50px;
}

/* ==================== 音乐控制 ==================== */
#music-control {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--stardew-brown);
}

#music-control .section-title {
    font-size: 18px;
    color: #f4a460;
    margin-bottom: 10px;
    padding-left: 5px;
    border-left: 3px solid var(--stardew-gold);
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.music-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--stardew-brown);
    border-radius: 6px;
    background: linear-gradient(180deg, #5c4a3d 0%, #3d2817 100%);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.music-btn:hover {
    background: linear-gradient(180deg, #7a6555 0%, #5c4033 100%);
    transform: scale(1.05);
}

.music-btn:active {
    transform: scale(0.95);
}

.volume-slider {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #3d2817;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--stardew-gold);
    border-radius: 50%;
    border: 2px solid var(--stardew-brown);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--stardew-gold);
    border-radius: 50%;
    border: 2px solid var(--stardew-brown);
    cursor: pointer;
}
