﻿/* 18_shimaenaga_care - style.css */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  touch-action: manipulation;
}

#game-container.game-shell > .ui-chrome {
  padding-inline-end: max(4px, env(safe-area-inset-right, 0px));
}

:root {
  --game-bg: #FFFFFF;
  --exp-color: #FFD166;
  --hunger-color: #EF476F;
}

#game-container {
  background-color: var(--game-bg);
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.name-pill {
    background: rgba(255, 255, 255, 0.92);
    padding: 6px 14px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #5d4037;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.name-edit-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  margin-left: 8px;
  cursor: pointer;
  padding: 4px;
}

.ui-stats-row.shima-stats {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  background: #FFF8EE;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 2px solid #EAE0D5;
}
.shima-stats__row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.shima-stats__row2 {
  display: flex;
  width: 100%;
  gap: 12px;
}
.name-pill--collection {
  background: #639BB7;
  color: #fff;
}
.stat-container {
  flex: 1;
  display: flex;
  align-items: center;
}
.stat-icon {
  font-size: 1.2rem;
  margin-right: 6px;
}
.stat-bar-bg {
  flex: 1;
  height: 14px;
  background: #E0E0E0;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.stat-bar-fill {
  background: var(--exp-color);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}
.hunger-fill {
  background: var(--hunger-color);
}

/* Actions Grid Row */
.ui-actions-grid {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px 12px;
  background: #F8F9FA;
  border-top: 2px solid #EEE;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
.ui-actions-grid.dead-mode .action-btn {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(1);
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 4px 0;
  box-shadow: 0 3px 0 #ddd;
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.3s;
  cursor: pointer;
  touch-action: manipulation;
}
.action-btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #ddd;
}
.action-emoji { font-size: clamp(20px, 4.5vh, 24px); }
.action-txt { font-size: clamp(10px, 2vh, 12px); font-weight: bold; color: #555; }

/* In Game Area */
#game-area {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.5s ease;
}

.btn-change-bg {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid #ddd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn-change-bg:active { transform: scale(0.95); }

.night-overlay {
  position: absolute;
  top:0; left:0; right:0; bottom:0;
  background: rgba(10, 10, 30, 0.7);
  z-index: 2;
  pointer-events: none;
  transition: opacity 1s;
}

.dead-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
}
.grave-icon { font-size: 80px; margin-bottom: 4px; }
.restart-btn { background: #FFD166; color:#333; margin-top:16px; padding: 12px 20px; }

.bg-decor {
  position: absolute;
  font-size: 40px;
  opacity: 0.3;
  z-index: 1;
}
.top-left { top: 20px; left: 20px; }
.top-right { top: 30px; right: 20px; transform: scaleX(-1); }

.character-container {
  position: relative;
  z-index: 10;
  width: min(250px, 35vh);
  height: min(250px, 35vh);
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
  cursor: pointer;
  margin-top: 6vh;
}

.character-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease, width 0.3s ease, filter 0.5s;
  user-select: none;
  -webkit-user-drag: none;
}
.character-img.sleeping {
  filter: brightness(0.6);
  transform: translateY(10px) scale(1.05, 0.95);
}

.status-indicator {
  position: absolute;
  font-size: 24px;
  font-weight: bold;
  z-index: 20;
}
#sleep-indicator { top: 10px; right: 10px; color: #88CCFF; animation: floatUpZzz 2s infinite ease-out; }
#sick-indicator { top: 10px; left: 10px; animation: pulse 1s infinite alternate; }

@keyframes floatUpZzz {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  20% { opacity: 1; }
  80% { transform: translateY(-40px) scale(1.2); opacity: 0; }
  100% { transform: translateY(-40px); opacity: 0; }
}
@keyframes pulse { 0% { transform: scale(1); } 100% { transform: scale(1.2); filter: drop-shadow(0 0 5px red); } }

.chat-bubble {
  position: absolute;
  top: 5%;
  right: 0%;
  background: white;
  border: 3px solid #ddd;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  z-index: 50;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chat-bubble::after {
  content: ''; position: absolute; bottom: -8px; left: 20px;
  border-width: 8px 8px 0; border-style: solid; border-color: #ddd transparent transparent transparent;
}

/* Anim */
.anim-breathe { animation: breathe 3s infinite ease-in-out; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02) translateY(-2px); } }
.anim-eat { animation: eat 0.4s 2; }
@keyframes eat { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.1, 0.9) translateY(4px); } }
.anim-jump { animation: jump 0.5s ease-out; }
@keyframes jump { 0% { transform: scale(1.1, 0.9) translateY(0); } 40% { transform: scale(0.9, 1.1) translateY(-30px); } 80% { transform: scale(1.05, 0.95) translateY(0); } 100% { transform: scale(1) translateY(0); } }
.anim-egg-crack { animation: egg-crack 0.4s; }
@keyframes egg-crack { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Items Layer */
#items-layer { position: absolute; top:0; left:0; right:0; bottom:0; pointer-events: none; z-index: 5; }
.poop-item {
  position: absolute; font-size: 32px; pointer-events: auto; cursor: pointer;
  animation: dropIn 0.5s bounce; touch-action: manipulation;
}
.food-item { position: absolute; font-size: 32px; animation: foodDrop 0.6s ease-in forwards; }
@keyframes dropIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes foodDrop { 0% { transform: translateY(-100px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(200px); opacity: 0; } }

#particles-layer { position: absolute; top:0; left:0; right:0; bottom:0; pointer-events: none; z-index: 30; }
.particle { position: absolute; font-size: 24px; animation: floatUp 1s ease-out forwards; }
@keyframes floatUp { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-60px) scale(1.5); opacity: 0; } }

/* Status Modal */
.status-grid {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    margin: 16px 0;
    font-size: 16px;
    background: #f9f9f9;
    padding: 16px;
    border-radius: 12px;
}
.st-lbl { font-weight: bold; color: #666; }
.st-val { font-weight: bold; color: #333; }
.journey-btn { background: #66BB6A; color:white; margin: 0 0 10px 0; border:none; padding:12px; border-radius:12px; font-weight:bold; width:100%; cursor:pointer; font-size: 1rem; }

#collection-overlay .collection-dialog {
  width: 90%;
  max-width: 360px;
  touch-action: pan-y;
}

.collection-grid {
  overflow-y: auto;
  max-height: 50vh;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 0;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.col-item {
  aspect-ratio: 1; background: #f0f0f0; border-radius: 8px; display: flex; justify-content: center; align-items: center; font-size: 16px; font-weight: bold; color: #ccc; border: 2px solid #ddd;
}
.col-item.unlocked { background: white; border-color: var(--exp-color); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.col-item img { width: 90%; height: 90%; object-fit: contain; }
.hidden { display: none !important; }
