/*@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap');*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global custom cursor */
html,
body,
* {
  cursor: url('/cursor.png') 16 16, auto;
}


/* Header height variable used to push page content below fixed header */
:root {
  --header-height: 110px;
  /* tuned to match header content */
}

/* Responsive adjustments for header height */
@media (max-width: 768px) {
  :root {
    --header-height: 92px;
  }
}

@media (max-width: 499px) {
  :root {
    --header-height: 76px;
  }
}

@media (max-width: 360px) {
  :root {
    --header-height: 68px;
  }
}


body {
  font-family: 'Pixelify Sans', 'Press Start 2P', 'Courier New', monospace;
  background: #FDF0C3;
  min-height: 100vh;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-height);
}

/* Header Styles */
.header {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #FFE130;
  box-shadow: 0 4px 6px rgba(84, 3, 3, 0.371);
  z-index: 100;
}

.page-name {
  font-size: 2.5rem;
  font-weight: bold;
  color: #EC8784;
  text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5rem;
  text-transform: lowercase;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-right,
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-button {
  padding: 0.5rem;
  border: none;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #333;
}

.nav-button img {
  width: 50px;
  height: auto;
  transition: transform 0.2s ease;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Visible button text next to icons for larger screens */
.nav-button .btn-text {
  margin-left: 0.5rem;
  font-size: 1rem;
  line-height: 1;
}

.nav-button:hover img {
  transform: scale(1.15);
}

.logout-btn,
.leaderboard-btn {
  background: #EC8784;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.logout-btn img,
.leaderboard-btn img {
  display: none;
}

.logout-btn:hover,
.leaderboard-btn:hover {
  background: #de6666;
  transform: scale(1.05);
}

.music-btn img {
  width: 50px;
  height: auto;
}

/* Main Content Area */
.content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

/* Container for main button */
.container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 60vh;
}

/* Main EGG Button */
#mainBtn {
  font-family: inherit;
  background: linear-gradient(180deg, #FFEB3B 0%, #FDD835 100%);
  border: 6px solid #EC8784;
  border-radius: 50px;
  padding: 2rem 6rem;
  font-size: 3rem;
  font-weight: bold;
  color: #EC8784;
  text-transform: uppercase;
  letter-spacing: 1rem;
  cursor: pointer;
  box-shadow:
    0 8px 0 #de6666,
    0 12px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
  position: relative;
  text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.3);
}

#mainBtn:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 0 #de6666,
    0 16px 25px rgba(0, 0, 0, 0.4);
}

#mainBtn:active {
  transform: translateY(4px);
  box-shadow:
    0 4px 0 #de6666,
    0 8px 15px rgba(0, 0, 0, 0.3);
}

/* Popup Overlay */
.popup-overlay {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #EC8784;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.close-btn:hover {
  background: #de6666;
  transform: rotate(90deg) scale(1.1);
}

/* Popup Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.popup-content {
  background: #F8E769;
  border: 3px solid #EC8784;
  border-radius: 2px;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 1rem;
  padding-top: 2.5rem;
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow:
    0 0 0 4px #EC8784,
    0 12px 40px rgba(0, 0, 0, 0.4);
}

.popup-inerr-content {
  background: #FDF0C3;
  border: 3px solid #EC8784;
  padding: 2.5rem;
  border-radius: 2px;
  text-align: center; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center;
}

.popup-content h2 {
  color: #EC8784;
  font-size: 2rem;
  font-weight: bold;
  text-align: left;
  margin-bottom: 1.5rem;
  letter-spacing: 0.3rem;
  text-transform: uppercase;
}

.close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: #EC8784;
  border: none;
  border-radius: 8px;
  width: 45px;
  height: 45px;
  font-size: 2rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  box-shadow: 0 4px 0 #e96b73;
}

.close-btn:hover {
  background: #e96b73;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #e25170;
}

.close-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #e96b73;
}

/* Form Styles */
.popup-content form {
  display: flex;
  flex-direction: column;
}

.popup-content form>div {
  margin-bottom: 1rem;
}

.popup-content label {
  display: block;
  color: #999;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: lowercase;
  letter-spacing: 0.05rem;
}

.popup-content input[type="email"],
.popup-content input[type="password"],
.popup-content input[type="text"] {
  width: 100%;
  padding: 1rem;
  border: 3px solid #E5E5E5;
  border-radius: 12px;
  background: white;
  font-size: 1rem;
  color: #666;
  transition: all 0.2s ease;
  outline: none;
}

.popup-content input:focus {
  border-color: #FFE130;
  box-shadow: 0 0 0 3px rgba(255, 225, 48, 0.2);
}

.popup-content input::placeholder {
  color: #ccc;
}

/* Submit Button */
.popup-content button[type="submit"] {
  background: linear-gradient(180deg, #F8E769 0%, #f9d948 100%);
  border: 4px solid #EC8784;
  border-radius: 40px;
  padding: 1rem 3rem;
  font-size: 1.3rem;
  font-weight: bold;
  color: #EC8784;
  text-transform: lowercase;
  letter-spacing: 0.3rem;
  cursor: pointer;
  margin-top: 1rem;
  box-shadow:
    0 6px 0 #e96b73,
    0 10px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
  align-self: center;
}

.popup-content button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow:
    0 9px 0 #e96b73,
    0 13px 25px rgba(0, 0, 0, 0.3);
}

.popup-content button[type="submit"]:active {
  transform: translateY(3px);
  box-shadow:
    0 3px 0 #e96b73,
    0 7px 15px rgba(0, 0, 0, 0.2);
}

/* Error Message Styling */
.popup-content div[style*="color: #8b0000"] {
  color: #EC8784 !important;
  background: #FFE5F0 !important;
  padding: 1rem !important;
  margin-bottom: 1.5rem !important;
  border-radius: 12px !important;
  border: 3px solid #EC8784 !important;
  font-weight: 600;
}

.body_home {
  background-image: url('/bakground 1.png');
}

body.body_leaderboard {
  background-image: url('/bakground 1.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}
@media(max-width: 570px) {
  .page-name {
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
  }
  .nav-button{
    padding: 0.25rem;
  }
}

@media(max-width: 272px){
  .page-name {
    display : none;
  }
}

/* Panel Styles (Shared by Leaderboard, Add Recipe, etc.) */
.panel-container {
  max-width: 900px;
  width: 95%;
  margin: 40px auto;
  text-align: center;
  background: #F8E769;
  border: 4px solid #EC8784;
  border-radius: 4px;
  padding: 2rem;
  box-shadow:
    0 0 0 4px #EC8784,
    0 12px 40px rgba(0, 0, 0, 0.4);
}

.panel-inner {
  background: #FDF0C3;
  border: 4px solid #EC8784;
  padding: 2rem;
  border-radius: 4px;
}

.panel-title {
  color: #EC8784;
  font-size: 2.5rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.3rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 0px #e96b7357;
}

.panel-subtitle {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
  font-size: 1.2rem;
}

.leaderboard-table th {
  background: #EC8784;
  color: white;
  padding: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  font-size: 1rem;
  border: 2px solid #EC8784;
}

.leaderboard-table td {
  padding: 1rem;
  border-bottom: 2px solid #EC8784;
  border-right: 2px solid #EC8784;
  border-left: 2px solid #EC8784;
  background: white;
  color: #333;
}

.leaderboard-table tr:first-child td {
  border-top: none;
}

.leaderboard-table tr:nth-child(even) td {
  background: #fff9e6;
}

.rank-cell {
  font-weight: bold;
  color: #EC8784;
}

.chef-cell {
  font-weight: bold;
}

.cooked-cell {
  color: #4CAF50;
  font-weight: bold;
}

.burned-cell {
  color: #FF5252;
  font-weight: bold;
}

.total-cell {
  font-weight: bold;
  color: #333;
}

.back-btn {
  display: inline-block;
  margin-top: 2rem;
  background: #EC8784;
  color: white;
  padding: 1rem 2rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 4px 0 #c05555;
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #c05555;
  background: #e96b73;
}

.back-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #c05555;
}

.personal-stats {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #fff9e6;
  border: 3px dashed #EC8784;
  border-radius: 8px;
}

.personal-stats h2 {
  color: #EC8784;
  text-transform: uppercase;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}

.stat-item span {
  display: block;
  font-size: 0.9rem;
  color: #666;
  text-transform: uppercase;
}

.stat-item strong {
  display: block;
  font-size: 1.5rem;
  color: #333;
}

/* Pixel egg image */
/* Pixel egg image */
.pixel_egg {
  /* Width handled by li container now */
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Menu Page Styles */
.body_menu {
  margin: 0;
  padding: 0;
  padding-top: var(--header-height);
  /* ensure header space on body_menu pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-image:
    repeating-linear-gradient(0deg,
      transparent,
      transparent 35px,
      rgba(236, 135, 132, 0.27) 35px,
      rgba(236, 135, 132, 0.27) 65px),
    repeating-linear-gradient(90deg,
      transparent,
      transparent 35px,
      #FCCAA7 35px,
      #FCCAA7 70px);
}

/* Override .content behavior for menu page */
.body_menu .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  /* takes remaining space */
  padding: 2rem;
}

.message {
  text-align: center;
  font-size: 1.2rem;
  margin-top: 20px;
  color: #EC8784;
  font-weight: bold;
  display: flex;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 100px;
  z-index: 200;
  justify-content: center;
  padding: 1rem 2rem;
  background: #fff9e6;
  border: 4px solid #EC8784;
  border-radius: 8px;
  box-shadow: 0 4px 0 #EC8784, 0 8px 15px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  animation: slideDown 0.5s ease-out, fadeOut 0.5s ease-in 4s forwards;
  width: auto;
  min-width: 300px;
}

@keyframes slideDown {
  from {
    top: -50px;
    opacity: 0;
  }

  to {
    top: 100px;
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    pointer-events: none;
  }
}

/* Single Recipe View Styles */
.recipe-detail-image {
   text-align: center;
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 0 auto 2rem auto;
  display: block;
  border: 4px solid #EC8784;
  border-radius: 8px;
  background: #fff;
  padding: 1rem;
  box-shadow: 4px 4px 0 rgba(236, 135, 132, 0.4);
}

/* UL as flex grid */
.body_menu ul {
  list-style: none;
  padding: 0;
  margin: 20px auto;
  /* Center the ul */
  width: 90%;
  max-width: 1200px;
  /* Optional: limit maximum width */
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  /* Align items from left */
  gap: 20px;
}

.body_menu ul li {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  /* Bigger items - roughly 3 per row */
  flex-grow: 1;
  flex-basis: calc(33.333% - 20px);
  /* 3 items per row accounting for gap */
  max-width: calc(33.333% - 20px);
  width: clamp(200px, 30vw, 400px);
  /* Increased from 150px/220px */
  transition: all 0.3s ease;
}

.body_menu ul li img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  transition: transform 0.2s ease;
  cursor: pointer;
  min-width: 150px;
  /* Increased minimum size */
}

.body_menu ul li:hover {
  transform: translateY(-2px);

  img {
    transform: scale(1.05);
  }
}

/* buttons bottom */
.menu_buttons {
  display: flex;
  gap: 20%;
  position: fixed;
  transform: translateX(-50%);
  left: 50%;
  bottom: 24px;
  /* space below the buttons */
  z-index: 60;
  justify-content: center;
  padding: 0 12px;
  /* prevent touching screen edges on small viewports */
  max-width: calc(100% - 32px);
}

.menu_buttons button {
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(180deg, #FFEB3B 0%, #FDD835 100%);
  border: 6px solid #EC8784;
  border-radius: 25px;
  font-weight: bold;
  color: #EC8784;
  text-transform: uppercase;
  letter-spacing: 0.5rem;
  cursor: pointer;
  box-shadow:
    0 8px 0 #de6666,
    0 12px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
  position: relative;
  text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.3);
}

.menu_buttons button:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 0 #de6666,
    0 16px 25px rgba(0, 0, 0, 0.4);
}

.menu_buttons button:active {
  transform: translateY(4px);
  box-shadow:
    0 4px 0 #de6666,
    0 8px 15px rgba(0, 0, 0, 0.3);
}

.menu_buttons img {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    padding: 0.75rem 1rem;
  }

  .page-name {
    font-size: 1.6rem;
    letter-spacing: 0.3rem;
    position: static;
    transform: none;
  }

  .nav-button img {
    width: 30px;
  }

  /* Smaller button text on medium screens */
  .nav-button .btn-text {
    font-size: 0.8rem;
  }

  .logout-btn,
  .leaderboard-btn {
    font-size: 0.8rem;
  }

  .music-btn img {
    width: 40px;
  }

  .header-right {
    gap: 0.5rem;
  }

  #mainBtn {
    padding: 1.5rem 4rem;
    font-size: 2rem;
    letter-spacing: 0.5rem;
    border-width: 5px;
  }

  .popup-content {
    padding: 1.5rem;
    border-width: 4px;
  }

  .close-btn {
    width: 35px;
    height: 35px;
    font-size: 1.3rem;
  }

  /* Two columns on medium / tablet screens */
  .body_menu ul li {
    flex: 0 0 calc(50% - 12px);
    max-width: calc(50% - 12px);
  }

  .menu_buttons button {
    width: 100%;
    max-width: 300px;
  }

  .panel-container {
    padding: 1rem;
    margin: 20px auto;
  }
  
  .panel-inner {
    padding: 1rem;
  }
  
  .panel-title {
    font-size: 1.8rem;
    letter-spacing: 0.2rem;
  }
  
  .panel-subtitle {
    font-size: 0.9rem;
  }
  
  .leaderboard-table {
    font-size: 0.9rem;
  }
  
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.6rem 0.4rem;
  }
  
  .stats-grid {
    gap: 0.8rem;
  }
}

.body_recipy {
  margin: 0;
  min-height: 100vh;
  background-image:
    repeating-linear-gradient(0deg,
      transparent,
      transparent 35px,
      rgba(236, 135, 132, 0.27) 35px,
      rgba(236, 135, 132, 0.27) 65px),
    repeating-linear-gradient(90deg,
      transparent,
      transparent 35px,
      #FCCAA7 35px,
      #FCCAA7 70px);
  background-size: 86px 86px;
} 

.recipe-container {
  flex-direction: column;
  padding: 20px;
  display: flex;
}

.columens-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.right-column, .left-column {
  width: 50%;
  gap: 20px;
  display: flex;
  flex-direction: column;
}

#timerArea {
  padding: 20px 0px;
  font-size: 1.5rem;
  font-weight: bold;
  background-color: #F8E769;
  text-align: center;
  border: 5px solid #EC8784;
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(236, 135, 132, 0.4);
}


@media (max-width: 499px) {
 .body_recipy .recipe-detail-image{
  display: none;
 }
  .columens-container{
    flex-direction: column;
  }

  .body_leaderboard .add-recipe-form .form-group label {
    font-size: 0.8rem;
  }

  .right-column, .left-column {
    width: 100%;
  }

  .body_leaderboard .add-recipe-form input[type="text"],
  .body_leaderboard .add-recipe-form input[type="number"],
  .body_leaderboard .add-recipe-form textarea,
  .body_leaderboard .add-recipe-form select {
    padding: 0.8rem;
    font-size: 0.9rem;
    border-width: 2px;
  }

  .body_leaderboard .add-recipe-form textarea {
    min-height: 100px;
  }

  .body_leaderboard .radio-group {
    flex-direction: column;
    gap: 10px;
  }

  .body_leaderboard .submit-btn {
    font-size: 1rem;
    padding: 0.8rem;
    letter-spacing: 0.1rem;
    border-width: 3px;
  }

  .panel-container {
    max-width: 900px;
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
  }

  .header {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .page-name {
    font-size: 100%;
    letter-spacing: 0.2rem;
    order: 2;
    width: 100%;
    text-align: center;
  }

  /* keep home button visually first on small screens */
  .nav-button.home-btn {
    order: 1;
  }

  /* inside the right header group, show music before logout */
  .header-right .nav-button.music-btn {
    order: -1;
  }

  .header-right .nav-button.logout-btn {
    order: 0;
  }

  .header-right {
    order: 3;
    margin-left: auto;
  }

  .nav-button img {
    width: 28px;
  }

  .music-btn img {
    width: 35px;
  }

  #mainBtn {
    padding: 1rem 2.5rem;
    font-size: 1.5rem;
    letter-spacing: 0.3rem;
    border-width: 4px;
    border-radius: 40px;
  }

  .logout-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .popup-content {
    padding: 1rem;
    border-width: 3px;
    border-radius: 20px;
  }

  .close-btn {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    top: 0.5rem;
    right: 0.5rem;
  }

  .popup-content {
    padding: 1rem;
    border-width: 5px;
    border-radius: 2px;
  }

  .popup-content h2 {
    font-size: 1.3rem;
    letter-spacing: 0.15rem;
    margin-bottom: 1rem;
  }

  .close-btn {
    width: 35px;
    height: 35px;
    font-size: 1.4rem;
    top: 0.75rem;
    right: 0.75rem;
  }

  .popup-content input[type="email"],
  .popup-content input[type="password"],
  .popup-content input[type="text"] {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  .popup-content button[type="submit"] {
    font-size: 1rem;
    padding: 0.8rem 2rem;
    letter-spacing: 0.15rem;
  }

  .popup-content label {
    font-size: 0.8rem;
  }

  .popup-inerr-content {
    padding: 1rem;
  }

  /* Restore full width for grid items on mobile to fit the 2-column layout */
  .pixel_egg {
    /* width: 100%;  <-- Removed to let clamp() work */
    min-width: 0;
  }

  .menu_buttons .btn-text {
    display: none;
  }

  .menu_buttons img {
    display: block;
    width: 40px;
    height: auto;
  }

  /* Switch buttons from text to icon-only at small screens */
  .nav-button,
  .logout-btn,
  .leaderboard-btn,
  .music-btn {
    font-size: 0;
    /* hide inline text while keeping images visible */
    padding: 0.25rem;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .logout-btn,
  .leaderboard-btn {
    border-radius: 50px;
  }

  /* hide the text span but keep it accessible to screen readers */
  .nav-button .btn-text {
    display: none;
  }

  .logout-btn img,
  .leaderboard-btn img {
    width: 28px;
    height: auto;
    display: block;
  }

  .body_menu ul li img {
    width: 100%;
    min-width: 100px;
  }

   .panel-title {
    font-size: 1.5rem;
    letter-spacing: 0.15rem;
  }
  
  .panel-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }
  
  .personal-stats {
    padding: 1rem;
    margin-top: 1rem;
  }
  
  .personal-stats h2 {
    font-size: 1.2rem;
  }
  
  .leaderboard-table {
    font-size: 0.75rem;
  }
  
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }
  
  .leaderboard-table th {
    font-size: 0.7rem;
  }
  
  .stat-item span {
    font-size: 0.75rem;
  }
  
  .stat-item strong {
    font-size: 1.2rem;
  }
  
  .back-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Very small devices */
@media (max-width: 370px) {
  .body_leaderboard.add-recipe-form input[type="text"],
  .body_leaderboard.add-recipe-form input[type="number"],
  .body_leaderboard.add-recipe-form textarea,
  .body_leaderboard.add-recipe-form select {
    padding: 0.7rem;
    font-size: 0.85rem;
  }

  .body_leaderboard .submit-btn {
    font-size: 0.9rem;
    padding: 0.7rem;
    letter-spacing: 0.05rem;
  }
  
  .body_menu ul li img {
    width: 100%;
    max-width: 120px;
  }

  .body_menu ul li {
    flex: 0 0 calc(100% - 10px);
    max-width: calc(100% - 10px);
    width: auto;
  }

  .recipe-card {
    flex: 0 0 calc(100% - 10px);
    max-width: calc(100% - 10px);
    width: auto;
  }

  .page-name {
    font-weight: bolder;
    font-size: 80%;
    letter-spacing: 0.15rem;
  }

  #mainBtn {
    padding: 0.8rem 2rem;
    font-size: 1.3rem;
    letter-spacing: 0.2rem;
  }

  .popup-content {
    padding: 0.5rem;
    border-width: 2px;
    border-radius: 2px;
  }

  .close-btn {
    width: 25px;
    height: 25px;
    font-size: 1rem;
    top: 0.75rem;
    right: 0.75rem;
    border-radius: 50px;
  }

  .popup-content input[type="email"],
  .popup-content input[type="password"],
  .popup-content input[type="text"] {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  .popup-content button[type="submit"] {
    font-size: 1rem;
    padding: 0.8rem 2rem;
    letter-spacing: 0.15rem;
  }

  .popup-content label {
    font-size: 0.8rem;
  }

  .popup-inerr-content {
    padding: 1rem;
  }

  /* Further reduce icon/button sizes on very small screens */
  .nav-button,
  .logout-btn,
  .leaderboard-btn,
  .music-btn {
    width: 30px;
    height: 30px;
    padding: 0.2rem;
  }

  .nav-button .logout-btn, .nav-button .leaderboard-btn img {
    width: 15px;
  }

  .logout-btn img,
  .leaderboard-btn img {
    width: 20px;
  }

  .menu_buttons img {
    width: 20px;
  }

  .panel-title {
    font-size: 1.2rem;
    letter-spacing: 0.1rem;
  }
  
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.4rem 0.2rem;
    font-size: 0.7rem;
  }
  
  .stat-item strong {
    font-size: 1rem;
  }
}

/* --- ADDED / PRESERVED STYLES BELOW --- */

.recipe-content-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.ingredients-section,
.instructions-section {
  background: #FCBC9C;
  border: 4px solid #EC8784;
  box-shadow: 4px 4px 0 rgba(236, 135, 132, 0.4);
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
  text-align: left;
}

.styled-list {
  border: 2px dashed #EC8784;
  border-radius: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: #FDF0C3;
  padding: 1rem;
}

.styled-list li {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.pixel-bullet {
  color: #EC8784;
  font-weight: bold;
  font-family: monospace;
  font-size: 1.2rem;
}

.pixel-number {
  background: #FCBC9C;
  color: #fffdf5;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 0px;
  box-shadow: 2px 2px 0 #EC8784;
}

@media (min-width: 768px) {
  .recipe-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 2rem;
  }
}

/* Timer Styles */
#timerArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 2rem auto;
  gap: 1.5rem;
  text-align: center;
}

#animationFrame {
  border: 4px solid #EC8784;
  border-radius: 8px;
  box-shadow: inset 4px 4px 0 rgba(236, 135, 132, 0.4);
  background: white;
  max-width: 100%;
  width: 80%;
}

#timerControls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

.timer-btn {
  background: #F8E769;
  border: 3px solid #EC8784;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #EC8784;
  transition: all 0.15s ease;
  box-shadow: 0 4px 0 #c05555;
  padding: 0;
}

.timer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #c05555;
  background: #FFEB3B;
}

.timer-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #c05555;
}

.timer-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  display: block;
}

#timer {
  font-size: 2.5rem;
  font-weight: bold;
  color: #EC8784;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
  letter-spacing: 0.2rem;
  margin: 1rem 0;
}

/* User Recipes / Community Page Styles - FLEXBOX (Desktop) */
.recipe-grid {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  width: 90%;
  max-width: 1200px;
}

.recipe-card {
  background: white;
  border: 3px solid #EC8784;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, flex-basis 0.3s ease, width 0.3s ease;
  /* Smooth transition */
  /* Graceful scaling matched to menu */
  flex-grow: 1;
  flex-basis: clamp(150px, 20vw, 220px);
  max-width: 300px;
  width: clamp(150px, 20vw, 220px);
}

.recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(236, 135, 132, 0.4);
}

.recipe-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.recipe-image-container {
  width: 100%;
  height: 150px;
  background: #fff9e6;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid #EC8784;
  overflow: hidden;
}

.recipe-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.recipe-info {
  padding: 10px;
  text-align: left;
}

.recipe-name {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 5px;
  font-weight: bold;
  text-transform: capitalize;
}

.recipe-chef {
  font-size: 0.8rem;
  color: #EC8784;
  font-weight: bold;
  text-transform: uppercase;
}

.no-recipes {
  padding: 2rem;
  text-align: center;
  color: #666;
}

.action-btn {
  display: inline-block;
  margin-top: 1rem;
  background: #F8E769;
  border: 2px solid #EC8784;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: #EC8784;
  font-weight: bold;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #FFEB3B;
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #EC8784;
}

/* Text under menu images (ul li p) — improved design */
.body_menu ul li p {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #333;
  font-weight: bold;
  text-align: center;
  text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.3);
}/* Recipe Action Buttons */
.recipe-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

.btn-action {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    border: 4px solid;
    transition: all 0.15s ease;
    min-width: 150px;
    /* Pixel shadow */
    box-shadow: 0 6px 0, 0 10px 10px rgba(0, 0, 0, 0.2);
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0, 0 13px 15px rgba(0, 0, 0, 0.3);
}

.btn-action:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0, 0 6px 5px rgba(0, 0, 0, 0.2);
}

/* Specific Colors */

/* Edit Button (Yellow/Standard) */
.btn-edit {
    background: linear-gradient(180deg, #F8E769 0%, #f9d948 100%);
    border-color: #EC8784;
    color: #EC8784;
    box-shadow: 0 6px 0 #e96b73, 0 10px 10px rgba(0, 0, 0, 0.2);
}

.btn-edit:hover {
    box-shadow: 0 9px 0 #e96b73, 0 13px 15px rgba(0, 0, 0, 0.3);
}

.btn-edit:active {
    box-shadow: 0 3px 0 #e96b73, 0 6px 5px rgba(0, 0, 0, 0.2);
}

/* Delete Button (Red/Danger) */
.btn-delete {
    background: linear-gradient(180deg, #ff8a80 0%, #ff5252 100%);
    border-color: #d32f2f;
    color: #b71c1c;
    box-shadow: 0 6px 0 #c62828, 0 10px 10px rgba(0, 0, 0, 0.2);
}

.btn-delete:hover {
    background: linear-gradient(180deg, #ff5252 0%, #ff1744 100%);
    box-shadow: 0 9px 0 #c62828, 0 13px 15px rgba(0, 0, 0, 0.3);
}

.btn-delete:active {
    box-shadow: 0 3px 0 #c62828, 0 6px 5px rgba(0, 0, 0, 0.2);
}
