/* ============================================================
   valdr.com.au — retro navy/teal auth + dashboard UI
   ============================================================ */

:root {
  --teal: #008080;
  --navy: #000080;
  --gray: #c3c3c3;
  --border: #444444;
  --text: #1a1a1a;
  --muted: #555555;
  --blue-link: #2222aa;
  --white: #ffffff;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --tile-width: 220px;
  --tile-gap: 24px;
  --wide-width: calc(var(--tile-width) * 3 + var(--tile-gap) * 2); /* 708px */
  --narrow-width: 420px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  background: var(--teal);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  width: 100%;
}

/* ---------- Generic "window" chrome ---------- */
.win {
  background: var(--gray);
  border: 1px solid var(--border);
}

.win-titlebar {
  background: var(--navy);
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  padding: 10px 16px;
  letter-spacing: 0.1px;
}

/* ============================================================
   AUTH WINDOW — narrow (email / code) vs wide (profile / dashboard)
   ============================================================ */

#mainWindow.narrow {
  width: var(--narrow-width);
  max-width: 100%;
}

#mainWindow.wide {
  width: var(--wide-width);
  max-width: 100%;
}

.step-narrow {
  padding: 56px 56px 40px 56px;
}

.step-wide {
  padding: 40px 48px 36px 48px;
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  outline: none;
}

.field-input:focus {
  box-shadow: 0 0 0 1px var(--navy);
}

.field-input:disabled {
  background: #e6e6e6;
  color: var(--muted);
}

.step-copy {
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  margin: 0 0 20px 0;
  color: var(--text);
}

.step-copy.left {
  text-align: left;
}

.field-msg {
  min-height: 16px;
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0 0;
}

.field-msg.error {
  color: #a01818;
}

.field-msg.success {
  color: #1a6b1a;
}

.step-actions {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.step-actions.left {
  justify-content: flex-start;
  margin-top: 20px;
}

.btn {
  background: var(--gray);
  border: 1px solid var(--border);
  padding: 14px 36px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}

.btn:hover {
  background: #b3b3b3;
}

.btn:active {
  background: #a3a3a3;
}

.btn.small {
  padding: 7px 16px;
  font-size: 13px;
}

/* ---------- Profile setup (new user) ---------- */
.profile-setup-grid {
  display: flex;
  gap: 24px;
  margin-bottom: 8px;
}

.avatar-upload {
  width: 100px;
  height: 100px;
  flex: none;
  background: var(--white);
  border: 2px solid var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.avatar-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-plus {
  font-size: 30px;
  color: var(--navy);
  line-height: 1;
}

.avatar-upload:focus {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.profile-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.profile-fields .field-label:not(:first-child) {
  margin-top: 14px;
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 28px;
}

.tab {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  color: var(--blue-link);
  cursor: pointer;
}

.tab:hover {
  text-decoration: underline;
}

.tab.active {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  cursor: default;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.dash-profile-row {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.dash-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 150px;
}

.avatar-box {
  width: 72px;
  height: 72px;
  border: 2px solid var(--navy);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 4px;
}

.avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-glyph {
  font-size: 32px;
  line-height: 1;
}

.dash-name {
  font-weight: 700;
  font-size: 15px;
}

.dash-email {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ---------- Group boxes (Stats / Badges) ---------- */
.groupbox {
  position: relative;
  flex: 1;
  min-width: 160px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.groupbox-legend {
  position: absolute;
  top: -11px;
  left: 0;
  background: var(--gray);
  padding-right: 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--blue-link);
}

.groupbox-full {
  max-width: 320px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  padding: 3px 0;
}

.stat-row span:last-child {
  font-weight: 600;
}

.badge-row {
  display: flex;
  gap: 10px;
  font-size: 26px;
  margin: 4px 0 14px 0;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 34px;
  margin-top: 4px;
}

.badge-icon {
  line-height: 1;
}

/* ============================================================
   GAME TILES
   ============================================================ */

.tiles-row {
  display: flex;
  gap: var(--tile-gap);
  width: var(--wide-width);
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}

.tile {
  width: var(--tile-width);
  flex: 0 1 var(--tile-width);
}

.tile-body {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 28px;
  align-items: flex-end;
}

.tile-play {
  display: none;
}

.tiles-row:not(.locked) .tile-play {
  display: inline-block;
}

@media (max-width: 480px) {
  .step-narrow {
    padding: 40px 28px 32px 28px;
  }
  .step-wide {
    padding: 28px 20px 24px 20px;
  }
  .profile-setup-grid {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .dash-profile-row {
    flex-direction: column;
  }
  .groupbox {
    width: 100%;
  }
}
