html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1e1e28;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #f0f0f0;
}

#mainCanvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    visibility: hidden;
    touch-action: none;
}

#splash {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: #2a3350;
    z-index: 10;
}

.splash-inner {
    text-align: center;
}

#splash h1 {
    margin: 0;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 1px;
}

#splash .version {
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.7;
}

#actionMenu {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 20;
}

#actionMenu .action-row {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 8px;
}

#foodSubmenu {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px;
    border-radius: 6px;
}

#foodSubmenu.hidden {
    display: none;
}

.action-btn,
.food-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s, border-color 0.15s;
}

.food-btn {
    padding: 6px 12px;
    font-size: 12px;
}

.action-btn:hover,
.food-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.action-btn.selected,
.food-btn.selected {
    background: rgba(255, 255, 255, 0.3);
    border-color: #e59c14;
    color: #fff;
}

#hud {
    position: fixed;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    z-index: 20;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    pointer-events: none;
}

.hud-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-label {
    width: 64px;
    color: rgba(255, 255, 255, 0.8);
}

.hud-bar {
    position: relative;
    width: 120px;
    height: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    overflow: hidden;
}

.hud-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.1s linear;
}

.hud-fill[data-stat-fill="hunger"]     { background: #e67e22; }
.hud-fill[data-stat-fill="fuel"]       { background: #f1c40f; }
.hud-fill[data-stat-fill="oil"]        { background: #2c3e50; }
.hud-fill[data-stat-fill="happiness"]  { background: #27ae60; }

.hud-midpoint {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
}

.hud-fill-signed {
    position: absolute;
    top: 0;
    height: 100%;
    background: #3498db;
    transition: left 0.1s linear, width 0.1s linear;
}

.hud-value {
    width: 36px;
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
}

.hud-pills {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    min-height: 18px;
}

.hud-pill {
    padding: 2px 8px;
    border-radius: 9px;
    font-size: 10px;
    color: #fff;
}

.hud-pill-scared {
    background: rgba(231, 76, 60, 0.85);
}

.hud-pill-purring {
    background: rgba(39, 174, 96, 0.85);
}

.hud-pill.hidden {
    display: none;
}
