:root {
    --bg-primary: #fef7ed;
    --bg-secondary: #fff9f0;
    --text-primary: #2d1810;
    --text-secondary: #6b4423;
    --accent-warm: #ff9b5a;
    --accent-soft: #ffb380;
    --accent-glow: #ffe5d1;
    --shadow-soft: rgba(255, 155, 90, 0.15);
    --shadow-medium: rgba(45, 24, 16, 0.1);
    --border-radius: 24px;
    --font-display: 'Georgia', 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screen transitions */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.4s ease-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

/* Pet Avatar */
.pet-avatar, .pet-avatar-large {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent-soft));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px var(--shadow-soft), 0 4px 12px var(--shadow-medium);
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
    position: relative;
}

.pet-avatar-large {
    width: 200px;
    height: 200px;
}

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

.pet-face {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pet-eyes {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.eye {
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 50%;
    animation: blink 4s infinite;
}

@keyframes blink {
    0%, 49%, 51%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

.pet-mouth {
    width: 30px;
    height: 15px;
    border: 3px solid var(--text-primary);
    border-top: none;
    border-radius: 0 0 30px 30px;
}

.pet-avatar.mood-happy .pet-mouth {
    border-radius: 0 0 30px 30px;
}

.pet-avatar.mood-neutral .pet-mouth {
    border-radius: 0;
    height: 3px;
}

.pet-avatar.mood-sad .pet-mouth {
    border-radius: 30px 30px 0 0;
    border-top: 3px solid var(--text-primary);
    border-bottom: none;
}

/* Main Screen */
.pet-container {
    text-align: center;
    max-width: 400px;
}

.pet-name {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.pet-message {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    padding: 0 20px;
}

.streak-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-glow);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 32px;
}

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

/* Buttons */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.btn-primary {
    background: var(--accent-warm);
    color: white;
    box-shadow: 0 4px 12px var(--shadow-soft);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-soft);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-soft);
}

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

.btn-secondary {
    background: white;
    color: var(--accent-warm);
    border: 2px solid var(--accent-warm);
}

.btn-secondary:hover {
    background: var(--accent-glow);
    transform: translateY(-2px);
}

/* Chat Screen */
.chat-container {
    width: 100%;
    max-width: 500px;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    box-shadow: 0 2px 8px var(--shadow-medium);
}

.btn-back {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
}

.chat-header h2 {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--text-primary);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    animation: slideIn 0.3s ease-out;
}

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

.message-user {
    align-self: flex-end;
    background: var(--accent-warm);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message-pet {
    align-self: flex-start;
    background: var(--accent-glow);
    color: var(--text-primary);
    border-radius: 18px 18px 18px 4px;
}

.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: white;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--accent-glow);
    border-radius: 20px;
    font-size: 16px;
    font-family: var(--font-body);
    outline: none;
}

#chat-input:focus {
    border-color: var(--accent-warm);
}

.btn-send {
    padding: 12px 24px;
    background: var(--accent-warm);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

.chat-counter {
    padding: 12px;
    text-align: center;
    background: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
}

/* Action Screen */
.action-container {
    text-align: center;
    max-width: 400px;
}

.action-message {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.action-timer {
    margin-bottom: 32px;
}

.timer-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 20px var(--shadow-soft);
}

#timer-text {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-warm);
}

/* End Screen */
.end-container {
    text-align: center;
    max-width: 400px;
}

.end-title {
    font-family: var(--font-display);
    font-size: 36px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.end-message {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Setup Screen */
.setup-container {
    text-align: center;
    max-width: 400px;
    padding: 40px 20px;
}

.setup-title {
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.setup-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

#pet-name-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--accent-glow);
    border-radius: var(--border-radius);
    font-size: 18px;
    font-family: var(--font-body);
    text-align: center;
    margin-bottom: 20px;
    outline: none;
}

#pet-name-input:focus {
    border-color: var(--accent-warm);
}

/* Limit Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 24, 16, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px 32px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(45, 24, 16, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-emoji {
    font-size: 56px;
    margin-bottom: 16px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.modal-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.modal-timer {
    font-size: 14px;
    color: var(--accent-warm);
    font-weight: 600;
    margin-bottom: 24px;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
    border-radius: 3px;
}
