/* Base Styles */
html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: 'Arial', sans-serif;
  font-weight: bold;
  background: 
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://cdn-assets-eu.frontify.com/s3/frontify-enterprise-files-eu/eyJwYXRoIjoic3VwZXJjZWxsXC9maWxlXC9yaXA0eXllVU1ENkN2Rno5c0JIZi5wbmcifQ:supercell:ZZZSWG4DvRZNpo3DqiaO3J6EpqUwit2X33PPuqUDCjw?width=2400') no-repeat center center fixed;
  background-size: cover;
  color: #fff;
  text-align: center;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  background-attachment: fixed;
  overflow-y: auto;
}

/* Header Styles */
header {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px 0;
  margin-bottom: 20px;
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

#logo {
  width: 140px;
  height: auto;
  margin-bottom: 10px;
}

#title-gif {
  width: 90px;
  height: 90px;
  margin: 15px auto;
  display: block;
  background-color: rgba(0,0,0,0.3);
  border-radius: 50%;
  padding: 5px;
}

h1 {
  font-family: 'Lilita One', sans-serif;
  font-size: 2.1rem;
  margin: 0;
  padding: 0 10px;
  text-shadow: 3px 3px 0px #000;
  letter-spacing: 1px;
}

/* Main Content */
main {
  max-width: 800px;
  margin: 20px auto;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 25px;
  border-radius: 12px;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

/* Form Elements */
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin: 15px 0;
}

/* Number of Brawlers row */
.row:nth-child(2) {
  justify-content: center;
}

.row:nth-child(2) label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Gear rows */
.row:nth-child(3),
.row:nth-child(4),
.row:nth-child(5) {
  gap: 10px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Level selection row */
#calc-form > .row:first-child {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
}

#calc-form > .row:first-child label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 160px;
  text-align: center;
}

select {
  padding: 6px;
  font-size: 1.1rem;
  width: 120px;
  text-align: center;
  background-color: rgba(255,255,255,0.9);
  border: 1px solid #444;
  border-radius: 4px;
}

input[type="number"] {
  padding: 6px;
  font-size: 1.1rem;
  width: 60px;
  text-align: center;
  background-color: rgba(255,255,255,0.9);
  border: 1px solid #444;
  border-radius: 4px;
}

.icon {
  width: 26px;
  height: 26px;
  vertical-align: middle;
  margin-left: 5px;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.7));
}

/* Buttons */
button {
  padding: 10px 20px;
  font-size: 1.1rem;
  margin: 10px;
  cursor: pointer;
  background-color: #ffd700;
  color: #222;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  transition: all 0.3s;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255,215,0,0.7);
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.preset-button {
  margin-top: 10px;
  text-align: center;
}

.preset-button button {
  padding: 8px 16px;
  background-color: #ffc107;
}

.preset-button button:hover {
  background-color: #ff9800;
}

/* Results Section */
#results {
  margin-top: 25px;
  font-size: 1.4rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Footer */
footer {
  margin-top: 40px;
  padding: 20px;
  font-size: 0.9rem;
  background-color: rgba(0, 0, 0, 0.7);
  position: relative;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}

a {
  color: #ffdd57;
  text-decoration: none;
  transition: all 0.3s;
}

a:hover {
  text-decoration: underline;
  color: #ffcc00;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }
  
  header, main, footer {
    background-color: rgba(0, 0, 0, 0.75);
    margin: 0;
    border-radius: 0;
  }
  
  #logo {
    width: 110px;
  }
  
  #title-gif {
    width: 70px;
    height: 70px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  main {
    padding: 20px 15px;
  }
  
  .row label {
    flex: 1 1 calc(50% - 10px);
    min-width: 160px;
    font-size: 1.1rem;
  }
  
  .icon {
    width: 24px;
    height: 24px;
  }
  
  button {
    padding: 8px 16px;
    font-size: 1rem;
  }
  
  #results {
    font-size: 1.2rem;
  }
}

/* Small Mobile Devices */
@media (max-width: 400px) {
  .row label {
    min-width: 120px;
    font-size: 1rem;
  }
  
  input[type="number"], select {
    width: 50px;
    font-size: 1rem;
  }
  
  /* Stack level selects vertically on very small screens */
  #calc-form > .row:first-child {
    flex-direction: column;
    gap: 15px;
  }
  
  #calc-form > .row:first-child label {
    width: 100%;
    justify-content: center;
  }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
  body {
    position: absolute;
    height: 100%;
    width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background-attachment: scroll;
  }
}
