/* Общие стили сайта: шапка, подвал, главная, таблица рекордов. */

:root {
  --bg: #dfc3a0;
  --stroke: #a8690a;
  --ok: #2f6b24;
  --bad: #a3271f;
  --paper: rgb(255 255 255 / 0.28);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--stroke);
  font-family: "Segoe UI", system-ui, sans-serif;
}

a {
  color: inherit;
}

main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

h1 {
  margin: 8px 0 20px;
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  text-align: center;
}

.hint {
  margin: 0 auto 20px;
  max-width: 560px;
  text-align: center;
}

/* Шапка и подвал */

.site-header,
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 12px 16px;
  border-bottom: 3px solid var(--stroke);
}

.site-footer {
  border-bottom: 0;
  border-top: 3px solid var(--stroke);
  justify-content: space-between;
  font-size: 0.9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.site-nav {
  display: flex;
  gap: 16px;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--stroke);
}

.auth-slot {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.auth-user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--stroke);
}

.auth-note {
  font-size: 0.9rem;
  opacity: 0.8;
}

.button {
  padding: 6px 14px;
  background: none;
  color: var(--stroke);
  border: 2px solid var(--stroke);
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background: var(--paper);
}

.button:focus-visible,
.tile:focus-visible {
  outline: 3px solid var(--stroke);
  outline-offset: 2px;
}

/* Главная: плашки игр */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 560px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tile {
  aspect-ratio: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  border: 3px solid var(--stroke);
  border-radius: 20px;
  background: var(--paper);
  transition: transform 0.15s, box-shadow 0.15s;
}

a.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 0 var(--stroke);
}

.tile-art {
  width: 40%;
  max-width: 96px;
  color: var(--stroke);
}

.tile-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.tile-desc {
  font-size: 0.85rem;
  line-height: 1.3;
}

.tile-soon {
  border-style: dashed;
  background: none;
  opacity: 0.55;
  cursor: default;
}

.tile-soon .tile-title {
  font-size: 1rem;
}

/* Таблица рекордов */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

select {
  padding: 6px 10px;
  font: inherit;
  color: var(--stroke);
  background: var(--paper);
  border: 2px solid var(--stroke);
  border-radius: 10px;
}

.records {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 3px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
}

.records th,
.records td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgb(0 0 0 / 0.1);
}

.records th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.records td.num,
.records th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.records tr.me {
  background: rgb(255 255 255 / 0.45);
  font-weight: 700;
}

.records .player {
  display: flex;
  align-items: center;
  gap: 8px;
}

.records .player img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.records .empty {
  text-align: center;
  padding: 24px;
}

.error {
  font-weight: 600;
  color: var(--bad);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }

  a.tile:hover {
    transform: none;
  }
}
