:root {
    --hud-font: 'Minecraftia', 'Press Start 2P', monospace;
    --hud-bg: rgba(18, 18, 18, 0.82);
    --hud-border: #d8c07c;
    --hud-border-dark: #7a6a3a;
    --hud-slot: #3a3a3a;
    --hud-slot-dark: #252525;
    --hud-slot-active: #f3e5a1;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: #87CEEB;
    cursor: crosshair;
    font-family: var(--hud-font);
}

canvas {
    display: block;
}

#weather-indicator,
#fps-counter,
#help-hint {
    position: absolute;
    top: 14px;
    padding: 9px 12px;
    background: var(--hud-bg);
    color: #f4f4f4;
    font-size: 13px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    pointer-events: none;
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.55),
        0 0 0 2px var(--hud-border-dark),
        0 6px 16px rgba(0, 0, 0, 0.28);
}

#weather-indicator {
    left: 14px;
}

#fps-counter {
    display: none;
}

#help-hint {
    top: 14px;
    right: 14px;
    font-size: 13px;
    gap: 8px;
    opacity: 0.92;
}

#crosshair div {
    background: #f2f2f2 !important;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
}

#hud-hotbar {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 6px;
    padding: 8px;
    background: var(--hud-bg);
    border: 2px solid var(--hud-border-dark);
    border-radius: 10px;
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.55),
        0 8px 20px rgba(0, 0, 0, 0.35);
    color: #fff;
    user-select: none;
}

#hotbar-label {
    position: absolute;
    bottom: 102px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--hud-bg);
    border: 2px solid var(--hud-border-dark);
    border-radius: 8px;
    color: #f5e6b3;
    font-family: var(--hud-font);
    font-size: 13px;
    letter-spacing: 0.3px;
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.55),
        0 6px 14px rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    white-space: nowrap;
}

.hud-slot {
    position: relative;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, var(--hud-slot), var(--hud-slot-dark));
    border: 2px solid #6e6e6e;
    border-radius: 4px;
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.45),
        0 1px 0 rgba(255, 255, 255, 0.08);
}

.hud-slot.is-active {
    border-color: var(--hud-slot-active);
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.45),
        0 0 0 2px rgba(243, 229, 161, 0.7),
        0 0 12px rgba(243, 229, 161, 0.35);
}


.hud-slot-inner {
    position: relative;
    display: grid;
    place-items: center;
}

.hud-icon {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

.hud-idx {
    position: absolute;
    top: 3px;
    left: 4px;
    font-size: 11px;
    color: #cfcfcf;
    text-shadow: 1px 1px 0 #111;
    pointer-events: none;
}

.hud-count {
    position: absolute;
    right: 5px;
    bottom: 2px;
    font-size: 12px;
    font-weight: bold;
    color: #f2f2f2;
    text-shadow: 1px 1px 0 #111;
    pointer-events: none;
}

.hud-inventory-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.92), rgba(14, 14, 14, 0.92));
    border: 3px solid var(--hud-border-dark);
    border-radius: 12px;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.04),
        0 16px 40px rgba(0, 0, 0, 0.45);
    color: #f5f5f5;
    z-index: 1500;
}

.hud-panel-title {
    font-size: 14px;
    color: #f5e6b3;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 0.5px;
}

.hud-inventory-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
}

.inventory-slot {
    width: 64px;
    height: 64px;
}

.inventory-slot .hud-icon {
    width: 60px;
    height: 60px;
}

.hud-held {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5000;
}

#pause-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    z-index: 4000;
}

.pause-panel {
    width: min(480px, 92vw);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 22px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(12, 12, 12, 0.92));
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(0, 0, 0, 0.5);
    color: #f1f1f1;
    font-family: var(--hud-font);
}

.pause-title {
    font-size: 20px;
    letter-spacing: 0.6px;
    color: #f5e6b3;
    text-shadow: 2px 2px 0 #000;
}

.pause-subtitle {
    font-size: 13px;
    color: #dcdcdc;
    opacity: 0.85;
}

.pause-btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid var(--hud-border-dark);
    background: linear-gradient(180deg, #f7d46b, #d5a53f);
    color: #1a1200;
    font-weight: bold;
    cursor: pointer;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.18),
        0 6px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.pause-btn:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.18),
        0 3px 8px rgba(0, 0, 0, 0.35);
}

.pause-btn.primary {
    align-self: flex-start;
}

.pause-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pause-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.pause-toggle {
    min-width: 70px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, #2b2b2b, #1c1c1c);
    color: #f1f1f1;
    cursor: pointer;
    transition: all 0.12s ease;
}

.pause-toggle.on {
    background: linear-gradient(180deg, #4caf50, #2e7d32);
    color: #0f1b0f;
    border-color: #92e29a;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.pause-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pause-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pause-slider input[type="range"] {
    accent-color: #f5e6b3;
}

.pause-value {
    font-size: 12px;
    color: #f1f1f1;
    opacity: 0.85;
    min-width: 42px;
    text-align: right;
}

.pause-tips {
    font-size: 12px;
    color: #dcdcdc;
    opacity: 0.8;
    line-height: 1.4;
}
