@import url("https://fonts.googleapis.com/css2?family=Saira:wght@400;500;600;700;800&display=swap");

:root {
  --fc-navy-1: #29497e;
  --fc-navy-2: #152e58;
  --fc-navy-3: #061121;
  --fc-ice-blue: #cee0f3;
  --fc-warm-grey: #5c4e57;
  --fc-rose-gold: #b8857b;
  --fc-coral: #de876f;
  --fc-sand: #f5dec8;
  --fc-lime: #bafc4f;
  --fc-green: #5f9424;
  --fc-green-dark: #294b0d;
  --fc-font: "Saira", sans-serif;
  --fc-menu-button-width: 220px;
  --fc-menu-button-gap: 1.60rem;
}

.login-page {
  width: 100%;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 2.5vw, 2rem);
  background:
    radial-gradient(circle at top left, rgba(206, 224, 243, 0.8), transparent 34%),
    radial-gradient(circle at bottom right, rgba(245, 222, 200, 0.72), transparent 38%),
    linear-gradient(135deg, var(--fc-ice-blue) 0%, var(--fc-sand) 100%);
}

.login-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(320px, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.login-brand img {
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 32px;
  box-shadow: 0 24px 50px rgba(0, 37, 56, 0.18);
  object-fit: cover;
}

.login-eyebrow {
  font-family: var(--fc-font);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fc-navy-1);
}

.login-brand h1 {
  font-family: var(--fc-font);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 0.98;
  color: var(--fc-navy-2);
  text-wrap: balance;
}

.login-brand p {
  font-family: var(--fc-font);
  font-size: 1rem;
  color: var(--fc-warm-grey);
}

.login-card {
  width: 100%;
  max-width: none;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 50px rgba(0, 37, 56, 0.14);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-submit {
  align-self: center;
  max-width: var(--fc-menu-button-width);
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.login-field {
  position: relative;
}

.login-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--fc-font);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--fc-navy-3);
}

.login-field input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(41, 73, 126, 0.32);
  border-radius: 14px;
  background: #ffffff;
  color: var(--fc-navy-3);
  font-family: var(--fc-font);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input:focus {
  border-color: var(--fc-navy-1);
  box-shadow: 0 0 0 4px rgba(41, 73, 126, 0.12);
}

.login-password input {
  padding-right: 3rem;
}

.login-toggle {
  position: absolute;
  right: 16px;
  top: 42px;
  cursor: pointer;
  font-size: 20px;
  user-select: none;
  line-height: 1;
}

.board-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--fc-menu-button-gap);
  width: 100%;
}

.board-row {
  display: grid;
  column-gap: var(--fc-menu-button-gap);
  row-gap: 5px;
  width: 100%;
  justify-content: center;
  justify-items: center;
}

.board-row--top {
  grid-template-columns: repeat(3, var(--fc-menu-button-width));
}

.board-row--top #btn-load {
  grid-column: 1;
}

.board-row--top #btn-new {
  grid-column: 2;
  grid-row: 1;
}

.board-row--top #btn-edit-games {
  grid-column: 3;
}

.board-row--bottom {
  grid-template-columns: repeat(2, var(--fc-menu-button-width));
}

.board-actions .custom-btn {
  max-width: var(--fc-menu-button-width);
}

.custom-btn {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  border: none;
  border-radius: 28px;
  padding: 0 1.2rem;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  color: inherit;
  font-family: var(--fc-font);
  margin: 0 auto;
  background: linear-gradient(135deg, var(--fc-navy-1) 0%, var(--fc-navy-2) 100%);
  box-shadow:
    0 8px 24px rgba(0, 37, 56, 0.08),
    0 3px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.custom-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.custom-btn:hover,
.custom-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(0, 37, 56, 0.14),
    0 5px 12px rgba(0, 0, 0, 0.05);
}

.custom-btn:hover::before,
.custom-btn:focus-visible::before {
  opacity: 1;
}

.custom-btn:active {
  transform: translateY(0);
}

.custom-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.68);
  outline-offset: 3px;
}

.btn-text {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-right: 0;
  font-family: var(--fc-font);
  font-size: clamp(0.88rem, 1.8vw, 1.05rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: #ffffff;
  user-select: none;
  pointer-events: none;
}

.btn-bg-overlay {
  display: none;
}

.wave-path,
.tab-shape {
  fill: var(--fc-ice-blue);
}

.tab-dot {
  transition: fill 0.2s ease;
}

.btn-icon-wrapper {
  display: none;
}

.btn-icon {
  width: 24px;
  height: 24px;
  transition: color 0.2s ease;
}

.btn-style-1 {
  background: linear-gradient(135deg, var(--fc-navy-1) 0%, var(--fc-navy-2) 100%);
  color: #ffffff;
}

.btn-style-1::before {
  background: linear-gradient(135deg, #375c9b 0%, #1d3f76 100%);
}

.btn-style-1:hover,
.btn-style-1:focus-visible {
  color: #ffffff;
}

.btn-style-1 .btn-icon {
  color: var(--fc-navy-3);
}

.btn-style-1 .tab-dot {
  fill: var(--fc-navy-3);
}

.btn-style-1:hover .btn-icon,
.btn-style-1:focus-visible .btn-icon {
  color: var(--fc-navy-1);
}

.btn-style-1:hover .tab-dot,
.btn-style-1:focus-visible .tab-dot {
  fill: var(--fc-navy-1);
}

.btn-style-2 {
  background: linear-gradient(135deg, #b5d5ff 0%, var(--fc-ice-blue) 100%);
  color: var(--fc-navy-3);
}

.btn-style-2::before {
  background: linear-gradient(135deg, #c7e0ff 0%, #e0ecf7 100%);
}

.btn-style-2:hover,
.btn-style-2:focus-visible {
  color: var(--fc-navy-3);
}

.btn-style-2 .btn-text {
  color: var(--fc-navy-3);
}

.btn-style-2 .btn-icon {
  color: var(--fc-warm-grey);
}

.btn-style-2 .tab-dot {
  fill: var(--fc-warm-grey);
}

.btn-style-2:hover .btn-icon,
.btn-style-2:focus-visible .btn-icon {
  color: var(--fc-rose-gold);
}

.btn-style-2:hover .tab-dot,
.btn-style-2:focus-visible .tab-dot {
  fill: var(--fc-rose-gold);
}

.btn-style-3 {
  background: linear-gradient(135deg, var(--fc-coral) 0%, #9e4a36 100%);
  color: #ffffff;
}

.btn-style-3::before {
  background: linear-gradient(135deg, #f29c84 0%, #b75740 100%);
}

.btn-style-3:hover,
.btn-style-3:focus-visible {
  color: #ffffff;
}

.btn-style-3 .btn-icon {
  color: var(--fc-warm-grey);
}

.btn-style-3 .tab-dot {
  fill: var(--fc-warm-grey);
}

.btn-style-3:hover .btn-icon,
.btn-style-3:focus-visible .btn-icon {
  color: var(--fc-coral);
}

.btn-style-3:hover .tab-dot,
.btn-style-3:focus-visible .tab-dot {
  fill: var(--fc-coral);
}

#cancelarJuego.custom-btn.btn-style-3 {
  background: linear-gradient(135deg, var(--fc-coral) 0%, #9e4a36 100%);
}

.btn-style-4 {
  background: linear-gradient(135deg, var(--fc-lime) 0%, var(--fc-green) 100%);
  color: var(--fc-navy-3);
}

.btn-style-4::before {
  background: linear-gradient(135deg, #cdfd76 0%, #71aa2f 100%);
}

.btn-style-4:hover,
.btn-style-4:focus-visible {
  color: var(--fc-navy-3);
}

.btn-style-4 .btn-text {
  color: var(--fc-navy-3);
}

.btn-style-4 .btn-icon {
  color: var(--fc-green-dark);
}

.btn-style-4 .tab-dot {
  fill: var(--fc-green-dark);
}

.btn-style-4:hover .btn-icon,
.btn-style-4:focus-visible .btn-icon {
  color: var(--fc-green);
}

.btn-style-4:hover .tab-dot,
.btn-style-4:focus-visible .tab-dot {
  fill: var(--fc-green);
}

.btn-style-6 {
  background: linear-gradient(135deg, var(--fc-sand) 0%, #e7c3a2 100%);
  color: #5C4E57;
  min-height: 44px;
}

.btn-style-6::before {
  background: linear-gradient(135deg, #fff0df 0%, var(--fc-sand) 100%);
}

.btn-style-6:hover,
.btn-style-6:focus-visible {
  color: #5C4E57;
}

.btn-style-6 .btn-text {
  color: #5C4E57;
}

.btn-style-6 .btn-icon {
  color: #d79b22;
}

.btn-style-6 .tab-dot {
  fill: #d79b22;
}

.btn-style-6:hover .btn-icon,
.btn-style-6:focus-visible .btn-icon {
  color: #c18417;
}

.btn-style-6:hover .tab-dot,
.btn-style-6:focus-visible .tab-dot {
  fill: #c18417;
}

.admin-config-actions {
  justify-content: center;
  width: 100%;
}

.admin-config-actions .admin-menu-btn {
  max-width: 260px;
}

.admin-config-actions .admin-menu-btn .btn-text {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.8rem;
  row-gap: 5px;
  width: 100%;
  margin-top: 20px;
}

.modal-actions .modal-menu-btn {
  max-width: var(--fc-menu-button-width);
}

.modal-actions .modal-menu-btn .btn-text {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.actions-top .custom-btn,
.button-container .custom-btn,
.modal-actions .custom-btn,
.timer-actions .custom-btn {
  margin-top: 2.5px;
  margin-bottom: 2.5px;
}

#modalAlert {
  padding: 1rem;
}

#modalAlert .modal-card {
  width: min(460px, calc(100vw - 2rem));
  min-height: 190px;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
  text-align: center;
}

#modalAlert .modal-message {
  max-width: 100%;
  font-size: clamp(1rem, 2.8vw, 1.18rem);
  font-weight: 700;
  line-height: 1.45;
  text-wrap: balance;
}

#modalAlert .modal-actions {
  margin-top: 0;
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

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

  .login-brand img {
    max-width: 280px;
  }

  .board-row--top,
  .board-row--bottom {
    max-width: none;
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .board-row--top #btn-load,
  .board-row--top #btn-new,
  .board-row--top #btn-edit-games {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .login-page {
    padding: 0.75rem;
  }

  .login-card {
    border-radius: 28px;
  }

  .custom-btn {
    min-height: 40px;
    border-radius: 24px;
    padding-left: 1.1rem;
    padding-right: 0.75rem;
  }

  .btn-text {
    padding-right: 0;
    font-size: 0.84rem;
  }

  .btn-icon-wrapper {
    width: 2.24rem;
  }

  .btn-icon {
    width: 20px;
    height: 20px;
  }

  .btn-bg-overlay {
    width: 2.69rem;
  }

  .login-toggle {
    top: 41px;
  }
}

@media (hover: none) {
  .custom-btn:hover,
  .custom-btn:focus-visible {
    transform: none;
  }

  .custom-btn:hover::before,
  .custom-btn:focus-visible::before {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .custom-btn,
  .custom-btn::before,
  .btn-icon,
  .tab-dot,
  .login-field input {
    transition: none;
  }
}
