/* ==============================
🌾 TRANG GAME NÔNG TRẠI
============================== */
body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  overflow: hidden;
  background: url("img/background.png") no-repeat center center fixed;
  background-size: cover;
  background-position: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;

}

.content {
  position: relative;
  z-index: 2;
  transform: translateY(50px);
}

h1 {
  font-size: 3rem;
  text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
  margin-bottom: 30px;
}

.btn-farm {
  background-color: #28a745;
  border: none;
  padding: 15px 40px;
  font-size: 1.3rem;
  border-radius: 50px;
  color: white;
  transition: 0.3s;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.btn-farm:hover {
  background-color: #218838;
  transform: scale(1.05);
}

footer {
  width: 100%;
  bottom: 0;
  left: 0;
  right: 0;
  position: relative;
  margin-top: auto;
}

/* ==============================
🗑️ TRANG PHÂN LOẠI RÁC
============================== */
.page-recycle {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: visible;

}



.page-recycle .trash {
  cursor: grab;
}

.page-recycle .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 10%;
  box-sizing: border-box;
}

.page-recycle .item {
  background: none;
  margin: 10px 0;
  border-radius: 20px;
  width: 200px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-recycle canvas {
  cursor: grab;
}

.page-recycle .mockup {
  width: 100%;
  max-width: 500px;
  height: 500px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.page-recycle .graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.page-recycle .graphic p {
  margin-top: 10px;
  font-weight: 500;
}

.page-recycle .graphic.drag-over {
  border: 3px dotted #000;
  background: rgba(0, 0, 0, 0.03);
}

@keyframes shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-3px, 0) rotate(-3deg); }
  40% { transform: translate(3px, 0) rotate(3deg); }
  60% { transform: translate(-3px, 0) rotate(-3deg); }
  80% { transform: translate(3px, 0) rotate(3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.page-recycle .graphic.shake {
  animation: shake 0.4s;
}

.page-recycle .tick {
  position: absolute;
  font-size: 40px;
  color: green;
  font-weight: bold;
  z-index: 5;
  animation: fadeOut 1s forwards;
  top: 10px;
  right: 10px;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ==============================
🎨 PHẦN GRID & CANVAS
============================== */
canvas {
  display: block;
  position: absolute;
}

.wrap {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
  background: none !important;
}

#treeCanvas {
  left: 0;
  top: 0;
  width: 700px;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

#gameCanvas {
  right: 0;
  top: 0;
  width: 720px;
  height: 720px;
  z-index: 2;
  background: transparent;
  display: none;
}

.trash-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  pointer-events: none;
}

.leaf {
  position: absolute;
  background-color: rgba(80, 180, 60, 0.8);
  border-radius: 100%;
  width: 1200px;
  height: 600px;
}

.trash {
    width: 70px;
    height: auto;
    cursor: grab;
}
.butterfly {
    top: 120px;
    left: 200px;
}
.gif.deco {
    position: absolute;
    width: 60px;
    pointer-events: none; /* không cản drag rác */
    z-index: 2;
}
.fly-gif {
    position: absolute;
    top: 200px;
    left: 400px;
    width: 70px;
    pointer-events: none;
    z-index: 3;

    animation: loopFly 12s ease-in-out infinite;
}

@keyframes loopFly {
    0%   { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(120px, -60px) rotate(10deg); }
    50%  { transform: translate(240px, 0) rotate(-10deg); }
    75%  { transform: translate(120px, 80px) rotate(15deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}
.flyo-gif {
    position: absolute;
    top: 100px;
    left: 00px;
    width: 70px;
    pointer-events: none;
    z-index: 3;

    animation: circleFly 10s linear infinite;
}

@keyframes circleFly {
    0%   { transform: rotate(0deg)   translateX(120px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(120px) rotate(-360deg); }
}
/* Vùng chứa lá */
#leaf-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

/* Lá */
.leaf {
    position: absolute;
    width: 18px;
    height: 30px;
    background: linear-gradient(135deg, #3cb371, #2e8b57);
    border-radius: 0 100% 0 100%;
    opacity: 0.8;
    transform-origin: center;
    animation: leafFloat linear infinite;
}

/* Gân lá */
.leaf::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.4);
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

/* Hiệu ứng bay */
@keyframes leafFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(50px, -40px) rotate(90deg);
    }
    50% {
        transform: translate(100px, 20px) rotate(180deg);
    }
    75% {
        transform: translate(50px, 60px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}
.dog {
    position: absolute;
    cursor: pointer;
}

/* hiệu ứng nảy */
.dog.jump {
    animation: dogJump 0.5s ease;
}

/* tim bay */
.heart {
    position: absolute;
    font-size: 24px;
    animation: heartFly 1s ease-out forwards;
    pointer-events: none;
}

@keyframes dogJump {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-40px); }
    100% { transform: translateY(0); }
}

@keyframes heartFly {
    from {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-80px) translateY(-40px) scale(1.5);
    }
}
.confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 14px;
    opacity: 0.8;
    animation: fall 2.5s linear forwards;
    z-index: 9999;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.heart {
    position: fixed;
    font-size: 28px;
    animation: heartUp 1.2s ease-out forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes heartUp {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(-120px) scale(1.6);
        opacity: 0;
    }
}
body {
    cursor: grab;
}

.trash {
    cursor: grab;
    pointer-events: auto;
}

.trash:active {
    cursor: grabbing;
}
#toast {
    position: fixed;
    top: 580px;          /* chỉnh vị trí */
    right: 200px;        /* đặt gần người nông dân */

    min-width: 220px;
    max-width: 320px;
    padding: 16px 22px;

    background: #ff3b30;
    color: #fff;
    font-weight: bold;
    font-size: 20px;
    text-align: center;

    border-radius: 25px;   /* bo tròn như bong bóng */
    box-shadow: 0 8px 18px rgba(0,0,0,.25);

    opacity: 0;
    transform: scale(0.8);
    transition: all .35s ease;

    z-index: 9999;
    pointer-events: none;
}

/* hiện lên */
#toast.show {
    opacity: 1;
    transform: scale(1);
}



#toast.error {
    background: #f44336;
}

#toast.success {
    background: #4caf50;
}

#toast.warn {
    background: #ff9800;
}

/* ==============================
🌾 TRANG GAME NÔNG TRẠI
============================== */
body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  overflow: hidden;
  background: url("img/background.png") no-repeat center center fixed;
  background-size: 1700px 1080px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
}

.content {
  position: relative;
  z-index: 2;
  transform: translateY(50px);
}

h1 {
  font-size: 3rem;
  text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
  margin-bottom: 30px;
}

.btn-farm {
  background-color: #28a745;
  border: none;
  padding: 15px 40px;
  font-size: 1.3rem;
  border-radius: 50px;
  color: white;
  transition: 0.3s;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.btn-farm:hover {
  background-color: #218838;
  transform: scale(1.05);
}

footer {
  width: 100%;
  bottom: 0;
  left: 0;
  right: 0;
  position: relative;
  margin-top: auto;
}

/* ==============================
🗑️ TRANG PHÂN LOẠI RÁC
============================== */
.page-recycle {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: visible;

}

.page-recycle .left {
  position: relative;
  width: 240px;
  height: 720px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
}

.page-recycle .trash {
  cursor: grab;
}

.page-recycle .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 10%;
  box-sizing: border-box;
}

.page-recycle .item {
  background: none;
  margin: 10px 0;
  border-radius: 20px;
  width: 200px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-recycle canvas {
  cursor: grab;
}

.page-recycle .mockup {
  width: 100%;
  max-width: 500px;
  height: 500px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.page-recycle .graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.page-recycle .graphic p {
  margin-top: 10px;
  font-weight: 500;
}

.page-recycle .graphic.drag-over {
  border: 3px dotted #000;
  background: rgba(0, 0, 0, 0.03);
}

@keyframes shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-3px, 0) rotate(-3deg); }
  40% { transform: translate(3px, 0) rotate(3deg); }
  60% { transform: translate(-3px, 0) rotate(-3deg); }
  80% { transform: translate(3px, 0) rotate(3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.page-recycle .graphic.shake {
  animation: shake 0.4s;
}

.page-recycle .tick {
  position: absolute;
  font-size: 40px;
  color: green;
  font-weight: bold;
  z-index: 5;
  animation: fadeOut 1s forwards;
  top: 10px;
  right: 10px;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ==============================
🎨 PHẦN GRID & CANVAS
============================== */
canvas {
  display: block;
  position: absolute;
}

.wrap {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
  background: none !important;
}

#treeCanvas {
  left: 0;
  top: 0;
  width: 700px;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

#gameCanvas {
  right: 0;
  top: 0;
  width: 720px;
  height: 720px;
  z-index: 2;
  background: transparent;
  display: none;
}

.trash-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  pointer-events: none;
}

.leaf {
  position: absolute;
  background-color: rgba(80, 180, 60, 0.8);
  border-radius: 100%;
  width: 1200px;
  height: 600px;
}


.trash {
    width: 60px;            /* ✅ nhỏ hơn */
    height: 70px;
    cursor: grab;
}

.left {
    position: absolute;
    left: 120px;
    top: 0;
    width: 500px;
    height: 720px;
    z-index: 3;
}

/* LUỐNG */
.luong {
    position: absolute;
    display: flex;
    gap: 18px;

    transform:
        rotate(-2deg)
        skewX(-1deg)
        scaleY(0.82);

    transform-origin: left center;
}


/* CANH TỌA ĐỘ THEO ẢNH */
.luong-1 {
    position: absolute;
    top: 440px;
    left: 120px;

    display: flex;
    gap: 180px;


    transform-origin: left center;
}

/* LUỐNG GIỮA */
.luong-2 {
    position: absolute;
    top: 600px;
    left: -50px;

    display: flex;
    gap: 250px;


    transform-origin: left center;
}

/* LUỐNG GẦN (dưới cùng) */
.luong-3 {
    position: absolute;
    top: 800px;
    left: -180px;

    display: flex;
    gap: 300px;


    transform-origin: left center;
}

.trash {
    width: 70px;
    height: auto;
    cursor: grab;
}
.butterfly {
    top: 120px;
    left: 200px;
}
.gif.deco {
    position: absolute;
    width: 60px;
    pointer-events: none; /* không cản drag rác */
    z-index: 2;
}
.fly-gif {
    position: absolute;
    top: 200px;
    left: 400px;
    width: 70px;
    pointer-events: none;
    z-index: 3;

    animation: loopFly 12s ease-in-out infinite;
}

@keyframes loopFly {
    0%   { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(120px, -60px) rotate(10deg); }
    50%  { transform: translate(240px, 0) rotate(-10deg); }
    75%  { transform: translate(120px, 80px) rotate(15deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}
.flyo-gif {
    position: absolute;
    top: 100px;
    left: 00px;
    width: 70px;
    pointer-events: none;
    z-index: 3;

    animation: circleFly 10s linear infinite;
}

@keyframes circleFly {
    0%   { transform: rotate(0deg)   translateX(120px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(120px) rotate(-360deg); }
}
/* Vùng chứa lá */
#leaf-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

/* Lá */
.leaf {
    position: absolute;
    width: 18px;
    height: 30px;
    background: linear-gradient(135deg, #3cb371, #2e8b57);
    border-radius: 0 100% 0 100%;
    opacity: 0.8;
    transform-origin: center;
    animation: leafFloat linear infinite;
}

/* Gân lá */
.leaf::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.4);
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

/* Hiệu ứng bay */
@keyframes leafFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(50px, -40px) rotate(90deg);
    }
    50% {
        transform: translate(100px, 20px) rotate(180deg);
    }
    75% {
        transform: translate(50px, 60px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}
.dog {
    position: absolute;
    cursor: pointer;
}

/* hiệu ứng nảy */
.dog.jump {
    animation: dogJump 0.5s ease;
}

/* tim bay */
.heart {
    position: absolute;
    font-size: 24px;
    animation: heartFly 1s ease-out forwards;
    pointer-events: none;
}

@keyframes dogJump {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-40px); }
    100% { transform: translateY(0); }
}

@keyframes heartFly {
    from {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-80px) translateY(-40px) scale(1.5);
    }
}
.confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 14px;
    opacity: 0.8;
    animation: fall 2.5s linear forwards;
    z-index: 9999;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.heart {
    position: fixed;
    font-size: 28px;
    animation: heartUp 1.2s ease-out forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes heartUp {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(-120px) scale(1.6);
        opacity: 0;
    }
}
body {
    cursor: grab;
}

.trash {
    cursor: grab;
    pointer-events: auto;
}

.trash:active {
    cursor: grabbing;
}

.right {
    position: absolute;
    right: -50px !important;
    bottom: 300px !important;

    display: flex;          /* 🔥 đổi grid → flex */
    gap: 15px;

    width: fit-content;     /* 🔥 tự co */
    height: fit-content;    /* 🔥 tự co */

    z-index: 2;
}
.right .bin.graphic.red img {
    height: 210px !important;
    width: auto !important;
    margin-top: -10px;


}
.right .bin.graphic.green img {
    margin-top: -5px;


}

.right img {
    width: 180px;
    height: 180px;
}

<style>
.logout-container {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 9999;
}

.logout-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #ff4d4d, #ff0000);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
}
/* ==============================
   THANH NÚT CỐ ĐỊNH PHÍA TRÊN
============================== */
.top-action-bar {
    position: fixed;
    top: 16px;
    right: 100px;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;

    height: 60px;
}

.top-action-bar form {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.top-action-btn {
    width: 56px;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 14px;

    color: black;
    font-size: 38px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;

    backdrop-filter: blur(4px);
}

.top-action-btn i {
    font-size: 38px;
    line-height: 1;
}

.music-toggle {
    font-size: 34px;
}

.top-action-btn:hover {
    transform: scale(1.06);
}
#anhStore {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}
#nextLevelBtn .lv-btn {
    color: #fff;
}
* {
    user-select: none;
    -webkit-user-select: none;
}
</style>
