/* ========== CSS Variables (Theme) ========== */
:root {
  --primary-color: #d946a6;
  --secondary-color: #ffc0e0;
  --text-color: #3d0a40;
  --text-light: #6b1b7a;
  --accent-color: #e879d9;
  --text-accent: #c41e8d;
  --border-color: #ffffff;
  --bg-color: #fef3f8;
  --popup-bg: #f8d7ed;
  --heading-bg: #f0d9f4;
  --light-purple: #e9d5f3;
  --light-pink: #ffe0ed;
  --rose: #ff69b4;
  --lavender: #e6ccff;
  --cream: #fff5f9;
  --font-cursive: 'Brush Script MT', cursive;
  --font-serif: 'Georgia', serif;
  --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ========== Global Styles ========== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  border: 20px solid var(--border-color);
  min-height: 100vh;
  font-family: var(--font-sans);
  text-align: center;
  padding: 40px 20px;
  background-image: radial-gradient(circle at 20% 50%, rgba(255, 192, 224, 0.2), transparent), 
                    radial-gradient(circle at 80% 80%, rgba(230, 204, 255, 0.2), transparent);
  line-height: 1.6;
  color: var(--text-color);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

header {
  color: white;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  font-family: var(--font-cursive);
  font-size: 3rem;
  padding: 30px;
  border-radius: 25px;
  box-shadow: 0 10px 30px rgba(217, 70, 166, 0.25);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
  margin-bottom: 30px;
  letter-spacing: 1px;
}

header p {
  margin: 0;
}

footer {
  color: var(--primary-color);
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 3px solid var(--primary-color);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ========== Headings ========== */
h1 {
  color: var(--primary-color);
  background: linear-gradient(135deg, var(--light-pink), var(--light-purple));
  font-family: var(--font-cursive);
  font-size: 2.8rem;
  margin: 35px 0 25px 0;
  padding: 25px 30px;
  border-radius: 25px;
  box-shadow: 0 8px 20px rgba(217, 70, 166, 0.15);
  text-shadow: 2px 2px 3px rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
}

h2 {
  color: var(--text-light);
  font-family: var(--font-cursive);
  font-size: 1.8rem;
  margin: 18px 0;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

h3 {
  color: var(--text-color);
  background: linear-gradient(135deg, rgba(255, 192, 224, 0.8), rgba(230, 204, 255, 0.8));
  font-family: var(--font-cursive);
  font-size: 1.6rem;
  margin: 12px auto;
  padding: 18px 20px;
  border-radius: 18px;
  box-shadow: 0 5px 12px rgba(217, 70, 166, 0.12);
  border-left: 4px solid var(--primary-color);
}

h4 {
  color: var(--primary-color);
  font-family: var(--font-cursive);
  font-size: 1.4rem;
  margin: 12px 0;
  text-shadow: 1px 1px 3px rgba(255, 192, 224, 0.5);
  font-weight: 500;
}

/* ========== Popup ========== */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 192, 224, 0.9), rgba(230, 204, 255, 0.9));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.popup-content {
  color: var(--text-color);
  background: linear-gradient(135deg, var(--cream), var(--light-pink));
  padding: 40px;
  border-radius: 30px;
  width: 320px;
  box-shadow: 0 15px 40px rgba(217, 70, 166, 0.25), 0 0 0 2px var(--primary-color);
  border: 3px solid var(--primary-color);
  animation: popupBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-content h1 {
  font-size: 2.2rem;
  margin: 0 0 15px 0;
  padding: 0;
  background: none;
  box-shadow: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.popup-content h3 {
  font-size: 1.1rem;
  margin: 15px 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  color: var(--text-light);
}

.popup-content p {
  margin: 0;
  line-height: 1.5;
}

.popup-content button {
  margin-top: 20px;
  min-width: 120px;
}

@keyframes popupBounce {
  0% {
    transform: scale(0.7) translateY(-60px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ========== Navigation ========== */
nav {
  margin: 30px 0;
  line-height: 2.2;
  background: linear-gradient(135deg, rgba(255, 192, 224, 0.6), rgba(230, 204, 255, 0.6));
  padding: 25px 30px;
  border-radius: 25px;
  box-shadow: 0 6px 18px rgba(217, 70, 166, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

nav a {
  margin: 0 12px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
  padding: 10px 18px;
  border-radius: 12px;
  display: inline-block;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

nav a:hover {
  color: white;
  background-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 6px 15px rgba(217, 70, 166, 0.35);
}

/* ========== Media Elements ========== */
img {
  max-width: 100%;
  height: auto;
  border-radius: 15px;
  margin: 20px 0;
  display: block;
}

.image-center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0;
  padding: 28px;
  background: linear-gradient(135deg, var(--light-pink), var(--light-purple));
  border-radius: 25px;
  box-shadow: 0 10px 28px rgba(217, 70, 166, 0.2);
  border: 2px solid rgba(217, 70, 166, 0.2);
}

.image-center img {
  margin: 0;
  border: 5px solid white;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
}

iframe {
  width: 100%;
  max-width: 100%;
  border: none;
  display: block;
  border-radius: 15px;
}

/* ========== Forms ========== */
input,
button {
  padding: 12px 20px;
  margin: 8px;
  font-family: var(--font-sans);
  border-radius: 15px;
  border: 2px solid var(--primary-color);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
  font-weight: 600;
  font-size: 0.95rem;
}

input[type="number"],
input[type="text"] {
  background: white;
  color: var(--text-color);
  padding: 12px 16px;
  width: auto;
  min-width: 200px;
}

input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 12px rgba(217, 70, 166, 0.3);
}

button {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  border: none;
  box-shadow: 0 6px 16px rgba(217, 70, 166, 0.3);
  letter-spacing: 0.5px;
}

button:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(217, 70, 166, 0.4);
}

button:active {
  transform: translateY(-2px);
}

button:active {
  transform: scale(0.96) translateY(-2px);
}

input {
  background: var(--light-pink);
  color: var(--text-color);
  border-color: var(--primary-color);
  padding: 10px 15px;
}

input::placeholder {
  color: rgba(61, 10, 64, 0.5);
}

input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(217, 70, 166, 0.15);
  background: white;
  border-color: var(--accent-color);
}

/* ========== Details/Summary ========== */
details {
  margin-bottom: 18px;
  padding: 20px;
  border: 2px solid var(--light-purple);
  border-radius: 18px;
  text-align: left;
  background: linear-gradient(135deg, var(--cream), var(--light-pink));
  box-shadow: 0 5px 12px rgba(217, 70, 166, 0.1);
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
}

details:hover {
  box-shadow: 0 8px 18px rgba(217, 70, 166, 0.2);
  border-color: var(--primary-color);
}

details[open] {
  background: linear-gradient(135deg, var(--light-pink), var(--lavender));
}

summary {
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: color 0.3s ease;
  padding: 10px;
  border-radius: 12px;
  letter-spacing: 0.3px;
}

summary:hover {
  color: var(--accent-color);
  background-color: rgba(255, 192, 224, 0.4);
}

summary h2 {
  display: inline;
  margin: 0;
  font-size: 1.15em;
}

/* ========== Gallery ========== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin: 30px 0;
  padding: 20px;
}

.gallery img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(217, 70, 166, 0.15);
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
  border: 3px solid var(--light-pink);
}

.gallery img:hover {
  transform: scale(1.08) rotate(-1deg);
  box-shadow: 0 12px 28px rgba(217, 70, 166, 0.3);
  border-color: var(--primary-color);
}

.gallery figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
}

.gallery figcaption {
  margin-top: 14px;
  font-size: 0.95rem;
  color: var(--text-color);
  font-weight: 600;
  font-style: italic;
  line-height: 1.5;
}

/* ========== Popup Gallery ========== */
.popup-gallery {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(217, 70, 166, 0.85), rgba(217, 70, 166, 0.85));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(10px);
}

.popup-gallery:target {
  display: flex;
  animation: fadeInPopup 0.3s ease-out;
}

@keyframes fadeInPopup {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.popup-gallery img {
  max-width: 85%;
  max-height: 85%;
  border-radius: 20px;
  border: 4px solid white;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 42px;
  text-decoration: none;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  font-weight: bold;
  line-height: 1;
}

.close:hover {
  color: var(--light-pink);
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.15) rotate(90deg);
}

/* ========== Lists ========== */
ul {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

li {
  background: linear-gradient(to right, rgba(255, 192, 224, 0.5), rgba(230, 204, 255, 0.5));
  margin: 10px auto;
  padding: 14px;
  border-radius: 12px;
  color: var(--text-color);
  border-left: 5px solid var(--primary-color);
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
  font-weight: 500;
}

li:hover {
  transform: translateX(6px);
  box-shadow: 0 5px 12px rgba(217, 70, 166, 0.2);
  background: linear-gradient(to right, rgba(255, 192, 224, 0.7), rgba(230, 204, 255, 0.7));
}

li button {
  margin-left: 10px;
  padding: 6px 12px;
  font-size: 11px;
}

.selecionado {
  border: 2px solid var(--rose);
  background-color: rgba(255, 105, 180, 0.15) !important;
}

.maior {
  background-color: rgba(100, 200, 100, 0.25) !important;
  font-weight: bold;
}

.menor {
  background-color: rgba(100, 150, 200, 0.25) !important;
  font-weight: bold;
}

/* ========== Game Area ========== */
#gameArea {
  width: 90vw;
  max-width: 400px;
  height: 90vw;
  max-height: 400px;
  margin: 20px auto;
  background: #2a1f3d;
  position: relative;
  border: 4px solid var(--primary-color);
  touch-action: manipulation;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(217, 70, 166, 0.3);
}

#target {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--rose), var(--primary-color));
  border-radius: 50%;
  position: absolute;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 105, 180, 0.8), 0 0 25px rgba(217, 70, 166, 0.5);
  transition: all 0.3s ease;
}

#target:hover {
  box-shadow: 0 0 20px rgba(255, 105, 180, 1), 0 0 35px rgba(217, 70, 166, 0.7);
  transform: scale(1.1);
}

.minigame-body {
  background: linear-gradient(135deg, #3a1f5e, #2d0a3f);
  color: white;
}

.minigame-body h1 {
  color: var(--rose);
  background-color: transparent;
  margin-top: 10px;
  font-size: 1.8em;
}

/* ========== Utility Classes ========== */
.conteudo {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.card {
  background: linear-gradient(135deg, var(--cream), var(--light-pink));
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(217, 70, 166, 0.12);
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
  border: 2px solid rgba(217, 70, 166, 0.1);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(217, 70, 166, 0.2);
  border-color: var(--primary-color);
}

.card h2 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 12px;
}

.card p {
  color: var(--text-light);
  line-height: 1.7;
}

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  padding: 12px 28px;
  text-decoration: none;
  border-radius: 15px;
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
  margin-top: 18px;
  box-shadow: 0 6px 16px rgba(217, 70, 166, 0.3);
  font-weight: 600;
  letter-spacing: 0.5px;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(217, 70, 166, 0.4);
}

/* ========== Temperature Indicator ========== */
.container {
  background: linear-gradient(135deg, white, var(--light-pink));
  width: 100%;
  max-width: 400px;
  margin: 20px auto;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(217, 70, 166, 0.2);
  border: 2px solid var(--light-purple);
}

.container h2 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

.container input {
  width: 80px;
  padding: 8px;
  font-size: 16px;
  text-align: center;
  background: var(--light-pink);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
}

.container button {
  padding: 10px 20px;
  margin-left: 5px;
}

.barra-container {
  width: 100%;
  max-width: 400px;
  height: 32px;
  background: linear-gradient(to right, rgba(255, 192, 224, 0.6), rgba(230, 204, 255, 0.6));
  border-radius: 20px;
  margin: 25px auto;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1), 0 6px 14px rgba(217, 70, 166, 0.2);
  border: 2px solid var(--primary-color);
}

.barra {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--rose), var(--accent-color));
  transition: width 0.6s cubic-bezier(0.4, 0.0, 0.2, 1), background 0.6s;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.15);
}

#status {
  margin-top: 18px;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
}

.frio {
  color: #5b7ec4;
}

.normal {
  color: #2ecc71;
}

.quente {
  color: var(--rose);
}

#mensagem {
  color: var(--rose);
  font-weight: bold;
  margin: 10px 0;
  background: rgba(255, 192, 224, 0.3);
  padding: 10px;
  border-radius: 10px;
}

#resultados,
#sequencia {
  margin-top: 20px;
  font-weight: bold;
  background: linear-gradient(135deg, var(--light-pink), var(--light-purple));
  padding: 20px;
  border-radius: 15px;
  color: var(--text-color);
  border-left: 5px solid var(--primary-color);
  box-shadow: 0 6px 15px rgba(217, 70, 166, 0.15);
}

/* ========== Game Styles ========== */
.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 30px auto;
  padding: 25px;
  background: linear-gradient(135deg, var(--light-pink), var(--cream));
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(217, 70, 166, 0.2);
  border: 3px solid var(--primary-color);
  max-width: 500px;
}

.game-stats {
  display: flex;
  gap: 30px;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-color);
}

.stat {
  background: var(--secondary-color);
  padding: 10px 15px;
  border-radius: 12px;
  border: 2px solid var(--primary-color);
}

#gameArea {
  position: relative;
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  border: 4px solid var(--primary-color);
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

#target {
  position: absolute;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, #FF4444, #CC0000);
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

#target:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

canvas {
  border: 4px solid var(--primary-color);
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: #000;
  max-width: 100%;
  height: auto;
}

.start-button {
  font-size: 1.1rem !important;
  padding: 12px 25px !important;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color)) !important;
  color: white !important;
  border: none !important;
  border-radius: 15px !important;
  cursor: pointer !important;
  font-weight: bold !important;
  box-shadow: 0 6px 16px rgba(217, 70, 166, 0.3) !important;
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
}

.start-button:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 24px rgba(217, 70, 166, 0.4) !important;
}

/* ========== Menu Page Styles ========== */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 30px auto;
  padding: 0 15px;
}

.menu-item {
  display: block;
  background: linear-gradient(135deg, var(--light-pink), var(--cream));
  border: 3px solid var(--primary-color);
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: var(--text-color);
  box-shadow: 0 8px 20px rgba(217, 70, 166, 0.2);
  transition: all 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.menu-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(217, 70, 166, 0.35);
  background: linear-gradient(135deg, var(--secondary-color), var(--light-purple));
}

.menu-item h3 {
  margin: 0 0 10px 0;
  font-size: 1.4rem;
  color: var(--primary-color);
  font-family: var(--font-sans);
}

.menu-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.4;
}

/* ========== Responsive Design ========== */

/* Tablet & iPad (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    padding: 25px 20px;
  }

  header {
    font-size: 2.5rem;
    padding: 25px;
  }

  h1 {
    font-size: 2.2rem;
    margin: 25px 0 20px 0;
    padding: 18px 25px;
  }

  nav {
    margin: 20px 0;
    padding: 15px 25px;
    line-height: 2;
  }

  nav a {
    margin: 0 10px;
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    padding: 20px;
  }

  .hobby-links {
    max-width: 700px;
  }

  .image-center img {
    width: 100%;
    max-width: 350px;
    height: auto;
  }

  button {
    padding: 12px 20px;
    font-size: 1rem;
  }
}

/* Smaller Tablets & Large Phones (481px - 768px) */
@media (max-width: 768px) {
  body {
    padding: 20px 15px;
    border-width: 10px;
  }

  header {
    font-size: 2.2rem;
    padding: 20px;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 1.8rem;
    margin: 20px 0 15px 0;
    padding: 15px 18px;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.1rem;
    padding: 12px 15px;
  }

  h4 {
    font-size: 1rem;
  }

  nav {
    margin: 18px 0;
    padding: 12px 18px;
    line-height: 1.8;
  }

  nav a {
    margin: 0 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    display: inline-block;
  }

  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    padding: 15px;
  }

  .hobby-links {
    max-width: 95%;
  }

  .hobby-item {
    padding: 18px;
  }

  .hobby-item h2 {
    font-size: 1.3rem;
  }

  .hobby-item .description {
    font-size: 0.9rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 18px;
  }

  .image-center {
    margin: 15px 0;
    padding: 15px;
  }

  .game-container {
    max-width: 95%;
    padding: 20px;
  }

  .game-stats {
    gap: 20px;
    font-size: 1rem;
  }

  #gameArea {
    width: 350px;
    height: 350px;
  }

  canvas {
    width: 100%;
    max-width: 350px;
  }

  .popup-content {
    width: 90%;
    padding: 24px;
  }

  .popup-gallery img {
    max-width: 100%;
    max-height: 60vh;
  }

  .container {
    max-width: 95%;
  }

  input[type="number"],
  input[type="text"] {
    width: 100%;
    max-width: 280px;
    padding: 10px;
    font-size: 1rem;
  }

  button {
    padding: 11px 18px;
    font-size: 0.95rem;
    width: auto;
  }
}

/* Mobile Phones (320px - 480px) */
@media (max-width: 480px) {
  * {
    max-width: 100%;
  }

  body {
    padding: 10px 8px;
    border-width: 5px;
    min-height: 100vh;
  }

  header {
    font-size: 1.6rem;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 15px;
  }

  h1 {
    font-size: 1.5rem;
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 12px;
  }

  h2 {
    font-size: 1.1rem;
  }

  h3 {
    font-size: 0.95rem;
    padding: 8px 10px;
    margin: 6px 0;
  }

  h4 {
    font-size: 0.9rem;
  }

  p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 8px 0;
  }

  nav {
    padding: 10px 12px;
    line-height: 1.5;
    margin: 12px 0;
  }

  nav a {
    margin: 2px 3px;
    padding: 5px 8px;
    font-size: 0.75rem;
    display: inline-block;
  }

  nav br {
    display: none;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 8px;
  }

  figure {
    margin: 8px 0;
    padding: 0;
  }

  figcaption {
    font-size: 0.85rem;
    padding: 8px;
  }

  .hobby-links {
    max-width: 100%;
    margin: 15px auto;
    padding: 0 5px;
  }

  .hobby-item {
    padding: 12px;
    border-radius: 15px;
    gap: 10px;
    margin-bottom: 12px;
  }

  .hobby-item h2 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
  }

  .hobby-item a {
    font-size: 1rem;
  }

  .hobby-item .description {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  .image-center {
    padding: 12px;
    margin: 10px 0;
  }

  .image-center img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-width: 3px;
    border-radius: 12px;
  }

  .popup-gallery {
    padding: 15px;
    border-radius: 15px;
  }

  .popup-gallery img {
    max-width: 100%;
    max-height: 50vh;
    border-radius: 12px;
  }

  .popup-content {
    width: 85%;
    padding: 16px;
    border-radius: 15px;
  }

  .popup-content h1 {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
  }

  .popup-content h3 {
    font-size: 0.9rem;
  }

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

  .close {
    width: 40px;
    height: 40px;
    font-size: 28px;
    top: 8px;
    right: 8px;
  }

  button {
    padding: 9px 14px;
    font-size: 0.8rem;
    margin: 6px 4px;
    width: auto;
    min-width: 80px;
  }

  input[type="number"],
  input[type="text"] {
    width: 100%;
    padding: 8px;
    font-size: 0.95rem;
    margin: 8px 0;
    border-radius: 8px;
  }

  .game-container {
    max-width: 98%;
    padding: 15px;
    gap: 15px;
  }

  .game-stats {
    gap: 15px;
    font-size: 0.9rem;
  }

  #gameArea {
    width: 280px;
    height: 280px;
  }

  #target {
    width: 35px;
    height: 35px;
  }

  canvas {
    width: 100%;
    max-width: 280px;
  }

  .start-button {
    font-size: 0.9rem !important;
    padding: 10px 20px !important;
  }

  .menu-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 95%;
  }

  .menu-item {
    padding: 20px;
  }

  .menu-item h3 {
    font-size: 1.2rem;
  }

  .menu-item p {
    font-size: 0.85rem;
  }

  .card {
    padding: 12px;
    margin: 10px 0;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .barra-container {
    width: 100%;
    max-width: 250px;
  }

  footer {
    font-size: 0.8rem;
    padding: 10px;
    margin-top: 15px;
  }
}
