/* Garden and House Styles */

/* House Decoration (CSS Art) */
.house-decoration {
    position: relative;
}

.house {
    width: 180px;
    height: 200px;
    position: relative;
    filter: drop-shadow(8px 8px 16px rgba(0,0,0,0.3));
}

/* Walls */
.walls {
    position: absolute;
    bottom: 0;
    width: 180px;
    height: 120px;
    background: linear-gradient(135deg, #D2691E 0%, #A0522D 100%);
    border: 5px solid #654321;
    border-radius: 8px;
}

.walls::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 3px solid rgba(139, 69, 19, 0.5);
    border-radius: 4px;
}

/* Roof */
.roof {
    position: absolute;
    top: 20px;
    left: -10px;
    width: 0;
    height: 0;
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 80px solid #8B0000;
    filter: drop-shadow(0 -4px 8px rgba(0,0,0,0.2));
}

.roof::after {
    content: '';
    position: absolute;
    top: 5px;
    left: -95px;
    width: 0;
    height: 0;
    border-left: 95px solid transparent;
    border-right: 95px solid transparent;
    border-bottom: 70px solid #A52A2A;
}

/* Chimney */
.chimney {
    position: absolute;
    top: 30px;
    right: 40px;
    width: 20px;
    height: 40px;
    background: linear-gradient(90deg, #8B0000 0%, #A52A2A 100%);
    border: 3px solid #654321;
    border-radius: 3px;
    z-index: 1;
}

.chimney::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -3px;
    width: 26px;
    height: 12px;
    background: #654321;
    border-radius: 3px 3px 0 0;
}

/* Door */
.door {
    position: absolute;
    bottom: 0;
    left: 70px;
    width: 40px;
    height: 60px;
    background: linear-gradient(90deg, #654321 0%, #4a2f1a 100%);
    border: 3px solid #3a1f0a;
    border-radius: 8px 8px 0 0;
}

.door::before {
    content: '';
    position: absolute;
    top: 28px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.6);
}

/* Windows */
.window {
    position: absolute;
    top: 40px;
    width: 30px;
    height: 35px;
    background: linear-gradient(135deg, #87CEEB 0%, #4682B4 100%);
    border: 4px solid #654321;
    border-radius: 4px;
}

.window.left {
    left: 20px;
}

.window.right {
    right: 20px;
}

.window::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 100%;
    background: #654321;
}

.window::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #654321;
}

/* Garden Wrapper */
.garden-wrapper {
    background: rgba(139, 111, 71, 0.4);
    padding: 12px;
    border-radius: 15px;
    border: 4px solid var(--dark-brown);
    box-shadow: 0 6px 0 var(--dark-brown), 0 8px 16px var(--shadow);
    position: relative;
    backdrop-filter: blur(5px);
}

.garden-shadow {
    position: absolute;
    bottom: -15px;
    left: 10%;
    right: 10%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.3) 0%, transparent 70%);
    border-radius: 50%;
}

/* Garden Grid */
.garden-grid {
    display: grid;
    grid-template-columns: repeat(6, 70px);
    grid-template-rows: repeat(4, 70px);
    gap: 6px;
    background: linear-gradient(135deg, rgba(107, 68, 35, 0.6) 0%, rgba(139, 111, 71, 0.6) 100%);
    padding: 12px;
    border-radius: 15px;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.3);
}

/* Tile Styles */
.tile {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #8B7355 0%, #6B5D4F 100%);
    border: 3px solid #654321;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 3px 0 #4a2f1a;
    overflow: hidden;
    font-size: 32px;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 8px 0 #4a2f1a, 0 10px 16px var(--shadow);
}

.tile:active {
    transform: translateY(-1px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 2px 0 #4a2f1a;
}

/* Empty tile dirt texture */
.tile-dirt {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(139, 115, 85, 0.8) 2px, transparent 2px),
        radial-gradient(circle at 60% 70%, rgba(107, 93, 79, 0.8) 2px, transparent 2px),
        radial-gradient(circle at 80% 20%, rgba(139, 115, 85, 0.8) 1.5px, transparent 1.5px),
        linear-gradient(135deg, #8B7355 0%, #6B5D4F 100%);
}

/* Tilled soil */
.tile.tilled {
    background: linear-gradient(135deg, #6B4423 0%, #5A3A1F 100%);
}

.tile-tilled {
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 8px,
            rgba(80, 50, 30, 0.5) 8px,
            rgba(80, 50, 30, 0.5) 10px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 12px,
            rgba(80, 50, 30, 0.3) 12px,
            rgba(80, 50, 30, 0.3) 14px
        ),
        linear-gradient(135deg, #6B4423 0%, #5A3A1F 100%);
}

/* Planted/Growing tile */
.tile.planted,
.tile.growing {
    background: linear-gradient(135deg, #6B4423 0%, #5A3A1F 100%);
}

/* Needs water indication */
/* Locked plot - not yet unlocked via the Upgrade Hut */
.tile.locked {
    /* Buyable now (click to unlock), not a dead end - lighter grayscale + pointer cursor
       than a truly unreachable state would use */
    opacity: 0.7;
    filter: grayscale(60%);
    cursor: pointer;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.tile.locked:hover {
    opacity: 0.92;
    filter: grayscale(25%);
}

.tile.locked::after {
    content: '🔒';
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    filter: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.plot-lock-price {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.75);
    color: #FFD700;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
    filter: none;
    white-space: nowrap;
}

.plot-lock-price .coin-icon {
    width: 11px;
    height: 11px;
    border-width: 1.5px;
}

.tile.needs-water {
    border-color: #FF6B6B;
    animation: pulse-warning 1.5s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        border-color: #FF6B6B;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 4px 0 #4a2f1a, 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        border-color: #FF4444;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 4px 0 #4a2f1a, 0 0 0 8px rgba(255, 107, 107, 0);
    }
}

/* Harvestable indication */
.tile.harvestable {
    animation: sparkle-pulse 1.5s infinite;
}

@keyframes sparkle-pulse {
    0%, 100% {
        border-color: #FFD700;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 4px 0 #4a2f1a, 0 0 20px rgba(255, 215, 0, 0.6);
    }
    50% {
        border-color: #FFA500;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 4px 0 #4a2f1a, 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

.harvest-ready-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #FFD700 0%, #FFA500 100%);
    border-radius: 50%;
    border: 3px solid #FF8C00;
    animation: sparkle-rotate 2s linear infinite;
    z-index: 10;
}

.harvest-ready-indicator::before,
.harvest-ready-indicator::after {
    content: '✨';
    position: absolute;
    font-size: 12px;
}

.harvest-ready-indicator::before {
    top: -15px;
    left: -5px;
    animation: twinkle 1s infinite;
}

.harvest-ready-indicator::after {
    bottom: -15px;
    right: -5px;
    animation: twinkle 1s 0.5s infinite;
}

@keyframes sparkle-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

/* Water droplet indicator */
.water-droplet-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 18px;
    animation: bounce-drop 0.8s infinite;
}

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

/* Plant container */
.plant-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Effects */
.water-splash-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    pointer-events: none;
    z-index: 100;
}

.harvest-sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    pointer-events: none;
    z-index: 100;
}

.money-popup {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: 700;
    color: #4CAF50;
    text-shadow: 2px 2px 0 white, -1px -1px 0 white;
    pointer-events: none;
    z-index: 100;
}

/* Growth Timer Tooltip */
.growth-tooltip {
    /* Same card language as the rest of the site (cream fill, dark-brown border, bevel
       shadow) instead of a plain dark speech bubble that didn't match anything else */
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    background: var(--white, #FFF8F0);
    color: var(--dark-brown, #5D4037);
    border: 3px solid var(--dark-brown, #5D4037);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 3px 0 var(--dark-brown, #5D4037), 0 6px 14px rgba(0, 0, 0, 0.25);
    font-family: 'Comfortaa', sans-serif;
    /* Pre-show state: invisible, slightly down and shrunk, so .show has something real
       to transition from instead of popping in on the same frame it's created (see
       showGrowthTooltip's forced reflow) */
    opacity: 0;
    transform: translateX(-50%) translateY(6px) scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.growth-tooltip .tooltip-row {
    margin-bottom: 4px;
}

.growth-tooltip .tooltip-row:last-child {
    margin-bottom: 0;
}

.growth-tooltip .time-value.urgent {
    color: #D32F2F;
}

/* Bordered speech-bubble tail: a larger dark triangle behind a smaller cream one in
   front, offset by the border width, to fake a stroked arrow with pure CSS borders */
.growth-tooltip::before,
.growth-tooltip::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

.growth-tooltip::before {
    border-top: 9px solid var(--dark-brown, #5D4037);
}

.growth-tooltip::after {
    bottom: -6px;
    border-left-width: 6px;
    border-right-width: 6px;
    border-top: 6px solid var(--white, #FFF8F0);
}

.growth-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

.growth-tooltip .time-label {
    color: var(--season-text, #6B4423);
    opacity: 0.75;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

.growth-tooltip .time-value {
    color: var(--dark-brown, #5D4037);
    font-size: 13px;
    font-weight: 700;
}

/* Plant Info Popup (Click-triggered) */
.plant-info-popup {
    position: fixed;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 250, 240, 0.98) 100%);
    border: 4px solid var(--dark-brown);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4),
                0 0 0 2px rgba(139, 111, 71, 0.3);
    min-width: 280px;
    max-width: 320px;
    z-index: 2000;
    font-family: 'Comfortaa', sans-serif;
    transform: scale(0.8);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.plant-info-popup:not(.hidden) {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.plant-info-popup.hidden {
    display: none;
}

.plant-info-header {
    background: linear-gradient(135deg, #8B6F47 0%, #A0826D 100%);
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 3px solid var(--dark-brown);
    position: relative;
}

.plant-info-header .plant-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.plant-info-header .plant-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    flex: 1;
}

.plant-info-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 20px;
    font-weight: 700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.plant-info-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.plant-info-close:active {
    transform: scale(0.95);
}

.plant-info-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: rgba(139, 111, 71, 0.08);
    border-radius: 10px;
    border: 2px solid rgba(139, 111, 71, 0.15);
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: #654321;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 16px;
    font-weight: 700;
    color: #2E7D32;
}

.info-value.live-timer {
    color: #1565C0;
    font-family: 'Courier New', monospace;
    font-size: 18px;
}

/* Pulsing animation for live timers */
.live-timer {
    animation: pulse-timer 2s ease-in-out infinite;
}

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