* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FFD700;
    --primary-dark: #FFA500;
    --bg-main: #1a1a2e;
    --bg-card: #16213e;
    --bg-modal: #0f3460;
    --text-main: #ffffff;
    --text-secondary: #b8b8b8;
    --success: #4CAF50;
    --danger: #f44336;
    --border-radius: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

#game-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.resource-display {
    display: flex;
    gap: 12px;
    font-size: 14px;
}

.resource {
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

#lang-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

#farm-view {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#farm-stats {
    display: flex;
    justify-content: space-around;
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--border-radius);
}

.stat {
    text-align: center;
    font-size: 14px;
}

.stat span {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
}

#chicken-coop {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#chickens-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 100px;
}

.chicken {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #FFE4B5, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.chicken.super {
    background: linear-gradient(135deg, #FFD700, #FF8C00);
    box-shadow: 0 0 15px rgba(255,215,0,0.5);
}

.egg-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

#feeder {
    width: 120px;
    height: 80px;
    background: linear-gradient(135deg, #8B4513, #A0522D);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.feeder-level {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFD700;
    transition: height 0.3s;
}

#feeder span {
    position: relative;
    z-index: 1;
    color: white;
    font-weight: bold;
}

#egg-collection {
    text-align: center;
}

.btn {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn:hover {
    background: rgba(255,255,255,0.1);
}

.btn-primary {
    background: var(--primary);
    color: #000;
    border: none;
    font-weight: bold;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

#bottom-nav {
    display: flex;
    background: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 8px 0;
}

.nav-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-btn.active {
    color: var(--primary);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-modal);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 16px;
}

.market-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.market-item-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.market-item-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.market-item-price {
    text-align: right;
}

.market-item-price .price {
    color: var(--primary);
    font-weight: bold;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.rank {
    font-weight: bold;
    color: var(--primary);
}

#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    pointer-events: none;
}

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

#tutorial-dim {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
}

#tutorial-highlight {
    position: absolute;
    border: 3px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255,215,0,0.5);
    pointer-events: auto;
}

#tutorial-hand {
    position: absolute;
    font-size: 40px;
    animation: handMove 1s infinite alternate;
    pointer-events: none;
}

#tutorial-text {
    position: absolute;
    bottom: 100px;
    left: 20px;
    right: 20px;
    background: var(--bg-modal);
    padding: 16px;
    border-radius: var(--border-radius);
    text-align: center;
    pointer-events: auto;
}

#tutorial-next {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.setting-item select,
.setting-item button {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: var(--bg-card);
    color: var(--text-main);
}
