* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: "Lato", sans-serif;
  background: #063047;
  color: #2b1b0c;
  overflow-x: hidden;
}

/* =========================
   HOME
========================= */

.home {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: url("../img/layout/sea.png") center / cover no-repeat;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 16px;
}

.home::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.04),
    rgba(0,0,0,.24)
  );
  z-index: 1;
}

/* =========================
   DECORAZIONI
========================= */

.ship {
  position: absolute;
  right: 12vw;
  top: 2vh;
  width: clamp(300px, 34vw, 560px);
  z-index: 2;
  pointer-events: none;
  animation: floatShip 10s ease-in-out infinite;
}

@keyframes floatShip {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

.map {
  position: absolute;
  right: 5vw;
  bottom: 7vh;
  width: clamp(170px, 20vw, 300px);
  z-index: 2;
  opacity: .95;
  transform: rotate(-5deg);
  pointer-events: none;
}

/* =========================
   PANNELLO CENTRALE
========================= */

.game-panel {
  position: relative;
  z-index: 5;
  width: min(90vw, 420px);
  text-align: center;
  transform: translateY(-35px);
}


.logo {
  width: min(95vw, 520px);
  margin: -60px -40px ;
}

/* =========================
   FRAME LOGIN 9-SLICE
========================= */

.login-frame {
  width: 100%;
  position: relative;
  transform: translateY(-240px);
}

.frame-top {
  height: 72px;
  background: url("../img/layout/ui-top.png") center top / 100% 100% no-repeat;
}

.frame-middle {
  background: url("../img/layout/ui-middle.png") center top / 100% auto repeat-y;
  padding: 0 44px;
}

.frame-bottom {
  height: 70px;
  background: url("../img/layout/ui-bottom.png") center bottom / 100% 100% no-repeat;
}

.login-content {
  position: relative;
  z-index: 2;
  margin-top: -20px;
  margin-bottom: -30px;
}

/* =========================
   FORM LOGIN
========================= */

.form-group {
  height: 42px;
  width: 80%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  margin-bottom: 7px;
  border: 2px solid #9c7339;
  border-radius: 6px;
  background: rgba(255,245,218,.38);
  box-shadow: inset 0 2px 5px rgba(80,45,10,.18);
}

.form-group input {
  width: 80%;
  margin: 0 auto;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: "Cinzel", serif;
  font-size: 14px;
  font-weight: 700;
  color: #2b1b0c;
}

.form-group input::placeholder {
  color: #4b3519;
}

.form-hint {
  width: 80%;
  margin: -2px auto 7px;
  font-family: "Lato", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #f8d98a;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  letter-spacing: .3px;
}

/* =========================
   ICONE
========================= */

.icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(.22);
}

/* =========================
   BOTTONE ACCEDI
========================= */

.login-btn {
  width: 100%;
  margin: 8px 0 12px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.login-btn img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: block;
  transition: transform .2s ease, filter .2s ease;
}

.login-btn:hover img {
  transform: scale(1.04);
  filter: brightness(1.12);
}

.login-btn:active img {
  transform: scale(.98);
}

/* =========================
   DIVISORE
========================= */

.divider {
  height: 1px;
  margin-bottom: 10px;
  background: linear-gradient(
    90deg,
    transparent,
    #8e642c,
    transparent
  );
  position: relative;
}

.divider::after {
  content: "✦";
  position: absolute;
  left: 50%;
  top: -11px;
  transform: translateX(-50%);
  color: #8e642c;
  background: #dfc182;
  padding: 0 8px;
}

/* =========================
   MENU LINK
========================= */

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-links a {
  height: 40px;
  width: 80%;
  margin: 0 auto;
  border: 2px solid #9c7339;
  border-radius: 6px;
  background: rgba(255,245,218,.24);
  color: #2b1b0c;
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow: inset 0 1px 4px rgba(80,45,10,.12);
  transition: background .2s ease, transform .2s ease;
}

.menu-links a:hover {
  background: rgba(255,255,255,.38);
  transform: translateX(3px);
}

.menu-links .left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-links .icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
}

.menu-links .icon img {
  width: 28px;
  height: 28px;
}

/* =========================
   ALERT (errori / ban / successi)
========================= */

.home-alert {
  position: relative;
  z-index: 6;
  width: 80%;
  margin: 0 auto 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: "Cinzel", serif;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .5px;
}

.home-alert--error {
  background: rgba(120, 0, 0, .85);
  border: 1px solid #8b0000;
  color: #ffe5e5;
}

.home-alert--success {
  background: rgba(20, 90, 30, .85);
  border: 1px solid #2e7a3a;
  color: #e6ffe6;
}

.home-alert--ban {
  background: rgba(120, 0, 0, .9);
  border: 1px solid #8b0000;
  color: #ffe5e5;
  text-align: left;
}

.home-alert--ban strong {
  display: block;
  margin-bottom: 4px;
}

/* =========================
   FOOTER
========================= */

.footer {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  z-index: 8;
  color: #f8d98a;
  font-family: "Cinzel", serif;
  font-size: 11px;
  text-align: center;
  text-shadow: 0 2px 4px #000;
  padding: 0 12px;
}

/* =========================
   SCHERMI BASSI DESKTOP
========================= */

@media (max-height: 850px) {
  .game-panel {
    width: min(88vw, 370px);
    transform: translateY(-16px);
  }

  .logo {
    width: min(88vw, 390px);
    margin-bottom: -26px;
  }

  .frame-top,
  .frame-bottom {
    height: 62px;
  }

  .frame-middle {
    padding: 0 40px;
  }

  .login-content {
    margin-top: -24px;
    margin-bottom: -26px;
  }

  .form-group {
    height: 38px;
  }

  .login-btn img {
    max-height: 120px;
  }

  .menu-links a {
    height: 36px;
    font-size: 13px;
  }

  .footer {
    display: none;
  }
}

/* =========================
   TABLET / MOBILE
========================= */

@media (max-width: 900px) {
  .home {
    height: auto;
    min-height: 100svh;
    overflow-y: auto;
    padding: 4px 10px 20px;
  }

  .ship,
  .map {
    display: none;
  }

  .game-panel {
    width: min(94vw, 380px);
    transform: translateY(0);
  }

  .logo {
    width: 108%;
    max-width: none;
    margin-left: -4%;
    margin-bottom: -22px;
  }

  .frame-top,
  .frame-bottom {
    height: 70px;
  }

  .frame-middle {
    padding: 0 30px;
  }

  .login-content {
    margin-top: -24px;
    margin-bottom: -28px;
  }
}

/* =========================
   SMARTPHONE PICCOLI
========================= */

@media (max-width: 430px) {
  .game-panel {
    width: 96vw;
  }

  .logo {
    width: 112%;
    margin-left: -6%;
    margin-bottom: -18px;
  }

  .frame-top,
  .frame-bottom {
    height: 62px;
  }

  .frame-middle {
    padding: 0 24px;
  }

  .login-content {
    margin-top: -22px;
    margin-bottom: -24px;
  }

  .form-group {
    height: 40px;
    margin-bottom: 7px;
  }

  .form-group input {
    font-size: 13px;
  }

  .icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .icon img {
    width: 28px;
    height: 28px;
  }

  .login-btn img {
    max-height: 120px;
  }

  .menu-links {
    gap: 6px;
  }

  .menu-links a {
    height: 38px;
    font-size: 12px;
    padding: 0 9px;
  }

  .menu-links .icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
  }

  .menu-links .icon img {
    width: 25px;
    height: 25px;
  }
}
