* {
  box-sizing: border-box;
}

:root {
  --accent-color: #A3C9A8;
  --accent-shadow: 0 10px 18px rgba(163, 201, 168, 0.82);
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 10px;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Yläpalkkien säiliö */
.ylapalkit {
  display: flex;
  position: relative;
  z-index: 9999;
  max-width: 100vw;
  overflow: visible;
}

.top1 {
  flex: 4;
  background-color: #8B6F4E;
  padding: 0;
  text-align: left;
  height: 210px;
}

.top1 img {
  margin-top: 5px;
  margin-left: 20px;
  width: auto;
  height: 200px;
  max-width: 333px;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.top2 {
  flex: 1;
  background-color: #8B6F4E;
  padding: 0;
  text-align: right;
  height: 210px;
  position: relative;
  z-index: 9999;
  display: flex;
  align-items: center;
}

/* Keskiosio */
.paasivu {
  background-color: #FFFFFF;
  padding: 20px;
  text-align: center;
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Alapalkki */
.alapalkki {
  background-color: #8B6F4E;
  text-align: left;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 20px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  width: 100%;
  max-width: 1200px;
  gap: 30px;
  margin-bottom: 20px;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  color: #FFFFFF;
}

.footer-section h3 {
  color: #A3C9A8;
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-section p {
  margin: 8px 0;
  line-height: 1.6;
  font-size: 15px;
}

.footer-section a {
  transition: opacity 0.3s ease;
}

.footer-section a:hover {
  opacity: 0.8;
}

.copyright {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  width: 100%;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 15px;
  margin-top: 10px;
}

.social-icons {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.social-icons a:hover {
  transform: translateY(-3px);
}

/* CTA Button */
.cta-button {
  display: inline-block;
  background: linear-gradient(135deg, #A3C9A8 0%, #8FBC8F 100%);
  color: #FFFFFF !important;
  padding: 14px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(163, 201, 168, 0.4);
  text-align: center;
  border: 2px solid transparent;
  letter-spacing: 0.5px;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(163, 201, 168, 0.6);
  background: linear-gradient(135deg, #8FBC8F 0%, #7CAD7C 100%);
}

.cta-button:active {
  transform: translateY(0);
}


/* Hamburger-kuvake */
.menu-icon {
  display: inline-block;
  cursor: pointer;
  padding: 30px;
  z-index: 9999;
  background: #A3C9A8;
  border: none;
  border-radius: 8px;
  transition: background-color 0.3s;
  margin-left: auto;
  margin-right: 30px;
  margin-top: -15px;
}

.menu-icon:hover {
  background-color: #88b894;
}

.menu-icon:active,
.menu-icon.change {
  background-color: #2e7d32;
}

.menu-icon:focus,
.menu-icon:focus-visible {
  outline: 2px solid #2e7d32;
  outline-offset: 2px;
}

.menu-icon span {
  display: block;
  width: 35px;
  height: 5px;
  border-radius: 8px;
  background-color: #333;
  margin: 8px 0;
  transition: 0.4s;
}

/* Animaatio ruksiksi */
.change .bar1 {
  transform: rotate(-45deg) translate(-6px, 6px);
}
.change .bar2 {
  opacity: 0;
}
.change .bar3 {
  transform: rotate(45deg) translate(-6px, -6px);
}

/* Dropdown-valikko */
.menu {
  display: none;
  flex-direction: column;
  background-color: #1C1C1C;
  border-radius: 10px;
  position: fixed;      /* kelluu sivun päällä, ei siirrä sisältöä */
  top: 120px;           /* etäisyys yläreunasta */
  right: 20px;          /* pieni sisennys oikeasta reunasta */
  width: 300px;
  max-height: calc(100vh - 140px); /* näkyy kokonaan pienissä näytöissä */
  overflow-y: auto;     /* rullaus valikon sisällä tarvittaessa */
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 99999;       /* pysyy muiden päällä */
  isolation: isolate;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.menu a {
  display: block;
  padding: 15px;
  margin: 5px;
  border-radius: 8px;
  background-color: #EAE7DC;
  border: 1px solid #ccc;
  text-decoration: none;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}

.menu a:hover {
  background-color: #A3C9A8;
  color: #fff;
}

/* Säiliö, joka asettaa divit vierekkäin Etusivulla*/
.container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 5px;
  text-align: left;
  flex: 1;
}

/* Yleinen tyyli kehyksille */
.box {
  padding: 50px;
  background-color: #FFFFFF;
  box-sizing: border-box;
  margin: 0;
  position: relative;
  z-index: 1;
  border: 2px solid var(--accent-color);
  box-shadow: var(--accent-shadow);
}

/* oikean puolen laatikko */
.oikea {
  background-color: #F5F5F5;
  text-align: center;
  border-radius: 20px;
  flex: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
}

.oikea img {
  width: 400px;
  height: auto;
  border-radius: 8px;
  border: none;
  outline: 2px solid var(--accent-color);
  outline-offset: -1px;
  box-shadow: var(--accent-shadow);
}

/* vasemman puolen laatikko */
.vasen {
  background-color: #F5F5F5;
  border-radius: 20px;
  flex: 1;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
}

.vasen img {
  width: 400px;
  height: auto;
  border-radius: 8px;
  border: none;
  outline: 2px solid var(--accent-color);
  outline-offset: -1px;
  box-shadow: var(--accent-shadow);
}
/* oikean puolen laatikko */
.oikea1 {
  background-color: #F5F5F5;
  text-align: left;
  border-radius: 20px;
  flex: 1;
}

.oikea1 img {
  width: 400px;
  height: auto;
  float: left;
  margin-right: 15px;
  margin-top: 15px;
  border-radius: 8px;
  border: none;
  outline: 2px solid var(--accent-color);
  outline-offset: -1px;
  box-shadow: var(--accent-shadow);
}

/* vasemman puolen laatikko */
.vasen1 {
  background-color: #F5F5F5;
  border-radius: 20px;
  flex: 2;
  text-align: left;
}

.vasen1 img {
  width: 400px;
  height: auto;
  float: left;
  margin-right: 15px;
  margin-top: 15px;
  border-radius: 8px;
  border: none;
  outline: 2px solid var(--accent-color);
  outline-offset: -1px;
  box-shadow: var(--accent-shadow);
}

/* Lomake */
form {
  max-width: 500px;
  margin: 0 auto;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
fieldset {
  border: none;
  padding: 0;
}
legend {
  font-size: 1.4em;
  margin-bottom: 10px;
  font-weight: bold;
}
label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  margin-right: 8px;
}
button {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}
button:hover {
  background-color: #1b5e20;
}

/* Yritystiedot */
.container2 {
  display: flex;
  flex-direction: column; /* pinotaan allekkain */
  align-items: center;    /* keskitetään sisältö */
  max-width: 600px;
  margin: 0 auto;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.company-image {
  width: 300px;
  height: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  border: none;
  outline: 2px solid var(--accent-color);
  outline-offset: -1px;
  box-shadow: var(--accent-shadow);
}
.company-info h1 {
  font-size: 1.8em;
  margin-bottom: 10px;
}
.company-info p {
  margin: 6px 0;
  font-size: 1em;
  color: #333;
}

/* Ilmoitukset */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 6px;
  font-size: 1rem;
}
.alert.success {
  background-color: #e6f7e6;
  border: 1px solid #4CAF50;
  color: #2e7d32;
}
.alert.error {
  background-color: #fdecea;
  border: 1px solid #f44336;
  color: #c62828;
}
.alert ul {
  margin: 0;
  padding-left: 20px;
}

/* Korostus */
.highlight {
  font-weight: bold;
}

/* H1 keskitys */
h1 {
  text-align: center;
}

/* Facebook timeline kehys */
.fb-embed {
  min-height: 700px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  box-shadow: var(--accent-shadow);
  display: block;
  overflow: hidden;
}


.slideshow {
  display: block;
  margin: 18px auto 0;
  margin-bottom: 16px;
  max-width: none;
  text-align: center;
  width: 100%;
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  box-shadow: var(--accent-shadow);
  overflow: hidden;
}

.slideshow-frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
  aspect-ratio: 4 / 3;
  min-height: 320px;
}

.slideshow-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  margin: 0;
  left: 0;
  right: 0;
  display: block;
  opacity: 0;
  z-index: 1;
  transition: opacity 1s ease, transform 1.2s ease;
  backface-visibility: hidden;
  will-change: opacity;
  transform: translateZ(0) scale(1.06); /* hieman zoomattuna ennen aktivointia */
}

.slideshow-frame img.is-active {
  opacity: 1;
  transform: translateZ(0) scale(1.00); /* zoomaa sisään aktivoinnissa */
}

.slideshow-caption {
  padding: 10px 12px;
  font-weight: 600;
  color: #1c1c1c;
  background: #EAE7DC;
  transition: opacity 1s ease;
  margin-top: 6px;
}

/* Kuvien stabiliteetti - ei shift latauksen yhteydessä */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* FAQ-osiolle (Usein kysytyt kysymykset) */
.faq {
  background-color: #ffffff;
  color: #111;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  margin-top: 18px;
}
.faq details {
  margin-bottom: 8px;
  padding: 6px 8px;
}
.faq summary {
  font-weight: 700;
  cursor: pointer;
  padding: 8px 6px;
  list-style: none;
  outline: none;
  display: block;
  border-radius: 6px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  text-align: center;
  margin-right: 8px;
  color: #2e7d32;
  font-weight: 700;
}
.faq details[open] summary::before {
  content: "–";
}
.faq details[open] summary {
  color: #2e7d32;
}
.faq summary:focus,
.faq summary:focus-visible {
  box-shadow: 0 0 0 4px rgba(163,201,168,0.25);
}
.faq details p {
  margin: 8px 0 0 1.6em;
  line-height: 1.5;
  color: #333;
}

@media (max-width: 768px) {
  .faq { padding: 12px; }
  .faq summary { font-size: 0.98rem; }
  .faq details p { margin-left: 1.2em; }
}

/* Pelisivu tyylit */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin: 30px 0;
}

.game-card {
  background: #2a2a2a;
  border: 3px solid #8B6F4E;
  border-radius: 10px;
  padding: 30px;
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(139, 111, 78, 0.4);
}

.game-card h2 {
  color: #A3C9A8;
  margin-bottom: 15px;
  font-size: 1.5em;
}

.game-card p {
  color: #CCCCCC;
  margin-bottom: 20px;
  line-height: 1.6;
}

.game-button {
  display: inline-block;
  background: #A3C9A8;
  color: #1C1C1C;
  padding: 12px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.3s;
  box-shadow: 0 4px 0 #8B6F4E;
}

.game-button:hover {
  background: #8BB68F;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #8B6F4E;
}

.game-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #8B6F4E;
}

/* Takaisin ylös -nappi */
#backToTop {
  position: fixed;
  bottom: 40px;
  right: 15px;
  width: 50px;
  height: 50px;
  background-color: #A3C9A8;
  color: #1C1C1C;
  border: none;
  border-radius: 50%;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
}

#backToTop:hover {
  background-color: #8BB68F;
}
