:root {
    --bg-color: #fff0f5;
    --text-color: #4a4a4a;
    --primary-color: #ff6b81;
    --primary-dark: #ff4757;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px rgba(255, 107, 129, 0.15);
}

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

body {
    font-family: 'M PLUS Rounded 1c', 'Kosugi Maru', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background blob decorations for a softer, cuter look */
.background-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    filter: blur(60px);
    opacity: 0.6;
    border-radius: 50%;
    animation: drift 10s infinite alternate ease-in-out;
}

.shape1 {
    width: 400px;
    height: 400px;
    background: #ffc3a0;
    top: -100px;
    left: -100px;
}

.shape2 {
    width: 500px;
    height: 500px;
    background: #ffafbd;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

.container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 40px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--glass-shadow);
    text-align: center;
    position: relative;
    z-index: 10;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: translateY(40px) scale(0.9); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

h1 {
    color: var(--primary-dark);
    margin-bottom: 5px;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(255, 107, 129, 0.2);
}

.comment-box {
    background: white;
    padding: 12px 20px;
    border-radius: 20px;
    margin: 15px auto 25px auto;
    width: max-content;
    max-width: 90%;
    font-weight: 700;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.1);
    transition: all 0.3s ease;
    font-size: 1.1rem;
    position: relative;
}
/* tooltip tail */
.comment-box::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: white transparent transparent transparent;
    display: block;
    width: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px 10px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.8rem;
    color: #747d8c;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-value {
    color: var(--primary-dark);
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
}

.stat-value.sm {
    font-size: 1.3rem;
    color: #ff7f50;
}

.orchard-container {
    margin: 30px 0 40px 0;
    position: relative;
    width: 100%;
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trees-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    z-index: 2;
    max-width: 400px;
}

.single-tree {
    position: relative;
    display: inline-block;
    transition: all 0.3s;
    animation: growTree 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes growTree {
    0% { transform: scale(0) translateY(50px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.glow-effect {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0.5;
}

.tree-target {
    font-size: 80px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s;
    filter: drop-shadow(0 15px 20px rgba(46, 204, 113, 0.4));
    position: relative;
    line-height: 1;
}

.tree-target:active {
    transform: scale(0.95) rotate(-3deg);
    filter: drop-shadow(0 5px 10px rgba(46, 204, 113, 0.6));
}

.tree-apple {
    position: absolute;
    font-size: 16px;
    z-index: 3;
    pointer-events: none;
    animation: popInApple 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}

@keyframes popInApple {
    0% { transform: scale(0) translateY(-10px); opacity: 0; }
    50% { transform: scale(1.2) translateY(2px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.falling-apple {
    position: absolute;
    font-size: 16px;
    z-index: 4;
    pointer-events: none;
    animation: fallDown 0.7s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}

@keyframes fallDown {
    0% { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translate(var(--drift, 0px), 100px) scale(0.6) rotate(180deg); opacity: 0; }
}

.floating-text {
    position: fixed;
    color: var(--primary-dark);
    font-size: 2rem;
    font-weight: 900;
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    z-index: 100;
    text-shadow: 0 3px 6px rgba(255,255,255,0.8);
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-40px) scale(1.2); }
    100% { transform: translateY(-80px) scale(1.5); opacity: 0; }
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

#happy-input {
    flex-grow: 1;
    padding: 14px 20px;
    border: 2px solid rgba(255, 107, 129, 0.3);
    border-radius: 25px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
}

#happy-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 107, 129, 0.2), inset 0 2px 5px rgba(0,0,0,0.02);
    background: white;
}

#submit-happy {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 25px;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(255, 107, 129, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#submit-happy:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(255, 107, 129, 0.4);
}

#submit-happy:active {
    transform: translateY(0);
}

.upgrades-section {
    text-align: left;
}

.upgrades-section h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #57606f;
    padding-left: 5px;
}

.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upgrade-btn {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border: 2px solid transparent;
    padding: 12px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
}

.upgrade-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 129, 0.2);
    border-color: var(--primary-color);
}

.upgrade-btn:active:not(:disabled) {
    transform: translateY(0);
}

.upgrade-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(80%);
}

.upgrade-icon {
    font-size: 1.8rem;
    margin-right: 15px;
}

.upgrade-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.upgrade-name {
    font-weight: 900;
    color: var(--text-color);
    font-size: 1.1rem;
}

.upgrade-desc {
    font-size: 0.8rem;
    color: #747d8c;
    margin-top: 2px;
}

.upgrade-cost {
    background: #ffecd2;
    color: #ff7f50;
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
}
