/* ============================================================
   GAMELOOP Developer Portal — styles.css
   All color references use CSS custom properties defined at :root.
   No hardcoded hex values appear outside this :root block.
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  /* Primary */
  --gl-white:        #FFFFFF;
  --gl-black:        #000000;
  --gl-red:          #FF0000;
  --gl-blue:         #00A8FF;
  --gl-green:        #21FF21;
  --gl-yellow:       #FFFF00;

  /* Secondary */
  --gl-navy:         #002132;
  --gl-teal:         #006B99;
  --gl-light-blue:   #99E0FF;
  --gl-pale-yellow:  #EEEF91;
  --gl-gray:         #CCCCCC;

  /* Semantic aliases */
  --gl-bg:           var(--gl-white);
  --gl-bg-dark:      var(--gl-navy);
  --gl-text:         var(--gl-black);
  --gl-text-inverse: var(--gl-white);
  --gl-primary:      var(--gl-red);
  --gl-secondary:    var(--gl-blue);
  --gl-border:       var(--gl-gray);
  --gl-success:      var(--gl-green);
  --gl-warning:      var(--gl-yellow);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Gilroy', 'Nunito', 'Poppins', 'Varela Round', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--gl-text);
  background-color: var(--gl-bg);
  letter-spacing: -0.01em;
  min-height: 100vh;
}

a {
  color: var(--gl-secondary);
  text-decoration: none;
  cursor: pointer;
}
a:hover {
  text-decoration: underline;
}

/* ---- Typography ---- */
h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.gl-eyebrow {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.gl-caption {
  font-size: 0.8rem;
  font-weight: 400;
}

/* ---- Navigation ---- */
.gl-nav {
  background-color: var(--gl-navy);
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.gl-nav-logo {
  color: var(--gl-text-inverse);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.gl-nav-logo span.logo-game { color: var(--gl-white); }
.gl-nav-logo span.logo-loop { color: var(--gl-blue); }

.gl-nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin-left: auto;
}
.gl-nav-links a {
  color: var(--gl-text-inverse);
  font-weight: 400;
  font-size: 0.95rem;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease;
}
.gl-nav-links a:hover,
.gl-nav-links a.active {
  font-weight: 800;
  border-bottom: 2px solid var(--gl-blue);
}

/* ---- Layout ---- */
#app {
  min-height: calc(100vh - 64px);
  background-color: var(--gl-bg);
}
.gl-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.gl-page-narrow {
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ---- Hero / Home Banner ---- */
.gl-hero {
  background-color: var(--gl-navy);
  color: var(--gl-text-inverse);
  padding: 4rem 2rem;
  text-align: center;
}
.gl-hero h1 { color: var(--gl-text-inverse); }
.gl-hero p {
  font-size: 1.1rem;
  margin-top: 0.75rem;
  color: var(--gl-light-blue);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Cards ---- */
.gl-card {
  background: var(--gl-white);
  border: 1.5px solid var(--gl-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.gl-card + .gl-card { margin-top: 1rem; }

.gl-card-highlight {
  background: var(--gl-pale-yellow);
  border: 1.5px solid var(--gl-border);
  border-radius: 12px;
  padding: 1.5rem;
}

/* ---- Buttons ---- */
button {
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

.gl-btn-primary {
  background-color: var(--gl-red);
  color: var(--gl-white);
  font-weight: 800;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  border: none;
  letter-spacing: -0.01em;
  transition: opacity 0.15s ease;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  display: inline-block;
}
.gl-btn-primary:hover { opacity: 0.88; }
.gl-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gl-btn-secondary {
  background-color: var(--gl-blue);
  color: var(--gl-white);
  font-weight: 700;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  display: inline-block;
  transition: opacity 0.15s ease;
}
.gl-btn-secondary:hover { opacity: 0.88; }

.gl-btn-outline {
  background-color: transparent;
  color: var(--gl-red);
  border: 2px solid var(--gl-red);
  font-weight: 700;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  display: inline-block;
  transition: opacity 0.15s ease;
}
.gl-btn-outline:hover { opacity: 0.78; }

.gl-btn-outline-blue {
  background-color: transparent;
  color: var(--gl-blue);
  border: 2px solid var(--gl-blue);
  font-weight: 700;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-block;
  transition: opacity 0.15s ease;
}
.gl-btn-outline-blue:hover { opacity: 0.78; }

.gl-btn-ghost {
  background: none;
  border: none;
  color: var(--gl-secondary);
  font-weight: 600;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ---- Forms ---- */
.gl-form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}
.gl-label {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--gl-text);
  margin-bottom: 0.35rem;
  display: block;
}
.gl-input {
  border: 2px solid var(--gl-border);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--gl-text);
  background: var(--gl-white);
  transition: border-color 0.15s ease;
  width: 100%;
}
.gl-input:focus {
  outline: none;
  border-color: var(--gl-blue);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.2);
}
.gl-input[readonly] {
  background: #F5F5F5;
  color: var(--gl-teal);
  cursor: not-allowed;
}
.gl-input.gl-input-error {
  border-color: var(--gl-red);
}

.gl-error {
  color: var(--gl-red);
  font-size: 0.8rem;
  font-weight: 400;
  margin-top: 0.25rem;
  display: block;
  min-height: 1rem;
}
.gl-error:empty { display: none; }

.gl-server-error {
  background: rgba(255, 0, 0, 0.07);
  border: 1.5px solid var(--gl-red);
  border-radius: 8px;
  color: var(--gl-red);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.gl-form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.gl-form-section {
  border-top: 1.5px solid var(--gl-border);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

/* ---- Radio Group ---- */
.gl-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}
.gl-radio-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  cursor: pointer;
}
.gl-radio-label input[type="radio"] {
  accent-color: var(--gl-blue);
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

/* ---- Profile Info Grid ---- */
.gl-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
}
@media (max-width: 600px) {
  .gl-profile-grid { grid-template-columns: 1fr; }
}
.gl-profile-field label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gl-teal);
  margin-bottom: 0.2rem;
  display: block;
}
.gl-profile-field p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gl-text);
  word-break: break-all;
}
.gl-profile-field p.gl-id-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gl-teal);
  font-family: 'Courier New', monospace;
  background: #F5F5F5;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  display: inline-block;
}
.gl-profile-field p.gl-rtmp-value {
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--gl-teal);
}

/* ---- Games List ---- */
.gl-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}
.gl-game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--gl-white);
  border: 1.5px solid var(--gl-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.gl-game-card-info h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.gl-game-card-info p {
  font-size: 0.8rem;
  color: var(--gl-teal);
}
.gl-game-card-meta {
  font-size: 0.75rem;
  color: var(--gl-teal);
  font-family: 'Courier New', monospace;
  background: #F5F5F5;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
}
.gl-games-empty {
  padding: 2rem;
  text-align: center;
  color: var(--gl-teal);
  font-size: 0.95rem;
  background: rgba(153, 224, 255, 0.15);
  border-radius: 12px;
  border: 1.5px dashed var(--gl-border);
  margin-top: 1rem;
}

/* ---- Sections / Page Parts ---- */
.gl-section {
  margin-bottom: 2.5rem;
}
.gl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---- TOS ---- */
.gl-tos-content {
  background: rgba(153, 224, 255, 0.15);
  border: 1.5px solid var(--gl-light-blue);
  border-radius: 12px;
  padding: 1.5rem;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--gl-text);
  margin-bottom: 1.5rem;
}
.gl-tos-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: normal;
}
.gl-tos-content p { margin-bottom: 0.75rem; }

/* ---- Modal ---- */
.gl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.gl-modal {
  background: var(--gl-white);
  border-radius: 16px;
  padding: 2rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}
.gl-modal h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.gl-modal p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--gl-text);
}
.gl-modal-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- Home Options Cards ---- */
.gl-home-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (max-width: 600px) {
  .gl-home-options { grid-template-columns: 1fr; }
}
.gl-option-card {
  background: var(--gl-white);
  border: 1.5px solid var(--gl-border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.gl-option-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.gl-option-card p {
  font-size: 0.9rem;
  color: var(--gl-teal);
  line-height: 1.5;
}

/* ---- Utility ---- */
.gl-mt-1 { margin-top: 0.5rem; }
.gl-mt-2 { margin-top: 1rem; }
.gl-mt-3 { margin-top: 1.5rem; }
.gl-mt-4 { margin-top: 2rem; }
.gl-mb-1 { margin-bottom: 0.5rem; }
.gl-mb-2 { margin-bottom: 1rem; }
.gl-text-center { text-align: center; }
.gl-text-muted { color: var(--gl-teal); }
.gl-flex-row { display: flex; flex-direction: row; align-items: center; gap: 1rem; }
.gl-divider {
  border: none;
  border-top: 1.5px solid var(--gl-border);
  margin: 2rem 0;
}

/* ---- Spinner ---- */
.gl-spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--gl-white);
  border-radius: 50%;
  animation: gl-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}
@keyframes gl-spin {
  to { transform: rotate(360deg); }
}

/* ---- Breadcrumb / Back ---- */
.gl-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--gl-teal);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1.5rem;
  text-decoration: none;
  border: none;
  background: none;
  font-family: inherit;
}
.gl-back-link:hover { color: var(--gl-secondary); }
