:root {
    --bg-color: #f8f5e1;
    --tab-bg: #e0d4b8;
    --content-bg: #ffffff;
    --card-bg: #f0e9d9;
    --accent-color: #ffd700;
    --text-color: #333333;
    --button-green: #4caf50;
    --button-blue: #2196f3;
    --button-red: #f44336;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 16px;
    touch-action: manipulation;
    height: 100vh;
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

body.modal-open .tab-container {
    display: none;
}

body.role-child #parent-actions,
body.role-child #parent-scoreboard {
    display: none !important;
}

h1 {
    font-size: 1.8rem;
    margin: 15px 0;
    text-align: center;
}

.content {
    width: 100%;
    max-width: 400px;
    background-color: var(--content-bg);
    padding: 15px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.tab-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 400px;
    background-color: var(--tab-bg);
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.tab {
    flex: 1;
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    font-size: 0.8rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tab span {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.tab.active {
    background-color: var(--content-bg);
    border-radius: 20px 20px 0 0;
}

.badge {
    background: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    position: absolute;
    top: 5px;
    right: 10px;
}

.hidden {
    display: none;
}

.user-card {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    box-sizing: border-box;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    cursor: pointer; /* Make avatar clickable */
}

.user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    cursor: pointer; /* Make user-info clickable */
}

.user-info h3 {
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-btn {
    background-color: var(--accent-color);
    border: 2px solid #333;
    border-radius: 0;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Press Start 2P', cursive !important; /* Ensure pixel font */
    color: #333;
    text-transform: uppercase;
    image-rendering: pixelated;
    width: 60px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    line-height: 1;
}

.chore-list, #transaction-list, #notification-list, #pending-list, #child-transactions {
    list-style: none;
    padding: 0;
    flex-grow: 1;
    width: 100%;
    box-sizing: border-box;
}

.chore-item, .shop-item, .transaction, .notification {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: var(--card-bg);
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    box-sizing: border-box;
}

.chore-item button, .shop-item button, #pending-list button {
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 10px;
    flex-shrink: 0;
}

.chore-item button, #pending-list button:first-of-type {
    background: var(--button-green);
    color: white;
}

.shop-item button {
    background: var(--button-blue);
    color: white;
}

#pending-list button:last-of-type {
    background: var(--button-red);
    color: white;
}

.shop-item img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    flex-shrink: 0;
}

.shop-item span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.day-nav button {
    padding: 8px 15px;
    font-size: 1.1rem;
    background: #ddd;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--content-bg);
    padding: 20px;
    border-radius: 15px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 350px;
}

.modal h2 {
    margin-top: 0;
    text-align: center;
    font-size: 1.5rem;
}

.modal form {
    display: flex;
    flex-direction: column;
}

.modal label {
    display: block;
    margin-bottom: 5px;
    font-size: 1rem;
}

.modal input, .modal select {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.modal button {
    padding: 10px;
    cursor: pointer;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    margin-top: 5px;
}

.modal button[type="submit"] {
    background: var(--button-green);
    color: white;
}

.modal button[type="button"] {
    background: var(--button-red);
    color: white;
}

button {
    touch-action: manipulation;
}

#parent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#parent-actions button {
    flex: 1 1 calc(50% - 5px);
    padding: 10px;
    background: var(--button-blue);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

#parent-actions button:last-child {
    background: var(--button-red);
}

#child-home > button {
    margin-top: auto;
    width: 100%;
    padding: 10px;
    background: var(--button-red);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

/* New transaction styles with muted colors, centered points, and spacing */
.transaction {
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
}

.transaction-emoji {
    font-size: 1.5rem; /* Perfect size as requested */
    margin-right: 10px;
}

.transaction-points-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 10px; /* Space before reason */
}

.transaction-points-value {
    font-size: 1.2rem; /* Larger points value */
    font-weight: bold;
    line-height: 1;
}

.transaction-points {
    font-size: 1rem; /* Slightly smaller for "Points!" */
    font-weight: bold;
}

.transaction-reason {
    margin-left: 10px; /* Increased gap between points and reason */
    flex-grow: 1;
}

.transaction-positive {
    background-color: #81C784; /* Muted green for positive */
    color: white;
}

.transaction-negative {
    background-color: #EF9A9A; /* Muted red for negative */
    color: white;
}

.transaction-neutral {
    background-color: #ffd700; /* Orange for neutral */
    color: #333;
}

small {
    font-size: 0.8rem;
    margin-left: 10px;
    color: #666; /* Uniform styling with a muted color */
}