:root {
  font: 16px/1.55 system-ui, sans-serif;
  color: #192336;
  background: #f1f4f7;
  --panel: #fff;
  --line: #cbd3dc;
  --action: #174563;
}
body { margin: 0; }
main { max-width: 43rem; margin: 3rem auto; padding: 0 1rem; }
header { margin-bottom: 1.5rem; }
header a { color: var(--action); font-weight: 700; }
h1 { margin: .6rem 0 .3rem; font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.2; }
header p { margin: 0; max-width: 37rem; }
form, section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: .8rem;
  padding: 1.35rem;
}
label { display: block; font-weight: 600; margin-bottom: .3rem; }
input, select, button {
  box-sizing: border-box;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: .35rem;
  padding: .55rem .65rem;
}
input, select { width: 100%; color: inherit; background: var(--panel); margin-bottom: 1rem; }
.fields { display: grid; gap: .75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
button { background: var(--action); color: white; font-weight: 650; cursor: pointer; }
button:disabled { cursor: progress; opacity: .65; }
:focus-visible { outline: 3px solid #3192bf; outline-offset: 2px; }
#status { min-height: 1.5em; }
section h2 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: .55rem; }
@media (max-width: 640px) {
  main {
    margin: 1rem auto;
    padding: 0 12px 2rem;
  }
  header { margin-bottom: 1rem; }
  h1 { font-size: 1.65rem; }
  form, section {
    border-radius: 14px;
    padding: 1.15rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  }
  input, select {
    font-size: 16px;
    min-height: 44px;
    border-radius: 8px;
  }
  button, .secondary-link {
    min-height: 44px;
    border-radius: 8px;
    justify-content: center;
  }
  .signed-in-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .signed-in-actions .secondary {
    margin-left: 0;
  }
  #login-tournaments-list li {
    padding: 4px 0;
  }
  .fields { grid-template-columns: 1fr; gap: 0; }
}

.secondary { background: white; color: var(--action); margin-left: .3rem; }
.secondary-link {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: .35rem;
  padding: .55rem .75rem;
  background: white;
  color: var(--action);
}
.secondary-link:hover { background: #f8fafc; border-color: #93b4e8; }

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .85rem;
}

#google-auth-section:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .85rem;
  margin-bottom: 1.25rem;
}

#google-signin-button {
  min-height: 44px;
}

.signed-in-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

#signed-in-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.signed-in-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.my-tournaments-box h2 {
  font-size: 1rem;
  margin: 0 0 .5rem;
}

#login-tournaments-list {
  margin: 0;
  padding-left: 1.15rem;
}

.muted {
  color: #526275;
  font-size: .9rem;
}
