:root {
  --pwl-black: #0d0d10;
  --pwl-panel: #17181c;
  --pwl-green: #6aab64;
  --pwl-gold: #d3bb5a;
  --pwl-grey: #787c7f;
  --tile-border: #d3d6da;
  --text-white: #ffffff;
  --key-bg: #d3d6da;
  --key-text: #1a1a1a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  background: var(--pwl-black);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Header / Nav ---------- */
.site-header {
  width: 100%;
  background: var(--pwl-black);
  border-bottom: 3px solid var(--pwl-green);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 10px;
}

.site-header img.banner {
  height: 46px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  gap: 24px;
  margin-top: 10px;
}

.site-nav a {
  color: var(--text-white);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 1px;
  padding: 6px 14px;
  border: 2px solid transparent;
  border-radius: 4px;
  text-transform: uppercase;
}

.site-nav a.active {
  border-color: var(--pwl-green);
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Game layout ---------- */
main.game-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
  padding: 18px 12px 30px;
  flex: 1;
}

.puzzle-meta {
  text-align: center;
  margin-bottom: 14px;
  color: #c7c7c7;
  font-size: 13px;
  letter-spacing: 0.5px;
  font-family: Arial, sans-serif;
}

#board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  margin: 0 auto 22px;
}

.row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.tile {
  width: 58px;
  height: 58px;
  background: #ffffff;
  border: 2px solid var(--tile-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #1a1a1a;
  text-transform: uppercase;
  user-select: none;
  transition: transform 0.15s ease;
}

.tile.filled {
  border-color: #878a8c;
  animation: pop 0.1s ease;
}

@keyframes pop {
  0% { transform: scale(0.9); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.tile.flip {
  animation: flip 0.55s ease forwards;
}

@keyframes flip {
  0% { transform: rotateX(0deg); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

.tile.correct {
  background: var(--pwl-green);
  border-color: var(--pwl-green);
  color: var(--text-white);
}

.tile.present {
  background: var(--pwl-gold);
  border-color: var(--pwl-gold);
  color: var(--text-white);
}

.tile.absent {
  background: var(--pwl-grey);
  border-color: var(--pwl-grey);
  color: var(--text-white);
}

/* ---------- Keyboard ---------- */
#keyboard {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.kb-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  width: 100%;
}

.key {
  background: var(--key-bg);
  color: var(--key-text);
  border: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  height: 46px;
  min-width: 32px;
  flex: 1;
  max-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.15s ease;
}

.key:hover {
  filter: brightness(1.1);
}

.key.wide {
  max-width: 66px;
  font-size: 11px;
}

.key.correct {
  background: var(--pwl-green);
  color: var(--text-white);
}

.key.present {
  background: var(--pwl-gold);
  color: var(--text-white);
}

.key.absent {
  background: var(--pwl-grey);
  color: var(--text-white);
}

/* ---------- Toast / messages ---------- */
#toast {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #1a1a1a;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
  text-align: center;
}

#toast.show {
  opacity: 1;
}

.result-banner {
  margin-top: 6px;
  margin-bottom: 16px;
  text-align: center;
  font-family: Arial, sans-serif;
  color: #c7c7c7;
  font-size: 14px;
}

.result-banner.win {
  color: var(--pwl-green);
  font-weight: bold;
}

.result-banner.lose {
  color: var(--pwl-gold);
  font-weight: bold;
}

footer.site-footer {
  width: 100%;
  text-align: center;
  padding: 16px 0;
  font-size: 11px;
  letter-spacing: 1px;
  color: #8a8a8a;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

footer.site-footer img {
  height: 24px;
}

/* ---------- Standings page ---------- */
main.standings-main {
  width: 100%;
  max-width: 700px;
  padding: 10px 14px 40px;
}

.standings-title {
  font-size: 34px;
  margin: 10px 0 4px;
  letter-spacing: 1px;
}

.standings-title span {
  font-size: 18px;
  color: #c7c7c7;
  font-weight: 400;
  letter-spacing: 0;
}

.standings-header-row {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: #c7c7c7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.standings-header-row .col-rank { width: 46px; }
.standings-header-row .col-team { flex: 1; }
.standings-header-row .col-pts { width: 90px; text-align: center; }
.standings-header-row .col-months { width: 70px; text-align: center; }

.standings-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.standing-row {
  display: flex;
  align-items: center;
  min-height: 78px;
  border-radius: 2px;
  overflow: hidden;
}

.standing-row .col-rank {
  width: 46px;
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  color: var(--text-white);
}

.standing-row .col-team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 78px;
  background: #0d0d10;
  padding-left: 8px;
}

.standing-row.team-black .col-team { background: #000000; }
.standing-row.team-blue .col-team { background: #0160ae; }
.standing-row.team-lightblue .col-team { background: #5f8dd0; }
.standing-row.team-red .col-team { background: #9b2230; }

.standing-row .logo {
  width: 66px;
  height: 66px;
  object-fit: contain;
  flex-shrink: 0;
}

.standing-row .headshot {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.standing-row .name {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--text-white);
}

.standing-row .col-pts {
  width: 90px;
  height: 78px;
  background: #e20502;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: var(--text-white);
}

.standing-row .col-months {
  width: 70px;
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  color: var(--text-white);
}

@media (max-width: 480px) {
  .tile { width: 52px; height: 52px; font-size: 24px; }
  .standing-row .name { font-size: 16px; }
  .standing-row .col-pts { font-size: 22px; width: 66px; }
  .standing-row .logo, .standing-row .headshot { width: 50px; height: 50px; }
  .standing-row .col-team { height: 62px; }
  .standing-row .col-pts { height: 62px; }
}
