:root {
  --auth-panel: rgba(24, 27, 39, 0.94);
  --auth-panel-soft: rgba(34, 38, 54, 0.82);
  --auth-border: rgba(255, 255, 255, 0.12);
  --auth-text-soft: #bfc6d6;
  --auth-primary: #008cff;
  --auth-danger: #df4f64;
  --auth-success: #31c889;
  --auth-warning: #f3b43f;
}

.auth-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: auto;
  padding: 10px 15px;
  border: 0;
  border-radius: 9px;
  background: #303544;
  color: #fff;
  font: 700 15px Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.auth-nav-button:hover {
  background: #41485d;
}

.auth-nav-primary {
  background: var(--auth-primary);
}

.auth-nav-primary:hover {
  background: #00b5ff;
}

.auth-user-menu {
  position: relative;
}

.auth-user-menu summary {
  list-style: none;
  padding: 10px 15px;
  border-radius: 9px;
  background: #303544;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.auth-user-menu summary::-webkit-details-marker {
  display: none;
}

.auth-user-menu-panel {
  position: absolute;
  z-index: 500;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 180px;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  background: #171a24;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.45);
}

.auth-user-menu-panel .auth-nav-button {
  width: 100%;
}

.auth-logout-button {
  background: #532d37;
}

.auth-shell {
  width: min(100%, 520px);
  margin: 50px auto;
  padding: 26px;
  border: 1px solid var(--auth-border);
  border-radius: 22px;
  background: var(--auth-panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  text-align: left;
}

.auth-shell-wide {
  width: min(100%, 980px);
}

.auth-shell h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 7vw, 48px);
  text-align: center;
}

.auth-subtitle {
  margin: 0 0 25px;
  color: var(--auth-text-soft);
  text-align: center;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field label,
.auth-section-label {
  font-size: 15px;
  font-weight: 800;
}

.auth-field,
.auth-field * {
  box-sizing: border-box;
}

.auth-field input {
  display: block;
  width: 100%;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px;
  padding: 8px 12px !important;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  outline: none;
  background: #10131c;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

.auth-field input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(0, 140, 255, 0.18);
}

.auth-field small,
.auth-help {
  color: var(--auth-text-soft);
  line-height: 1.45;
}

.auth-password-row {
  position: relative;
  height: 44px;
}

.auth-password-row input {
  padding-right: 82px !important;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: auto !important;
  min-width: 0;
  max-width: calc(100% - 14px);
  height: 32px;
  margin: 0 !important;
  padding: 5px 10px !important;
  transform: translateY(-50%);
  border-radius: 7px;
  background: #303544;
  font-size: 13px;
  line-height: 1;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-status {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #222634;
  line-height: 1.45;
  text-align: left;
}

.auth-status[hidden] {
  display: none;
}

.auth-status[data-type="error"] {
  border: 1px solid rgba(223, 79, 100, 0.5);
  background: rgba(223, 79, 100, 0.14);
}

.auth-status[data-type="success"] {
  border: 1px solid rgba(49, 200, 137, 0.5);
  background: rgba(49, 200, 137, 0.14);
}

.auth-status[data-type="warning"] {
  border: 1px solid rgba(243, 180, 63, 0.5);
  background: rgba(243, 180, 63, 0.13);
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--auth-text-soft);
  text-align: center;
}

.auth-switch a {
  color: #65c7ff;
}

.auth-privacy-note {
  margin-top: 20px;
  padding: 13px;
  border-radius: 10px;
  background: rgba(0, 140, 255, 0.1);
  color: var(--auth-text-soft);
  line-height: 1.5;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid var(--auth-border);
  border-radius: 17px;
  background: var(--auth-panel-soft);
}

.profile-initial {
  display: grid;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(145deg, #008cff, #7b55ff);
  font-size: 43px;
  font-weight: 900;
}

.profile-header h1 {
  margin: 0 0 6px;
  text-align: left;
}

.profile-header p {
  margin: 0;
  color: var(--auth-text-soft);
}

.auth-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 28px;
}

.auth-stat-card {
  padding: 17px;
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  background: var(--auth-panel-soft);
  text-align: center;
}

.auth-stat-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 25px;
}

.auth-stat-card span {
  color: var(--auth-text-soft);
  font-size: 14px;
}

.auth-section {
  margin-top: 23px;
  padding: 20px;
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  background: var(--auth-panel-soft);
}

.auth-section h2 {
  margin: 0 0 15px;
}

.auth-game-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.auth-game-stat {
  padding: 15px;
  border-radius: 12px;
  background: #11151f;
}

.auth-game-stat h3,
.auth-game-stat p {
  margin: 0 0 8px;
}

.auth-empty-state {
  color: var(--auth-text-soft);
}

.auth-achievement-placeholder {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  color: var(--auth-text-soft);
  text-align: center;
}

.settings-grid {
  display: grid;
  gap: 16px;
}

.auth-check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 12px 0;
  text-align: left;
}

.auth-check-row input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.auth-check-row span {
  color: var(--auth-text-soft);
  line-height: 1.45;
}

.auth-danger-zone {
  border-color: rgba(223, 79, 100, 0.35);
}

.auth-danger-button {
  background: var(--auth-danger);
}

.auth-secondary-button {
  background: #303544;
}

.auth-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-action-row button,
.auth-action-row a {
  width: auto;
  margin: 0;
}

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

  .navbar {
    position: relative;
    top: 0;
  }

  .nav-buttons {
    justify-content: center;
  }

  .auth-nav {
    width: 100%;
    justify-content: center;
  }

  .auth-user-menu-panel {
    right: 50%;
    transform: translateX(50%);
  }
}

@media (max-width: 560px) {
  .auth-shell {
    margin: 20px auto;
    padding: 18px;
  }

  .profile-header {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .profile-header h1 {
    text-align: center;
  }

  .auth-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-nav-button {
    flex: 1 1 auto;
  }

  .auth-action-row {
    display: grid;
  }

  .auth-action-row button,
  .auth-action-row a {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .auth-field input,
  .auth-password-row {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px;
  }

  .auth-password-toggle {
    height: 30px;
    padding: 4px 9px !important;
  }

  .auth-form {
    gap: 12px;
  }
}

.auth-achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.auth-achievement-card {
  padding: 15px;
  border: 1px solid rgba(243, 180, 63, 0.26);
  border-radius: 12px;
  background: rgba(243, 180, 63, 0.08);
}

.auth-achievement-card h3,
.auth-achievement-card p {
  margin: 0 0 7px;
}

.auth-achievement-card p {
  color: var(--auth-text-soft);
}

/* ------------------------------------------------------------
   Oprava zarovnání nových účetních stránek a mobilního menu
   ------------------------------------------------------------ */

.auth-shell,
.profile-header,
.auth-stat-card,
.auth-section,
.auth-user-menu-panel {
  box-sizing: border-box;
}

.auth-shell {
  max-width: 100%;
}

.auth-user-menu summary {
  box-sizing: border-box;
  text-align: center;
}

.auth-user-menu-panel .auth-nav-button,
.auth-user-menu-panel .auth-logout-button {
  box-sizing: border-box;
  min-height: 42px;
  margin: 0 !important;
  padding: 10px 14px !important;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
}

@media (max-width: 800px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .navbar {
    width: 100%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-shell,
  .auth-shell-wide {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-nav {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  /*
    Na mobilu se dropdown nerozbalí přes obsah stránky.
    Zůstane uvnitř navbaru a zvětší jeho výšku.
  */
  .auth-user-menu {
    display: grid;
    width: 100%;
    min-width: 0;
    justify-items: center;
  }

  .auth-user-menu summary {
    width: min(180px, 100%);
    min-height: 44px;
    padding: 11px 16px;
  }

  .auth-user-menu-panel {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    width: min(260px, 100%);
    min-width: 0;
    margin: 9px auto 0;
    padding: 9px;
    transform: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
  }

  .auth-user-menu-panel .auth-nav-button,
  .auth-user-menu-panel .auth-logout-button {
    display: flex;
    width: 100% !important;
    min-width: 0;
    flex: none;
  }
}

@media (max-width: 560px) {
  .auth-shell,
  .auth-shell-wide {
    width: 100%;
    margin: 18px auto 28px;
    padding: 17px;
  }

  .auth-section {
    width: 100%;
    padding: 17px;
  }

  .profile-header {
    width: 100%;
  }

  .auth-nav-button {
    min-width: 0;
  }

  .auth-user-menu-panel {
    width: min(240px, 100%);
  }
}


/* Veřejné profily a report dialog */
.profile-role-badge {
  display: inline-flex;
  width: fit-content;
  margin: 9px 0 0 !important;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(123, 85, 255, 0.18);
  color: #cfc2ff !important;
  font-size: 13px;
  font-weight: 800;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}

.profile-actions .auth-nav-button,
.profile-actions button {
  width: auto;
  margin: 0;
}

.auth-dialog {
  width: min(92vw, 520px);
  padding: 0;
  border: 1px solid var(--auth-border);
  border-radius: 18px;
  background: #171a24;
  color: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

.auth-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
}

.auth-dialog form {
  padding: 22px;
}

.auth-dialog h2 {
  margin: 0 0 12px;
  text-align: center;
}

.auth-field select,
.auth-field textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  outline: none;
  background: #10131c;
  color: #fff;
  font: 16px Arial, sans-serif;
}

.auth-field textarea {
  min-height: 110px;
  resize: vertical;
}

.auth-field select:focus,
.auth-field textarea:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(0, 140, 255, 0.18);
}

@media (max-width: 560px) {
  .profile-actions {
    display: grid;
    width: 100%;
  }

  .profile-actions .auth-nav-button,
  .profile-actions button {
    width: 100%;
  }
}


.auth-achievement-game {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 140, 255, 0.16);
  color: #8ed8ff;
  font-size: 12px;
  font-weight: 800;
}


/* Achievementy X/X, zamčené položky a podrobné herní statistiky */
.auth-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.auth-section-heading h2 {
  margin: 0;
}

#achievementSectionCount {
  display: inline-flex;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(243, 180, 63, 0.14);
  color: #ffd36f;
  font-size: 14px;
  white-space: nowrap;
}

.auth-achievement-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    border-color 0.18s ease;
}

.auth-achievement-unlocked {
  border-color: rgba(243, 180, 63, 0.48);
  background: rgba(243, 180, 63, 0.11);
}

.auth-achievement-locked {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(17, 21, 31, 0.92);
  opacity: 0.72;
}

.auth-achievement-card:hover {
  transform: translateY(-2px);
}

.auth-achievement-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.auth-achievement-top .auth-achievement-game {
  margin: 0;
}

.auth-achievement-status {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--auth-text-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.auth-achievement-unlocked .auth-achievement-status {
  background: rgba(49, 200, 137, 0.17);
  color: #8cf0bf;
}

.auth-achievement-description {
  min-height: 38px;
}

.auth-achievement-progress {
  margin-top: 12px;
}

.auth-achievement-progress[hidden] {
  display: none;
}

.auth-achievement-progress-text {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
  color: var(--auth-text-soft);
  font-size: 13px;
  font-weight: 800;
}

.auth-achievement-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.auth-achievement-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #008cff,
    #7b55ff
  );
  transition: width 0.35s ease;
}

.auth-achievement-unlocked
.auth-achievement-progress-track span {
  background: linear-gradient(
    90deg,
    #31c889,
    #f3b43f
  );
}

.auth-game-stat-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.auth-game-stat-main p {
  margin: 0 0 9px;
}

.auth-game-detail-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.auth-game-detail-grid[hidden] {
  display: none;
}

.auth-game-detail-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-height: 44px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
}

.auth-game-detail-stat span {
  color: var(--auth-text-soft);
  font-size: 13px;
  line-height: 1.25;
}

.auth-game-detail-stat strong {
  font-size: 18px;
}

@media (max-width: 560px) {
  .auth-section-heading {
    align-items: flex-start;
  }

  .auth-achievement-top {
    align-items: flex-start;
  }

  .auth-achievement-status {
    flex: 0 0 auto;
  }

  .auth-game-detail-grid {
    grid-template-columns: 1fr;
  }
}
