body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #f0f8ff;
    overflow: hidden;
}

.container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #8aeb87;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message {
    font-size: 24px;
    font-weight: bold;
    color: #1e90ff;
    flex: 1;
    text-align: center;
}

.generation {
    font-size: 20px;
    color: #4682b4;
    font-weight: bold;
}

.aquarium {
    flex: 1;
    background: linear-gradient(to bottom, #87ceeb 0%, #4682b4 100%);
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
#three-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* �����͖����i���̎��j */
}

.aquarium::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    transform: translateX(-50%);
    z-index: -1;
    background: linear-gradient(to top, #8b7d6b 0%, rgba(139,125,107,0) 100%);
    z-index: 0; /* ����艺�� */
    pointer-events: none; /* �N���b�N�𓧉� */
}

.aquarium::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, #8b7d6b 0%, rgba(139,125,107,0) 100%);
}

/*�A�̋��ʃN���X*/
.bubble{
  position: absolute;
  bottom: -15vh;
  width: 15vw;
  height: 15vh;
  background: url("background_img/bubble.png") no-repeat center;
  background-size: contain;
  animation: float 10s linear infinite;
}

/*bubble1(���̖A)�̃N���X*/
.bubble1{
    left:10vw;
    animation-delay: 0s;
}

/*bubble2(�����̖A)�̃N���X*/
.bubble2{
    left:50vw;
    animation-delay:5s;
    opacity: 0.6;
}

/*bubble3(�E�̖A)�̃N���X*/
.bubble3{
    left:70vw;
    animation-delay:3s;
    opacity: 0.8;
}

/*�A�̃A�j���[�V����(�֍s���Ȃ���A��ʏ㕔�ֈړ�����)*/
@keyframes float{
  0% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(-20px) translateY(-25vh); 
  }
  50% {
    transform: translateX(20px) translateY(-50vh); 
  }
  75% {
    transform: translateX(-10px) translateY(-75vh);
  }
  100% {
    transform: translateX(10px) translateY(-100vh);
  }
}

/*�����̃N���X*/
.gravel {
    position: absolute;
    bottom: 0%;
    left: 0%;
    width: 100%;
    height: 230px;
    background:url('background_img/gravel.png') no-repeat center bottom ;
    background-size: cover; 
}

/*�y�ǂ̃N���X*/
.clayPipe{
    position: absolute;
    bottom: 0%;
    left: 15%;
    width: 40vw;
    height: 50vh;
    background: url('background_img/clayPipe.png') no-repeat center bottom;
    background-size: contain;
}

/*��O�̊�̃N���X*/
.frontLock{
    position: absolute;
    bottom: 0%;
    left: -45%;
    width: 110vw;
    height: 110vh;
    background: url('background_img/lock.png')no-repeat center bottom;
    background-size: contain;
}

/*���̊�̃N���X*/
.backLock{
    position: absolute;
    bottom: 120px;
    left: 0vw;
    width: 60vw;
    height: 70vh;
    background: url('background_img/lock.png')no-repeat center bottom;
    background-size: contain;
    opacity: 0.5;
}

/*��O�̐����̃N���X*/
.frontAquaticPlants {
    position: absolute;
    bottom: 0;
    right: -15vw;
    width: 40vw;
    height: 80vh;
    background: url('background_img/aquaticPlants.png') no-repeat center bottom;
    background-size: contain;
    animation: sway1 6s infinite ease-in-out;
    transform-origin: bottom center;
}
.dirt {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    bottom: 0px;
    opacity: 0;
    background: rgba(78, 90, 80, 0.573);
}
/*���̐����̋��ʃN���X*/
.backAquaticPlants {
    position: absolute;
    bottom: 50px;
    background: url('background_img/aquaticPlants.png') no-repeat center bottom;
    background-size: contain;
    transform-origin: bottom center;
}

/*backAquaticPlants1(���̐���)�̃N���X*/
.backAquaticPlants1 {
    right: -5vw;
    width: 40vw;
    height: 85vh;
    animation: sway2 4s infinite ease-in-out;
    opacity: 0.5;
}

/*backAquaticPlants2(�����̐���)�̃N���X*/
.backAquaticPlants2 {
    right: -10vw;
    width: 40vw;
    height: 75vh;
    animation: sway1 10s infinite ease-in-out;
    opacity: 0.3;
}

/*backAquaticPlants3(�E�̐���)�̃N���X*/
.backAquaticPlants3 {
    right: -15vw;
    width: 40vw;
    height: 85vh;
    animation: sway2 4s infinite ease-in-out;
    opacity: 0.5;
}

/*frontAquaticPlants��backAquaticPlants2�̃A�j���[�V����*/
@keyframes sway1 {
  0%   { transform: rotate(-10deg); }
  10%  { transform: rotate(-5deg); }
  25%  { transform: rotate(-10deg); }
  50%  { transform: rotate(-5deg); }
  75%  { transform: rotate(-0deg); }
  100% { transform: rotate(-10deg); }
}
/*backAquaticPlants1,3�̃A�j���[�V����*/
@keyframes sway2 {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(-5deg); }
  100%  { transform: rotate(-0deg); }
}

.egg {
    position: absolute;
    width: 80px;
    height: 100px;
    background: radial-gradient(ellipse at center, #ffffff 0%, #f0e68c 60%, #daa520 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%);
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10; /* ���̗v�f���m���ɏ�� */
    pointer-events: auto; /* �����I�ɃN���b�N�\�� */
}

.egg:hover {
    transform: translateX(-50%) scale(1.05);
}

.egg:active {
    transform: translateX(-50%) scale(0.95);
}

.egg.crack {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(-5deg); }
    75% { transform: translateX(-50%) rotate(5deg); }
}

.fish {
    position: absolute;
    width: 60px;
    height: 40px;
    transition: all 0.3s ease;
}

.fish img {
    width: 100%;
    height: 100%;
    display: block;
}

.fish.swimming {
    animation: swim 10s infinite linear;
    transform-origin: center center;
}

.buttons {
      margin-top: 20px;
}

button {
      padding: 10px 20px;
      margin: 5px;
      font-size: 16px;
      border: none;
      border-radius: 5px;
      cursor: pointer;
}
.clean-btn {
      background-color: #1e88e5;
      color: white;
    }

@keyframes swim {
    0% {
        left: -100px;
        top: 20%;
        transform: scaleX(1);
    }
    24.99% {
        left: calc(100% - 60px);
        top: 60%;
        transform: scaleX(1);
    }
    25% {
        left: calc(100% - 60px);
        top: 60%;
        transform: scaleX(-1);
    }
    49.99% {
        left: 0px;
        top: 40%;
        transform: scaleX(-1);
    }
    50% {
        left: 0px;
        top: 40%;
        transform: scaleX(1);
    }
    74.99% {
        left: calc(100% - 60px);
        top: 70%;
        transform: scaleX(1);
    }
    75% {
        left: calc(100% - 60px);
        top: 70%;
        transform: scaleX(-1);
    }
    99.99% {
        left: 0px;
        top: 20%;
        transform: scaleX(-1);
    }
    100% {
        left: -100px;
        top: 20%;
        transform: scaleX(1);
    }
}

.skull {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
}

.food {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #8b4513;
    border-radius: 50%;
    animation: fall 3s linear;
    pointer-events: none;
}

@keyframes fall {
    0% {
        opacity: 1;
    }
    100% {
        transform: translateY(500px);
        opacity: 0.5;
    }
}

.name-input-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.name-input-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.name-input-container h2 {
    margin-top: 0;
    color: #1e90ff;
}

.name-input-container input {
    padding: 10px;
    font-size: 16px;
    border: 2px solid #87ceeb;
    border-radius: 5px;
    width: 200px;
    margin: 10px 0;
}

.name-input-container button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #1e90ff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.name-input-container button:hover {
    background-color: #4682b4;
}

.gameover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.gameover-container {
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    background: #2c3e50;
    color: #dfe6e9;
    padding: 30px;
    border-radius: 5px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    animation: sigh 3s infinite;
}

.gameover-container h2 {
    margin-top: 0;
}

.gameover-container input {
    padding: 10px;
    font-size: 16px;
    border: 2px solid #87ceeb;
    border-radius: 5px;
    width: 200px;
    margin: 10px 0;
}

.gameover-container button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #1e90ff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.gameover-container button:hover {
    background-color: #4682b4;
}

@keyframes sigh {
  0%, 100% { opacity: 0.8; transform: translateY(0); }
  50% { opacity: 0.6; transform: translateY(3px); }
}