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

:root {
  color-scheme: light;
  --bg: #f6ecd9;
  --panel: #fffaf0;
  --panel-2: #f1e8d3;
  --text: #23211d;
  --muted: #8a8071;
  --muted-dark: #6d6152;
  --divider: #ece0c4;
  --input-border: #e3d5b3;
  --accent: #c1442e;
  --accent-dark: #9c3423;
  --accent-2: #1f5c8a;
  --deep: #123a5e;
  --rosa: #c1467e;
  --rosa-dark: #9c3564;
  --ok: #4c8c4a;
  --danger: #b3261e;
}

* {
  box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    top: env(safe-area-inset-top, 0);
    height: 100vh;
}

body {
    font-family: "Nunito", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Baloo 2", "Segoe UI", sans-serif;
  font-weight: 700;
}

a {
  color: inherit;
}

/* ---------- App --------------------- */
#app {
    position: absolute;
    display: flex;
    flex-direction: column;
    top: env(safe-area-inset-top, 0);
    left: env(safe-area-inset-left, 0px);
    right: env(safe-area-inset-right, 0px);
    height: calc(100dvh - env(safe-area-inset-top, 0));
}

/* ---------- Top navigation ---------- */

.topnav {
  flex-shrink: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.4rem;
  padding: 0 1.25rem;
  background: rgba(18, 58, 94, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

/* ---------- Scrollable content area ---------- */

.page-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.02em;
  color: #fff;
  flex-shrink: 0;
}

.topnav-logo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.topnav-links {
  display: flex;
  align-items: stretch;
}

.topnav-scroll {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.topnav-scroll::-webkit-scrollbar {
  display: none;
}

.topnav-links a,
.topnav-trigger {
  display: flex;
  align-items: center;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0 0.75rem;
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.topnav-links a:hover,
.topnav-trigger:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.1);
}

.topnav-links a.active,
.topnav-trigger.active {
  color: #fff;
  background: rgba(0, 0, 0, 0.2);
}

/* ---------- Hero ---------- */

.hero {
  padding: 3rem 1.25rem 2rem;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--divider);
  box-shadow: 0 3px 10px rgba(30, 40, 20, 0.06);
  border-radius: 20px;
  padding: 2.25rem;
}

.hero-visual,
.hero-copy {
  min-width: 0;
}

.hero-visual {
  display: grid;
  gap: 0.9rem;
}

.hero-logo-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 1.4rem;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--divider);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.mascot {
  width: min(100%, 360px);
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(35, 33, 29, 0.16));
}

.hero-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.hero-copy h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-top: 0.35rem;
  max-width: 15ch;
  line-height: 1.05;
}

.brand-kicker {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin: 0;
}

.brand-copy {
  color: var(--muted);
  margin-top: 0.85rem;
  max-width: 58ch;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0.7rem 1.1rem;
  font-weight: 800;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 0 var(--accent-dark);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.hero-cta:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--accent-dark);
}

.hero-cta.secondary {
  background: var(--muted);
  color: #fff;
  box-shadow: 0 4px 0 var(--muted-dark);
}

.hero-cta.secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--muted-dark);
}

/* ---------- Main / sections ---------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.section {
  margin-top: 1.5rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.2rem;
}

.section-heading h2 {
  font-size: 1.4rem;
}

.section-heading p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Game catalog ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.1rem;
}

.game-card {
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 10px rgba(30, 40, 20, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(193, 68, 46, 0.4);
}

.game-card.muted:hover {
  transform: none;
  border-color: var(--divider);
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.game-emoji {
  font-size: 1.6rem;
}

.game-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}

.game-card p {
  color: var(--muted);
  margin-top: 0.55rem;
  flex-grow: 1;
  line-height: 1.45;
  font-size: 0.92rem;
}

.game-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tile-action {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  background: var(--accent);
  box-shadow: 0 3px 0 var(--accent-dark);
  padding: 0.6rem 0.8rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.tile-action:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-dark);
}

.tile-action.ghost {
  background: var(--muted);
  color: #fff;
  box-shadow: 0 3px 0 var(--muted-dark);
}

.tile-action.ghost:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--muted-dark);
}

.tile-action.muted {
  background: rgba(35, 33, 29, 0.08);
  color: rgba(35, 33, 29, 0.4);
  box-shadow: none;
  cursor: not-allowed;
  flex-basis: 100%;
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  width: fit-content;
  line-height: 1;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}

.live {
  background: #e5f1e1;
  color: var(--ok);
}

.beta {
  background: rgba(31, 92, 138, 0.14);
  color: var(--accent-2);
}

.soon {
  background: rgba(193, 70, 126, 0.16);
  color: var(--rosa-dark);
}

/* ---------- Pontuações page ---------- */

.page-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 0.5rem;
}

.page-header h1 {
  font-size: 1.9rem;
}

.page-header p {
  color: var(--muted);
  margin-top: 0.5rem;
  max-width: 65ch;
}

.scores-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  gap: 1.25rem;
}

.game-panel {
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 3px 10px rgba(30, 40, 20, 0.06);
  scroll-margin-top: 1rem;
}

.game-panel.highlight {
  border-color: rgba(193, 68, 46, 0.5);
  box-shadow: 0 0 0 1px rgba(193, 68, 46, 0.25);
}

.game-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.game-panel-head h2 {
  font-size: 1.15rem;
}

.refresh-btn {
  display: inline-block;
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.refresh-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--divider);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

td {
    font-size: 0.85rem;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 1.2rem 0.5rem;
}

/* ---------- Footer ---------- */

.site-footer {
  flex-shrink: 0;
  z-index: 10;
  padding: 0.55rem 1.25rem;
  background: rgba(18, 58, 94, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.4rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .mascot {
    width: min(100%, 300px);
  }

  .topnav {
    gap: 0.6rem;
  }
}

@media (max-width: 480px) {
  .topnav {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    gap: 0.4rem;
  }

  .topnav-title {
    display: none;
  }

  .topnav-links a,
  .topnav-trigger {
    font-size: 0.85rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
}

/* ---------- Menu "Conta" (dropdown) na topnav ---------- */

.topnav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
}

.topnav-trigger {
  list-style: none;
}

.topnav-trigger::-webkit-details-marker {
  display: none;
}

.topnav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(18, 30, 45, 0.22);
  min-width: 170px;
  overflow: hidden;
  z-index: 500;
}

.topnav-dropdown-menu a,
.topnav-dropdown-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  background: none;
  border: 0;
  cursor: pointer;
}

.topnav-dropdown-menu a:hover,
.topnav-dropdown-menu button:hover {
  background: var(--panel-2);
  color: var(--accent);
}

.topnav-dropdown-menu hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 0;
}

/* ---------- Páginas de conta (login/registo/gestão - /Account/*) ---------- */
/* Estas classes cobrem o vocabulário Bootstrap-like usado pelas páginas
   Identity geradas pelo template do ASP.NET Core, para não terem de ser
   reescritas uma a uma - qualquer página nova dentro de .account-shell
   herda automaticamente o mesmo visual do resto do site. */

.account-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  width: 100%;
}

.account-shell h1 {
  font-size: 1.9rem;
  margin-bottom: 1rem;
}

.account-shell h2 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}

.account-shell h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.account-shell h4 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--muted);
}

.account-shell p {
  margin-bottom: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
}

.account-shell hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 1.25rem 0;
}

.account-shell a {
  color: var(--accent);
  text-decoration: none;
}

.account-shell a:hover {
  text-decoration: underline;
}

.account-shell ul {
  margin: 0.3rem 0 0.75rem 1.1rem;
  padding: 0;
  color: var(--muted);
}

.account-shell strong {
  color: var(--text);
}

/* grid (row/col-*) */

.account-shell .row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 0;
}

.account-shell [class*="col-"] {
  flex: 1 1 280px;
  min-width: 0;
}

.account-shell .col-lg-3 {
  flex: 0 1 220px;
}

.account-shell .col-lg-9 {
  flex: 2 1 380px;
}

/* forms */

.account-shell .form-floating {
  position: relative;
  margin-bottom: 1rem;
}

.account-shell .form-control {
  width: 100%;
  background: var(--panel);
  border: 2px solid var(--input-border);
  border-radius: 10px;
  color: var(--text);
  padding: 1rem 0.85rem 0.4rem;
  font-size: 0.95rem;
  font-family: inherit;
}

.account-shell .form-floating > .form-control::placeholder {
  color: transparent;
  text-align: left;
}

.account-shell .form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193, 68, 46, 0.15);
}

.account-shell .form-control:disabled {
  opacity: 0.6;
}

.account-shell .form-floating > label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.85rem 0.85rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
  transition: transform 0.15s ease, color 0.15s ease;
  transform-origin: 0 0;
}

.account-shell .form-floating > .form-control:focus ~ label,
.account-shell .form-floating > .form-control:not(:placeholder-shown) ~ label {
  transform: translateY(-0.45rem) scale(0.82);
  color: var(--accent);
}

.account-shell .form-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.account-shell .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin-right: 0.5rem;
  accent-color: var(--accent);
  vertical-align: middle;
}

/* buttons */

.account-shell .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--muted);
  color: #fff;
  border: 0;
  box-shadow: 0 4px 0 var(--muted-dark);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.account-shell .btn:hover {
  color: #fff;
}

.account-shell .btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--muted-dark);
}

.account-shell .btn-primary {
  background: var(--accent);
  color: #fff;
  border: 0;
  box-shadow: 0 4px 0 var(--accent-dark);
}

.account-shell .btn-primary:hover {
  color: #fff;
}

.account-shell .btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--accent-dark);
}

.account-shell .btn-danger {
  background: rgba(179, 38, 30, 0.1);
  color: var(--danger);
  border: 1px solid rgba(179, 38, 30, 0.35);
}

.account-shell .btn-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.account-shell .btn-link {
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--accent);
  text-decoration: underline;
  padding: 0.4rem;
}

.account-shell .btn-link:hover {
  color: var(--accent-dark);
}

.account-shell .btn-link:active {
  transform: none;
  box-shadow: none;
}

.account-shell .btn-lg {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
}

.account-shell .w-100 {
  width: 100%;
}

/* alerts */

.account-shell .alert {
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.account-shell .alert-danger {
  background: rgba(179, 38, 30, 0.1);
  color: var(--danger);
  border: 1px solid rgba(179, 38, 30, 0.3);
}

.account-shell .alert-success {
  background: #e5f1e1;
  color: var(--ok);
  border: 1px solid rgba(76, 140, 74, 0.3);
}

.account-shell .alert-warning {
  background: rgba(193, 70, 126, 0.14);
  color: var(--rosa-dark);
  border: 1px solid rgba(193, 70, 126, 0.3);
}

.account-shell .alert-info {
  background: rgba(31, 92, 138, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(31, 92, 138, 0.3);
}

.account-shell .text-danger {
  color: var(--danger);
  font-size: 0.85rem;
}

.account-shell .text-secondary {
  color: var(--muted);
}

.account-shell .text-success {
  color: var(--ok);
}

.account-shell .text-info {
  color: var(--accent-2);
}

/* barra lateral de navegação (Gerir conta) */

.account-shell .nav-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.account-shell .nav-pills .nav-link {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.account-shell .nav-pills .nav-link:hover {
  color: var(--text);
  background: var(--panel-2);
  text-decoration: none;
}

.account-shell .nav-pills .nav-link.active {
  color: #fff;
  background: var(--accent);
}

/* tabelas (logins externos, etc.) */

.account-shell table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.account-shell th,
.account-shell td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--divider);
  text-align: left;
}

/* utilitários usados pelas páginas Identity geradas */

.account-shell .d-flex {
  display: flex;
}

.account-shell .flex-column {
  flex-direction: column;
}

.account-shell .mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.account-shell .mt-2 {
  margin-top: 0.5rem;
}

.account-shell .mb-3 {
  margin-bottom: 1rem;
}

.account-shell .h-100 {
  height: 100%;
}

.account-shell code.recovery-code {
  display: inline-block;
  background: var(--panel-2);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.account-shell .input-group {
  display: flex;
  align-items: stretch;
}

.account-shell .input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.account-shell .input-group-append {
  display: flex;
}

.account-shell .input-group-text {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: var(--panel-2);
  border: 2px solid var(--input-border);
  border-left: 0;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.account-shell .font-weight-bold {
  font-weight: 700;
}

.account-shell .glyphicon-warning-sign::before {
  content: "⚠️";
  margin-right: 0.4rem;
}

@media (max-width: 640px) {
  .account-shell .row {
    gap: 1rem;
  }
}
