/* apps/tiny-house-adventure/style.css */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Noto+Sans+JP:wght@400;700;900&display=swap');

:root {
    --primary: #3b82f6; /* Roblox風ブルー */
    --danger: #ef4444;  /* HP赤 */
    --stamina: #10b981; /* スタミナ緑 */
    --bg-dark: rgba(15, 23, 42, 0.7);
    --text-main: #f8fafc;
    --font-en: 'Fredoka', sans-serif;
    --font-ja: 'Noto Sans JP', sans-serif;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
html, body { width: 100%; height: 100%; overflow: hidden; background-color: #87CEEB; font-family: var(--font-ja); }
#root { width: 100%; height: 100%; position: relative; }

/* === UI Overlay === */
.ui-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
}

/* === Status Bar (Top Left) === */
.status-container {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 250px;
}

.status-bar-wrapper {
    background: var(--bg-dark);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 8px 12px;
    backdrop-filter: blur(4px);
}

.status-label {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 900;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.bar-track {
    width: 100%;
    height: 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.1s linear;
}
.bar-fill.hp { background: linear-gradient(90deg, #dc2626, #ef4444); }
.bar-fill.stamina { background: linear-gradient(90deg, #059669, #10b981); }

/* === Inventory (Right Side) === */
.inventory-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    pointer-events: auto;
    background: var(--bg-dark);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    backdrop-filter: blur(4px);
}
.inventory-title {
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}
.inv-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.inv-slot {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;
}
.inv-slot:active { transform: scale(0.95); }
.inv-slot.has-item { border-color: #fde047; background: rgba(253, 224, 71, 0.2); }
.inv-count {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid white;
}

/* === Controls (Bottom) === */
.controls-container {
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 10px;
}

/* Joystick */
.joystick-zone {
    width: 150px;
    height: 150px;
    position: relative;
    touch-action: none;
}
.joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.joystick-stick {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    position: absolute;
    transition: transform 0.05s;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 20px;
    margin-right: 20px;
    margin-bottom: 20px;
}
.btn-action {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.4);
    color: white;
    font-size: 1.8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    transition: transform 0.1s, background 0.1s;
    touch-action: manipulation;
}
.btn-action:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.4);
}
.btn-action.jump { background: rgba(59, 130, 246, 0.6); }

/* === Toast / Messages === */
.message-toast {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.message-toast.show { opacity: 1; }

/* === Game Over / Clear Screen === */
.screen-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    pointer-events: auto;
}
.screen-title {
    font-size: 4rem;
    font-family: var(--font-en);
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
    margin-bottom: 20px;
}
.screen-btn {
    padding: 16px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 30px;
    border: none;
    background: #fde047;
    color: #854d0e;
    cursor: pointer;
    box-shadow: 0 6px 0 #ca8a04;
    transition: transform 0.1s;
}
.screen-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #ca8a04;
}

@media (min-width: 768px) {
    .status-container { width: 350px; }
}
