:root {
    --sky-color: #a4b8ad; /* muted sky */
    --grass-color: #8a9a5b; /* earthy green */
    --parchment: #e8d6b3; /* warm beige background */
    --parchment-dark: #d4c09a; /* for alternating rows */
    --choco-outline: #3b2818; /* dark chocolate */
    --wood-btn: #8a5a40; /* warm wood */
    --wood-btn-hover: #a67253;
    --text-dark: #3b2818; /* chunky text */
    --text-light: #f7f1e3; /* bright text on dark */
    --accent-red: #c25953; /* muted red for timer/accents */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Press Start 2P', cursive;
    background-color: var(--sky-color);
    color: var(--text-dark);
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* --- HUD Header (Transparent) --- */
header {
    background-color: transparent;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    box-shadow: none;
    z-index: 10000;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
}

h1 {
    font-size: 24px;
    margin: 0;
    color: var(--text-dark);
}

#timer-container {
    font-size: 20px;
    background: var(--parchment-dark);
    padding: 15px 20px;
    border: 4px solid var(--choco-outline);
    border-radius: 8px;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.1);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

#timer {
    color: var(--accent-red);
    font-size: 24px;
}

/* --- Buttons --- */
.pixel-btn {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--wood-btn);
    color: var(--text-light);
    border: 4px solid var(--choco-outline);
    border-radius: 8px;
    padding: 12px 18px;
    cursor: pointer;
    box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.2), inset 4px 4px 0 rgba(255, 255, 255, 0.1);
}

.pixel-btn:hover {
    background-color: var(--wood-btn-hover);
}

.pixel-btn:active {
    box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.3);
}

/* --- Scene --- */
main {
    flex-grow: 1;
    position: relative;
    background-image: url('assets/yard_background.png');
    background-size: cover;
    background-position: center bottom;
    image-rendering: pixelated;
}

#scene {
    position: absolute;
    top: 28.33%;
    left: 0;
    width: 100%;
    height: 71.67%;
}

.cat-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(2);
    transform-origin: bottom center;
}

.cat-img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.3));
    background-repeat: no-repeat;
    animation: sprite-anim 1s steps(var(--frames, 1)) infinite;
}

@keyframes sprite-anim {
    100% { background-position: calc(var(--frames, 1) * -32px) center; }
}

.cat-bed {
    position: absolute;
    bottom: -15px;
    width: 32px;
    height: 32px;
    background-repeat: no-repeat;
    background-size: 100%;
    image-rendering: pixelated;
    display: none; /* Only show when sleeping */
    z-index: -1; /* Keep it behind the cat */
}

.cat-bowl {
    position: absolute;
    bottom: -5px;
    left: 8px;
    width: 16px;
    height: 16px;
    background-image: url('assets/cats/accesories/CatBowls.png');
    background-repeat: no-repeat;
    background-size: 100%;
    image-rendering: pixelated;
    display: none; 
    z-index: 1; /* In front of cat */
}


/* --- Name Tags --- */
.holder-id {
    font-size: 6px;
    background: var(--parchment);
    color: var(--text-dark);
    padding: 3px 4px;
    border: 2px solid var(--choco-outline);
    border-radius: 4px;
    margin-top: 2px;
}

/* --- Modal & Table --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(59, 40, 24, 0.7); /* warm dark tint */
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

.modal-content {
    background-color: var(--parchment);
    border: 8px solid var(--choco-outline);
    border-radius: 12px;
    padding: 30px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    /* Soft highlights and chunky shadows for the RPG feel */
    box-shadow: inset 4px 4px 0 rgba(255,255,255,0.4), 
                inset -4px -4px 0 rgba(0,0,0,0.1),
                12px 12px 0 rgba(0,0,0,0.2); 
}

/* Faux wooden screws in corners */
.modal-content::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px;
    width: 6px; height: 6px;
    background: var(--choco-outline);
    border-radius: 50%;
    box-shadow: calc(100% + 700px) 0 0 var(--choco-outline); /* Will just use simple dots instead */
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-dark);
    font-size: 28px;
    cursor: pointer;
}

.close:hover {
    color: var(--accent-red);
}

h2 {
    text-align: center;
    margin-top: 0;
    color: var(--text-dark);
    margin-bottom: 25px;
}

.table-container {
    border: 6px solid var(--choco-outline);
    border-radius: 8px;
    background: var(--parchment-dark);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    line-height: 1.5;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 4px solid var(--choco-outline);
}

th {
    background-color: var(--wood-btn);
    color: var(--text-light);
    border-bottom: 6px solid var(--choco-outline);
}

tbody tr:nth-child(even) {
    background-color: var(--parchment);
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* --- Cat Info Modal Specifics --- */
.cat-modal-header-top {
    text-align: center;
    margin-bottom: 25px;
}

.cat-modal-header-top h2 {
    margin-bottom: 8px;
    font-size: 20px;
}

.cat-variant-tag {
    font-size: 10px;
    color: var(--wood-btn);
    margin-top: 0;
    margin-bottom: 0;
    text-transform: uppercase;
}

.cat-modal-body {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 25px;
}

.cat-modal-left, .cat-modal-right {
    flex: 1;
}

#cat-info-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 160px;
    background: linear-gradient(to bottom, var(--sky-color) 0%, var(--sky-color) 50%, var(--grass-color) 50%, var(--grass-color) 100%);
    border: 4px solid var(--choco-outline);
    border-radius: 8px;
    box-shadow: inset 4px 4px 0 rgba(0,0,0,0.1);
    box-sizing: border-box;
}

#cat-info-preview {
    transform: scale(4); /* Larger for the preview */
}

#cat-info-stats {
    background: var(--parchment-dark);
    padding: 15px 20px;
    border: 4px solid var(--choco-outline);
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.5;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    box-sizing: border-box;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.05);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed rgba(59, 40, 24, 0.2);
    padding-bottom: 10px;
}

.stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    font-weight: bold;
    color: var(--text-dark);
}

.stat-value {
    color: var(--text-dark);
    text-align: right;
    font-size: 8px; 
}

#cat-info-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.anim-header {
    text-align: center; 
    font-size: 10px; 
    margin-bottom: 15px;
    color: var(--wood-btn);
}

.anim-btn {
    font-size: 8px;
    padding: 8px 10px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1000px) {
    #timer-container {
        font-size: 10px;
        padding: 8px 12px;
        white-space: nowrap;
    }
    #timer {
        font-size: 12px;
    }
    h1 {
        font-size: 16px;
    }
    .pixel-btn {
        padding: 8px 12px;
        font-size: 8px;
    }
}

@media (max-width: 600px) {
    #timer-container {
        font-size: 8px;
        padding: 6px 10px;
    }
    #timer {
        font-size: 10px;
    }
    h1 {
        font-size: 12px;
    }
    .pixel-btn {
        padding: 6px 8px;
        font-size: 6px;
    }
}
