/* Game Review System V19.1 Cloud UI */

html:not(.grs-authenticated) body > .container {
  display: none !important;
}

html.grs-authenticated #grs-auth-shell {
  display: none !important;
}

[hidden] {
  display: none !important;
}

body {
  background: #f4f5f7;
  color: #17202b;
}

.grs-auth-shell {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.grs-auth-panel {
  width: min(420px, 100%);
  padding: 34px 30px;
  border: 1px solid #1d2938;
  background: #fff;
  box-shadow: 9px 9px 0 #d8dee6;
}

.grs-auth-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  margin-bottom: 28px;
}

.grs-auth-panel h1 {
  margin: 0;
  color: #12243a;
  font-size: clamp(24px, 5vw, 38px);
  line-height: 1.05;
  letter-spacing: .04em;
}

.grs-auth-language {
  appearance: none;
  border: 0;
  border-bottom: 1px solid #66788c;
  border-radius: 0;
  background: transparent;
  color: #173754;
  padding: 3px 1px 4px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.grs-auth-language:focus-visible {
  outline: 3px solid rgba(26, 84, 145, .16);
  outline-offset: 3px;
}

.grs-auth-choice-actions,
.grs-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.grs-primary-action,
.grs-secondary-action,
.grs-text-action,
.grs-line-button,
.grs-nav-link,
.grs-v19-home-links button,
.grs-v19-tabs button,
.grs-v19-subtabs button {
  appearance: none;
  border-radius: 2px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.grs-primary-action,
.grs-secondary-action,
.grs-text-action {
  min-height: 46px;
  padding: 11px 16px;
}

.grs-primary-action {
  border: 1px solid #142d4d;
  background: #142d4d;
  color: #fff;
}

.grs-secondary-action {
  border: 1px solid #142d4d;
  background: #fff;
  color: #142d4d;
}

.grs-text-action {
  border: 0;
  border-bottom: 1px solid #9aa8b8;
  background: transparent;
  color: #243d5b;
}

.grs-guest-action {
  margin-top: 10px;
}

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

.grs-auth-form > label,
.grs-v19-fields label,
.grs-v19-file-label,
.grs-cloud-meta-row label {
  display: grid;
  gap: 7px;
  color: #2b3b4f;
  font-size: 13px;
  font-weight: 750;
}

.grs-auth-form input,
.grs-v19-fields input,
.grs-cloud-meta-row input,
.grs-cloud-meta-row textarea,
.grs-v19-home-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #91a0b1;
  border-radius: 2px;
  background: #fff;
  color: #17202b;
  padding: 11px 12px;
  font: inherit;
}

.grs-auth-form input:focus,
.grs-v19-fields input:focus,
.grs-cloud-meta-row input:focus,
.grs-cloud-meta-row textarea:focus,
.grs-v19-home-search input:focus {
  outline: 3px solid rgba(26, 84, 145, .16);
  border-color: #1a5491;
}

.grs-check-line {
  display: flex !important;
  align-items: center;
  gap: 9px !important;
}

.grs-check-line input {
  width: 18px;
  height: 18px;
}

.grs-v19-status {
  min-height: 20px;
  padding-top: 8px;
  color: #42546a;
  font-size: 13px;
}

.grs-v19-status.error {
  color: #a11d2e;
}

.grs-v19-status.success {
  color: #176d45;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 24px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid #aab6c4;
  border-radius: 0;
  background: rgba(244, 245, 247, .96);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.grs-nav-brand {
  appearance: none;
  border: 0;
  background: transparent;
  color: #163a66;
  padding: 8px 5px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
}

.grs-nav-spacer {
  flex: 1;
}

.grs-nav-link,
.grs-line-button {
  border: 0;
  border-bottom: 1px solid #55708f;
  background: transparent;
  color: #23466f;
  padding: 8px 9px;
}

.grs-nav-link:hover,
.grs-line-button:hover,
.grs-v19-home-links button:hover {
  background: #e4ebf3;
}

.grs-nav-link.danger,
.grs-line-button.danger {
  border-color: #a32939;
  color: #a32939;
}

.grs-welcome {
  max-width: 220px;
  overflow: hidden;
  color: #26384e;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grs-welcome.guest::after {
  content: " GUEST";
  margin-left: 5px;
  color: #6f5d24;
  font-size: 9px;
  letter-spacing: .08em;
}

.grs-v19-home {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 30px;
  padding: 35px 12px 70px;
  box-sizing: border-box;
}

.grs-v19-home h1 {
  margin: 0;
  color: #112f54;
  font-size: clamp(34px, 6vw, 72px);
  line-height: .98;
  letter-spacing: .035em;
  text-align: center;
}

.grs-v19-home-search {
  width: min(760px, 100%);
  display: grid;
  gap: 9px;
}

.grs-v19-home-search label {
  color: #203b5d;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .03em;
  text-align: center;
}

.grs-v19-home-search input {
  min-height: 62px;
  border-width: 2px;
  border-color: #173f70;
  padding: 13px 17px;
  font-size: 20px;
  box-shadow: 6px 6px 0 #c8d3df;
}

.grs-v19-home-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.grs-v19-home-links button {
  border: 0;
  border-bottom: 1px solid #526c8a;
  background: transparent;
  color: #264b76;
  padding: 9px 4px;
}

.grs-v19-page-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 18px;
}

.grs-v19-page-head h1 {
  margin: 0;
}

.grs-v19-tabs,
.grs-v19-subtabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 2px solid #1d4f86;
  margin-bottom: 22px;
}

.grs-v19-tabs button,
.grs-v19-subtabs button {
  border: 0;
  border-right: 1px solid #b0bdca;
  background: transparent;
  color: #345371;
  padding: 10px 16px;
  white-space: nowrap;
}

.grs-v19-tabs button.active,
.grs-v19-subtabs button.active {
  background: #1d4f86;
  color: #fff;
}

.grs-v19-ranking-panel,
.grs-v19-settings-panel,
.grs-v19-general-panel {
  display: none;
}

.grs-v19-ranking-panel.active,
.grs-v19-settings-panel.active,
.grs-v19-general-panel.active {
  display: block;
}

.grs-v19-analysis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  border-top: 1px solid #8ea0b3;
  border-bottom: 1px solid #8ea0b3;
  margin-bottom: 18px;
}

.grs-v19-analysis > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 16px;
  border-right: 1px solid #c1cbd5;
}

.grs-v19-analysis span {
  color: #536477;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.grs-v19-analysis b {
  color: #173f70;
  font-size: 24px;
}

.grs-v19-setting-section {
  margin-bottom: 26px;
  padding: 19px 0;
  border-top: 1px solid #91a2b4;
}

.grs-v19-setting-section h2 {
  margin: 0 0 16px;
  color: #183f6b;
  font-size: 19px;
}

.grs-v19-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
  gap: 14px;
}

.grs-v19-action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.grs-v19-file-label {
  display: inline-flex;
  margin-top: 18px;
}

.grs-v19-file-label input {
  margin-top: 8px;
}

.danger-zone {
  border-color: #a32939;
}

.danger-zone h2 {
  color: #a32939;
}

.grs-cloud-search-shell {
  position: relative;
  width: min(680px, 100%);
}

.grs-cloud-search-shell > label {
  display: block;
  margin-bottom: 7px;
  color: #1d3d63;
  font-weight: 850;
}

.grs-cloud-search-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.grs-cloud-search-input-row #game-name {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.grs-cloud-results {
  position: absolute;
  z-index: 900;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 440px;
  overflow: auto;
  border: 1px solid #243e5d;
  background: #fff;
  box-shadow: 8px 8px 0 rgba(82, 102, 126, .25);
}

.grs-cloud-result {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 0;
  border-bottom: 1px solid #d8dfe6;
  background: #fff;
  padding: 10px;
  color: #1d3149;
  text-align: left;
  cursor: pointer;
}

.grs-cloud-result:hover {
  background: #edf3f9;
}

.grs-cloud-result img {
  width: 42px;
  height: 54px;
  object-fit: cover;
}

.grs-cloud-result small {
  display: block;
  margin-top: 4px;
  color: #5a6979;
}

.grs-cloud-empty-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px;
}

.grs-cloud-meta-card {
  margin: 18px 0;
  padding: 19px;
  border-top: 2px solid #1d4f86;
  border-bottom: 1px solid #9eacbb;
  background: #fff;
}

.grs-cloud-meta-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.grs-cloud-meta-head h2 {
  margin: 0;
  font-size: 20px;
}

.grs-cloud-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.grs-cloud-meta-row.wide {
  grid-column: 1 / -1;
}

.grs-cloud-meta-row textarea {
  min-height: 82px;
  resize: vertical;
}

.grs-cloud-meta-row input:disabled,
.grs-cloud-meta-row textarea:disabled {
  border-color: #d6dde4;
  background: #f1f3f5;
  color: #465463;
}

.grs-v19-game-averages,
.grs-v19-detail-averages {
  margin: 18px 0;
  padding: 17px 0;
  border-top: 1px solid #7f93aa;
  border-bottom: 1px solid #7f93aa;
}

.grs-v19-average-overall {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.grs-v19-average-overall span,
.grs-v19-detail-average-grid span,
.grs-v19-category-averages span {
  color: #52657b;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.grs-v19-average-overall b {
  color: #153f70;
  font-size: 30px;
}

.grs-v19-average-overall small {
  color: #697b8f;
}

.grs-v19-category-averages,
.grs-v19-detail-average-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0;
  border-top: 1px solid #d2d9e0;
}

.grs-v19-category-averages > div,
.grs-v19-detail-average-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 10px 12px;
  border-right: 1px solid #d2d9e0;
  border-bottom: 1px solid #d2d9e0;
}

.grs-v19-detail-averages h2 {
  margin: 0 0 13px;
  font-size: 20px;
}

.grs-v19-rubric-average {
  display: block;
  margin-top: 5px;
  color: #8a3040;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.grs-cloud-toast {
  position: fixed;
  z-index: 30000;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 16px;
  border: 1px solid #173f70;
  border-radius: 2px;
  background: #173f70;
  color: #fff;
  box-shadow: 6px 6px 0 rgba(18, 39, 63, .25);
}

.grs-cloud-toast.error {
  border-color: #871b2a;
  background: #9f2435;
}

/* Remove legacy prompt-like helper copy that may be recreated by old renderers. */
.grs-landing-mark,
.grs-home-action-icon,
.grs-landing > p,
.grs-page-head-copy > p,
.grs-settings-head p,
.sandbox-note,
.big-tab-help,
.qs-hint,
.grs-search-help,
#schema-sandbox-note,
#grs-landing-subtitle,
#grs-ranking-subtitle,
#grs-search-subtitle,
#grs-awards-subtitle,
#grs-settings-subtitle,
#ui-desc-qs,
#ui-desc-gw {
  display: none !important;
}

@media (max-width: 800px) {
  body {
    padding: 10px;
  }

  .top-nav {
    position: relative;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .grs-nav-spacer {
    display: none;
  }

  .grs-welcome {
    order: -1;
    flex-basis: 100%;
    max-width: none;
    padding: 4px 5px;
  }

  .grs-v19-home {
    min-height: calc(100vh - 180px);
  }

  .grs-cloud-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .grs-v19-analysis > div {
    border-right: 0;
    border-bottom: 1px solid #c1cbd5;
  }
}

@media (max-width: 520px) {
  .grs-auth-panel {
    padding: 27px 21px;
    box-shadow: 5px 5px 0 #d8dee6;
  }

  .grs-v19-home-search input {
    min-height: 54px;
    font-size: 17px;
  }

  .grs-cloud-meta-grid {
    grid-template-columns: 1fr;
  }

  .grs-cloud-meta-row.wide {
    grid-column: auto;
  }

  .grs-cloud-result {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .grs-cloud-result img {
    display: none;
  }
}
